3
0
Fork 0
forked from mirrors/nixpkgs

system-config-printer: 1.3.12 -> 1 5.7

This commit is contained in:
Nikolay Amiantov 2016-01-17 14:54:28 +03:00
parent 47017474fd
commit 03353ce6ff
2 changed files with 38 additions and 6 deletions

View file

@ -5,16 +5,20 @@
, withGUI ? true
}:
stdenv.mkDerivation rec {
name = "system-config-printer-1.3.12";
let majorVersion = "1.5";
in stdenv.mkDerivation rec {
name = "system-config-printer-${majorVersion}.7";
src = fetchurl {
url = "http://cyberelk.net/tim/data/system-config-printer/1.3/${name}.tar.xz";
url = "http://cyberelk.net/tim/data/system-config-printer/${majorVersion}/${name}.tar.xz";
sha256 = "1cg9n75rg5l9vr1925n2g771kga33imikyl0mf70lww2sfgvs18r";
};
propagatedBuildInputs = [ pythonPackages.pycurl ];
patches = [ ./detect_serverbindir.patch ];
buildInputs =
[ intltool pkgconfig glib udev libusb1 cups xmlto
libxml2 docbook_xml_dtd_412 docbook_xsl desktop_file_utils
@ -32,17 +36,28 @@ stdenv.mkDerivation rec {
postInstall =
''
export makeWrapperArgs="--set prefix $out"
wrapPythonPrograms
# The program imports itself, so we need to move shell wrappers to a proper place.
fixupWrapper() {
mv "$out/share/system-config-printer/$2.py" \
"$out/bin/$1"
sed -i "s/.$2.py-wrapped/$2.py/g" "$out/bin/$1"
mv "$out/share/system-config-printer/.$2.py-wrapped" \
"$out/share/system-config-printer/$2.py"
}
fixupWrapper scp-dbus-service scp-dbus-service
fixupWrapper system-config-printer system-config-printer
fixupWrapper system-config-printer-applet applet
# This __init__.py is both executed and imported.
( cd $out/share/system-config-printer/troubleshoot
mv .__init__.py-wrapped __init__.py
)
# Upstream issue: https://github.com/twaugh/system-config-printer/issues/28
sed -i -e "s|/usr/bin|$out/bin|" "$out/share/dbus-1/services/org.fedoraproject.Config.Printing.service"
'';
meta = {
homepage = http://cyberelk.net/tim/software/system-config-printer/;
platforms = stdenv.lib.platforms.linux;
license = stdenv.lib.licenses.gpl2;
};
}

View file

@ -0,0 +1,17 @@
diff --git a/cupshelpers/config.py.in b/cupshelpers/config.py.in
index 55abbfc..1244327 100644
--- a/cupshelpers/config.py.in
+++ b/cupshelpers/config.py.in
@@ -22,3 +22,12 @@
prefix="@prefix@"
sysconfdir="@sysconfdir@"
cupsserverbindir="@cupsserverbindir@"
+
+try:
+ with open("/etc/cups/cups-files.conf") as config:
+ for cfgline in config:
+ args = cfgline.split(" ")
+ if len(args) == 2 and args[0] == "ServerBin":
+ cupsserverbindir = args[1].strip()
+except OSError:
+ pass