Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

qtspim: init at 722 #74999

Closed
wants to merge 1 commit into from
Closed

qtspim: init at 722 #74999

wants to merge 1 commit into from

Conversation

aske
Copy link
Member

@aske aske commented Dec 4, 2019

Motivation for this change

Add a MIPS32 simulator.

To build a documentation I've needed to set QT_QPA_PLATFORM_PATH and QT_PLUGIN_PATH because qhelpgenerator failed with:

qt.qpa.plugin: Could not find the Qt platform plugin "minimal" in ""

Either way after installation I did not manage to make qtspim find its help file, so I added a patch disabling doc building to save some build time.

@ttuegel maybe you have ideas on what's going on?

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nix-review --run "nix-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.
Notify maintainers

cc @


buildInputs = [ qtbase qttools ];

# Remove build artefacts from the repo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# Remove build artefacts from the repo
# Remove build artifacts from the repo

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed, thanks!

install -D ../Documentation/qtspim.man $out/usr/share/man/man1/qtspim.1
gzip -f --best $out/usr/share/man/man1/qtspim.1

install -d $out/usr/share/qtspim
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All of these paths should be $out/share/... (no /usr prefix). This may affect finding the files at runtime.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, fixed!

Finally found what's up with the docs -- doesn't have anything to do with Qt, just a bunch of hardcoded paths in the source code (missed initially them while stracing as qtspim accessed them, while I expected other syscalls).

@aske aske force-pushed the spim branch 3 times, most recently from 601f767 to 2cc7fba Compare December 8, 2019 16:09
buildPhase = ''
export QT_PLUGIN_PATH="${qtbase.bin}/${qtbase.qtPluginPrefix}"
export QT_QPA_PLATFORM_PLUGIN_PATH="${qtbase.bin}/${qtbase.qtPluginPrefix}/platforms"
make
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ttuegel is there a better way to make qhelpgenerator inside build work than setting these vars?

Copy link
Member Author

@aske aske Dec 8, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(about "Outdated") moved it to preBuild, question is still valid

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(moved it to the buildPhase again, as preBuild version sometimes broke down when building with more than 3 --cores)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure why setting QT_PLUGIN_PATH isn't sufficient, and it should be OK to set these in preBuild, but I don't see anything wrong with this.

@stale
Copy link

stale bot commented Jun 5, 2020

Thank you for your contributions.

This has been automatically marked as stale because it has had no activity for 180 days.

If this is still important to you, we ask that you leave a comment below. Your comment can be as simple as "still important to me". This lets people see that at least one person still cares about this. Someone will have to do this at most twice a year if there is no other activity.

Here are suggestions that might help resolve this more quickly:

  1. Search for maintainers and people that previously touched the related code and @ mention them in a comment.
  2. Ask on the NixOS Discourse.
  3. Ask on the #nixos channel on irc.freenode.net.

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jun 5, 2020
buildPhase = ''
export QT_PLUGIN_PATH="${qtbase.bin}/${qtbase.qtPluginPrefix}"
export QT_QPA_PLATFORM_PLUGIN_PATH="${qtbase.bin}/${qtbase.qtPluginPrefix}/platforms"
make
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure why setting QT_PLUGIN_PATH isn't sufficient, and it should be OK to set these in preBuild, but I don't see anything wrong with this.

@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jul 20, 2020

sourceRoot = "code-r${version}/QtSpim";

nativeBuildInputs = [ bison flex qmake ];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add wrapQtAppsHook to nativeBuildInputs.

@prusnak
Copy link
Member

prusnak commented Dec 3, 2020

@aske do you still want to get this in?

@prusnak prusnak added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Dec 3, 2020
@aske
Copy link
Member Author

aske commented Dec 3, 2020 via email

@eadwu
Copy link
Member

eadwu commented Jan 15, 2021

For 734, it at least worked a month or two ago when I was using it for my Computer Architecture course last semester.

commit 
Author: Edmund Wu
Date:   Sun Nov 22 13:42:27 2020 -0500

    qtspim: 722 -> 734

