diff options
author | Tobias Geerinckx-Rice <tobias.geerinckx.rice@gmail.com> | 2015-07-22 23:17:08 +0200 |
---|---|---|
committer | Tobias Geerinckx-Rice <tobias.geerinckx.rice@gmail.com> | 2015-07-23 03:12:24 +0200 |
commit | aebb3ec0f4edcd5f7f51b6c794e7a20da3f9bd3b (patch) | |
tree | 09dff3d18a813104fc685181ae81f597dc390d7d /pkgs | |
parent | 603b146979af8fdd696b11ea0ff81c36700751c5 (diff) | |
download | nixpkgs-aebb3ec0f4edcd5f7f51b6c794e7a20da3f9bd3b.tar nixpkgs-aebb3ec0f4edcd5f7f51b6c794e7a20da3f9bd3b.tar.gz nixpkgs-aebb3ec0f4edcd5f7f51b6c794e7a20da3f9bd3b.tar.bz2 nixpkgs-aebb3ec0f4edcd5f7f51b6c794e7a20da3f9bd3b.tar.lz nixpkgs-aebb3ec0f4edcd5f7f51b6c794e7a20da3f9bd3b.tar.xz nixpkgs-aebb3ec0f4edcd5f7f51b6c794e7a20da3f9bd3b.tar.zst nixpkgs-aebb3ec0f4edcd5f7f51b6c794e7a20da3f9bd3b.zip |
hplip: patch shebangs in $out/share
A full wrap isn't needed as these scripts are only run from within hplip's own environment, and unwanted because they are imported as Python modules. Also fix a reference to /etc in $out/etc/hp/hplip.conf, though I've no idea whether it is actually used.
Diffstat (limited to 'pkgs')
-rw-r--r-- | pkgs/misc/drivers/hplip/default.nix | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/pkgs/misc/drivers/hplip/default.nix b/pkgs/misc/drivers/hplip/default.nix index a96e71a3af0..d173b0ac406 100644 --- a/pkgs/misc/drivers/hplip/default.nix +++ b/pkgs/misc/drivers/hplip/default.nix @@ -139,9 +139,9 @@ stdenv.mkDerivation { '')); fixupPhase = '' - # Wrap the user-facing Python scripts in /bin without turning the ones - # in /share into shell scripts (they need to be importable). - # Complicated by the fact that /bin contains just symlinks to /share. + # Wrap the user-facing Python scripts in $out/bin without turning the + # ones in $out /share into shell scripts (they need to be importable). + # Note that $out/bin contains only symlinks to $out/share. for bin in $out/bin/*; do py=`readlink -m $bin` rm $bin @@ -153,7 +153,18 @@ stdenv.mkDerivation { # Remove originals. Knows a little too much about wrapPythonProgramsIn. rm -f $out/bin/.*-wrapped + # Merely patching shebangs in $out/share does not cause trouble. + for i in $out/share/hplip{,/*}/*.py; do + substituteInPlace $i \ + --replace /usr/bin/python \ + ${pythonPackages.python}/bin/${pythonPackages.python.executable} \ + --replace "/usr/bin/env python" \ + ${pythonPackages.python}/bin/${pythonPackages.python.executable} + done + wrapPythonProgramsIn $out/lib "$out $pythonPath" + + substituteInPlace $out/etc/hp/hplip.conf --replace /usr $out ''; meta = with stdenv.lib; { |