Merge pull request #29616 from ttuegel/hplip
HPLIP: Fix PostScript printers, installed utilities
This commit is contained in:
commit
5f328b33ab
@ -61,10 +61,9 @@ pythonPackages.buildPythonApplication {
|
|||||||
|
|
||||||
nativeBuildInputs = [
|
nativeBuildInputs = [
|
||||||
pkgconfig
|
pkgconfig
|
||||||
makeWrapper
|
|
||||||
];
|
];
|
||||||
|
|
||||||
propagatedBuildInputs = with pythonPackages; [
|
pythonPath = with pythonPackages; [
|
||||||
dbus
|
dbus
|
||||||
pillow
|
pillow
|
||||||
pygobject2
|
pygobject2
|
||||||
@ -74,6 +73,8 @@ pythonPackages.buildPythonApplication {
|
|||||||
pyqt4
|
pyqt4
|
||||||
];
|
];
|
||||||
|
|
||||||
|
makeWrapperArgs = [ ''--prefix PATH : "${nettools}/bin"'' ];
|
||||||
|
|
||||||
prePatch = ''
|
prePatch = ''
|
||||||
# HPLIP hardcodes absolute paths everywhere. Nuke from orbit.
|
# HPLIP hardcodes absolute paths everywhere. Nuke from orbit.
|
||||||
find . -type f -exec sed -i \
|
find . -type f -exec sed -i \
|
||||||
@ -88,6 +89,7 @@ pythonPackages.buildPythonApplication {
|
|||||||
|
|
||||||
preConfigure = ''
|
preConfigure = ''
|
||||||
export configureFlags="$configureFlags
|
export configureFlags="$configureFlags
|
||||||
|
--with-hpppddir=$out/share/cups/model/HP
|
||||||
--with-cupsfilterdir=$out/lib/cups/filter
|
--with-cupsfilterdir=$out/lib/cups/filter
|
||||||
--with-cupsbackenddir=$out/lib/cups/backend
|
--with-cupsbackenddir=$out/lib/cups/backend
|
||||||
--with-icondir=$out/share/applications
|
--with-icondir=$out/share/applications
|
||||||
@ -144,10 +146,30 @@ pythonPackages.buildPythonApplication {
|
|||||||
rm $out/etc/udev/rules.d/56-hpmud.rules
|
rm $out/etc/udev/rules.d/56-hpmud.rules
|
||||||
'';
|
'';
|
||||||
|
|
||||||
postFixup = ''
|
# The installed executables are just symlinks into $out/share/hplip,
|
||||||
wrapProgram $out/lib/cups/filter/hpps \
|
# but wrapPythonPrograms ignores symlinks. We cannot replace the Python
|
||||||
--prefix PATH : "${nettools}/bin"
|
# modules in $out/share/hplip with wrapper scripts because they import
|
||||||
|
# each other as libraries. Instead, we emulate wrapPythonPrograms by
|
||||||
|
# 1. Calling patchPythonProgram on the original script in $out/share/hplip
|
||||||
|
# 2. Making our own wrapper pointing directly to the original script.
|
||||||
|
dontWrapPythonPrograms = true;
|
||||||
|
preFixup = ''
|
||||||
|
buildPythonPath "$out $pythonPath"
|
||||||
|
|
||||||
|
for bin in $out/bin/*; do
|
||||||
|
py=$(readlink -m $bin)
|
||||||
|
rm $bin
|
||||||
|
echo "patching \`$py'..."
|
||||||
|
patchPythonScript "$py"
|
||||||
|
echo "wrapping \`$bin'..."
|
||||||
|
makeWrapper "$py" "$bin" \
|
||||||
|
--prefix PATH ':' "$program_PATH" \
|
||||||
|
--set PYTHONNOUSERSITE "true" \
|
||||||
|
$makeWrapperArgs
|
||||||
|
done
|
||||||
|
'';
|
||||||
|
|
||||||
|
postFixup = ''
|
||||||
substituteInPlace $out/etc/hp/hplip.conf --replace /usr $out
|
substituteInPlace $out/etc/hp/hplip.conf --replace /usr $out
|
||||||
'' + stdenv.lib.optionalString (!withPlugin) ''
|
'' + stdenv.lib.optionalString (!withPlugin) ''
|
||||||
# A udev rule to notify users that they need the binary plugin.
|
# A udev rule to notify users that they need the binary plugin.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user