Diff cups-filters-1.28.17-r2 with a cups-filters-2.0.1-r1

/usr/portage/net-print/cups-filters/cups-filters-2.0.1-r1.ebuild 2026-09-22 20:03:05.238484330 +0300
1
# Copyright 1999-2026 Gentoo Authors
1
# Copyright 2023-2026 Gentoo Authors
2 2
# Distributed under the terms of the GNU General Public License v2
3 3

  
4 4
EAPI=8
5 5

  
6
GENTOO_DEPEND_ON_PERL=no
7
inherit perl-module systemd flag-o-matic
6
inherit flag-o-matic
8 7

  
9 8
DESCRIPTION="Cups filters"
10 9
HOMEPAGE="https://wiki.linuxfoundation.org/openprinting/cups-filters"
11
SRC_URI="
12
	https://github.com/OpenPrinting/cups-filters/releases/download/${PV}/${P}.tar.xz
13
	https://www.openprinting.org/download/${PN}/${P}.tar.xz
14
"
15 10

  
16
LICENSE="MIT GPL-2"
17
SLOT="0"
18
IUSE="dbus exif +foomatic jpeg ldap pclm pdf perl png +postscript test tiff zeroconf"
19
KEYWORDS="~alpha amd64 arm arm64 ~hppa ~loong ~mips ppc ppc64 ~riscv ~s390 ~sparc x86"
11
if [[ ${PV} == 9999 ]] ; then
12
	EGIT_REPO_URI="https://github.com/OpenPrinting/cups-filters"
13
	inherit autotools git-r3
14
else
15
	SRC_URI="https://github.com/OpenPrinting/cups-filters/releases/download/${PV}/${P}.tar.xz"
20 16

  
21
RESTRICT="!test? ( test )"
17
	KEYWORDS="~alpha amd64 arm arm64 ~hppa ~loong ~mips ppc ppc64 ~riscv ~s390 ~sparc x86"
18
fi
19

  
20
LICENSE="Apache-2.0"
21
SLOT="0"
22
IUSE="+foomatic"
22 23

  
23 24
RDEPEND="
24
	>=app-text/poppler-0.32[cxx,jpeg?,lcms,tiff?,utils]
25
	>=app-text/qpdf-8.3.0:=
26
	dev-libs/glib:2
27
	media-libs/fontconfig
28
	media-libs/freetype:2
29
	media-libs/lcms:2
25
	net-print/libcupsfilters
26
	net-print/libppd
30 27
	>=net-print/cups-1.7.3
31
	!<=net-print/cups-1.5.9999
32
	app-alternatives/bc
33
	virtual/zlib:=
34
	exif? ( media-libs/libexif )
35
	dbus? ( sys-apps/dbus )
36
	foomatic? ( !net-print/foomatic-filters )
37
	jpeg? ( media-libs/libjpeg-turbo:= )
38
	ldap? ( net-nds/openldap:= )
39
	pdf? ( app-text/mupdf:= )
40
	perl? ( dev-lang/perl:= )
41
	png? ( media-libs/libpng:= )
42
	postscript? ( >=app-text/ghostscript-gpl-9.09[cups] )
43
	tiff? ( media-libs/tiff:= )
44
	zeroconf? ( net-dns/avahi[dbus] )
45 28
"
46 29
DEPEND="${RDEPEND}"
47 30
BDEPEND="
48
	>=dev-util/gdbus-codegen-2.80.5-r1
49 31
	>=sys-devel/gettext-0.18.3
50 32
	virtual/pkgconfig
51
	test? ( media-fonts/dejavu )
