public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] [RFC PATCH 00/10] Upgrading cups-filters to 2.0.0
@ 2023-12-05  5:20 Eli Schwartz
  2023-12-05  5:20 ` [gentoo-dev] [RFC PATCH 01/10] net-print/libcupsfilters: new package, add 2.0.0 Eli Schwartz
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: Eli Schwartz @ 2023-12-05  5:20 UTC (permalink / raw
  To: gentoo-dev

I've been working with Sam for a bit on this update. It's a bit of a
fiddly one, as a lot of stuff has changed upstream. It's probably best
described via my proposed news post. Please review. It would also be
quite nice to get a bit of testing -- I'm especially concerned about
cups-browsed's testsuite, so if anyone has any ideas how to actually run
it, that would be fantastic. I do not use cups-browsed myself...

News post:
-------------------------------------

Title: CUPS no longer directly depends on its filters
Author: Eli Schwartz <eschwartz93@gmail.com>
Posted: 2023-11-20
Revision: 1
News-Item-Format: 2.0
Display-If-Installed: <=net-print/cups-2.4.7-r1

Reasons
=======

Historically, net-print/cups has both depended on and been a dependency of
net-print/cups-filters. The latter is required for usability of a CUPS
printing setup, but also must build against the former's libraries. This
results in an ugly dependency cycle, and forcing the entire CUPS printing
setup wherever USE=cups is enabled on a framework.

Current upstream work on CUPS has focused on modularizing the codebase. There
are now several packages, and there will be more in the future. Installing
net-print/cups-filters is no longer sufficient to ensure all components are
installed.

In the future, when CUPS v3 is released, filters will be exclusive to legacy
printers, and largely replaced with IPP Everywhere.[1]

A more future-proof way to install a CUPS production printing setup is needed.

User Action Required
=======

cups-filters is required for current versions of CUPS. To prevent depcleaning
if you are a CUPS user (and it was not installed just as a dependency for
something else):

    emerge net-print/cups-meta

If cups-browsed support is desired, add the following package.use:

    net-print/cups-meta browsed


[1] https://openprinting.github.io/current/#the-new-architecture-for-printing-and-scanning



Eli Schwartz (10):
  net-print/libcupsfilters: new package, add 2.0.0
  net-print/libppd: new package, add 2.0.0
  net-print/cups-filters: add 2.0.0
  net-print/cups-browsed: new package, add 2.0.0
  net-print/cups-meta: new package, add 1
  net-print/cups: drop cyclic dependency on cups-filters
  net-print/cups: re-enable tests
  net-print/cups: avoid running unittests in src_compile
  net-print/cups-browsed: restrict tests
  net-print/cups-filters: restrict tests

 net-print/cups-browsed/Manifest               |   1 +
 .../cups-browsed/cups-browsed-2.0.0.ebuild    |  82 +++++
 ...d.c-Fix-build-with-avahi-disabled-20.patch |  34 ++
 net-print/cups-browsed/metadata.xml           |  11 +
 net-print/cups-filters/Manifest               |   1 +
 .../cups-filters/cups-filters-2.0.0.ebuild    |  54 +++
 net-print/cups-meta/cups-meta-1.ebuild        |  21 ++
 net-print/cups-meta/metadata.xml              |   9 +
 net-print/cups/cups-2.4.7-r2.ebuild           | 320 ++++++++++++++++++
 net-print/libcupsfilters/Manifest             |   1 +
 .../libcupsfilters-2.0.0.ebuild               |  60 ++++
 net-print/libcupsfilters/metadata.xml         |  14 +
 net-print/libppd/Manifest                     |   1 +
 net-print/libppd/libppd-2.0.0.ebuild          |  52 +++
 net-print/libppd/metadata.xml                 |  14 +
 15 files changed, 675 insertions(+)
 create mode 100644 net-print/cups-browsed/Manifest
 create mode 100644 net-print/cups-browsed/cups-browsed-2.0.0.ebuild
 create mode 100644 net-print/cups-browsed/files/0001-cups-browsed.c-Fix-build-with-avahi-disabled-20.patch
 create mode 100644 net-print/cups-browsed/metadata.xml
 create mode 100644 net-print/cups-filters/cups-filters-2.0.0.ebuild
 create mode 100644 net-print/cups-meta/cups-meta-1.ebuild
 create mode 100644 net-print/cups-meta/metadata.xml
 create mode 100644 net-print/cups/cups-2.4.7-r2.ebuild
 create mode 100644 net-print/libcupsfilters/Manifest
 create mode 100644 net-print/libcupsfilters/libcupsfilters-2.0.0.ebuild
 create mode 100644 net-print/libcupsfilters/metadata.xml
 create mode 100644 net-print/libppd/Manifest
 create mode 100644 net-print/libppd/libppd-2.0.0.ebuild
 create mode 100644 net-print/libppd/metadata.xml

-- 
2.41.0



^ permalink raw reply	[flat|nested] 12+ messages in thread

* [gentoo-dev] [RFC PATCH 01/10] net-print/libcupsfilters: new package, add 2.0.0
  2023-12-05  5:20 [gentoo-dev] [RFC PATCH 00/10] Upgrading cups-filters to 2.0.0 Eli Schwartz
@ 2023-12-05  5:20 ` Eli Schwartz
  2023-12-05  5:20 ` [gentoo-dev] [RFC PATCH 02/10] net-print/libppd: " Eli Schwartz
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Eli Schwartz @ 2023-12-05  5:20 UTC (permalink / raw
  To: gentoo-dev

Part of the CUPS v3 evolution. Now, cups-filters has been split out into
multiple sub-packages. This is the core library.

Signed-off-by: Eli Schwartz <eschwartz93@gmail.com>
---
 net-print/libcupsfilters/Manifest             |  1 +
 .../libcupsfilters-2.0.0.ebuild               | 60 +++++++++++++++++++
 net-print/libcupsfilters/metadata.xml         | 14 +++++
 3 files changed, 75 insertions(+)
 create mode 100644 net-print/libcupsfilters/Manifest
 create mode 100644 net-print/libcupsfilters/libcupsfilters-2.0.0.ebuild
 create mode 100644 net-print/libcupsfilters/metadata.xml

diff --git a/net-print/libcupsfilters/Manifest b/net-print/libcupsfilters/Manifest
new file mode 100644
index 000000000000..9145aecf6f6d
--- /dev/null
+++ b/net-print/libcupsfilters/Manifest
@@ -0,0 +1 @@
+DIST libcupsfilters-2.0.0.tar.xz 1279856 BLAKE2B ce9d839bb700017c303c1301c7a97fd02e3657a908e685377be49557d995574a7fc5a31d4fcbda5eeb9ba2d3cd07858224540dbf0bc9fa078cfd25a58ee15a41 SHA512 279bff6dcfa76312b10dae97480914345defd90eab79c4716d4553870f73e0f9db404786fd7e2948a86ae5aedb10dca0c2984ccb4222acbd4e835cd572030d6a
diff --git a/net-print/libcupsfilters/libcupsfilters-2.0.0.ebuild b/net-print/libcupsfilters/libcupsfilters-2.0.0.ebuild
new file mode 100644
index 000000000000..511d423289b8
--- /dev/null
+++ b/net-print/libcupsfilters/libcupsfilters-2.0.0.ebuild
@@ -0,0 +1,60 @@
+# Copyright 2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DESCRIPTION="library for developing printing features, split out of cups-filters"
+HOMEPAGE="https://github.com/OpenPrinting/libcupsfilters"
+SRC_URI="https://github.com/OpenPrinting/libcupsfilters/releases/download/${PV}/${P}.tar.xz"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+IUSE="dbus exif jpeg pdf +poppler +postscript png test tiff"
+KEYWORDS="~amd64"
+
+RESTRICT="!test? ( test )"
+
+RDEPEND="
+	>=app-text/qpdf-8.3.0:=
+	media-libs/fontconfig
+	media-libs/lcms:2
+	>=net-print/cups-2
+	!<net-print/cups-filters-2.0.0
+
+	exif? ( media-libs/libexif )
+	dbus? ( sys-apps/dbus )
+	jpeg? ( media-libs/libjpeg-turbo:= )
+	poppler? ( >=app-text/poppler-0.32[cxx] )
+	png? ( media-libs/libpng:= )
+	tiff? ( media-libs/tiff:= )
+"
+DEPEND="${RDEPEND}"
+BDEPEND="
+	>=sys-devel/gettext-0.18.3
+	virtual/pkgconfig
+	test? ( media-fonts/dejavu )
+"
+
+src_configure() {
+	local myeconfargs=(
+		--enable-imagefilters
+		--localstatedir="${EPREFIX}"/var
+		--with-cups-rundir="${EPREFIX}"/run/cups
+
+		$(use_enable exif)
+		$(use_enable dbus)
+		$(use_enable poppler)
+		$(use_enable postscript)
+		$(use_enable pdf mutool)
+		$(use_with jpeg)
+		$(use_with png)
+		$(use_with tiff)
+	)
+
+	econf "${myeconfargs[@]}"
+}
+
+src_install() {
+	default
+	find "${ED}" -name '*.la' -delete || die
+}
diff --git a/net-print/libcupsfilters/metadata.xml b/net-print/libcupsfilters/metadata.xml
new file mode 100644
index 000000000000..d31059e1c097
--- /dev/null
+++ b/net-print/libcupsfilters/metadata.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+	<maintainer type="project">
+		<email>printing@gentoo.org</email>
+		<name>Gentoo Printing Project</name>
+	</maintainer>
+	<use>
+		<flag name="poppler">Build the pdftoraster filter</flag>
+	</use>
+	<upstream>
+		<remote-id type="github">OpenPrinting/libcupsfilters</remote-id>
+	</upstream>
+</pkgmetadata>
-- 
2.41.0



^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [gentoo-dev] [RFC PATCH 02/10] net-print/libppd: new package, add 2.0.0
  2023-12-05  5:20 [gentoo-dev] [RFC PATCH 00/10] Upgrading cups-filters to 2.0.0 Eli Schwartz
  2023-12-05  5:20 ` [gentoo-dev] [RFC PATCH 01/10] net-print/libcupsfilters: new package, add 2.0.0 Eli Schwartz
