2017-04-23 16:08:12 +02:00
|
|
|
{ stdenv, fetchurl, udev, intltool, pkgconfig, glib, xmlto, wrapGAppsHook
|
2018-07-21 02:44:44 +02:00
|
|
|
, docbook_xml_dtd_412, docbook_xsl
|
2019-05-22 13:03:39 +02:00
|
|
|
, libxml2, desktop-file-utils, libusb1, cups, gdk-pixbuf, pango, atk, libnotify
|
2018-12-02 12:41:15 +01:00
|
|
|
, gobject-introspection, libsecret
|
2016-08-26 20:47:22 +02:00
|
|
|
, cups-filters
|
2012-01-18 21:53:01 +01:00
|
|
|
, pythonPackages
|
2011-07-22 00:18:41 +02:00
|
|
|
}:
|
2010-08-29 21:37:02 +02:00
|
|
|
|
2017-04-23 16:08:12 +02:00
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 14:41:18 +02:00
|
|
|
pname = "system-config-printer";
|
2018-07-06 09:34:12 +02:00
|
|
|
version = "1.5.11";
|
2009-02-25 17:05:13 +01:00
|
|
|
|
|
|
|
src = fetchurl {
|
2019-08-15 14:41:18 +02:00
|
|
|
url = "https://github.com/zdohnal/system-config-printer/releases/download/${version}/${pname}-${version}.tar.xz";
|
2018-07-06 09:34:12 +02:00
|
|
|
sha256 = "1lq0q51bhanirpjjvvh4xiafi8hgpk8r32h0dj6dn3f32z8pib9q";
|
2010-08-29 21:37:02 +02:00
|
|
|
};
|
|
|
|
|
2016-01-17 12:54:28 +01:00
|
|
|
patches = [ ./detect_serverbindir.patch ];
|
|
|
|
|
2018-07-06 09:34:12 +02:00
|
|
|
buildInputs = [
|
|
|
|
glib udev libusb1 cups
|
|
|
|
pythonPackages.python
|
2019-05-22 13:03:39 +02:00
|
|
|
libnotify gobject-introspection gdk-pixbuf pango atk
|
2018-07-06 09:34:12 +02:00
|
|
|
libsecret
|
|
|
|
];
|
2017-04-23 16:08:12 +02:00
|
|
|
|
2018-07-06 09:34:12 +02:00
|
|
|
nativeBuildInputs = [
|
|
|
|
intltool pkgconfig
|
|
|
|
xmlto libxml2 docbook_xml_dtd_412 docbook_xsl desktop-file-utils
|
|
|
|
pythonPackages.wrapPython
|
|
|
|
wrapGAppsHook
|
|
|
|
];
|
2012-12-12 16:34:38 +01:00
|
|
|
|
2017-11-26 09:15:39 +01:00
|
|
|
pythonPath = with pythonPackages; requiredPythonModules [ pycups pycurl dbus-python pygobject3 requests pycairo pysmbc ];
|
|
|
|
|
2018-07-06 09:34:12 +02:00
|
|
|
configureFlags = [
|
|
|
|
"--with-udev-rules"
|
|
|
|
"--with-udevdir=$(out)/etc/udev"
|
|
|
|
"--with-systemdsystemunitdir=$(out)/etc/systemd/system"
|
|
|
|
];
|
2010-08-29 21:37:02 +02:00
|
|
|
|
2017-04-23 16:08:12 +02:00
|
|
|
stripDebugList = [ "bin" "lib" "etc/udev" ];
|
2017-03-20 16:24:16 +01:00
|
|
|
|
2018-08-08 23:36:23 +02:00
|
|
|
doCheck = false; # generates shebangs in check phase, too lazy to fix
|
|
|
|
|
2017-11-26 09:15:39 +01:00
|
|
|
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
|
2017-04-23 16:08:12 +02:00
|
|
|
|
2017-11-26 09:15:39 +01:00
|
|
|
# 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"
|
2016-08-25 17:28:16 +02:00
|
|
|
|
2017-11-26 09:15:39 +01:00
|
|
|
# Manually expand literal "$(out)", which have failed to expand
|
|
|
|
sed -e "s|ExecStart=\$(out)|ExecStart=$out|" \
|
|
|
|
-i "$out/etc/systemd/system/configure-printer@.service"
|
|
|
|
'';
|
2010-11-28 10:46:51 +01:00
|
|
|
|
2017-11-26 09:15:39 +01:00
|
|
|
meta = {
|
2012-12-12 16:34:38 +01:00
|
|
|
homepage = http://cyberelk.net/tim/software/system-config-printer/;
|
2017-11-26 09:15:39 +01:00
|
|
|
platforms = stdenv.lib.platforms.linux;
|
|
|
|
license = stdenv.lib.licenses.gpl2;
|
2009-02-25 17:05:13 +01:00
|
|
|
};
|
|
|
|
}
|