system-config-printer: 1.3.12 -> 1 5.7
This commit is contained in:
parent
47017474fd
commit
03353ce6ff
|
@ -5,16 +5,20 @@
|
||||||
, withGUI ? true
|
, withGUI ? true
|
||||||
}:
|
}:
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
let majorVersion = "1.5";
|
||||||
name = "system-config-printer-1.3.12";
|
|
||||||
|
in stdenv.mkDerivation rec {
|
||||||
|
name = "system-config-printer-${majorVersion}.7";
|
||||||
|
|
||||||
src = fetchurl {
|
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";
|
sha256 = "1cg9n75rg5l9vr1925n2g771kga33imikyl0mf70lww2sfgvs18r";
|
||||||
};
|
};
|
||||||
|
|
||||||
propagatedBuildInputs = [ pythonPackages.pycurl ];
|
propagatedBuildInputs = [ pythonPackages.pycurl ];
|
||||||
|
|
||||||
|
patches = [ ./detect_serverbindir.patch ];
|
||||||
|
|
||||||
buildInputs =
|
buildInputs =
|
||||||
[ intltool pkgconfig glib udev libusb1 cups xmlto
|
[ intltool pkgconfig glib udev libusb1 cups xmlto
|
||||||
libxml2 docbook_xml_dtd_412 docbook_xsl desktop_file_utils
|
libxml2 docbook_xml_dtd_412 docbook_xsl desktop_file_utils
|
||||||
|
@ -32,17 +36,28 @@ stdenv.mkDerivation rec {
|
||||||
|
|
||||||
postInstall =
|
postInstall =
|
||||||
''
|
''
|
||||||
|
export makeWrapperArgs="--set prefix $out"
|
||||||
wrapPythonPrograms
|
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
|
( cd $out/share/system-config-printer/troubleshoot
|
||||||
mv .__init__.py-wrapped __init__.py
|
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 = {
|
meta = {
|
||||||
homepage = http://cyberelk.net/tim/software/system-config-printer/;
|
homepage = http://cyberelk.net/tim/software/system-config-printer/;
|
||||||
platforms = stdenv.lib.platforms.linux;
|
platforms = stdenv.lib.platforms.linux;
|
||||||
|
license = stdenv.lib.licenses.gpl2;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -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
|
Loading…
Reference in New Issue