2011-08-15 19:06:26 +01:00
|
|
|
{ kde, pkgconfig, pythonPackages, sip, pycups, pygobject, system_config_printer,
|
|
|
|
kdelibs, kdepimlibs, pykde4, cups, nettools }:
|
2011-07-22 02:28:09 +01:00
|
|
|
|
2011-08-15 19:06:26 +01:00
|
|
|
let s_c_p = system_config_printer.override { withGUI = false; }; in
|
|
|
|
kde {
|
|
|
|
buildInputs = [ kdelibs kdepimlibs pythonPackages.python pycups pykde4 sip
|
|
|
|
pygobject s_c_p ];
|
2011-07-22 02:28:09 +01:00
|
|
|
|
2011-08-15 19:06:26 +01:00
|
|
|
passthru = { system_config_printer = s_c_p; };
|
2011-07-22 02:28:09 +01:00
|
|
|
|
|
|
|
preConfigure =
|
|
|
|
''
|
|
|
|
for i in system-config-printer-kde/cmake-modules/FindSystemConfigPrinter.py system-config-printer-kde/system-config-printer-kde.py; do
|
|
|
|
substituteInPlace $i \
|
2011-08-15 19:06:26 +01:00
|
|
|
--replace /usr/share/system-config-printer ${s_c_p}/share/system-config-printer \
|
2011-07-22 02:28:09 +01:00
|
|
|
--replace /usr/bin/cupstestppd ${cups}/bin/cupstestppd \
|
|
|
|
--replace /bin/hostname ${nettools}/bin/hostname
|
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
|
|
|
postInstall =
|
|
|
|
''
|
|
|
|
# Bake the required Python path into the printer configuration program.
|
|
|
|
res=
|
|
|
|
for i in $(IFS=:; echo $PYTHONPATH); do res="$res''${res:+,} '$i'"; done
|
2011-08-15 19:06:26 +01:00
|
|
|
|
2011-07-22 02:28:09 +01:00
|
|
|
sed -i $out/share/apps/system-config-printer-kde/system-config-printer-kde.py \
|
|
|
|
-e "1 a import sys\nsys.path = [$res] + sys.path"
|
2011-08-15 19:06:26 +01:00
|
|
|
|
2011-07-22 02:28:09 +01:00
|
|
|
mkdir -p $out/nix-support
|
|
|
|
echo ${pykde4} > $out/nix-support/propagated-user-env-packages
|
|
|
|
'';
|
|
|
|
}
|