52 33
"
53 34

  
35
# The tests are composed of:
36
# - built program
37
# - test case itself: filter/test.sh
38
#
39
# The latter is not wired up, and it becomes immediately evident why.
40
# Bow to this reality and don't claim we can run anything. As a side
41
# effect, don't compile in src_test, that which we never use.
42
RESTRICT="test"
43

  
54 44
PATCHES=(
55
	"${FILESDIR}"/${PN}-1.28.17-c++17.patch
56
	"${FILESDIR}"/${PN}-1.28.17-CVE-2023-24805.patch
57
	"${FILESDIR}"/${PN}-1.28.17-qpdf-12.patch
45
	"${FILESDIR}"/${PN}-2.0.1-CVE-2025-64524.patch
58 46
)
59 47

  
48
src_prepare() {
49
	default
50

  
51
	[[ ${PV} == 9999 ]] && eautoreconf
52
}
53

  
60 54
src_configure() {
61
	# Bug #898156
62
	append-cxxflags -std=c++17
55
	# https://github.com/OpenPrinting/cups-filters/issues/605 (bug #944074)
56
	append-cflags -std=gnu17
63 57

  
64 58
	local myeconfargs=(
65 59
		--enable-imagefilters
60
		--enable-driverless
61
		--enable-poppler
66 62
		--localstatedir="${EPREFIX}"/var
67
		--with-browseremoteprotocols=DNSSD,CUPS
68
		--with-cups-rundir="${EPREFIX}"/run/cups
69 63
		--with-fontdir="fonts/conf.avail"
70
		--with-pdftops=pdftops
71
		--with-rcdir=no
72
		--without-php
64
		# These are just probed for the path. Always enable them.
65
		--with-gs-path="${EPREFIX}"/usr/bin/gs
66
		--with-mutool-path="${EPREFIX}"/usr/bin/mutool
73 67

  
74
		$(use_enable exif)
75
		$(use_enable dbus)
76 68
		$(use_enable foomatic)
77
		$(use_enable ldap)
78
		$(use_enable pclm)
79
		$(use_enable pdf mutool)
80
		$(use_enable postscript ghostscript)
81
		$(use_enable zeroconf avahi)
82
		$(use_with jpeg)
83
		$(use_with png)
84
		$(use_with tiff)
85 69
	)
86 70

  
87 71
	econf "${myeconfargs[@]}"
88

  
89
	if use perl; then
90
		pushd "${S}"/scripting/perl > /dev/null || die
91
		perl-module_src_configure
92
		popd > /dev/null || die
93
	fi
94
}
95

  
96
src_compile() {
97
	default
98

  
99
	if use perl; then
100
		pushd "${S}"/scripting/perl > /dev/null || die
101
		perl-module_src_compile
102
		popd > /dev/null || die
103
	fi
104
}
105

  
106
src_test() {
107
	# Avoid perl-module_src_test
108
	default
109

  
110
	if use perl; then
111
		pushd "${S}/scripting/perl" > /dev/null || die
112
		perl-module_src_test
113
		popd > /dev/null || die
114
	fi
115
}
116

  
117
src_install() {
118
	default
119

  
120
	if use perl; then
121
		pushd "${S}"/scripting/perl > /dev/null || die
122
		perl-module_src_install
123
		perl_delete_localpod
124
		popd > /dev/null || die
125
	fi
126

  
127
	if use postscript; then
128
		# workaround: some printer drivers still require pstoraster and pstopxl, bug #383831
129
		dosym gstoraster /usr/libexec/cups/filter/pstoraster
130
		dosym gstopxl /usr/libexec/cups/filter/pstopxl
131
	fi
132

  
133
	find "${ED}" \( -name "*.a" -o -name "*.la" \) -delete || die
134

  
135
	cp "${FILESDIR}"/cups-browsed.init.d-r2 "${T}"/cups-browsed || die
136

  
137
	if ! use zeroconf ; then
138
		sed -i -e 's:need cupsd avahi-daemon:need cupsd:g' "${T}"/cups-browsed || die
139
		sed -i -e 's:cups\.service avahi-daemon\.service:cups.service:g' "${S}"/utils/cups-browsed.service || die
140
	fi
141

  
142
	doinitd "${T}"/cups-browsed
143
	systemd_dounit "${S}"/utils/cups-browsed.service
144
}
145

  
146
pkg_postinst() {
147
	if ! use foomatic ; then
148
		ewarn "You are disabling the foomatic code in cups-filters. Please do that ONLY if absolutely"
149
		ewarn "necessary. net-print/foomatic-filters as a replacement is deprecated and unmaintained."
150
	fi
151 72
}
Thank you!