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