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