-
-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Fixup calibre RPATH stuff #26209
Conversation
@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. |
Can you add a comment referencing NixOS/patchelf#98 so these hacks can be later removed. |
Done. |
There was a problem hiding this 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.
There was a problem hiding this 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.
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 { |
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.
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 |
@vcunat Thanks for providing the "right" way to do this in nixpkgs. I am however a bit astonished at this "best" solution. @mdorman Would you mind updating your PR ? I, as probably many others, would be glad to see this fixed :-). |
@vcunat Well, no, your patch does not work. So mine seems the only correct (and hacky) way to go for now. |
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. |
It took quite some discussions to find a good solution: close NixOS#26201, close NixOS#26209. (Authorship assigned to the author of the idea.)
Motivation for this change
Get the expression building again.
Things done
(nix.useSandbox on NixOS,
or option
build-use-sandbox
innix.conf
on non-NixOS)
nix-shell -p nox --run "nox-review wip"
./result/bin/
)I think this is a slightly cleaner option than #26201