1{ stdenv, fetchurl, udev, intltool, pkgconfig, glib, xmlto
2, makeWrapper, pygobject, pygtk, docbook_xml_dtd_412, docbook_xsl
3, pythonDBus, libxml2, desktop_file_utils, libusb1, cups, pycups
4, pythonPackages
5, withGUI ? true
6}:
7
8stdenv.mkDerivation rec {
9 name = "system-config-printer-1.3.12";
10
11 src = fetchurl {
12 url = "http://cyberelk.net/tim/data/system-config-printer/1.3/${name}.tar.xz";
13 sha256 = "1cg9n75rg5l9vr1925n2g771kga33imikyl0mf70lww2sfgvs18r";
14 };
15
16 propagatedBuildInputs = [ pythonPackages.pycurl ];
17
18 buildInputs =
19 [ intltool pkgconfig glib udev libusb1 cups xmlto
20 libxml2 docbook_xml_dtd_412 docbook_xsl desktop_file_utils
21 pythonPackages.python pythonPackages.wrapPython
22 ];
23
24 pythonPath =
25 [ pythonDBus pycups pygobject pythonPackages.pycurl ]
26 ++ stdenv.lib.optionals withGUI [ pygtk pythonPackages.notify ];
27
28 configureFlags =
29 [ "--with-udev-rules"
30 "--with-systemdsystemunitdir=$(out)/etc/systemd/system"
31 ];
32
33 postInstall =
34 ''
35 wrapPythonPrograms
36 ( cd $out/share/system-config-printer/troubleshoot
37 mv .__init__.py-wrapped __init__.py
38 )
39 '';
40
41 meta = {
42 homepage = http://cyberelk.net/tim/software/system-config-printer/;
43 };
44}