diff --git a/pkgs/applications/virtualization/spim/default.nix b/pkgs/applications/virtualization/spim/default.nix
index 07c94d84d5a..595f1e90789 100644
--- a/pkgs/applications/virtualization/spim/default.nix
+++ b/pkgs/applications/virtualization/spim/default.nix
@@ -1,35 +1,40 @@
-{ mkDerivation, lib, fetchsvn, qmake, qtbase, qttools, bison, flex }:
+{ lib, mkDerivation, fetchsvn
+, flex, bison, qmake, wrapQtAppsHook
+, qtbase, qttools }:
 
 mkDerivation rec {
   pname = "QtSpim";
-  version = "722";
+  version = "734";
 
   src = fetchsvn {
     url = "https://svn.code.sf.net/p/spimsimulator/code";
     rev = version;
-    sha256 = "1hfz41ra93pdd2pri5hibl63sg9yyk12a8nhdkmgj7h9bwgqxw6b";
+    sha256 = "1c2d30xi9jvxh34pd7m5mzgp14qz0s1726gryc7ny2z6sqdjqsaa";
   };
 
   sourceRoot = "code-r${version}/QtSpim";
 
-  nativeBuildInputs = [ bison flex qmake ];
+  nativeBuildInputs = [ flex bison qmake wrapQtAppsHook ];
 
   buildInputs = [ qtbase qttools ];
 
   # Remove build artifacts from the repo
   preConfigure = ''
-    rm parser_yacc.h
-    rm parser_yacc.cpp
-    rm scanner_lex.cpp
+    sed -i \
+      -e 's@$(COPY) ''${QMAKE_FILE_PATH}/''${QMAKE_FILE_BASE}.qhc ''${QMAKE_FILE_OUT};@@g' \
+      -e 's@qcollectiongenerator@qhelpgenerator@g' \
+      QtSpim.pro
+
+    sed -i \
+      -e 's/zero_imm/is_zero_imm/g' \
+      -e 's/^int data_dir/bool data_dir/g' \
+      -e 's/^int text_dir/bool text_dir/g' \
+      -e 's/^int parse_error_occurred/bool parse_error_occurred/g' \
+      parser_yacc.cpp
 
     rm help/qtspim.qhc
   '';
 
-  # Fix bug in a generated Makefile
-  postConfigure = ''
-    substituteInPlace Makefile --replace '$(MOVE) help/qtspim.qhc help/qtspim.qhc;' ""
-  '';
-
   # Fix documentation path
   postPatch = ''
     substituteInPlace menu.cpp --replace "/usr/lib/qtspim/help/qtspim.qhc" "$out/share/qtspim/help/qtspim.qhc"

@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jan 15, 2021
@hpfr
Copy link

hpfr commented Jul 1, 2021

I was also able to get this working with eadwu's patch. Friendly ping to @aske in case you've got the bandwidth to get this in

Comment on lines +21 to +25
rm parser_yacc.h
rm parser_yacc.cpp
rm scanner_lex.cpp

rm help/qtspim.qhc
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
rm parser_yacc.h
rm parser_yacc.cpp
rm scanner_lex.cpp
rm help/qtspim.qhc
rm parser_yacc.h parser_yacc.cpp scanner_lex.cpp help/qtspim.qhc

Comment on lines +35 to +36
substituteInPlace menu.cpp --replace "/usr/lib/qtspim/help/qtspim.qhc" "$out/share/qtspim/help/qtspim.qhc"
substituteInPlace menu.cpp --replace "/usr/lib/qtspim/bin/assistant" "${qttools.dev}/bin/assistant"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
substituteInPlace menu.cpp --replace "/usr/lib/qtspim/help/qtspim.qhc" "$out/share/qtspim/help/qtspim.qhc"
substituteInPlace menu.cpp --replace "/usr/lib/qtspim/bin/assistant" "${qttools.dev}/bin/assistant"
substituteInPlace menu.cpp \
--replace "/usr/lib/qtspim/help/qtspim.qhc" "$out/share/qtspim/help/qtspim.qhc" \
--replace "/usr/lib/qtspim/bin/assistant" "${qttools.dev}/bin/assistant"

@stale
Copy link

stale bot commented Jan 3, 2022

I marked this as stale due to inactivity. → More info

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jan 3, 2022
@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Apr 13, 2022
@Artturin Artturin marked this pull request as draft May 1, 2022 23:06
@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Oct 30, 2022
@NickCao
Copy link
Member

NickCao commented Jan 26, 2023

superseded by #131325

@NickCao NickCao closed this Jan 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

10 participants