@ 2023-12-05  5:20 ` Eli Schwartz
  2023-12-05  5:20 ` [gentoo-dev] [RFC PATCH 03/10] net-print/cups-filters: " Eli Schwartz
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Eli Schwartz @ 2023-12-05  5:20 UTC (permalink / raw
  To: gentoo-dev

Part of the CUPS v3 evolution. Now, cups-filters has been split out into
multiple sub-packages. This is the legacy PPD filters core library.

Signed-off-by: Eli Schwartz <eschwartz93@gmail.com>
---
 net-print/libppd/Manifest            |  1 +
 net-print/libppd/libppd-2.0.0.ebuild | 52 ++++++++++++++++++++++++++++
 net-print/libppd/metadata.xml        | 14 ++++++++
 3 files changed, 67 insertions(+)
 create mode 100644 net-print/libppd/Manifest
 create mode 100644 net-print/libppd/libppd-2.0.0.ebuild
 create mode 100644 net-print/libppd/metadata.xml

diff --git a/net-print/libppd/Manifest b/net-print/libppd/Manifest
new file mode 100644
index 000000000000..bc6ba554c08c
--- /dev/null
+++ b/net-print/libppd/Manifest
@@ -0,0 +1 @@
+DIST libppd-2.0.0.tar.xz 580716 BLAKE2B 8505c5ab5b515104308624a8f78505343b894df08ab8ac2727d7bd82d0d65d256d22ecaf384b212d9a5c45d2a619a6311722a8c5ed954b7a8a9780477aedb458 SHA512 8be9e67552528606fd804ba13b05710938ed7d02316c1c902ee657bc0e5fade663ffacb5b032609a1c1fdc80d976e7e54d2ca2f71db83cb8fdcee6a371e6bad4
diff --git a/net-print/libppd/libppd-2.0.0.ebuild b/net-print/libppd/libppd-2.0.0.ebuild
new file mode 100644
index 000000000000..174c775a213f
--- /dev/null
+++ b/net-print/libppd/libppd-2.0.0.ebuild
@@ -0,0 +1,52 @@
+# Copyright 2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DESCRIPTION="Legacy library for PPD files, split out of cups-filters"
+HOMEPAGE="https://github.com/OpenPrinting/libppd"
+SRC_URI="https://github.com/OpenPrinting/libppd/releases/download/${PV}/${P}.tar.xz"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+IUSE="+postscript +poppler"
+KEYWORDS="~amd64"
+
+# pdftops has various possible implementations, but the default
+# really needs to be decent
+REQUIRED_USE="|| ( postscript poppler )"
+
+RDEPEND="
+	>=net-print/cups-2
+	net-print/libcupsfilters
+	!<net-print/cups-filters-2.0.0
+	postscript? ( >=app-text/ghostscript-gpl-9.09[cups] )
+	poppler? ( >=app-text/poppler-0.32[utils] )
+"
+DEPEND="${RDEPEND}"
+BDEPEND="
+	>=sys-devel/gettext-0.18.3
+	virtual/pkgconfig
+"
+
+src_configure() {
+	local myeconfargs=(
+		--localstatedir="${EPREFIX}"/var
+		--with-cups-rundir="${EPREFIX}"/run/cups
+		# This does build time checks for (preferred) tool interfaces.
+		$(use_enable postscript ghostscript)
+		$(use_enable poppler pdftops)
+		# These fallbacks are just probed for the path. Always enable them.
+		--with-mutool-path="${EPREFIX}"/usr/bin/mutool
+		--with-pdftocairo-path="${EPREFIX}"/usr/bin/pdftocairo # from poppler
+		# unpackaged
+		--disable-acroread
+	)
+
+	econf "${myeconfargs[@]}"
+}
+
+src_install() {
+	default
+	find "${ED}" -name '*.la' -delete || die
+}
diff --git a/net-print/libppd/metadata.xml b/net-print/libppd/metadata.xml
new file mode 100644
index 000000000000..67a6452ca268
--- /dev/null
+++ b/net-print/libppd/metadata.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+	<maintainer type="project">
+		<email>printing@gentoo.org</email>
+		<name>Gentoo Printing Project</name>
+	</maintainer>
+	<use>
+		<flag name="poppler">Use the <pkg>app-text/poppler</pkg> pdftops filter</flag>
+	</use>
+	<upstream>
+		<remote-id type="github">OpenPrinting/libppd</remote-id>
+	</upstream>
+</pkgmetadata>
-- 
2.41.0



^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [gentoo-dev] [RFC PATCH 03/10] net-print/cups-filters: add 2.0.0
  2023-12-05  5:20 [gentoo-dev] [RFC PATCH 00/10] Upgrading cups-filters to 2.0.0 Eli Schwartz
  2023-12-05  5:20 ` [gentoo-dev] [RFC PATCH 01/10] net-print/libcupsfilters: new package, add 2.0.0 Eli Schwartz
  2023-12-05  5:20 ` [gentoo-dev] [RFC PATCH 02/10] net-print/libppd: " Eli Schwartz
@ 2023-12-05  5:20 ` Eli Schwartz
  2023-12-05  5:20 ` [gentoo-dev] [RFC PATCH 04/10] net-print/cups-browsed: new package, " Eli Schwartz
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Eli Schwartz @ 2023-12-05  5:20 UTC (permalink / raw
  To: gentoo-dev

Part of the CUPS v3 evolution. Now, cups-filters has been split out into
multiple sub-packages. The new version of cups-filters depends on a
couple of extracted libraries, and builds on these to distribute the
actual filters. It no longer handles browsed at all -- this is a
completely separate, optional component.

Most options are no longer relevant, as they are encapsulated in the
subpackages.

Signed-off-by: Eli Schwartz <eschwartz93@gmail.com>
---
 net-print/cups-filters/Manifest               |  1 +
 .../cups-filters/cups-filters-2.0.0.ebuild    | 45 +++++++++++++++++++
 2 files changed, 46 insertions(+)
 create mode 100644 net-print/cups-filters/cups-filters-2.0.0.ebuild

diff --git a/net-print/cups-filters/Manifest b/net-print/cups-filters/Manifest
index 96b28980e619..3e7f08806c56 100644
--- a/net-print/cups-filters/Manifest
+++ b/net-print/cups-filters/Manifest
@@ -1 +1,2 @@
 DIST cups-filters-1.28.17.tar.xz 1516052 BLAKE2B 87258391901d55d9e59b06d54603d014e54d224a373529bd70fcd38cded9dc96c88ca73bcea63d7633c065caea3f9e3274cd450aec5f1bd90130d9a88c0d3421 SHA512 320544a48206165581adafb28dbef58f39c66bebd3641be3d180a692605349d9e6af6d464044db9f7bda17a67f4a079370d8cc880cd7873d684b2209882deb35
+DIST cups-filters-2.0.0.tar.xz 447648 BLAKE2B be5e2aab4eb921aa67bfcc93aa5f95a9f1fe1a269ed73d18273a0e9a3e816187e9e32750ba6521c3ab083c3c7b7a60bb1fa679e16d4a5917f911a4ba8d4b7207 SHA512 fc8ba3bbf92d5ede295884023d1c42422c4c250dbbf21c948f160a04ded3259784df4bd17eea64492f9417f866e566be1a9fcde47d29655cd4204ef4cc7af134
diff --git a/net-print/cups-filters/cups-filters-2.0.0.ebuild b/net-print/cups-filters/cups-filters-2.0.0.ebuild
new file mode 100644
index 000000000000..fde6177f0322
--- /dev/null
+++ b/net-print/cups-filters/cups-filters-2.0.0.ebuild
@@ -0,0 +1,45 @@
+# Copyright 2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DESCRIPTION="Cups filters"
+HOMEPAGE="https://wiki.linuxfoundation.org/openprinting/cups-filters"
+SRC_URI="https://github.com/OpenPrinting/cups-filters/releases/download/${PV}/${P}.tar.xz"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+IUSE="+foomatic"
+#IUSE=""
+KEYWORDS="~amd64"
+
+RDEPEND="
+	net-print/libcupsfilters
+	net-print/libppd
+	>=net-print/cups-1.7.3
+"
+DEPEND="${RDEPEND}"
+BDEPEND="
+	>=sys-devel/gettext-0.18.3
+	virtual/pkgconfig
+"
+
+src_configure() {
+	local myeconfargs=(
+		--enable-imagefilters
+		--enable-driverless
+		--enable-poppler
+		--localstatedir="${EPREFIX}"/var
+		--with-fontdir="fonts/conf.avail"
+		# cups-browsed is split out and avahi is not needed for filters
+		# https://github.com/OpenPrinting/cups-filters/pull/558
+		--disable-avahi
+		# These are just probed for the path. Always enable them.
+		--with-gs-path="${EPREFIX}"/usr/bin/gs
+		--with-mutool-path="${EPREFIX}"/usr/bin/mutool
+
+		$(use_enable foomatic)
+	)
+
+	econf "${myeconfargs[@]}"
+}
-- 
2.41.0



^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [gentoo-dev] [RFC PATCH 04/10] net-print/cups-browsed: new package, add 2.0.0
  2023-12-05  5:20 [gentoo-dev] [RFC PATCH 00/10] Upgrading cups-filters to 2.0.0 Eli Schwartz
                   ` (2 preceding siblings ...)
  2023-12-05  5:20 ` [gentoo-dev] [RFC PATCH 03/10] net-print/cups-filters: " Eli Schwartz
@ 2023-12-05  5:20 ` Eli Schwartz
  2023-12-05  5:20 ` [gentoo-dev] [RFC PATCH 05/10] net-print/cups-meta: new package, add 1 Eli Schwartz
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Eli Schwartz @ 2023-12-05  5:20 UTC (permalink / raw
  To: gentoo-dev

Part of the CUPS v3 evolution. Now, cups-filters has been split out into
multiple sub-packages. This contains the standalone browsed component.

Signed-off-by: Eli Schwartz <eschwartz93@gmail.com>
---
 net-print/cups-browsed/Manifest               |  1 +
 .../cups-browsed/cups-browsed-2.0.0.ebuild    | 63 +++++++++++++++++++
 ...d.c-Fix-build-with-avahi-disabled-20.patch | 34 ++++++++++
 net-print/cups-browsed/metadata.xml           | 11 ++++
 4 files changed, 109 insertions(+)
 create mode 100644 net-print/cups-browsed/Manifest
 create mode 100644 net-print/cups-browsed/cups-browsed-2.0.0.ebuild
 create mode 100644 net-print/cups-browsed/files/0001-cups-browsed.c-Fix-build-with-avahi-disabled-20.patch
 create mode 100644 net-print/cups-browsed/metadata.xml

diff --git a/net-print/cups-browsed/Manifest b/net-print/cups-browsed/Manifest
new file mode 100644
index 000000000000..e9a2ce2398ba
--- /dev/null
+++ b/net-print/cups-browsed/Manifest
@@ -0,0 +1 @@
+DIST cups-browsed-2.0.0.tar.xz 426132 BLAKE2B e1724c03302d61cf131c8886a95f6ad8f0236b134f1deaadb783fa185141b83cd8ac5c5d993ded37d04c7fd806c5cde157a792a90a2f372075f24a5bd2423dc5 SHA512 592493ef82c65b2418b86b555c4d24bdf352f78516993a021d106240b8c399fd9f4fcc27e396e895d94da889a97f2bbc5e96bfa92c58c8be80802ee8df43db80
diff --git a/net-print/cups-browsed/cups-browsed-2.0.0.ebuild b/net-print/cups-browsed/cups-browsed-2.0.0.ebuild
new file mode 100644
index 000000000000..6baeb697f2cd
--- /dev/null
+++ b/net-print/cups-browsed/cups-browsed-2.0.0.ebuild
@@ -0,0 +1,63 @@
+# Copyright 2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit systemd
+
+DESCRIPTION="helper daemon to browse for remote CUPS queues and IPP network printers"
+HOMEPAGE="https://github.com/OpenPrinting/cups-browsed"
+SRC_URI="https://github.com/OpenPrinting/cups-browsed/releases/download/${PV}/${P}.tar.xz"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+IUSE="ldap test zeroconf"
+KEYWORDS="~amd64"
+
+RDEPEND="
+	dev-libs/glib:2
+	>=net-print/cups-2
+	>=net-print/cups-filters-2.0.0
+	ldap? ( net-nds/openldap:= )
+	test? ( net-print/cups[zeroconf] )
+	zeroconf? ( net-dns/avahi[dbus] )
+"
+DEPEND="${RDEPEND}"
+BDEPEND="
+	dev-util/gdbus-codegen
+	>=sys-devel/gettext-0.18.3
+	virtual/pkgconfig
+"
+
+PATCHES=(
+	"${FILESDIR}"/0001-cups-browsed.c-Fix-build-with-avahi-disabled-20.patch
+)
+
+src_configure() {
+	local myeconfargs=(
+		--localstatedir="${EPREFIX}"/var
+		--with-browseremoteprotocols=DNSSD,CUPS
+		--with-cups-rundir="${EPREFIX}"/run/cups
+		--with-rcdir=no
+
+		$(use_enable ldap)
+		$(use_enable zeroconf avahi)
+	)
+
+	econf "${myeconfargs[@]}"
+}
+
+src_install() {
+	default
+
+	cp "${FILESDIR}"/cups-browsed.init.d "${T}"/cups-browsed || die
+
+	if ! use zeroconf ; then
+		sed -i -e 's:need cupsd avahi-daemon:need cupsd:g' "${T}"/cups-browsed || die
+		sed -i -e 's:cups\.service avahi-daemon\.service:cups.service:g' "${S}"/daemon/cups-browsed.service || die
+	fi
+
+	doinitd "${T}"/cups-browsed
+	systemd_dounit "${S}"/daemon/cups-browsed.service
+
+}
diff --git a/net-print/cups-browsed/files/0001-cups-browsed.c-Fix-build-with-avahi-disabled-20.patch b/net-print/cups-browsed/files/0001-cups-browsed.c-Fix-build-with-avahi-disabled-20.patch
new file mode 100644
index 000000000000..f72d3919c037
--- /dev/null
+++ b/net-print/cups-browsed/files/0001-cups-browsed.c-Fix-build-with-avahi-disabled-20.patch
@@ -0,0 +1,34 @@
+Upstream: https://github.com/OpenPrinting/cups-browsed/commit/08af74bfbf9aa8ccab45a2ee74e95951839756ba.patch
+From 08af74bfbf9aa8ccab45a2ee74e95951839756ba Mon Sep 17 00:00:00 2001
+From: Timo Gurr <timo.gurr@gmail.com>
+Date: Wed, 27 Sep 2023 13:01:46 +0200
+Subject: [PATCH] cups-browsed.c: Fix build with avahi disabled (#20)
+
+Fixes #19
+---
+ daemon/cups-browsed.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/daemon/cups-browsed.c b/daemon/cups-browsed.c
+index b06461b4..c1e64fab 100644
+--- a/daemon/cups-browsed.c
++++ b/daemon/cups-browsed.c
+@@ -400,6 +400,7 @@ typedef struct pagesize_count_s
+   int   count;
+ } pagesize_count_t;
+ 
++#ifdef HAVE_AVAHI
+ typedef struct resolver_args_s
+ {
+   AvahiIfIndex interface;
+@@ -414,6 +415,7 @@ typedef struct resolver_args_s
+   AvahiLookupResultFlags flags;
+   void* userdata;
+ } resolver_args_t;
++#endif // HAVE_AVAHI
+ 
+ typedef struct create_args_s
+ {
+-- 
+2.41.0
+
diff --git a/net-print/cups-browsed/metadata.xml b/net-print/cups-browsed/metadata.xml
new file mode 100644
index 000000000000..1b9a77a07ab0
--- /dev/null
+++ b/net-print/cups-browsed/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+	<maintainer type="project">
+		<email>printing@gentoo.org</email>
+		<name>Gentoo Printing Project</name>
+	</maintainer>
+	<upstream>
+		<remote-id type="github">OpenPrinting/cups-browsed</remote-id>
+	</upstream>
+</pkgmetadata>
-- 
2.41.0



^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [gentoo-dev] [RFC PATCH 05/10] net-print/cups-meta: new package, add 1
  2023-12-05  5:20 [gentoo-dev] [RFC PATCH 00/10] Upgrading cups-filters to 2.0.0 Eli Schwartz
                   ` (3 preceding siblings ...)
  2023-12-05  5:20 ` [gentoo-dev] [RFC PATCH 04/10] net-print/cups-browsed: new package, " Eli Schwartz
@ 2023-12-05  5:20 ` Eli Schwartz
  2023-12-05  5:20 ` [gentoo-dev] [RFC PATCH 06/10] net-print/cups: drop cyclic dependency on cups-filters Eli Schwartz
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Eli Schwartz @ 2023-12-05  5:20 UTC (permalink / raw
  To: gentoo-dev

New metapackage to pull in all the parts for a functional cups printing
stack. This will allow to avoid relying on net-print/cups for that
purpose -- because, with the advent of cups-filters 2.0.0 and the
ongoing work to refactor CUPS 3, things are broken out into various
interconnected components and configuring each one is not perfectly
straightforward. Eventually, there will not be a "cups" package at all
anyway.

Additionally, this helps solve a longstanding cycle with cups <-->
cups-filters that has only gotten worse since the latter was broken up
into various packages which require libcups from cups, which in turn
depends on -filters. There are a number of use cases for having cups
installed in "minimal" mode so that other packages can build against it.

Signed-off-by: Eli Schwartz <eschwartz93@gmail.com>
---
 net-print/cups-meta/cups-meta-1.ebuild | 21 +++++++++++++++++++++
 net-print/cups-meta/metadata.xml       |  9 +++++++++
 2 files changed, 30 insertions(+)
 create mode 100644 net-print/cups-meta/cups-meta-1.ebuild
 create mode 100644 net-print/cups-meta/metadata.xml

diff --git a/net-print/cups-meta/cups-meta-1.ebuild b/net-print/cups-meta/cups-meta-1.ebuild
new file mode 100644
index 000000000000..f4d404d2be8e
--- /dev/null
+++ b/net-print/cups-meta/cups-meta-1.ebuild
@@ -0,0 +1,21 @@
+# Copyright 2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DESCRIPTION="Metapackage for a fully configured cups printer setup"
+
+SLOT="0"
+IUSE="+browsed +foomatic pdf +postscript +poppler zeroconf"
+KEYWORDS="~amd64"
+
+RDEPEND="
+	net-print/cups[zeroconf?]
+	net-print/libppd[postscript?,poppler?]
+	net-print/libcupsfilters[pdf?,poppler?]
+	net-print/cups-filters[foomatic?]
+
+	browsed? ( net-print/cups-browsed )
+	pdf? ( app-text/mupdf )
+	postscript? ( >=app-text/ghostscript-gpl-9.09[cups] )
+"
diff --git a/net-print/cups-meta/metadata.xml b/net-print/cups-meta/metadata.xml
new file mode 100644
index 000000000000..07456818fddc
--- /dev/null
+++ b/net-print/cups-meta/metadata.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+	<maintainer type="project">
+		<email>printing@gentoo.org</email>
+		<name>Gentoo Printing Project</name>
+	</maintainer>
+	<stabilize-allarches/>
+</pkgmetadata>
-- 
2.41.0



^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [gentoo-dev] [RFC PATCH 06/10] net-print/cups: drop cyclic dependency on cups-filters
  2023-12-05  5:20 [gentoo-dev] [RFC PATCH 00/10] Upgrading cups-filters to 2.0.0 Eli Schwartz
                   ` (4 preceding siblings ...)
  2023-12-05  5:20 ` [gentoo-dev] [RFC PATCH 05/10] net-print/cups-meta: new package, add 1 Eli Schwartz
@ 2023-12-05  5:20 ` Eli Schwartz
  2023-12-05  5:20 ` [gentoo-dev] [RFC PATCH 07/10] net-print/cups: re-enable tests Eli Schwartz
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Eli Schwartz @ 2023-12-05  5:20 UTC (permalink / raw
  To: gentoo-dev

It is a PDEPEND which forces installing both, and makes building a
modular cups-filters more challenging.

Additionally, many "users" of cups may not actually want cups-filters at
all. A primary reason is because cups provides libcups, which other
packages need as an RDEPEND in order to support USE=cups while not
having any expectation of using a printing stack (at least, yet). Rely
instead on a metapackage for the full cups experience.

Signed-off-by: Eli Schwartz <eschwartz93@gmail.com>
---
 net-print/cups/cups-2.4.7-r2.ebuild | 313 ++++++++++++++++++++++++++++
 1 file changed, 313 insertions(+)
 create mode 100644 net-print/cups/cups-2.4.7-r2.ebuild

diff --git a/net-print/cups/cups-2.4.7-r2.ebuild b/net-print/cups/cups-2.4.7-r2.ebuild
new file mode 100644
index 000000000000..d63cb0132e9a
--- /dev/null
+++ b/net-print/cups/cups-2.4.7-r2.ebuild
@@ -0,0 +1,313 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit autotools linux-info xdg multilib-minimal optfeature pam toolchain-funcs
+
+MY_PV="${PV/_beta/b}"
+MY_PV="${MY_PV/_rc/rc}"
+MY_PV="${MY_PV/_p/op}"
+MY_P="${PN}-${MY_PV}"
+
+if [[ ${PV} == *9999 ]] ; then
+	inherit git-r3
+	EGIT_REPO_URI="https://github.com/OpenPrinting/cups.git"
+	[[ ${PV} != 9999 ]] && EGIT_BRANCH=branch-${PV/.9999}
+else
+	SRC_URI="https://github.com/OpenPrinting/cups/releases/download/v${MY_PV}/cups-${MY_PV}-source.tar.gz"
+	if [[ ${PV} != *_beta* && ${PV} != *_rc* ]] ; then
+		KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
+	fi
+fi
+
+S="${WORKDIR}/${MY_P}"
+
+DESCRIPTION="The Common Unix Printing System"
+HOMEPAGE="https://www.cups.org/ https://github.com/OpenPrinting/cups"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+IUSE="acl dbus debug kerberos openssl pam selinux static-libs systemd test usb X xinetd zeroconf"
+
+# As of 2.4.2, they don't actually seem to be interactive (they pass some flags
+# by default to input for us), but they fail on some greyscale issue w/ poppler?
+RESTRICT="!test? ( test ) test"
+
+BDEPEND="
+	acct-group/lp
+	acct-group/lpadmin
+	virtual/pkgconfig
+"
+DEPEND="
+	app-text/libpaper:=
+	sys-libs/zlib
+	acl? (
+		kernel_linux? (
+			sys-apps/acl
+			sys-apps/attr
+		)
+	)
+	dbus? ( >=sys-apps/dbus-1.6.18-r1[${MULTILIB_USEDEP}] )
+	kerberos? ( >=virtual/krb5-0-r1[${MULTILIB_USEDEP}] )
+	pam? ( sys-libs/pam )
+	!pam? ( virtual/libcrypt:= )
+	!openssl? ( >=net-libs/gnutls-2.12.23-r6:=[${MULTILIB_USEDEP}] )
+	openssl? ( dev-libs/openssl:=[${MULTILIB_USEDEP}] )
+	systemd? ( sys-apps/systemd )
+	usb? ( virtual/libusb:1 )
+	X? ( x11-misc/xdg-utils )
+	xinetd? ( sys-apps/xinetd )
+	zeroconf? ( >=net-dns/avahi-0.6.31-r2[dbus,${MULTILIB_USEDEP}] )
+"
+RDEPEND="
+	${DEPEND}
+	acct-group/lp
+	acct-group/lpadmin
+	selinux? ( sec-policy/selinux-cups )
+"
+
+PATCHES=(
+	"${FILESDIR}/${PN}-2.4.1-nostrip.patch"
+	"${FILESDIR}/${PN}-2.4.1-user-AR.patch"
+)
+
+MULTILIB_CHOST_TOOLS=(
+	/usr/bin/cups-config
+)
+
+pkg_setup() {
+	if use kernel_linux; then
+		linux-info_pkg_setup
+		if  ! linux_config_exists; then
+			ewarn "Can't check the linux kernel configuration."
+			ewarn "You might have some incompatible options enabled."
+		else
+			# Recheck that we don't have usblp to collide with libusb; this should now work in most cases (bug #501122)
+			if use usb; then
+				if linux_chkconfig_present USB_PRINTER; then
+					elog "Your USB printers will be managed via libusb. In case you run into problems, "
+					elog "please try disabling USB_PRINTER support in your kernel or blacklisting the"
+					elog "usblp kernel module."
+					elog "Alternatively, just disable the usb useflag for cups (your printer will still work)."
+				fi
+			else
+				if ! linux_chkconfig_present USB_PRINTER; then
+					ewarn "If you plan to use USB printers you should enable the USB_PRINTER"
+					ewarn "support in your kernel."
+					ewarn "Please enable it:"
+					ewarn "    CONFIG_USB_PRINTER=y"
+					ewarn "in /usr/src/linux/.config or"
+					ewarn "    Device Drivers --->"
+					ewarn "        USB support  --->"
+					ewarn "            [*] USB Printer support"
+					ewarn "Alternatively, enable the usb useflag for cups and use the libusb code."
+				fi
+			fi
+		fi
+	fi
+}
+
+src_prepare() {
+	default
+
+	# Remove ".SILENT" rule for verbose output (bug #524338).
+	sed 's#^.SILENT:##g' -i Makedefs.in || die
+
+	# Remove redefinition of _FORTIFY_SOURCE (bug #907683)
+	sed 's#-D_FORTIFY_SOURCE=3##g' -i config-scripts/cups-compiler.m4 || die
+
+	AT_M4DIR="config-scripts" eautoreconf
+
+	# Custom Makefiles
+	multilib_copy_sources
+}
+
+multilib_src_configure() {
+	export DSOFLAGS="${LDFLAGS}"
+
+	# Explicitly specify compiler wrt bug #524340
+	#
+	# Need to override KRB5CONFIG for proper flags
+	# https://github.com/apple/cups/issues/4423
+	local myeconfargs=(
+		CC="$(tc-getCC)"
+		CXX="$(tc-getCXX)"
+		KRB5CONFIG="${EPREFIX}"/usr/bin/${CHOST}-krb5-config
+		--libdir="${EPREFIX}"/usr/$(get_libdir)
+		--localstatedir="${EPREFIX}"/var
+		# Follow Fedora permission setting
+		--with-cupsd-file-perm=0755
+		--with-exe-file-perm=755
+		--with-log-file-perm=0640
+		# Used by Debian, also prevents printers from getting
+		# disabled and users not knowing how to re-enable them
+		--with-error-policy=retry-job
+		# Used in Debian and Fedora
+		--enable-sync-on-close
+		#
+		--with-rundir="${EPREFIX}"/run/cups
+		--with-pkgconfpath="${EPREFIX}"/usr/$(get_libdir)/pkgconfig
+		--with-cups-user=lp
+		--with-cups-group=lp
+		--with-docdir="${EPREFIX}"/usr/share/cups/html
+		# See bug #863221 for adding root
+		--with-system-groups="root lpadmin"
+		--with-xinetd="${EPREFIX}"/etc/xinetd.d
+		$(multilib_native_use_enable acl)
+		$(use_enable dbus)
+		$(use_enable debug)
+		$(use_enable debug debug-guards)
+		$(use_enable debug debug-printfs)
+		$(use_enable kerberos gssapi)
+		$(multilib_native_use_enable pam)
+		$(use_enable static-libs static)
+		$(use_enable test unit-tests)
+		--with-tls=$(usex openssl openssl gnutls)
+		$(use_with systemd ondemand systemd)
+		$(multilib_native_use_enable usb libusb)
+		$(use_with zeroconf dnssd avahi)
+		$(multilib_is_native_abi && echo --enable-libpaper || echo --disable-libpaper)
+	)
+
+	# Handle empty LINGUAS properly, bug #771162
+	if [[ -n "${LINGUAS+x}" ]] ; then
+		myeconfargs+=(
+			--with-languages="${LINGUAS}"
+		)
+	fi
+
+	if tc-is-static-only; then
+		myeconfargs+=(
+			--disable-shared
+		)
+	fi
+
+	# Install in /usr/libexec always, instead of using /usr/lib/cups, as that
+	# makes more sense when facing multilib support.
+	sed -i -e 's:CUPS_SERVERBIN="$exec_prefix/lib/cups":CUPS_SERVERBIN="$exec_prefix/libexec/cups":g' configure ||die
+
+	econf "${myeconfargs[@]}"
+
+	sed -i -e "s:SERVERBIN.*:SERVERBIN = \"\$\(BUILDROOT\)${EPREFIX}/usr/libexec/cups\":" Makedefs || die
+	sed -i -e "s:#define CUPS_SERVERBIN.*:#define CUPS_SERVERBIN \"${EPREFIX}/usr/libexec/cups\":" config.h || die
+	sed -i -e "s:cups_serverbin=.*:cups_serverbin=\"${EPREFIX}/usr/libexec/cups\":" cups-config || die
+
+	# Additional path corrections needed for prefix, see bug #597728
+	sed \
+		-e "s:ICONDIR.*:ICONDIR = ${EPREFIX}/usr/share/icons:" \
+		-e "s:INITDIR.*:INITDIR = ${EPREFIX}/etc:" \
+		-e "s:DBUSDIR.*:DBUSDIR = ${EPREFIX}/etc/dbus-1:" \
+		-e "s:MENUDIR.*:MENUDIR = ${EPREFIX}/usr/share/applications:" \
+		-i Makedefs || die
+}
+
+multilib_src_compile() {
+	if multilib_is_native_abi; then
+		default
+	else
+		emake libs
+	fi
+}
+
+multilib_src_test() {
+	# Avoid using /tmp
+	export CUPS_TESTBASE="${T}"/cups-tests
+
+	mkdir "${T}"/cups-tests || die
+
+	# We only build some of CUPS for multilib, so can't run the tests.
+	multilib_is_native_abi && default
+}
+
+multilib_src_install() {
+	if multilib_is_native_abi; then
+		emake BUILDROOT="${D}" install
+	else
+		emake BUILDROOT="${D}" install-libs install-headers
+		dobin cups-config
+	fi
+}
+
+multilib_src_install_all() {
+	dodoc {CHANGES,CREDITS,README}.md
+
+	# Move the default config file to docs
+	dodoc "${ED}"/etc/cups/cupsd.conf.default
+	rm "${ED}"/etc/cups/cupsd.conf.default || die
+
+	# Clean out cups init scripts
+	rm -r "${ED}"/etc/{init.d/cups,rc*} || die
+
+	# Install our init script
+	local neededservices=(
+		$(usex zeroconf avahi-daemon '')
+		$(usex dbus dbus '')
+	)
+	[[ -n ${neededservices[@]} ]] && neededservices="need ${neededservices[@]}"
+	cp "${FILESDIR}"/cupsd.init.d-r4 "${T}"/cupsd || die
+	sed -i -e "s/@neededservices@/${neededservices}/" "${T}"/cupsd || die
+	doinitd "${T}"/cupsd
+
+	if use pam ; then
+		rm "${ED}"/etc/pam.d/${PN} || die
+		pamd_mimic_system cups auth account
+	fi
+
+	if use xinetd ; then
+		# Correct path
+		sed -i -e "s:server = .*:server = /usr/libexec/cups/daemon/cups-lpd:" \
+			"${ED}"/etc/xinetd.d/cups-lpd || die
+		# It is safer to disable this by default, bug #137130
+		grep -w 'disable' "${ED}"/etc/xinetd.d/cups-lpd || \
+			{ sed -i -e "s:}:\tdisable = yes\n}:" "${ED}"/etc/xinetd.d/cups-lpd || die ; }
+		# Write permission for file owner (root), bug #296221
+		fperms u+w /etc/xinetd.d/cups-lpd
+	else
+		# Always configure with --with-xinetd= and clean up later,
+		# bug #525604
+		rm -r "${ED}"/etc/xinetd.d || die
+	fi
+
+	keepdir /etc/cups/{interfaces,ppd,ssl}
+
+	if ! use X ; then
+		rm -r "${ED}"/usr/share/applications || die
+	fi
+
+	# Create /etc/cups/client.conf, bug #196967 and bug #266678
+	echo "ServerName ${EPREFIX}/run/cups/cups.sock" >> "${ED}"/etc/cups/client.conf
+
+	# The following file is now provided by cups-filter:
+	rm -r "${ED}"/usr/share/cups/banners || die
+
+	# The following are created by the init script
+	rm -r "${ED}"/var/cache || die
+	rm -r "${ED}"/run || die
+
+	keepdir /usr/libexec/cups/driver /usr/share/cups/{model,profiles} /var/log/cups /var/spool/cups/tmp
+}
+
+pkg_postinst() {
+	xdg_pkg_postinst
+	local v
+
+	for v in ${REPLACING_VERSIONS}; do
+		if ! ver_test ${v} -ge 2.2.2-r2 ; then
+			ewarn "The cupsd init script switched to using pidfiles. Shutting down"
+			ewarn "cupsd will fail the next time. To fix this, please run once as root"
+			ewarn "   killall cupsd ; /etc/init.d/cupsd zap ; /etc/init.d/cupsd start"
+			break
+		fi
+	done
+
+	for v in ${REPLACING_VERSIONS}; do
+		elog
+		elog "For information about installing a printer and general cups setup"
+		elog "take a look at: https://wiki.gentoo.org/wiki/Printing"
+		break
+	done
+
+	optfeature_header "CUPS may need installing the following for certain features to work:"
+	use zeroconf && optfeature "local hostname resolution using a hostname.local naming scheme" sys-auth/nss-mdns
+}
-- 
2.41.0



^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [gentoo-dev] [RFC PATCH 07/10] net-print/cups: re-enable tests
  2023-12-05  5:20 [gentoo-dev] [RFC PATCH 00/10] Upgrading cups-filters to 2.0.0 Eli Schwartz
                   ` (5 preceding siblings ...)
  2023-12-05  5:20 ` [gentoo-dev] [RFC PATCH 06/10] net-print/cups: drop cyclic dependency on cups-filters Eli Schwartz
@ 2023-12-05  5:20 ` Eli Schwartz
  2023-12-05  5:20 ` [gentoo-dev] [RFC PATCH 08/10] net-print/cups: avoid running unittests in src_compile Eli Schwartz
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Eli Schwartz @ 2023-12-05  5:20 UTC (permalink / raw
  To: gentoo-dev

They appear to work at the moment. There's a fun oddity, in that if
libcupsfilters is installed you need image support of some variety.

Signed-off-by: Eli Schwartz <eschwartz93@gmail.com>
---
 net-print/cups/cups-2.4.7-r2.ebuild | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/net-print/cups/cups-2.4.7-r2.ebuild b/net-print/cups/cups-2.4.7-r2.ebuild
index d63cb0132e9a..3f63cd43a70c 100644
--- a/net-print/cups/cups-2.4.7-r2.ebuild
+++ b/net-print/cups/cups-2.4.7-r2.ebuild
@@ -17,7 +17,7 @@ if [[ ${PV} == *9999 ]] ; then
 else
 	SRC_URI="https://github.com/OpenPrinting/cups/releases/download/v${MY_PV}/cups-${MY_PV}-source.tar.gz"
 	if [[ ${PV} != *_beta* && ${PV} != *_rc* ]] ; then
-		KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
+		KEYWORDS="~amd64"
 	fi
 fi
 
@@ -32,14 +32,14 @@ IUSE="acl dbus debug kerberos openssl pam selinux static-libs systemd test usb X
 
 # As of 2.4.2, they don't actually seem to be interactive (they pass some flags
 # by default to input for us), but they fail on some greyscale issue w/ poppler?
-RESTRICT="!test? ( test ) test"
+RESTRICT="!test? ( test )"
 
 BDEPEND="
 	acct-group/lp
 	acct-group/lpadmin
 	virtual/pkgconfig
 "
-DEPEND="
+COMMON_DEPEND="
 	app-text/libpaper:=
 	sys-libs/zlib
 	acl? (
@@ -60,8 +60,13 @@ DEPEND="
 	xinetd? ( sys-apps/xinetd )
 	zeroconf? ( >=net-dns/avahi-0.6.31-r2[dbus,${MULTILIB_USEDEP}] )
 "
+# if libcupsfilters is installed, more tests are run. They fail without at least one of the two formats enabled.
+DEPEND="
+	${COMMON_DEPEND}
+	test? ( || ( net-print/libcupsfilters[jpeg] net-print/libcupsfilters[png] ) )
+"
 RDEPEND="
-	${DEPEND}
+	${COMMON_DEPEND}
 	acct-group/lp
 	acct-group/lpadmin
 	selinux? ( sec-policy/selinux-cups )
-- 
2.41.0



^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [gentoo-dev] [RFC PATCH 08/10] net-print/cups: avoid running unittests in src_compile
  2023-12-05  5:20 [gentoo-dev] [RFC PATCH 00/10] Upgrading cups-filters to 2.0.0 Eli Schwartz
                   ` (6 preceding siblings ...)
  2023-12-05  5:20 ` [gentoo-dev] [RFC PATCH 07/10] net-print/cups: re-enable tests Eli Schwartz
@ 2023-12-05  5:20 ` Eli Schwartz
  2023-12-05  5:20 ` [gentoo-dev] [RFC PATCH 09/10] net-print/cups-browsed: restrict tests Eli Schwartz
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Eli Schwartz @ 2023-12-05  5:20 UTC (permalink / raw
  To: gentoo-dev

If USE=test, an option was passed to configure that makes unittest
binaries be built, and as a side effect also runs them. But we really do
not want to run tests in src_compile, as FEATURES=test might not be set.

Crudely hack around this by overriding the autoconf variable that would
normally be set by `$(use_enable test unit-tests)`, when running the
test invocation itself. As a side effect, this also moves the
test-program compilation to src_test.

Signed-off-by: Eli Schwartz <eschwartz93@gmail.com>
---
 net-print/cups/cups-2.4.7-r2.ebuild | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/net-print/cups/cups-2.4.7-r2.ebuild b/net-print/cups/cups-2.4.7-r2.ebuild
index 3f63cd43a70c..d8a193a64337 100644
--- a/net-print/cups/cups-2.4.7-r2.ebuild
+++ b/net-print/cups/cups-2.4.7-r2.ebuild
@@ -30,8 +30,6 @@ LICENSE="Apache-2.0"
 SLOT="0"
 IUSE="acl dbus debug kerberos openssl pam selinux static-libs systemd test usb X xinetd zeroconf"
 
-# As of 2.4.2, they don't actually seem to be interactive (they pass some flags
-# by default to input for us), but they fail on some greyscale issue w/ poppler?
 RESTRICT="!test? ( test )"
 
 BDEPEND="
@@ -167,7 +165,6 @@ multilib_src_configure() {
 		$(use_enable kerberos gssapi)
 		$(multilib_native_use_enable pam)
 		$(use_enable static-libs static)
-		$(use_enable test unit-tests)
 		--with-tls=$(usex openssl openssl gnutls)
 		$(use_with systemd ondemand systemd)
 		$(multilib_native_use_enable usb libusb)
@@ -222,7 +219,12 @@ multilib_src_test() {
 	mkdir "${T}"/cups-tests || die
 
 	# We only build some of CUPS for multilib, so can't run the tests.
-	multilib_is_native_abi && default
+	if multilib_is_native_abi; then
+		# avoid building *and running* test binaries in src_compile
+		# https://github.com/OpenPrinting/cups/commit/b1d42061e9286f50eefc851ed906d17c6e80c4b0
+		emake UNITTESTS=unittests
+		default
+	fi
 }
 
 multilib_src_install() {
-- 
2.41.0



^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [gentoo-dev] [RFC PATCH 09/10] net-print/cups-browsed: restrict tests
  2023-12-05  5:20 [gentoo-dev] [RFC PATCH 00/10] Upgrading cups-filters to 2.0.0 Eli Schwartz
                   ` (7 preceding siblings ...)
  2023-12-05  5:20 ` [gentoo-dev] [RFC PATCH 08/10] net-print/cups: avoid running unittests in src_compile Eli Schwartz
@ 2023-12-05  5:20 ` Eli Schwartz
  2023-12-05  5:20 ` [gentoo-dev] [RFC PATCH 10/10] net-print/cups-filters: " Eli Schwartz
  2023-12-05 21:51 ` [gentoo-dev] [RFC PATCH 00/10] Upgrading cups-filters to 2.0.0 James Le Cuirot
  10 siblings, 0 replies; 12+ messages in thread
From: Eli Schwartz @ 2023-12-05  5:20 UTC (permalink / raw
  To: gentoo-dev

The tests are newly created during the 2.x upgrade. They will hang
forever if they cannot run properly. And running them properly has hit a
wall. I'm not sure where to go on from here.

Even getting this far means stepping outside of what portage can
reasonably require. Avahi only runs as root, and doesn't seem to have a
mocking mode, and even if it is running, the sandbox prevents src_test
from seeing it.

Signed-off-by: Eli Schwartz <eschwartz93@gmail.com>
---
 .../cups-browsed/cups-browsed-2.0.0.ebuild    | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/net-print/cups-browsed/cups-browsed-2.0.0.ebuild b/net-print/cups-browsed/cups-browsed-2.0.0.ebuild
index 6baeb697f2cd..0232d57c8b51 100644
--- a/net-print/cups-browsed/cups-browsed-2.0.0.ebuild
+++ b/net-print/cups-browsed/cups-browsed-2.0.0.ebuild
@@ -29,6 +29,18 @@ BDEPEND="
 	virtual/pkgconfig
 "
 
+# The tests are new since the split out of cups-filters. Actually running them
+# seems to be challenging. You need:
+# - cups tools that are USE-optional
+# - running avahi-daemon (as root!)
+# - disable portage's pid-sandbox, which interferes with avahi
+# - ipptool still fails to connect to port 8xxx
+#
+# If anything fails, a `while true` loop fails to successfully launch and break
+# out of the loop, leading to a hang. Until there's an obvious recipe for
+# successfully running the tests, restrict it.
+RESTRICT="test"
+
 PATCHES=(
 	"${FILESDIR}"/0001-cups-browsed.c-Fix-build-with-avahi-disabled-20.patch
 )
@@ -47,6 +59,13 @@ src_configure() {
 	econf "${myeconfargs[@]}"
 }
 
+src_test() {
+	# Requires avahi running. Hangs forever if not available.
+	avahi-daemon --check 2>/dev/null || die "no running avahi daemon found, cannot run tests"
+
+	default
+}
+
 src_install() {
 	default
 
-- 
2.41.0



^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [gentoo-dev] [RFC PATCH 10/10] net-print/cups-filters: restrict tests
  2023-12-05  5:20 [gentoo-dev] [RFC PATCH 00/10] Upgrading cups-filters to 2.0.0 Eli Schwartz
                   ` (8 preceding siblings ...)
  2023-12-05  5:20 ` [gentoo-dev] [RFC PATCH 09/10] net-print/cups-browsed: restrict tests Eli Schwartz
@ 2023-12-05  5:20 ` Eli Schwartz
  2023-12-05 21:51 ` [gentoo-dev] [RFC PATCH 00/10] Upgrading cups-filters to 2.0.0 James Le Cuirot
  10 siblings, 0 replies; 12+ messages in thread
From: Eli Schwartz @ 2023-12-05  5:20 UTC (permalink / raw
  To: gentoo-dev

Checking the test phase output, it is not implemented and does nothing.
Or to be more accurate, it compiles one executable but never runs
anything.

The former testsuite in the 1.x series has been divided up, just like
the constituent installable components, and it turns out that all
testable parts are in the split-out packages and none are left here.

Signed-off-by: Eli Schwartz <eschwartz93@gmail.com>
---
 net-print/cups-filters/cups-filters-2.0.0.ebuild | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/net-print/cups-filters/cups-filters-2.0.0.ebuild b/net-print/cups-filters/cups-filters-2.0.0.ebuild
index fde6177f0322..e07acf911895 100644
--- a/net-print/cups-filters/cups-filters-2.0.0.ebuild
+++ b/net-print/cups-filters/cups-filters-2.0.0.ebuild
@@ -24,6 +24,15 @@ BDEPEND="
 	virtual/pkgconfig
 "
 
+# The tests are composed of:
+# - built program
+# - test case itself: filter/test.sh
+#
+# The latter is not wired up, and it becomes immediately evident why.
+# Bow to this reality and don't claim we can run anything. As a side
+# effect, don't compile in src_test, that which we never use.
+RESTRICT="test"
+
 src_configure() {
 	local myeconfargs=(
 		--enable-imagefilters
-- 
2.41.0



^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [gentoo-dev] [RFC PATCH 00/10] Upgrading cups-filters to 2.0.0
  2023-12-05  5:20 [gentoo-dev] [RFC PATCH 00/10] Upgrading cups-filters to 2.0.0 Eli Schwartz
                   ` (9 preceding siblings ...)
  2023-12-05  5:20 ` [gentoo-dev] [RFC PATCH 10/10] net-print/cups-filters: " Eli Schwartz
@ 2023-12-05 21:51 ` James Le Cuirot
  10 siblings, 0 replies; 12+ messages in thread
From: James Le Cuirot @ 2023-12-05 21:51 UTC (permalink / raw
  To: gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 699 bytes --]

On Tue, 2023-12-05 at 00:20 -0500, Eli Schwartz wrote:
> I've been working with Sam for a bit on this update. It's a bit of a
> fiddly one, as a lot of stuff has changed upstream. It's probably best
> described via my proposed news post. Please review. It would also be
> quite nice to get a bit of testing -- I'm especially concerned about
> cups-browsed's testsuite, so if anyone has any ideas how to actually run
> it, that would be fantastic. I do not use cups-browsed myself...

I've mostly just glanced at the code, which looks fine, but I just want to
express my huge thanks for doing this. I know printing stuff isn't sexy, but
it is important, so I really appreciate the effort.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 858 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2023-12-05 21:51 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-05  5:20 [gentoo-dev] [RFC PATCH 00/10] Upgrading cups-filters to 2.0.0 Eli Schwartz
2023-12-05  5:20 ` [gentoo-dev] [RFC PATCH 01/10] net-print/libcupsfilters: new package, add 2.0.0 Eli Schwartz
2023-12-05  5:20 ` [gentoo-dev] [RFC PATCH 02/10] net-print/libppd: " Eli Schwartz
2023-12-05  5:20 ` [gentoo-dev] [RFC PATCH 03/10] net-print/cups-filters: " Eli Schwartz
2023-12-05  5:20 ` [gentoo-dev] [RFC PATCH 04/10] net-print/cups-browsed: new package, " Eli Schwartz
2023-12-05  5:20 ` [gentoo-dev] [RFC PATCH 05/10] net-print/cups-meta: new package, add 1 Eli Schwartz
2023-12-05  5:20 ` [gentoo-dev] [RFC PATCH 06/10] net-print/cups: drop cyclic dependency on cups-filters Eli Schwartz
2023-12-05  5:20 ` [gentoo-dev] [RFC PATCH 07/10] net-print/cups: re-enable tests Eli Schwartz
2023-12-05  5:20 ` [gentoo-dev] [RFC PATCH 08/10] net-print/cups: avoid running unittests in src_compile Eli Schwartz
2023-12-05  5:20 ` [gentoo-dev] [RFC PATCH 09/10] net-print/cups-browsed: restrict tests Eli Schwartz
2023-12-05  5:20 ` [gentoo-dev] [RFC PATCH 10/10] net-print/cups-filters: " Eli Schwartz
2023-12-05 21:51 ` [gentoo-dev] [RFC PATCH 00/10] Upgrading cups-filters to 2.0.0 James Le Cuirot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox