-
-
Notifications
You must be signed in to change notification settings - Fork 14.9k
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
ghostscript: wrap binaries to add correct PATH #216666
base: staging
Are you sure you want to change the base?
Conversation
retarget staging now |
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.
This seems to be a legit change, but I would like to have the confirmation of more experienced reviewers.
@xworld21 @apfelkuchen6 Can you help me reviewing this PR ? |
Uhm, doesn't texlive depend on ghostscript already? I suppose this can work in a pinch, but it should definitely be revised to depend directly on |
@apfelkuchen6 points out that “dvips looks up font files (and other external files) using kpathsea and embeds them into the ps output. But if you take dvips from such a minimal texlive installation, this font lookup will always fail”. Since it is also ridiculous to use texlive.combined.scheme-full, we do not wrap dvips and leaves the users to provide their own dvips.
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.
The changes look reasonable to me now.
There are failing tests on darwin, these also failed before, right?
done | ||
|
||
for bin in $out/bin/ps2* ; do | ||
wrapProgram $bin --prefix PATH : ${lib.makeBinPath [ coreutils ]}:$out/bin |
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.
Have you checked that $0
is interpreted correctly? I believe wrapProgram
breaks $0
for non-binary executables. I suspect in this case it would only break the help output, showing e.g. .ps2pdf-wrapped
instead of ps2pdf
. But $0
is also used to find the sibling executables.
(By the way, for many of these scripts, a single substituteInPlace
of the entire block GS_EXECUTABLE= ... GS_EXECUTABLE="$gs"
with GS_EXECUTABLE='${out}/bin/gs'
is enough, and possibly more appropriate than a wrapper.)
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.
Yes, help output is showing .ps2pdf-wrapped
since it is using basename $0
.
Substituting GS_EXECUTABLE='${out}/bin/gs'
seems not enough because we also need to bind some PATH from coreutils, gawk.
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.
Substituting
GS_EXECUTABLE='${out}/bin/gs'
seems not enough because we also need to bind some PATH from coreutils, gawk.
I meant, for quite a few scripts, the only coreutils usage is around GS_EXECUTABLE
, so if you patch that away, there is no need for a wrapper. Other scripts do use gawk, basename, etc. so I agree with wrapping for those of course.
Description of changes
For scripts in
${ghostscript}/bin
, they are not properly wrapped to put the binaries in PATH. When running them without packages in PATH, the scripts complain command not found. For example,We wrapped these binaries to prefix the necessary packages to PATH.
Things done
sandbox = true
set innix.conf
? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)