2020-06-15 23:48:42 +02:00
|
|
|
{ stdenv, fetchFromGitHub, fetchpatch, 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
|
2019-10-09 14:00:00 +02:00
|
|
|
, gobject-introspection, libsecret, packagekit
|
2016-08-26 20:47:22 +02:00
|
|
|
, cups-filters
|
2019-10-09 14:00:00 +02:00
|
|
|
, python3Packages, autoreconfHook, bash
|
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";
|
2019-10-09 14:00:00 +02:00
|
|
|
version = "1.5.12";
|
2009-02-25 17:05:13 +01:00
|
|
|
|
2019-10-09 14:00:00 +02:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "openPrinting";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
|
|
|
sha256 = "1a812jsd9pb02jbz9bq16qj5j6k2kw44g7s1xdqqkg7061rd7mwf";
|
2010-08-29 21:37:02 +02:00
|
|
|
};
|
|
|
|
|
2019-10-09 14:00:00 +02:00
|
|
|
prePatch = ''
|
|
|
|
# for automake
|
|
|
|
touch README ChangeLog
|
|
|
|
# for tests
|
|
|
|
substituteInPlace Makefile.am --replace /bin/bash ${bash}/bin/bash
|
|
|
|
'';
|
|
|
|
|
2020-06-15 23:48:42 +02:00
|
|
|
patches = [
|
|
|
|
./detect_serverbindir.patch
|
|
|
|
|
|
|
|
# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=958104
|
|
|
|
# (Fixes will be included in next upstream release.)
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/OpenPrinting/system-config-printer/commit/cf9903466c1a2d18a701f3b5e8c7e03483e1244d.patch";
|
|
|
|
sha256 = "03gpav618w50q90m2kdkgwclc7fv17m493fgjd633zfavb5kqr3n";
|
|
|
|
})
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/OpenPrinting/system-config-printer/commit/b9289dfe105bdb502f183f0afe7a115ecae5f2af.patch";
|
|
|
|
sha256 = "12w47hy3ly4phh8jcqxvdnd5sgbnbp8dnscjd7d5y2i43kxj7b23";
|
|
|
|
})
|
|
|
|
];
|
2016-01-17 12:54:28 +01:00
|
|
|
|
2018-07-06 09:34:12 +02:00
|
|
|
buildInputs = [
|
|
|
|
glib udev libusb1 cups
|
2019-10-09 14:00:00 +02:00
|
|
|
python3Packages.python
|
|
|
|
libnotify gobject-introspection gdk-pixbuf pango atk packagekit
|
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
|
2019-10-09 14:00:00 +02:00
|
|
|
python3Packages.wrapPython
|
|
|
|
wrapGAppsHook autoreconfHook
|
2018-07-06 09:34:12 +02:00
|
|
|
];
|
2012-12-12 16:34:38 +01:00
|
|
|
|
2019-10-09 14:00:00 +02:00
|
|
|
pythonPath = with python3Packages; requiredPythonModules [ pycups pycurl dbus-python pygobject3 requests pycairo pysmbc ];
|
2017-11-26 09:15:39 +01:00
|
|
|
|
2018-07-06 09:34:12 +02:00
|
|
|
configureFlags = [
|
|
|
|
"--with-udev-rules"
|
2019-10-09 14:00:00 +02:00
|
|
|
"--with-udevdir=${placeholder "out"}/etc/udev"
|
|
|
|
"--with-systemdsystemunitdir=${placeholder "out"}/etc/systemd/system"
|
2018-07-06 09:34:12 +02:00
|
|
|
];
|
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
|
|
|
|
2019-10-09 14:00:00 +02:00
|
|
|
doCheck = true;
|
2018-08-08 23:36:23 +02:00
|
|
|
|
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
|
2019-10-09 14:00:00 +02:00
|
|
|
patchPythonScript $out/etc/udev/udev-add-printer
|
2019-08-27 23:22:53 +02:00
|
|
|
|
|
|
|
substituteInPlace $out/etc/udev/rules.d/70-printers.rules \
|
|
|
|
--replace "udev-configure-printer" "$out/etc/udev/udev-configure-printer"
|
2017-11-26 09:15:39 +01:00
|
|
|
'';
|
2010-11-28 10:46:51 +01:00
|
|
|
|
2017-11-26 09:15:39 +01:00
|
|
|
meta = {
|
2019-10-09 14:00:00 +02:00
|
|
|
homepage = "https://github.com/openprinting/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
|
|
|
};
|
|
|
|
}
|