2019-10-09 13:00:00 +01:00
|
|
|
{ stdenv, fetchFromGitHub, udev, intltool, pkgconfig, glib, xmlto, wrapGAppsHook
|
2018-07-21 01:44:44 +01:00
|
|
|
, docbook_xml_dtd_412, docbook_xsl
|
2019-05-22 12:03:39 +01:00
|
|
|
, libxml2, desktop-file-utils, libusb1, cups, gdk-pixbuf, pango, atk, libnotify
|
2019-10-09 13:00:00 +01:00
|
|
|
, gobject-introspection, libsecret, packagekit
|
2016-08-26 19:47:22 +01:00
|
|
|
, cups-filters
|
2019-10-09 13:00:00 +01:00
|
|
|
, python3Packages, autoreconfHook, bash
|
2011-07-21 23:18:41 +01:00
|
|
|
}:
|
2010-08-29 20:37:02 +01:00
|
|
|
|
2017-04-23 15:08:12 +01:00
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "system-config-printer";
|
2019-10-09 13:00:00 +01:00
|
|
|
version = "1.5.12";
|
2009-02-25 16:05:13 +00:00
|
|
|
|
2019-10-09 13:00:00 +01:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "openPrinting";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
|
|
|
sha256 = "1a812jsd9pb02jbz9bq16qj5j6k2kw44g7s1xdqqkg7061rd7mwf";
|
2010-08-29 20:37:02 +01:00
|
|
|
};
|
|
|
|
|
2019-10-09 13:00:00 +01:00
|
|
|
prePatch = ''
|
|
|
|
# for automake
|
|
|
|
touch README ChangeLog
|
|
|
|
# for tests
|
|
|
|
substituteInPlace Makefile.am --replace /bin/bash ${bash}/bin/bash
|
|
|
|
'';
|
|
|
|
|
2016-01-17 11:54:28 +00:00
|
|
|
patches = [ ./detect_serverbindir.patch ];
|
|
|
|
|
2018-07-06 08:34:12 +01:00
|
|
|
buildInputs = [
|
|
|
|
glib udev libusb1 cups
|
2019-10-09 13:00:00 +01:00
|
|
|
python3Packages.python
|
|
|
|
libnotify gobject-introspection gdk-pixbuf pango atk packagekit
|
2018-07-06 08:34:12 +01:00
|
|
|
libsecret
|
|
|
|
];
|
2017-04-23 15:08:12 +01:00
|
|
|
|
2018-07-06 08:34:12 +01:00
|
|
|
nativeBuildInputs = [
|
|
|
|
intltool pkgconfig
|
|
|
|
xmlto libxml2 docbook_xml_dtd_412 docbook_xsl desktop-file-utils
|
2019-10-09 13:00:00 +01:00
|
|
|
python3Packages.wrapPython
|
|
|
|
wrapGAppsHook autoreconfHook
|
2018-07-06 08:34:12 +01:00
|
|
|
];
|
2012-12-12 15:34:38 +00:00
|
|
|
|
2019-10-09 13:00:00 +01:00
|
|
|
pythonPath = with python3Packages; requiredPythonModules [ pycups pycurl dbus-python pygobject3 requests pycairo pysmbc ];
|
2017-11-26 08:15:39 +00:00
|
|
|
|
2018-07-06 08:34:12 +01:00
|
|
|
configureFlags = [
|
|
|
|
"--with-udev-rules"
|
2019-10-09 13:00:00 +01:00
|
|
|
"--with-udevdir=${placeholder "out"}/etc/udev"
|
|
|
|
"--with-systemdsystemunitdir=${placeholder "out"}/etc/systemd/system"
|
2018-07-06 08:34:12 +01:00
|
|
|
];
|
2010-08-29 20:37:02 +01:00
|
|
|
|
2017-04-23 15:08:12 +01:00
|
|
|
stripDebugList = [ "bin" "lib" "etc/udev" ];
|
2017-03-20 15:24:16 +00:00
|
|
|
|
2019-10-09 13:00:00 +01:00
|
|
|
doCheck = true;
|
2018-08-08 22:36:23 +01:00
|
|
|
|
2017-11-26 08:15:39 +00: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
|
2019-10-09 13:00:00 +01:00
|
|
|
patchPythonScript $out/etc/udev/udev-add-printer
|
2019-08-27 22:22:53 +01:00
|
|
|
|
|
|
|
substituteInPlace $out/etc/udev/rules.d/70-printers.rules \
|
|
|
|
--replace "udev-configure-printer" "$out/etc/udev/udev-configure-printer"
|
2017-11-26 08:15:39 +00:00
|
|
|
'';
|
2010-11-28 09:46:51 +00:00
|
|
|
|
2017-11-26 08:15:39 +00:00
|
|
|
meta = {
|
2019-10-09 13:00:00 +01:00
|
|
|
homepage = "https://github.com/openprinting/system-config-printer";
|
2017-11-26 08:15:39 +00:00
|
|
|
platforms = stdenv.lib.platforms.linux;
|
|
|
|
license = stdenv.lib.licenses.gpl2;
|
2009-02-25 16:05:13 +00:00
|
|
|
};
|
|
|
|
}
|