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

Fixup calibre RPATH stuff #26209

Closed
wants to merge 1 commit into from
Closed

Conversation

mdorman
Copy link
Contributor

@mdorman mdorman commented May 29, 2017

Motivation for this change

Get the expression building again.

Things done
  • Tested using sandboxing
    (nix.useSandbox on NixOS,
    or option build-use-sandbox in nix.conf
    on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • Linux
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

I think this is a slightly cleaner option than #26201

@mention-bot
Copy link

@mdorman, thanks for your PR! By analyzing the history of the files in this pull request, we identified @cmfwyp, @peterhoeg and @FRidh to be potential reviewers.

@mdorman mdorman mentioned this pull request May 29, 2017
7 tasks
@dezgeg
Copy link
Contributor

dezgeg commented May 29, 2017

Can you add a comment referencing NixOS/patchelf#98 so these hacks can be later removed.

@mdorman
Copy link
Contributor Author

mdorman commented May 29, 2017

Done.

Copy link
Member

@vcunat vcunat left a comment

Choose a reason for hiding this comment

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

Seems OK, starts OK.

Copy link
Member

@layus layus left a comment

Choose a reason for hiding this comment

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

@ttuegel This looks like something to improve in https://github.com/NixOS/nixpkgs/blob/53835c93cb4bc1c6228ee04d6788398a8ab36ab4/pkgs/development/libraries/qt-5/qtbase-setup-hook.sh rather than propagating ahd-hoc fixes here.

Any idea why _qtRmTmp is not being called ?

As-is, I would not merge this. The hook should do it himself.

@layus
Copy link
Member

layus commented Jun 2, 2017

Ok, the issue come from installPhase = "..." which overrides the default install phase (as intended) but forgets to call the install hooks.

A better, working patch:

diff --git a/pkgs/applications/misc/calibre/default.nix b/pkgs/applications/misc/calibre/default.nix
index 6dcd96216c..5d228d264d 100644
--- a/pkgs/applications/misc/calibre/default.nix
+++ b/pkgs/applications/misc/calibre/default.nix
@@ -62,6 +62,8 @@ stdenv.mkDerivation rec {
   ]);
 
   installPhase = ''
+    runHook preInstall
+
     export HOME=$TMPDIR/fakehome
     export POPPLER_INC_DIR=${poppler_utils.dev}/include/poppler
     export POPPLER_LIB_DIR=${poppler_utils.out}/lib
@@ -92,6 +94,8 @@ stdenv.mkDerivation rec {
     for entry in $out/share/applications/*.desktop; do
       substituteAllInPlace $entry
     done
+
+    runHook postInstall
   '';
 
   calibreDesktopItem = makeDesktopItem {

vcunat added a commit to vcunat/nixpkgs that referenced this pull request Jun 3, 2017
I've seen that mistake at least a few times already, e.g.
NixOS#26209 (comment)
It might perhaps seem counter-intuitive if one doesn't know nixpkgs well.
@vcunat
Copy link
Member

vcunat commented Jun 3, 2017

It would seem a bit nicer to have something like this (it builds):

--- a/pkgs/applications/misc/calibre/default.nix
+++ b/pkgs/applications/misc/calibre/default.nix
@@ -61,7 +61,8 @@ stdenv.mkDerivation rec {
     chardet cherrypy html5lib_0_9999999 odfpy routes
   ]);
 
-  installPhase = ''
+  dontInstall = true;
+  postInstall = ''
     export HOME=$TMPDIR/fakehome
     export POPPLER_INC_DIR=${poppler_utils.dev}/include/poppler
     export POPPLER_LIB_DIR=${poppler_utils.out}/lib

@layus
Copy link
Member

layus commented Jun 3, 2017

@vcunat Thanks for providing the "right" way to do this in nixpkgs. I am however a bit astonished at this "best" solution. dontInstall = true; sounds like the installPhase will be skipped. It is a bit counter-intuitive. See my comment in #26345.

@mdorman Would you mind updating your PR ? I, as probably many others, would be glad to see this fixed :-).

@layus
Copy link
Member

layus commented Jun 3, 2017

@vcunat Well, no, your patch does not work. dontInstall = true; is strictly equivalent to installPhase = "";. The only reason this builds is because it installs nothing. Just check the produced derivation, it is (nearly) empty.

So mine seems the only correct (and hacky) way to go for now.

@vcunat vcunat closed this in e6550cb Jun 5, 2017
@vcunat
Copy link
Member

vcunat commented Jun 5, 2017

Ah, right, I'm sorry :-/ This part of stdenv does seem to need a redesign. Overriding the default install phase is a rather common setup. Pushed the patch from @layus for now, until we fix Qt hooks and/or stdenv.

@mdorman mdorman deleted the calibre-fixup branch June 11, 2017 11:28
peterhoeg pushed a commit to peterhoeg/nixpkgs that referenced this pull request Jun 15, 2017
It took quite some discussions to find a good solution:
close NixOS#26201, close NixOS#26209.
(Authorship assigned to the author of the idea.)
ashgillman added a commit to ashgillman/nixpkgs that referenced this pull request Feb 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants