Gentoo Archives: gentoo-commits

From: Joonas Niilola <juippis@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: media-gfx/sane-backends/
Date: Sun, 28 Jun 2020 07:41:11
Message-Id: 1593330046.a4f54515916bb0fb696fb3cbf7632573e1651d60.juippis@gentoo
1 commit: a4f54515916bb0fb696fb3cbf7632573e1651d60
2 Author: Sam James (sam_c) <sam <AT> cmpct <DOT> info>
3 AuthorDate: Sat Jun 27 05:21:55 2020 +0000
4 Commit: Joonas Niilola <juippis <AT> gentoo <DOT> org>
5 CommitDate: Sun Jun 28 07:40:46 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a4f54515
7
8 media-gfx/sane-backends: add ricoh2 backend, fix IUSE defaults, etc
9
10 Changes:
11 * Add the ricoh2 backend
12
13 * Set +zeroconf by default, to avoid a REQUIRED_USE choice
14 being required out of the box. The other backends with
15 a REQUIRED_USE are disabled by default.
16
17 We could switch to turning off escl by default instead,
18 if defaulting to zeroconf is unfavourable.
19
20 * Switch escl dep to be multilib, and add
21 missing avahi dependency.
22
23 * Add pixma libjpeg dep, which was referenced in
24 the ChangeLog for 1.0.28.
25
26 Bug: https://bugs.gentoo.org/729312
27 Closes: https://bugs.gentoo.org/729850
28 Closes: https://bugs.gentoo.org/729808
29 Package-Manager: Portage-2.3.99, Repoman-2.3.22
30 Signed-off-by: Sam James (sam_c) <sam <AT> cmpct.info>
31 Closes: https://github.com/gentoo/gentoo/pull/16447
32 Signed-off-by: Joonas Niilola <juippis <AT> gentoo.org>
33
34 .../sane-backends/sane-backends-1.0.30-r2.ebuild | 345 +++++++++++++++++++++
35 1 file changed, 345 insertions(+)
36
37 diff --git a/media-gfx/sane-backends/sane-backends-1.0.30-r2.ebuild b/media-gfx/sane-backends/sane-backends-1.0.30-r2.ebuild
38 new file mode 100644
39 index 00000000000..e7eb2d4d7dd
40 --- /dev/null
41 +++ b/media-gfx/sane-backends/sane-backends-1.0.30-r2.ebuild
42 @@ -0,0 +1,345 @@
43 +# Copyright 1999-2020 Gentoo Authors
44 +# Distributed under the terms of the GNU General Public License v2
45 +
46 +EAPI=7
47 +
48 +inherit autotools eutils flag-o-matic multilib-minimal systemd toolchain-funcs udev user
49 +
50 +# gphoto and v4l are handled by their usual USE flags.
51 +# The pint backend was disabled because I could not get it to compile.
52 +IUSE_SANE_BACKENDS="
53 + abaton
54 + agfafocus
55 + apple
56 + artec
57 + artec_eplus48u
58 + as6e
59 + avision
60 + bh
61 + canon
62 + canon630u
63 + canon_dr
64 + canon_pp
65 + cardscan
66 + coolscan
67 + coolscan2
68 + coolscan3
69 + dc210
70 + dc240
71 + dc25
72 + dell1600n_net
73 + dmc
74 + epjitsu
75 + epson
76 + epson2
77 + escl
78 + fujitsu
79 + genesys
80 + gt68xx
81 + hp
82 + hp3500
83 + hp3900
84 + hp4200
85 + hp5400
86 + hp5590
87 + hpljm1005
88 + hpsj5s
89 + hs2p
90 + ibm
91 + kodak
92 + kodakaio
93 + kvs1025
94 + kvs20xx
95 + kvs40xx
96 + leo
97 + lexmark
98 + ma1509
99 + magicolor
100 + matsushita
101 + microtek
102 + microtek2
103 + mustek
104 + mustek_pp
105 + mustek_usb
106 + mustek_usb2
107 + nec
108 + net
109 + niash
110 + p5
111 + pie
112 + pixma
113 + plustek
114 + plustek_pp
115 + pnm
116 + qcam
117 + ricoh
118 + ricoh2
119 + rts8891
120 + s9036
121 + sceptre
122 + sharp
123 + sm3600
124 + sm3840
125 + snapscan
126 + sp15c
127 + st400
128 + stv680
129 + tamarack
130 + teco1
131 + teco2
132 + teco3
133 + test
134 + u12
135 + umax
136 + umax1220u
137 + umax_pp
138 + xerox_mfp"
139 +
140 +IUSE="gphoto2 ipv6 snmp systemd threads usb v4l xinetd +zeroconf"
141 +
142 +for GBACKEND in ${IUSE_SANE_BACKENDS}; do
143 + case ${GBACKEND} in
144 + # Disable backends that require parallel ports as no one has those anymore.
145 + canon_pp|hpsj5s|mustek_pp|\
146 + pnm|mustek_usb2|kvs40xx)
147 + IUSE+=" sane_backends_${GBACKEND}"
148 + ;;
149 + *)
150 + IUSE+=" +sane_backends_${GBACKEND}"
151 + esac
152 +done
153 +
154 +REQUIRED_USE="
155 + sane_backends_escl? ( zeroconf )
156 + sane_backends_kvs40xx? ( threads )
157 + sane_backends_mustek_usb2? ( threads )
158 +"
159 +
160 +MY_PN=${PN//sane-/}
161 +MY_P="${MY_PN}-${PV}"
162 +
163 +DESCRIPTION="Scanner Access Now Easy - Backends"
164 +HOMEPAGE="http://www.sane-project.org/"
165 +SRC_URI="https://gitlab.com/sane-project/backends/-/archive/${PV}/${MY_P}.tar.gz"
166 +
167 +LICENSE="GPL-2 public-domain"
168 +SLOT="0"
169 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux"
170 +
171 +# For pixma: see https://gitlab.com/sane-project/backends/-/releases/1.0.28#build
172 +RDEPEND="
173 + gphoto2? (
174 + >=media-libs/libgphoto2-2.5.3.1:=[${MULTILIB_USEDEP}]
175 + >=virtual/jpeg-0-r2:0=[${MULTILIB_USEDEP}]
176 + )
177 + sane_backends_canon_pp? ( >=sys-libs/libieee1284-0.2.11-r3[${MULTILIB_USEDEP}] )
178 + sane_backends_dc210? ( >=virtual/jpeg-0-r2:0=[${MULTILIB_USEDEP}] )
179 + sane_backends_dc240? ( >=virtual/jpeg-0-r2:0=[${MULTILIB_USEDEP}] )
180 + sane_backends_dell1600n_net? (
181 + >=media-libs/tiff-3.9.7-r1:0=[${MULTILIB_USEDEP}]
182 + >=virtual/jpeg-0-r2:0=[${MULTILIB_USEDEP}]
183 + )
184 + sane_backends_escl? (
185 + net-dns/avahi[${MULTILIB_USEDEP}]
186 + net-misc/curl[${MULTILIB_USEDEP}]
187 + )
188 + sane_backends_hpsj5s? ( >=sys-libs/libieee1284-0.2.11-r3[${MULTILIB_USEDEP}] )
189 + sane_backends_mustek_pp? ( >=sys-libs/libieee1284-0.2.11-r3[${MULTILIB_USEDEP}] )
190 + sane_backends_pixma? ( >=virtual/jpeg-0-r2:0=[${MULTILIB_USEDEP}] )
191 + snmp? ( net-analyzer/net-snmp:0= )
192 + systemd? ( sys-apps/systemd:0= )
193 + usb? ( >=virtual/libusb-1-r1:1=[${MULTILIB_USEDEP}] )
194 + v4l? ( >=media-libs/libv4l-0.9.5[${MULTILIB_USEDEP}] )
195 + xinetd? ( sys-apps/xinetd )
196 + zeroconf? ( >=net-dns/avahi-0.6.31-r2[${MULTILIB_USEDEP}] )
197 +"
198 +
199 +DEPEND="${RDEPEND}
200 + dev-libs/libxml2
201 + v4l? ( sys-kernel/linux-headers )
202 +"
203 +BDEPEND="
204 + sys-devel/autoconf-archive
205 + sys-devel/gettext
206 + virtual/pkgconfig
207 +"
208 +
209 +PATCHES=(
210 + "${FILESDIR}"/${PN}-1.0.24-saned_pidfile_location.patch
211 + "${FILESDIR}"/${PN}-1.0.27-disable-usb-tests.patch
212 + "${FILESDIR}"/${P}-missing-stdint-include.patch
213 + "${FILESDIR}"/sane-backends-1.0.30-add_hpaio_epkowa_dll.conf.patch
214 +)
215 +
216 +S="${WORKDIR}/${MY_P}"
217 +
218 +MULTILIB_CHOST_TOOLS=(
219 + /usr/bin/sane-config
220 +)
221 +
222 +pkg_setup() {
223 + enewgroup scanner
224 + enewuser saned -1 -1 -1 scanner
225 +}
226 +
227 +src_prepare() {
228 + default
229 +
230 + # Patch out the git reference so we can run eautoreconf
231 + sed -i -e "s/m4_esyscmd_s(\[git describe --dirty\])/${PV}/" configure.ac || die
232 + eautoreconf
233 +
234 + # Fix for "make check". Upstream sometimes forgets to update this.
235 + local ver=$(./configure --version | awk '{print $NF; exit 0}')
236 + sed -i \
237 + -e "/by sane-desc 3.5 from sane-backends/s:sane-backends .*:sane-backends ${ver}:" \
238 + testsuite/tools/data/html* || die
239 +
240 +}
241 +
242 +src_configure() {
243 + # From Fedora
244 + append-flags -fno-strict-aliasing
245 + multilib-minimal_src_configure
246 +}
247 +
248 +multilib_src_configure() {
249 + # the blank is intended - an empty string would result in building ALL backends.
250 + local lbackends=" "
251 +
252 + use gphoto2 && lbackends="gphoto2"
253 + use v4l && lbackends="${lbackends} v4l"
254 + for backend in ${IUSE_SANE_BACKENDS}; do
255 + if use "sane_backends_${backend}" && [ ${backend} != pnm ]; then
256 + lbackends="${lbackends} ${backend}"
257 + fi
258 + done
259 +
260 + local myconf=(
261 + $(use_with usb)
262 + $(multilib_native_use_with snmp)
263 + )
264 +
265 + # you can only enable this backend, not disable it...
266 + if use sane_backends_pnm; then
267 + myconf+=( --enable-pnm-backend )
268 + fi
269 + if use sane_backends_mustek_pp; then
270 + myconf+=( --enable-parport-directio )
271 + fi
272 + if ! { use sane_backends_canon_pp || use sane_backends_hpsj5s || use sane_backends_mustek_pp; }; then
273 + myconf+=( sane_cv_use_libieee1284=no )
274 + fi
275 +
276 + # relative path must be used for tests to work properly
277 + # All distributions pass --disable-locking because /var/lock/sane/ would be a world-writable directory
278 + # --without-api-spec to not automagically depend on tons of stuff
279 + # that break in many ways, bug #636202, #668232, #668350
280 + # People can refer to the "Programmer's Documentation" at http://www.sane-project.org/docs.html
281 + ECONF_SOURCE=${S} \
282 + SANEI_JPEG="sanei_jpeg.o" SANEI_JPEG_LO="sanei_jpeg.lo" \
283 + BACKENDS="${lbackends}" \
284 + econf \
285 + --disable-locking \
286 + --without-api-spec \
287 + $(use_with gphoto2) \
288 + $(multilib_native_use_with systemd) \
289 + $(use_with v4l) \
290 + $(use_enable ipv6) \
291 + $(use_enable threads pthread) \
292 + $(use_enable zeroconf avahi) \
293 + "${myconf[@]}"
294 +}
295 +
296 +multilib_src_compile() {
297 + emake VARTEXFONTS="${T}/fonts"
298 +
299 + if tc-is-cross-compiler; then
300 + pushd "${BUILD_DIR}"/tools >/dev/null || die
301 +
302 + # The build system sucks and doesn't handle this properly.
303 + # https://alioth.debian.org/tracker/index.php?func=detail&aid=314236&group_id=30186&atid=410366
304 + tc-export_build_env BUILD_CC
305 + ${BUILD_CC} ${BUILD_CPPFLAGS} ${BUILD_CFLAGS} ${BUILD_LDFLAGS} \
306 + -I. -I../include -I"${S}"/include \
307 + "${S}"/sanei/sanei_config.c "${S}"/sanei/sanei_constrain_value.c \
308 + "${S}"/sanei/sanei_init_debug.c "${S}"/tools/sane-desc.c -o sane-desc || die
309 + local dirs=( hal hotplug hotplug-ng udev )
310 + local targets=(
311 + hal/libsane.fdi
312 + hotplug/libsane.usermap
313 + hotplug-ng/libsane.db
314 + udev/libsane.rules
315 + )
316 + mkdir -p "${dirs[@]}" || die
317 + emake "${targets[@]}"
318 +
319 + popd >/dev/null || die
320 + fi
321 +
322 + if use usb; then
323 + sed -i -e '/^$/d' \
324 + tools/hotplug/libsane.usermap || die
325 + fi
326 +}
327 +
328 +multilib_src_install() {
329 + emake INSTALL_LOCKPATH="" DESTDIR="${D}" install \
330 + docdir="${EPREFIX}"/usr/share/doc/${PF}
331 +
332 + if multilib_is_native_abi; then
333 + if use usb; then
334 + insinto /etc/hotplug/usb
335 + doins tools/hotplug/libsane.usermap
336 + fi
337 +
338 + udev_newrules tools/udev/libsane.rules 41-libsane.rules
339 + insinto "/usr/share/pkgconfig"
340 + doins tools/sane-backends.pc
341 + fi
342 +}
343 +
344 +multilib_src_install_all() {
345 + keepdir /var/lib/lock/sane
346 + fowners root:scanner /var/lib/lock/sane
347 + fperms g+w /var/lib/lock/sane
348 + dodir /etc/env.d
349 +
350 + if use systemd; then
351 + systemd_newunit "${FILESDIR}"/saned_at.service "saned@.service"
352 + systemd_newunit "${FILESDIR}"/saned.socket saned.socket
353 + fi
354 +
355 + if use usb; then
356 + exeinto /etc/hotplug/usb
357 + doexe tools/hotplug/libusbscanner
358 + newdoc tools/hotplug/README README.hotplug
359 + fi
360 +
361 + dodoc NEWS AUTHORS PROBLEMS README README.linux
362 + find "${D}" -name '*.la' -delete || die
363 +
364 + if use xinetd; then
365 + insinto /etc/xinetd.d
366 + doins "${FILESDIR}"/saned
367 + fi
368 +
369 + newinitd "${FILESDIR}"/saned.initd saned
370 + newconfd "${FILESDIR}"/saned.confd saned
371 +}
372 +
373 +pkg_postinst() {
374 + elog "Optional backends:"
375 + optfeature "Epson-specific backend" media-gfx/iscan
376 + optfeature "HP-specific backend" net-print/hplip
377 +
378 + if use xinetd; then
379 + elog "If you want remote clients to connect, edit"
380 + elog "/etc/sane.d/saned.conf and /etc/hosts.allow"
381 + fi
382 +
383 + if ! use systemd; then
384 + elog "If you are using a USB scanner, add all users who want"
385 + elog "to access your scanner to the \"scanner\" group."
386 + fi
387 +}