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

HPLIP: Fix PostScript printers, installed utilities #29616

Merged
merged 2 commits into from Sep 21, 2017
Merged

Conversation

ttuegel
Copy link
Member

@ttuegel ttuegel commented Sep 20, 2017

Motivation

This PR fixes two bugs:

  1. The PPDs for PostScript-based printers are not installed where CUPS can find them, so the drivers for all such printers (most enterprise models) are missing.
  2. None of the installed utilities work because wrapPythonPrograms ignores symlinks! We cannot wrap the symlink targets, either, so we must emulate it ourselves.

Testing

  • 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 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 nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

We cannot rely on wrapPythonPrograms to wrap the installed executables because
they are symlinks (which it ignores). Instead, we have to emulate it to make
the wrappers ourselves.
@ttuegel ttuegel requested review from nckx and FRidh September 20, 2017 22:06
@mention-bot
Copy link

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

@Mic92 Mic92 added the 9.needs: port to stable A PR needs a backport to the stable release. label Sep 20, 2017
wrapProgram $out/lib/cups/filter/hpps \
--prefix PATH : "${nettools}/bin"
# The installed executables are just symlinks into $out/share/hplip,
# but wrapPythonPrograms ignores symlinks. We cannot replace the Python
Copy link
Member

Choose a reason for hiding this comment

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

@abbradar you recall whether that is on purpose?

Copy link
Member Author

Choose a reason for hiding this comment

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

I can answer that. wrapPythonPrograms ignores symlinks because you have to do this gymnastics of patching the target, deleting the symlink, and creating a wrapper directly to the target. I think it doesn't want to implement this logic because it assumes you can just call wrapPythonPrograms on the actual target, but we can't do that here.

@nckx
Copy link
Member

nckx commented Sep 21, 2017

Hi @ttuegel!

A weird feeling of déjà vu: I thought I made this exact change, and comment, ages ago. Except, well, I obviously didn't...

Thanks for taking care of this. It's probably painfully obvious I no longer use Nix* myself, and should remove myself as a maintainer. ( 😿 )

@ttuegel
Copy link
Member Author

ttuegel commented Sep 21, 2017

@nckx Someone made this change to hplip-15.09, it may have been you! That's what this change was based on, I just streamlined it a little by emulating wrapPythonPrograms instead of calling it. (Actually, wrapPythonPrograms only works on directories now, so I should probably backport this.)

@ttuegel ttuegel merged commit 5f328b3 into NixOS:master Sep 21, 2017
@ttuegel ttuegel mentioned this pull request Sep 22, 2017
8 tasks
@samueldr samueldr removed the 9.needs: port to stable A PR needs a backport to the stable release. label Apr 17, 2019
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

6 participants