Skip to content

Commit

Permalink
system-config-printer: fix python path
Browse files Browse the repository at this point in the history
propagated dependencies were not added to PYTHONPATH

(cherry picked from commit b69cbfa269879d9bcf919c0489728cbc9d4c0f3e)
  • Loading branch information
Mic92 authored and andir committed Nov 25, 2017
1 parent 87bfe2c commit 992dee0
Showing 1 changed file with 32 additions and 35 deletions.
67 changes: 32 additions & 35 deletions pkgs/tools/misc/system-config-printer/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -18,50 +18,47 @@ stdenv.mkDerivation rec {

patches = [ ./detect_serverbindir.patch ];

buildInputs =
[ intltool pkgconfig glib udev libusb1 cups xmlto
libxml2 docbook_xml_dtd_412 docbook_xsl desktop_file_utils
pythonPackages.python pythonPackages.wrapPython
libnotify gobjectIntrospection gdk_pixbuf pango atk
libgnome_keyring3
];
buildInputs = [
intltool pkgconfig glib udev libusb1 cups xmlto
libxml2 docbook_xml_dtd_412 docbook_xsl desktop_file_utils

nativeBuildInputs = [ wrapGAppsHook ];
libnotify gobjectIntrospection gdk_pixbuf pango atk
libgnome_keyring3

(pythonPackages.python.withPackages (ps: with ps; [
pycups pycurl dbus-python pygobject3 requests pycairo pysmbc
]))
];

pythonPath = with pythonPackages;
[ pycups pycurl dbus-python pygobject3 requests pycairo pythonPackages.pycurl ];
nativeBuildInputs = [ wrapGAppsHook ];

configureFlags =
[ "--with-udev-rules"
"--with-udevdir=$(out)/etc/udev"
"--with-systemdsystemunitdir=$(out)/etc/systemd/system"
];
configureFlags = [
"--with-udev-rules"
"--with-udevdir=$(out)/etc/udev"
"--with-systemdsystemunitdir=$(out)/etc/systemd/system"
];

stripDebugList = [ "bin" "lib" "etc/udev" ];

postInstall =
''
buildPythonPath "$out $pythonPath"
gappsWrapperArgs+=(
--prefix PATH : "$program_PATH"
--set CUPS_DATADIR "${cups-filters}/share/cups"
)
find $out/share/system-config-printer -name \*.py -type f -perm -0100 -print0 | while read -d "" f; do
patchPythonScript "$f"
done
postInstall = ''
gappsWrapperArgs+=(
--prefix PATH : "$program_PATH"
--prefix PYTHONPATH : "$out/${pythonPackages.python.sitePackages}"
--set CUPS_DATADIR "${cups-filters}/share/cups"
)
# The below line will be unneeded when the next upstream release arrives.
sed -i -e "s|/usr/local/bin|$out/bin|" "$out/share/dbus-1/services/org.fedoraproject.Config.Printing.service"
# The below line will be unneeded when the next upstream release arrives.
sed -i -e "s|/usr/local/bin|$out/bin|" \
"$out/share/dbus-1/services/org.fedoraproject.Config.Printing.service"
# Manually expand literal "$(out)", which have failed to expand
sed -e "s|ExecStart=\$(out)|ExecStart=$out|" \
-i "$out/etc/systemd/system/configure-printer@.service"
'';
# Manually expand literal "$(out)", which have failed to expand
sed -e "s|ExecStart=\$(out)|ExecStart=$out|" \
-i "$out/etc/systemd/system/configure-printer@.service"
'';

meta = {
meta = with stdenv.lib; {
homepage = http://cyberelk.net/tim/software/system-config-printer/;
platforms = stdenv.lib.platforms.linux;
license = stdenv.lib.licenses.gpl2;
platforms = platforms.linux;
license = licenses.gpl2;
};
}

1 comment on commit 992dee0

@bjornfor
Copy link
Contributor

Choose a reason for hiding this comment

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

This breaks nixpkgs eval:

$ nix-env -f . -qa '*' --meta --xml --drv-path --show-trace
error: while querying the derivation named ‘system-config-printer-1.5.9’:
while evaluating the attribute ‘buildInputs’ of the derivation ‘system-config-printer-1.5.9’ at /home/bfo/proj/code/forks/nixpkgs2/pkgs/stdenv/generic/make-derivation.nix:98:11:
while evaluating the attribute ‘pkgs’ of the derivation ‘python3-3.6.3-env’ at /home/bfo/proj/code/forks/nixpkgs2/pkgs/stdenv/generic/make-derivation.nix:98:11:
while evaluating ‘closePropagation’ at /home/bfo/proj/code/forks/nixpkgs2/lib/deprecated.nix:228:22, called from /home/bfo/proj/code/forks/nixpkgs2/pkgs/development/interpreters/python/wrapper.nix:10:13:
while evaluating ‘uniqList’ at /home/bfo/proj/code/forks/nixpkgs2/lib/deprecated.nix:159:14, called from /home/bfo/proj/code/forks/nixpkgs2/lib/deprecated.nix:228:29:
while evaluating ‘go’ at /home/bfo/proj/code/forks/nixpkgs2/lib/deprecated.nix:160:18, called from /home/bfo/proj/code/forks/nixpkgs2/lib/deprecated.nix:166:8:
while evaluating ‘innerClosePropagation’ at /home/bfo/proj/code/forks/nixpkgs2/lib/deprecated.nix:211:32, called from /home/bfo/proj/code/forks/nixpkgs2/lib/deprecated.nix:228:52:
while evaluating ‘innerClosePropagation’ at /home/bfo/proj/code/forks/nixpkgs2/lib/deprecated.nix:211:32, called from /home/bfo/proj/code/forks/nixpkgs2/lib/deprecated.nix:219:21:
while evaluating ‘uniqList’ at /home/bfo/proj/code/forks/nixpkgs2/lib/deprecated.nix:159:14, called from /home/bfo/proj/code/forks/nixpkgs2/lib/deprecated.nix:221:24:
while evaluating ‘go’ at /home/bfo/proj/code/forks/nixpkgs2/lib/deprecated.nix:160:18, called from /home/bfo/proj/code/forks/nixpkgs2/lib/deprecated.nix:166:8:
while evaluating ‘go’ at /home/bfo/proj/code/forks/nixpkgs2/lib/deprecated.nix:160:18, called from /home/bfo/proj/code/forks/nixpkgs2/lib/deprecated.nix:165:27:
while evaluating ‘go’ at /home/bfo/proj/code/forks/nixpkgs2/lib/deprecated.nix:160:18, called from /home/bfo/proj/code/forks/nixpkgs2/lib/deprecated.nix:165:27:
while evaluating ‘go’ at /home/bfo/proj/code/forks/nixpkgs2/lib/deprecated.nix:160:18, called from /home/bfo/proj/code/forks/nixpkgs2/lib/deprecated.nix:165:27:
while evaluating ‘go’ at /home/bfo/proj/code/forks/nixpkgs2/lib/deprecated.nix:160:18, called from /home/bfo/proj/code/forks/nixpkgs2/lib/deprecated.nix:165:27:
while evaluating ‘go’ at /home/bfo/proj/code/forks/nixpkgs2/lib/deprecated.nix:160:18, called from /home/bfo/proj/code/forks/nixpkgs2/lib/deprecated.nix:165:27:
while evaluating ‘go’ at /home/bfo/proj/code/forks/nixpkgs2/lib/deprecated.nix:160:18, called from /home/bfo/proj/code/forks/nixpkgs2/lib/deprecated.nix:165:27:
while evaluating ‘go’ at /home/bfo/proj/code/forks/nixpkgs2/lib/deprecated.nix:160:18, called from /home/bfo/proj/code/forks/nixpkgs2/lib/deprecated.nix:165:27:
undefined variable ‘pysmbc’ at /home/bfo/proj/code/forks/nixpkgs2/pkgs/tools/misc/system-config-printer/default.nix:29:61

Please sign in to comment.