Line 0
Link Here
|
0 |
- |
1 |
# Copyright 1999-2023 Gentoo Authors |
|
|
2 |
# Distributed under the terms of the GNU General Public License v2 |
3 |
|
4 |
EAPI=8 |
5 |
|
6 |
inherit systemd |
7 |
|
8 |
DESCRIPTION="Cups filters" |
9 |
HOMEPAGE="https://wiki.linuxfoundation.org/openprinting/cups-filters" |
10 |
SRC_URI=" |
11 |
https://github.com/OpenPrinting/cups-filters/releases/download/${PV}/${P}.tar.xz |
12 |
https://www.openprinting.org/download/${PN}/${P}.tar.xz |
13 |
" |
14 |
|
15 |
LICENSE="Apache-2.0" |
16 |
SLOT="0" |
17 |
IUSE="pdf +postscript test zeroconf" |
18 |
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86" |
19 |
RESTRICT="!test? ( test )" |
20 |
|
21 |
RDEPEND=" |
22 |
>=app-text/poppler-0.32[utils] |
23 |
dev-libs/glib:2 |
24 |
>=net-print/cups-2.2.2 |
25 |
sys-devel/bc |
26 |
pdf? ( app-text/mupdf:= ) |
27 |
postscript? ( >=app-text/ghostscript-gpl-9.09[cups] ) |
28 |
zeroconf? ( net-dns/avahi[dbus] ) |
29 |
" |
30 |
DEPEND="${RDEPEND}" |
31 |
BDEPEND=" |
32 |
dev-util/gdbus-codegen |
33 |
>=sys-devel/gettext-0.18.3 |
34 |
virtual/pkgconfig |
35 |
test? ( media-fonts/dejavu ) |
36 |
" |
37 |
|
38 |
src_configure() { |
39 |
local myeconfargs=( |
40 |
--localstatedir="${EPREFIX}"/var |
41 |
--with-fontdir="fonts/conf.avail" |
42 |
|
43 |
--enable-foomatic |
44 |
--enable-imagefilters |
45 |
$(use_enable pdf mutool) |
46 |
$(use_enable postscript ghostscript) |
47 |
$(use_enable zeroconf avahi) |
48 |
) |
49 |
|
50 |
econf "${myeconfargs[@]}" |
51 |
} |
52 |
|
53 |
src_install() { |
54 |
default |
55 |
|
56 |
if use postscript; then |
57 |
# workaround: some printer drivers still require pstoraster and pstopxl, bug #383831 |
58 |
dosym gstoraster /usr/libexec/cups/filter/pstoraster |
59 |
dosym gstopxl /usr/libexec/cups/filter/pstopxl |
60 |
fi |
61 |
|
62 |
find "${ED}" \( -name "*.a" -o -name "*.la" \) -delete || die |
63 |
|
64 |
cp "${FILESDIR}"/cups-browsed.init.d-r2 "${T}"/cups-browsed || die |
65 |
|
66 |
if ! use zeroconf ; then |
67 |
sed -i -e 's:need cupsd avahi-daemon:need cupsd:g' "${T}"/cups-browsed || die |
68 |
sed -i -e 's:cups\.service avahi-daemon\.service:cups.service:g' "${S}"/utils/cups-browsed.service || die |
69 |
fi |
70 |
|
71 |
doinitd "${T}"/cups-browsed |
72 |
systemd_dounit "${S}"/utils/cups-browsed.service |
73 |
} |