Gentoo Archives: gentoo-commits

From: Daniel Pielmeier <billie@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-print/hplip/
Date: Fri, 23 Oct 2020 14:50:10
Message-Id: 1603464564.ad423d91bed7dc60a06432861002f294cf97b3b3.billie@gentoo
1 commit: ad423d91bed7dc60a06432861002f294cf97b3b3
2 Author: Daniel Pielmeier <billie <AT> gentoo <DOT> org>
3 AuthorDate: Fri Oct 23 14:49:24 2020 +0000
4 Commit: Daniel Pielmeier <billie <AT> gentoo <DOT> org>
5 CommitDate: Fri Oct 23 14:49:24 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ad423d91
7
8 net-print/hplip: Revision bump to hplip-3.20.9-r3.
9
10 Remove dependency on net-dns/avahi if USE="scanner".
11 Thanks to Duncan for the report.
12
13 Closes: https://bugs.gentoo.org/750824
14 Package-Manager: Portage-3.0.8, Repoman-3.0.2
15 Signed-off-by: Daniel Pielmeier <billie <AT> gentoo.org>
16
17 net-print/hplip/hplip-3.20.9-r3.ebuild | 281 +++++++++++++++++++++++++++++++++
18 1 file changed, 281 insertions(+)
19
20 diff --git a/net-print/hplip/hplip-3.20.9-r3.ebuild b/net-print/hplip/hplip-3.20.9-r3.ebuild
21 new file mode 100644
22 index 00000000000..6306de7445d
23 --- /dev/null
24 +++ b/net-print/hplip/hplip-3.20.9-r3.ebuild
25 @@ -0,0 +1,281 @@
26 +# Copyright 1999-2020 Gentoo Authors
27 +# Distributed under the terms of the GNU General Public License v2
28 +
29 +EAPI=7
30 +
31 +PYTHON_COMPAT=( python3_{6,7,8} )
32 +PYTHON_REQ_USE="threads(+),xml"
33 +
34 +# 14 and 15 spit out a lot of warnings about subdirs
35 +WANT_AUTOMAKE="1.13"
36 +
37 +inherit autotools linux-info python-single-r1 readme.gentoo-r1 udev
38 +
39 +DESCRIPTION="HP Linux Imaging and Printing - Print, scan, fax drivers and service tools"
40 +HOMEPAGE="https://developers.hp.com/hp-linux-imaging-and-printing"
41 +SRC_URI="mirror://sourceforge/hplip/${P}.tar.gz
42 + https://dev.gentoo.org/~billie/distfiles/${PN}-3.20.9-patches-2.tar.xz"
43 +
44 +LICENSE="GPL-2"
45 +SLOT="0"
46 +KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~x86"
47 +
48 +IUSE="doc fax +hpcups hpijs kde libnotify libressl -libusb0 minimal parport policykit qt5 scanner +snmp static-ppds X"
49 +
50 +COMMON_DEPEND="
51 + net-print/cups
52 + virtual/jpeg:0
53 + hpijs? ( net-print/cups-filters[foomatic] )
54 + !minimal? (
55 + ${PYTHON_DEPS}
56 + sys-apps/dbus
57 + !libusb0? ( virtual/libusb:1 )
58 + libusb0? ( virtual/libusb:0 )
59 + scanner? (
60 + media-gfx/sane-backends
61 + )
62 + snmp? (
63 + !libressl? ( dev-libs/openssl:0= )
64 + libressl? ( dev-libs/libressl:= )
65 + net-analyzer/net-snmp:=
66 + $(python_gen_cond_dep 'net-dns/avahi[${PYTHON_MULTI_USEDEP}]')
67 + )
68 + )
69 +"
70 +BDEPEND="
71 + virtual/pkgconfig
72 +"
73 +DEPEND="
74 + ${COMMON_DEPEND}
75 +"
76 +RDEPEND="
77 + ${COMMON_DEPEND}
78 + app-text/ghostscript-gpl
79 + !minimal? (
80 + $(python_gen_cond_dep 'dev-python/pygobject:3[${PYTHON_MULTI_USEDEP}]' 'python3*')
81 + kernel_linux? ( virtual/udev )
82 + $(python_gen_cond_dep '
83 + >=dev-python/dbus-python-1.2.0-r1[${PYTHON_MULTI_USEDEP}]
84 + dev-python/distro[${PYTHON_MULTI_USEDEP}]
85 + fax? ( dev-python/reportlab[${PYTHON_MULTI_USEDEP}] )
86 + qt5? (
87 + >=dev-python/PyQt5-5.5.1[dbus,gui,widgets,${PYTHON_MULTI_USEDEP}]
88 + libnotify? ( dev-python/notify2[${PYTHON_MULTI_USEDEP}] )
89 + )
90 + scanner? (
91 + >=dev-python/reportlab-3.2[${PYTHON_MULTI_USEDEP}]
92 + >=dev-python/pillow-3.1.1[${PYTHON_MULTI_USEDEP}]
93 + X? (
94 + || (
95 + kde? ( kde-misc/skanlite )
96 + media-gfx/xsane
97 + media-gfx/sane-frontends
98 + )
99 + )
100 + )
101 + ')
102 + )
103 + policykit? ( sys-auth/polkit )
104 +"
105 +
106 +REQUIRED_USE="!minimal? ( ${PYTHON_REQUIRED_USE} )"
107 +
108 +PATCHES=(
109 + "${WORKDIR}/patches"
110 +)
111 +
112 +CONFIG_CHECK="~PARPORT ~PPDEV"
113 +ERROR_PARPORT="Please make sure kernel parallel port support is enabled (PARPORT and PPDEV)."
114 +
115 +#DISABLE_AUTOFORMATTING="yes"
116 +DOC_CONTENTS="
117 +For more information on setting up your printer please take
118 +a look at the hplip section of the gentoo printing guide:
119 +https://wiki.gentoo.org/wiki/Printing
120 +"
121 +
122 +pkg_setup() {
123 + use !minimal && python-single-r1_pkg_setup
124 +
125 + use scanner && ! use X && ewarn "You need USE=X for the scanner GUI."
126 +
127 + if ! use hpcups && ! use hpijs ; then
128 + ewarn "Installing neither hpcups (USE=-hpcups) nor hpijs (USE=-hpijs) driver,"
129 + ewarn "which is probably not what you want."
130 + ewarn "You will almost certainly not be able to print."
131 + fi
132 +
133 + if use minimal ; then
134 + ewarn "Installing driver portions only, make sure you know what you are doing."
135 + ewarn "Depending on the USE flags set for hpcups or hpijs the appropiate driver"
136 + ewarn "is installed. If both USE flags are set hpijs overrides hpcups."
137 + else
138 + use parport && linux-info_pkg_setup
139 + fi
140 +}
141 +
142 +src_prepare() {
143 + default
144 +
145 + if use !minimal ; then
146 + python_fix_shebang .
147 + fi
148 +
149 + # Make desktop files follow the specification
150 + # Gentoo bug: https://bugs.gentoo.org/show_bug.cgi?id=443680
151 + # Upstream bug: https://bugs.launchpad.net/hplip/+bug/1080324
152 + sed -i -e '/^Categories=/s/Application;//' \
153 + -e '/^Encoding=.*/d' hplip.desktop.in || die
154 + sed -i -e '/^Categories=/s/Application;//' \
155 + -e '/^Version=.*/d' \
156 + -e '/^Comment=.*/d' hplip-systray.desktop.in || die
157 +
158 + # Fix for Gentoo bug https://bugs.gentoo.org/show_bug.cgi?id=345725
159 + # Upstream bug: https://bugs.launchpad.net/hplip/+bug/880847,
160 + # https://bugs.launchpad.net/hplip/+bug/500086
161 + local udevdir=$(get_udevdir)
162 + sed -i -e "s|/etc/udev|${udevdir}|g" \
163 + $(find . -type f -exec grep -l /etc/udev {} +) || die
164 +
165 + # Force recognition of Gentoo distro by hp-check
166 + sed -i \
167 + -e "s:file('/etc/issue', 'r').read():'Gentoo':" \
168 + installer/core_install.py || die
169 +
170 + eautoreconf
171 +}
172 +
173 +src_configure() {
174 + local myconf drv_build minimal_build
175 +
176 + if use libusb0 ; then
177 + myconf="${myconf} --enable-libusb01_build"
178 + else
179 + myconf="${myconf} --disable-libusb01_build"
180 + fi
181 +
182 + if use hpcups ; then
183 + drv_build="$(use_enable hpcups hpcups-install)"
184 + if use static-ppds ; then
185 + drv_build="${drv_build} --enable-cups-ppd-install"
186 + drv_build="${drv_build} --disable-cups-drv-install"
187 + else
188 + drv_build="${drv_build} --enable-cups-drv-install"
189 + drv_build="${drv_build} --disable-cups-ppd-install"
190 + fi
191 + else
192 + drv_build="--disable-hpcups-install"
193 + drv_build="${drv_build} --disable-cups-drv-install"
194 + drv_build="${drv_build} --disable-cups-ppd-install"
195 + fi
196 +
197 + if use hpijs ; then
198 + drv_build="${drv_build} $(use_enable hpijs hpijs-install)"
199 + if use static-ppds ; then
200 + drv_build="${drv_build} --enable-foomatic-ppd-install"
201 + drv_build="${drv_build} --disable-foomatic-drv-install"
202 + else
203 + drv_build="${drv_build} --enable-foomatic-drv-install"
204 + drv_build="${drv_build} --disable-foomatic-ppd-install"
205 + fi
206 + else
207 + drv_build="${drv_build} --disable-hpijs-install"
208 + drv_build="${drv_build} --disable-foomatic-drv-install"
209 + drv_build="${drv_build} --disable-foomatic-ppd-install"
210 + fi
211 +
212 + if use minimal ; then
213 + if use hpijs ; then
214 + minimal_build="--enable-hpijs-only-build"
215 + else
216 + minimal_build="--disable-hpijs-only-build"
217 + fi
218 + if use hpcups ; then
219 + minimal_build="${minimal_build} --enable-hpcups-only-build"
220 + else
221 + minimal_build="${minimal_build} --disable-hpcups-only-build"
222 + fi
223 + minimal_build="${minimal_build} --disable-fax-build"
224 + else
225 + if use fax ; then
226 + minimal_build="${minimal_build} --enable-fax-build"
227 + else
228 + minimal_build="${minimal_build} --disable-fax-build"
229 + fi
230 + fi
231 +
232 + # disable class driver for now
233 + econf \
234 + --disable-cups11-build \
235 + --disable-lite-build \
236 + --disable-foomatic-rip-hplip-install \
237 + --disable-shadow-build \
238 + --disable-qt3 \
239 + --disable-qt4 \
240 + --disable-udev_sysfs_rules \
241 + --with-cupsbackenddir=$(cups-config --serverbin)/backend \
242 + --with-cupsfilterdir=$(cups-config --serverbin)/filter \
243 + --with-docdir=/usr/share/doc/${PF} \
244 + --with-htmldir=/usr/share/doc/${PF}/html \
245 + ${myconf} \
246 + ${drv_build} \
247 + ${minimal_build} \
248 + --enable-hpps-install \
249 + --disable-class-driver \
250 + $(use_enable doc doc-build) \
251 + $(use_enable !minimal gui-build) \
252 + $(use_enable !minimal dbus-build) \
253 + $(use_enable parport pp-build) \
254 + $(use_enable policykit) \
255 + $(use_enable qt5) \
256 + $(use_enable scanner scan-build) \
257 + $(use_enable snmp network-build)
258 +
259 + # hpijs ppds are created at configure time but are not installed (3.17.11)
260 +
261 + # Use system foomatic-rip for hpijs driver instead of foomatic-rip-hplip
262 + # The hpcups driver does not use foomatic-rip
263 + #local i
264 + #for i in ppd/hpijs/*.ppd.gz ; do
265 + # rm -f ${i}.temp || die
266 + # gunzip -c ${i} | sed 's/foomatic-rip-hplip/foomatic-rip/g' | \
267 + # gzip > ${i}.temp || die
268 + # mv ${i}.temp ${i} || die
269 + #done
270 +}
271 +
272 +src_install() {
273 + # Disable parallel install
274 + # Gentoo Bug: https://bugs.gentoo.org/show_bug.cgi?id=578018
275 + emake -j1 DESTDIR="${D}" install
276 + einstalldocs
277 + # default
278 +
279 + # Installed by sane-backends
280 + # Gentoo Bug: https://bugs.gentoo.org/show_bug.cgi?id=201023
281 + rm -f "${ED}"/etc/sane.d/dll.conf || die
282 +
283 + # Remove desktop and autostart files
284 + # Gentoo Bug: https://bugs.gentoo.org/show_bug.cgi?id=638770
285 + use qt5 || {
286 + rm -Rf "${ED}"/usr/share/applications "${ED}"/etc/xdg
287 + }
288 +
289 + rm -f "${ED}"/usr/share/doc/${PF}/{copyright,README_LIBJPG,COPYING} || die
290 + rmdir --ignore-fail-on-non-empty "${ED}"/usr/share/doc/${PF}/ || die
291 +
292 + # Remove hal fdi files
293 + rm -rf "${ED}"/usr/share/hal || die
294 +
295 + find "${D}" -name '*.la' -delete || die
296 +
297 + if use !minimal ; then
298 + python_optimize "${ED}"/usr/share/hplip
299 + fi
300 +
301 + readme.gentoo_create_doc
302 +}
303 +
304 +pkg_postinst() {
305 + readme.gentoo_print_elog
306 +}