push sheeet
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s

This commit is contained in:
Dark Steveneq
2025-10-09 14:15:47 +02:00
commit 646b892680
49168 changed files with 5897842 additions and 0 deletions

View File

@@ -0,0 +1,148 @@
{
lib,
stdenv,
fetchFromGitHub,
udev,
pkg-config,
glib,
xmlto,
wrapGAppsHook3,
docbook_xml_dtd_412,
docbook_xsl,
libxml2,
desktop-file-utils,
libusb1,
cups,
gdk-pixbuf,
pango,
atk,
libnotify,
gobject-introspection,
libsecret,
packagekit,
libcupsfilters,
gettext,
libtool,
autoconf-archive,
python3Packages,
autoreconfHook,
bash,
fetchpatch,
}:
stdenv.mkDerivation rec {
pname = "system-config-printer";
version = "1.5.18";
src = fetchFromGitHub {
owner = "openPrinting";
repo = pname;
rev = "v${version}";
sha256 = "sha256-l3HEnYycP56vZWREWkAyHmcFgtu09dy4Ds65u7eqNZk=";
};
prePatch = ''
# for automake
touch README ChangeLog
# for tests
substituteInPlace Makefile.am --replace /bin/bash ${bash}/bin/bash
'';
patches = [
./detect_serverbindir.patch
# fix typeerror, remove on next release
(fetchpatch {
url = "https://github.com/OpenPrinting/system-config-printer/commit/399b3334d6519639cfe7f1c0457e2475b8ee5230.patch";
sha256 = "sha256-JCdGmZk2vRn3X1BDxOJaY3Aw8dr0ODVzi0oY20ZWfRs=";
excludes = [ "NEWS" ];
})
# switch to pep517 build tools
./pep517.patch
# FIXME: remove when gettext is fixed
./gettext-0.25.patch
];
buildInputs = [
glib
udev
libusb1
cups
python3Packages.python
libnotify
gdk-pixbuf
pango
atk
packagekit
libsecret
];
nativeBuildInputs = [
pkg-config
gettext
libtool
autoconf-archive
xmlto
libxml2
docbook_xml_dtd_412
docbook_xsl
desktop-file-utils
python3Packages.wrapPython
python3Packages.build
python3Packages.installer
python3Packages.setuptools
python3Packages.wheel
wrapGAppsHook3
autoreconfHook
gobject-introspection
];
pythonPath =
with python3Packages;
requiredPythonModules [
pycups
pycurl
dbus-python
pygobject3
pycairo
pysmbc
];
configureFlags = [
"--with-udev-rules"
"--with-udevdir=${placeholder "out"}/etc/udev"
"--with-systemdsystemunitdir=${placeholder "out"}/etc/systemd/system"
];
stripDebugList = [
"bin"
"lib"
"etc/udev"
];
doCheck = true;
doInstallCheck = true;
postInstall = ''
buildPythonPath "$out $pythonPath"
gappsWrapperArgs+=(
--prefix PATH : "$program_PATH"
--set CUPS_DATADIR "${libcupsfilters}/share/cups"
)
find $out/share/system-config-printer -name \*.py -type f -perm -0100 -print0 | while read -d "" f; do
patchPythonScript "$f"
done
patchPythonScript $out/etc/udev/udev-add-printer
substituteInPlace $out/etc/udev/rules.d/70-printers.rules \
--replace "udev-configure-printer" "$out/etc/udev/udev-configure-printer"
'';
meta = {
homepage = "https://github.com/openprinting/system-config-printer";
platforms = lib.platforms.linux;
license = lib.licenses.gpl2Plus;
};
}

View File

@@ -0,0 +1,17 @@
diff --git a/cupshelpers/config.py.in b/cupshelpers/config.py.in
index 55abbfc..1244327 100644
--- a/cupshelpers/config.py.in
+++ b/cupshelpers/config.py.in
@@ -22,3 +22,12 @@
prefix="@prefix@"
sysconfdir="@sysconfdir@"
cupsserverbindir="@cupsserverbindir@"
+
+try:
+ with open("/etc/cups/cups-files.conf") as config:
+ for cfgline in config:
+ args = cfgline.split(" ")
+ if len(args) == 2 and args[0] == "ServerBin":
+ cupsserverbindir = args[1].strip()
+except OSError:
+ pass

View File

@@ -0,0 +1,24 @@
diff --git a/Makefile.am b/Makefile.am
index 9993ca0d..678fa629 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,5 +1,7 @@
SUBDIRS=. po
+ACLOCAL_AMFLAGS = -I m4
+
EXPORT_MODULES= \
cupshelpers/__init__.py \
cupshelpers/cupshelpers.py \
diff --git a/configure.ac b/configure.ac
index 9398fd3e..3b6d8e0e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2,7 +2,6 @@ AC_INIT(system-config-printer, 1.5.18)
AC_CONFIG_SRCDIR(system-config-printer.py)
AM_INIT_AUTOMAKE([dist-xz dist-bzip2 subdir-objects 1.6])
AM_GNU_GETTEXT_VERSION(0.20)
-AX_REQUIRE_DEFINED([AM_GNU_GETTEXT])
AM_GNU_GETTEXT([external])
AM_PATH_PYTHON([3])
PACKAGE="AC_PACKAGE_NAME"

View File

@@ -0,0 +1,16 @@
--- a/Makefile.am
+++ b/Makefile.am
@@ -59,11 +59,11 @@ dbus/org.fedoraproject.Config.Printing.service: dbus/org.fedoraproject.Config.Pr
# Use distutils to build the module.
all-local: .stamp-distutils-in-builddir config.py cupshelpers/config.py
- $(PYTHON) setup.py build
+ $(PYTHON) -m build --no-isolation --outdir dist/ --wheel
# Use distutils to install the module.
install-exec-local: .stamp-distutils-in-builddir
- $(PYTHON) setup.py install --prefix=$(DESTDIR)$(prefix)
+ $(PYTHON) -m installer --prefix=$(prefix) dist/*.whl
# Uninstall the module, crossing our fingers that we know enough
# about how distutils works to do this. Unfortunately, distutils