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

sigil: use qt5's mkDerivation #66435

Merged
merged 2 commits into from Aug 12, 2019
Merged

Conversation

lightbulbjim
Copy link
Contributor

Motivation for this change

Slightly different implementation because out of the box:

  • $out/bin/sigil is a shell script wrapper
  • $out/lib/sigil/sigil is the ELF executable

See #65399

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • 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 @RamKromberg

@worldofpeace
Copy link
Contributor

Can you apply this patch @lightbulbjim? This expression is kinda atypical.

patch
diff --git a/pkgs/applications/editors/sigil/default.nix b/pkgs/applications/editors/sigil/default.nix
index 36e9bc757a4..d977599eca1 100644
--- a/pkgs/applications/editors/sigil/default.nix
+++ b/pkgs/applications/editors/sigil/default.nix
@@ -17,18 +17,18 @@ mkDerivation rec {
 
   pythonPath = with python3Packages; [ lxml ];
 
-  propagatedBuildInputs = with python3Packages; [ lxml ];
-
   nativeBuildInputs = [ cmake pkgconfig makeWrapper ];
 
   buildInputs = [
     boost xercesc qtbase qttools qtwebkit qtxmlpatterns
-    python3 python3Packages.lxml ];
+  ];
+
+  dontWrapQtApps = true;
 
   preFixup = ''
-    wrapQtApp "$out/lib/sigil/sigil"
     wrapProgram "$out/bin/sigil" \
-       --prefix PYTHONPATH : $PYTHONPATH:$(toPythonPath ${python3Packages.lxml})
+       --prefix PYTHONPATH : $PYTHONPATH \
+       ''${qtWrapperArgs[@]}
   '';
 
   enableParallelBuilding = true;
@@ -37,7 +37,7 @@ mkDerivation rec {
     description = "Free, open source, multi-platform ebook (ePub) editor";
     homepage = https://github.com/Sigil-Ebook/Sigil/;
     license = licenses.gpl3;
-    maintainers =[ maintainers.ramkromberg ];
+    maintainers = [ maintainers.ramkromberg ];
     platforms = platforms.linux;
   };
 }

@worldofpeace
Copy link
Contributor

Can you also remove @RamKromberg from maintainers of this package? They haven't contributed since 0efd187 so I'd think it's safe to say it's unmaintained.

Slightly different implementation because out of the box:

  - $out/bin/sigil is a shell script wrapper
  - $out/lib/sigil/sigil is the ELF executable

See NixOS#65399
Maintainer has not committed for >2 years.
@lightbulbjim
Copy link
Contributor Author

Can you apply this patch @lightbulbjim? This expression is kinda atypical.

It works as long as I retain python3Packages.lxml in buildInputs.

Would it be more idiomatic to use mkDerivationWith buildPythonApplication even though it's not a Python app?

Can you also remove @RamKromberg from maintainers of this package? They haven't contributed since 0efd187 so I'd think it's safe to say it's unmaintained.

Done.

@worldofpeace
Copy link
Contributor

Would it be more idiomatic to use mkDerivationWith buildPythonApplication even though it's not a Python app?

I don't think so, this would add python's wrapPython which does something completely different with wrapping PYTHONPATH and we use a shell wrapper here. So I'd think it would complicate things.

Copy link
Contributor

@worldofpeace worldofpeace left a comment

Choose a reason for hiding this comment

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

Starts for me and I checked that the wrapper had the correct entries.

@worldofpeace worldofpeace merged commit d73cca7 into NixOS:master Aug 12, 2019
@lightbulbjim lightbulbjim deleted the sigil-wrapping branch August 12, 2019 03:39
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

2 participants