1 |
commit: f108b95e0cc1025f4c6d8119b14e779ff843230e |
2 |
Author: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue Apr 5 15:30:03 2022 +0000 |
4 |
Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Apr 5 16:33:48 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f108b95e |
7 |
|
8 |
media-gfx/zbar: 0.23.90 version bump, EAPI-8 bump |
9 |
|
10 |
Fix build without dev-qt/qtchooser's unversioned Qt5 binaries in PATH. |
11 |
|
12 |
Package-Manager: Portage-3.0.30, Repoman-3.0.3 |
13 |
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org> |
14 |
|
15 |
media-gfx/zbar/Manifest | 1 + |
16 |
.../zbar/files/zbar-0.23.90-fix-gtk-default.patch | 35 ++++ |
17 |
.../zbar-0.23.90-fix-qt5x11extras-detect.patch | 18 ++ |
18 |
.../zbar/files/zbar-0.23.90-fix-unittest.patch | 78 +++++++ |
19 |
media-gfx/zbar/zbar-0.23.90.ebuild | 228 +++++++++++++++++++++ |
20 |
5 files changed, 360 insertions(+) |
21 |
|
22 |
diff --git a/media-gfx/zbar/Manifest b/media-gfx/zbar/Manifest |
23 |
index a72b685b4bf3..60c7d029a61a 100644 |
24 |
--- a/media-gfx/zbar/Manifest |
25 |
+++ b/media-gfx/zbar/Manifest |
26 |
@@ -1 +1,2 @@ |
27 |
DIST zbar-0.23.1.tar.gz 1019268 BLAKE2B 5aa8725a0945b6f50eb78bb7b8a61e5b46356b18f07e8af778a63d46b94c894d9e827ed71bd89060898ecbdaebc5b4bb6e638939d7bc0dede390f7137770049f SHA512 ae7741cf750a10cf53dc11abcd482c3885507153ee37f6e3364ed5ed72184ebb009560b8c40d8090603a551fb681700a962838a59ce77d005d080ee49fbfa54b |
28 |
+DIST zbar-0.23.90.tar.gz 1005314 BLAKE2B 5d0c193509602dfb55741b421e1d28f1424ecec50aa3be584912544a587922c053284c41cf14ff0b4824095d0d376381ed055e7faf9ff394bd8d44fd9ed2971d SHA512 d73d71873bec68ee021997512a9edbd223f5f5fe43c66c4dd3502224ba6009be2e5e1714766cb8e1056244673e87e0939ed0319116f61d7371b5ab79fb5e04eb |
29 |
|
30 |
diff --git a/media-gfx/zbar/files/zbar-0.23.90-fix-gtk-default.patch b/media-gfx/zbar/files/zbar-0.23.90-fix-gtk-default.patch |
31 |
new file mode 100644 |
32 |
index 000000000000..b1316243dd24 |
33 |
--- /dev/null |
34 |
+++ b/media-gfx/zbar/files/zbar-0.23.90-fix-gtk-default.patch |
35 |
@@ -0,0 +1,35 @@ |
36 |
+From 468f6bda627d683b3f40dbaf242c158409666f7e Mon Sep 17 00:00:00 2001 |
37 |
+From: Mauro Carvalho Chehab <mchehab+huawei@××××××.org> |
38 |
+Date: Sat, 13 Mar 2021 18:04:57 +0100 |
39 |
+Subject: [PATCH] configure.ac: fix some issues with gtk parameter |
40 |
+ |
41 |
+By default, it uses Gtk3. Also, the with_gtk set to "no" |
42 |
+is wrong. |
43 |
+ |
44 |
+Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@××××××.org> |
45 |
+--- |
46 |
+ configure.ac | 4 ++-- |
47 |
+ 1 file changed, 2 insertions(+), 2 deletions(-) |
48 |
+ |
49 |
+diff --git a/configure.ac b/configure.ac |
50 |
+index b6f87531..30a59f72 100644 |
51 |
+--- a/configure.ac |
52 |
++++ b/configure.ac |
53 |
+@@ -492,7 +492,7 @@ AS_IF([test "x$with_npapi" != "xno"], |
54 |
+ AM_CONDITIONAL([HAVE_NPAPI], [test "x$with_npapi" = "xyes"]) |
55 |
+ |
56 |
+ dnl GTK |
57 |
+-dnl For now, defaults to GTK version 2 |
58 |
++dnl For now, defaults to GTK version 3 |
59 |
+ |
60 |
+ AC_ARG_WITH([gtk], |
61 |
+ [AS_HELP_STRING([--with-gtk], |
62 |
+@@ -500,7 +500,7 @@ AC_ARG_WITH([gtk], |
63 |
+ [AS_IF([test "x$with_gtk" != "xno" && test "x$with_gtk" != "xauto" && |
64 |
+ test "x$with_gtk" != "xgtk2" && test "x$with_gtk" != "xgtk3"], |
65 |
+ [echo "Invalid value for --with-gtk. Falling back to 'no'" |
66 |
+- with_gtk="xno"])], |
67 |
++ with_gtk="no"])], |
68 |
+ [with_gtk="auto"]) |
69 |
+ |
70 |
+ AC_ARG_VAR([GLIB_GENMARSHAL], [full path to glib-genmarshal]) |
71 |
|
72 |
diff --git a/media-gfx/zbar/files/zbar-0.23.90-fix-qt5x11extras-detect.patch b/media-gfx/zbar/files/zbar-0.23.90-fix-qt5x11extras-detect.patch |
73 |
new file mode 100644 |
74 |
index 000000000000..e8f6357eb486 |
75 |
--- /dev/null |
76 |
+++ b/media-gfx/zbar/files/zbar-0.23.90-fix-qt5x11extras-detect.patch |
77 |
@@ -0,0 +1,18 @@ |
78 |
+diff -ur a/configure.ac b/configure.ac |
79 |
+--- a/configure.ac 2019-05-23 23:37:12.000000000 +0300 |
80 |
++++ b/configure.ac 2020-01-22 12:27:14.190755156 +0300 |
81 |
+@@ -638,13 +638,9 @@ |
82 |
+ |
83 |
+ AC_ARG_VAR([MOC], [full path to Qt moc program]) |
84 |
+ |
85 |
+-AS_IF([test "x$have_x" = "xyes"], |
86 |
+- [qt_extra="Qt5X11Extras >= 5.0"], |
87 |
+- [qt_extra=""]) |
88 |
+- |
89 |
+ AS_IF([test "x$with_qt" != "xno"], |
90 |
+ [PKG_CHECK_MODULES([QT], |
91 |
+- [Qt5Core >= 5 Qt5Gui >= 5 Qt5Widgets >= 5.0 $qt_extra],, |
92 |
++ [Qt5Core >= 5 Qt5Gui >= 5 Qt5Widgets >= 5.0 Qt5X11Extras >= 5.0],, |
93 |
+ [with_qt5="no" |
94 |
+ PKG_CHECK_MODULES([QT], |
95 |
+ [QtCore >= 4 QtGui >= 4],, |
96 |
|
97 |
diff --git a/media-gfx/zbar/files/zbar-0.23.90-fix-unittest.patch b/media-gfx/zbar/files/zbar-0.23.90-fix-unittest.patch |
98 |
new file mode 100644 |
99 |
index 000000000000..589ebd4e287c |
100 |
--- /dev/null |
101 |
+++ b/media-gfx/zbar/files/zbar-0.23.90-fix-unittest.patch |
102 |
@@ -0,0 +1,78 @@ |
103 |
+diff -ur a/configure.ac b/configure.ac |
104 |
+--- a/configure.ac 2020-04-21 00:09:21.000000000 +0300 |
105 |
++++ b/configure.ac 2020-04-23 16:53:06.654339488 +0300 |
106 |
+@@ -336,6 +336,14 @@ |
107 |
+ AC_SUBST(DBUS_CONFDIR) |
108 |
+ ]) |
109 |
+ |
110 |
++dnl zbarimg tests |
111 |
++AC_ARG_WITH([zbarimg_tests], |
112 |
++ [AS_HELP_STRING([--without-zbarimg-tests], |
113 |
++ [disable tests for zbarimg])], |
114 |
++ [], |
115 |
++ [with_zbarimg_tests="yes"]) |
116 |
++AM_CONDITIONAL([HAVE_ZBARIMG_TESTS], [test "x$with_zbarimg_tests" = "xyes"]) |
117 |
++ |
118 |
+ dnl libjpeg |
119 |
+ AC_ARG_WITH([jpeg], |
120 |
+ [AS_HELP_STRING([--without-jpeg], |
121 |
+@@ -724,25 +732,12 @@ |
122 |
+ |
123 |
+ AC_ARG_VAR([CLASSPATH], [Java class path (include JUnit to run java tests)]) |
124 |
+ AS_IF([test "x$CLASSPATH" = "x"], [CLASSPATH="."]) |
125 |
++AC_SUBST(CLASSPATH) |
126 |
+ |
127 |
+-dnl Search for Java unit test library |
128 |
+-AS_IF([test -z "$JUNIT_HOME"], |
129 |
+- [JUNIT_HOME="/usr/share/java"]) |
130 |
+- |
131 |
+-AS_IF([test -f "$JUNIT_HOME/junit4.jar"], |
132 |
+- [JUNIT="$JUNIT_HOME/junit4.jar"], |
133 |
+- [AS_IF([test -f "$JUNIT_HOME/junit.jar"], |
134 |
+- [JUNIT="$JUNIT_HOME/junit.jar"])]) |
135 |
+- |
136 |
+-AS_IF([test "x$JUNIT" != "x"], |
137 |
+- [AS_IF([test -f "/usr/share/java/hamcrest/all.jar"], |
138 |
+- [CLASSPATH="$JUNIT:/usr/share/java/hamcrest/all.jar:$CLASSPATH" |
139 |
+- AC_SUBST(CLASSPATH) |
140 |
+- with_java_unit="yes"])], |
141 |
+- [AS_IF([test -f "/usr/share/java/hamcrest-all.jar"], |
142 |
+- [CLASSPATH="$JUNIT:/usr/share/java/hamcrest-all.jar:$CLASSPATH" |
143 |
+- AC_SUBST(CLASSPATH) |
144 |
+- with_java_unit="yes"])]) |
145 |
++AC_ARG_WITH([java_unit], |
146 |
++ [AS_HELP_STRING([--without-java-unit], |
147 |
++ [Enable java unittest])], |
148 |
++ [with_java_unit="yes"]) |
149 |
+ |
150 |
+ AM_CONDITIONAL([HAVE_JAVA_UNIT], [test "x$with_java_unit" = "xyes"]) |
151 |
+ |
152 |
+@@ -905,6 +900,8 @@ |
153 |
+ [echo " => the Java interface will *NOT* be built"]) |
154 |
+ AS_IF([test "x$with_java_unit" != "xyes"], |
155 |
+ [echo " => the Java unit test will *NOT* be enabled"]) |
156 |
++AS_IF([test "x$with_zbarimg_tests" != "xyes"], |
157 |
++ [echo " => zbarimg tests will *NOT* be enabled"]) |
158 |
+ dnl echo "NPAPI Plugin --with-npapi=$with_npapi" |
159 |
+ dnl AS_IF([test "x$with_mozilla" != "xyes"], |
160 |
+ dnl [echo " => the Mozilla/Firefox/OpenOffice plugin will *NOT* be built"]) |
161 |
+diff -ur a/test/Makefile.am.inc b/test/Makefile.am.inc |
162 |
+--- a/test/Makefile.am.inc 2020-04-21 00:09:21.000000000 +0300 |
163 |
++++ b/test/Makefile.am.inc 2020-04-23 17:03:07.819999370 +0300 |
164 |
+@@ -91,11 +91,16 @@ |
165 |
+ regress-decoder: test/test_decode |
166 |
+ @abs_top_builddir@/test/test_decode -q -n 100000 |
167 |
+ |
168 |
++if HAVE_ZBARIMG_TESTS |
169 |
+ check-images-py: zbarimg/zbarimg |
170 |
+ @PYTHON@ @abs_top_srcdir@/test/barcodetest.py |
171 |
+ |
172 |
+ check-images: zbarimg/zbarimg |
173 |
+ @abs_top_builddir@/test/test_examples.sh |
174 |
++else |
175 |
++check-images-py: |
176 |
++check-images: |
177 |
++endif |
178 |
+ |
179 |
+ check-convert: test/test_convert |
180 |
+ @abs_top_srcdir@/test/test_convert |
181 |
|
182 |
diff --git a/media-gfx/zbar/zbar-0.23.90.ebuild b/media-gfx/zbar/zbar-0.23.90.ebuild |
183 |
new file mode 100644 |
184 |
index 000000000000..91cdcabb9f33 |
185 |
--- /dev/null |
186 |
+++ b/media-gfx/zbar/zbar-0.23.90.ebuild |
187 |
@@ -0,0 +1,228 @@ |
188 |
+# Copyright 1999-2022 Gentoo Authors |
189 |
+# Distributed under the terms of the GNU General Public License v2 |
190 |
+ |
191 |
+EAPI=8 |
192 |
+ |
193 |
+PYTHON_COMPAT=( python3_{8..10} ) |
194 |
+inherit autotools flag-o-matic java-pkg-opt-2 multilib-minimal python-single-r1 qmake-utils virtualx |
195 |
+ |
196 |
+DESCRIPTION="Library and tools for reading barcodes from images or video" |
197 |
+HOMEPAGE="https://github.com/mchehab/zbar" |
198 |
+SRC_URI="https://github.com/mchehab/zbar/archive/${PV}.tar.gz -> ${P}.tar.gz" |
199 |
+ |
200 |
+LICENSE="LGPL-2.1" |
201 |
+SLOT="0" |
202 |
+KEYWORDS="~amd64 ~arm ~arm64 ~x86" |
203 |
+IUSE="dbus graphicsmagick gtk +imagemagick introspection java jpeg nls python qt5 static-libs test +threads v4l X xv" |
204 |
+ |
205 |
+REQUIRED_USE=" |
206 |
+ introspection? ( gtk ) |
207 |
+ python? ( ${PYTHON_REQUIRED_USE} ) |
208 |
+ test? ( |
209 |
+ ${PYTHON_REQUIRED_USE} |
210 |
+ X? ( imagemagick ) |
211 |
+ ) |
212 |
+ xv? ( X )" |
213 |
+ |
214 |
+RESTRICT="!test? ( test )" |
215 |
+ |
216 |
+COMMON_DEPEND=" |
217 |
+ dbus? ( sys-apps/dbus[${MULTILIB_USEDEP}] ) |
218 |
+ gtk? ( |
219 |
+ dev-libs/glib:2[${MULTILIB_USEDEP}] |
220 |
+ x11-libs/gtk+:3[${MULTILIB_USEDEP}] |
221 |
+ introspection? ( dev-libs/gobject-introspection ) |
222 |
+ ) |
223 |
+ imagemagick? ( |
224 |
+ !graphicsmagick? ( media-gfx/imagemagick:=[png,jpeg?] ) |
225 |
+ graphicsmagick? ( media-gfx/graphicsmagick:=[png,jpeg?] ) |
226 |
+ ) |
227 |
+ jpeg? ( virtual/jpeg:0[${MULTILIB_USEDEP}] ) |
228 |
+ python? ( ${PYTHON_DEPS} ) |
229 |
+ qt5? ( |
230 |
+ dev-qt/qtcore:5 |
231 |
+ dev-qt/qtgui:5 |
232 |
+ dev-qt/qtwidgets:5 |
233 |
+ dev-qt/qtx11extras:5 |
234 |
+ ) |
235 |
+ v4l? ( media-libs/libv4l:0=[${MULTILIB_USEDEP}] ) |
236 |
+ X? ( |
237 |
+ x11-libs/libX11[${MULTILIB_USEDEP}] |
238 |
+ x11-libs/libXext[${MULTILIB_USEDEP}] |
239 |
+ xv? ( x11-libs/libXv[${MULTILIB_USEDEP}] ) |
240 |
+ )" |
241 |
+ |
242 |
+RDEPEND="${COMMON_DEPEND} |
243 |
+ java? ( >=virtual/jre-1.8 )" |
244 |
+ |
245 |
+DEPEND="${COMMON_DEPEND} |
246 |
+ java? ( |
247 |
+ >=virtual/jdk-1.8 |
248 |
+ test? ( |
249 |
+ dev-java/hamcrest-core:1.3 |
250 |
+ dev-java/junit:4 |
251 |
+ ) |
252 |
+ ) |
253 |
+ test? ( |
254 |
+ ${PYTHON_DEPS} |
255 |
+ $(python_gen_cond_dep ' |
256 |
+ dev-python/pillow[${PYTHON_USEDEP}] |
257 |
+ ') |
258 |
+ )" |
259 |
+ |
260 |
+BDEPEND=" |
261 |
+ app-text/xmlto |
262 |
+ virtual/pkgconfig |
263 |
+ gtk? ( dev-util/glib-utils ) |
264 |
+ nls? ( |
265 |
+ sys-devel/gettext |
266 |
+ virtual/libiconv |
267 |
+ )" |
268 |
+ |
269 |
+DOCS=( README.md NEWS.md TODO.md HACKING.md TODO.md ChangeLog ) |
270 |
+ |
271 |
+PATCHES=( |
272 |
+ # git master |
273 |
+ "${FILESDIR}/${P}-fix-gtk-default.patch" |
274 |
+ # TODO: upstream? |
275 |
+ "${FILESDIR}/${PN}-0.23_fix_python_detect.patch" |
276 |
+ "${FILESDIR}/${P}-fix-unittest.patch" |
277 |
+ "${FILESDIR}/${P}-fix-qt5x11extras-detect.patch" |
278 |
+) |
279 |
+ |
280 |
+pkg_setup() { |
281 |
+ if use python || use test; then |
282 |
+ python-single-r1_pkg_setup |
283 |
+ fi |
284 |
+ use java && java-pkg-opt-2_pkg_setup |
285 |
+} |
286 |
+ |
287 |
+src_prepare() { |
288 |
+ default |
289 |
+ |
290 |
+ if use python || use test; then |
291 |
+ if use test; then |
292 |
+ # make tests happy |
293 |
+ # because one of the test requires loadable py module from the current ${BUILD_DIR} |
294 |
+ sed -e "s|PYTHONPATH=@abs_top_srcdir@|PYTHONPATH=@builddir@|g" \ |
295 |
+ -i test/Makefile.am.inc || die |
296 |
+ fi |
297 |
+ |
298 |
+ python_fix_shebang \ |
299 |
+ examples/*.py \ |
300 |
+ test/{test_python,barcodetest}.py # test_pygtk.py — py2 only |
301 |
+ fi |
302 |
+ |
303 |
+ if use java; then |
304 |
+ java-pkg-opt-2_src_prepare |
305 |
+ sed -e "s|javadir = \$(pkgdatadir)|javadir = /usr/$(get_libdir)/zbar|" \ |
306 |
+ -i java/Makefile.am || die |
307 |
+ fi |
308 |
+ |
309 |
+ # do not install {LICENSE,INSTALL,etc} doc files with 'make install' (use DOCS=() instead) |
310 |
+ sed -e "s|^dist_doc_DATA =\(.*\)|dist_doc_DATA =|" -i Makefile.am || die |
311 |
+ |
312 |
+ eautoreconf |
313 |
+} |
314 |
+ |
315 |
+multilib_src_configure() { |
316 |
+ append-cppflags -DNDEBUG |
317 |
+ |
318 |
+ local myeconfargs=( |
319 |
+ $(use_with dbus) |
320 |
+ $(use_with gtk gtk gtk3) # avoid 'auto' |
321 |
+ $(use_with jpeg) |
322 |
+ $(multilib_native_use_with introspection gir) |
323 |
+ $(multilib_native_use_with java) |
324 |
+ $(multilib_native_use_with python python auto) |
325 |
+ $(use_enable nls) |
326 |
+ $(use_enable static-libs static) |
327 |
+ $(use_enable threads pthread) |
328 |
+ $(use_enable v4l video) |
329 |
+ $(use_with X x) |
330 |
+ $(use_with X xshm) |
331 |
+ $(use_with xv xv) |
332 |
+ ) |
333 |
+ |
334 |
+ if multilib_is_native_abi; then |
335 |
+ # both must be enabled to use GraphicsMagick |
336 |
+ if use graphicsmagick; then |
337 |
+ myeconfargs+=( |
338 |
+ --with-graphicsmagick |
339 |
+ --without-imagemagick |
340 |
+ ) |
341 |
+ elif use imagemagick; then |
342 |
+ myeconfargs+=( |
343 |
+ --with-imagemagick |
344 |
+ --without-graphicsmagick |
345 |
+ ) |
346 |
+ else |
347 |
+ myeconfargs+=( |
348 |
+ --without-imagemagick |
349 |
+ --without-graphicsmagick |
350 |
+ ) |
351 |
+ fi |
352 |
+ |
353 |
+ if use java; then |
354 |
+ export JAVACFLAGS="$(java-pkg_javac-args)" |
355 |
+ append-cflags "$(java-pkg_get-jni-cflags)" |
356 |
+ if use test; then # bug 629078 |
357 |
+ myeconfargs+=( --with-java-unit ) |
358 |
+ java-pkg_append_ CLASSPATH . |
359 |
+ java-pkg_append_ CLASSPATH $(java-pkg_getjar --build-only junit-4 junit.jar) |
360 |
+ java-pkg_append_ CLASSPATH $(java-pkg_getjar --build-only hamcrest-core-1.3 hamcrest-core.jar) |
361 |
+ fi |
362 |
+ fi |
363 |
+ |
364 |
+ if use qt5; then |
365 |
+ myeconfargs+=( |
366 |
+ --with-qt |
367 |
+ --with-qt5 |
368 |
+ ) |
369 |
+ else |
370 |
+ myeconfargs+=( --without-qt ) |
371 |
+ fi |
372 |
+ else |
373 |
+ myeconfargs+=( |
374 |
+ --without-graphicsmagick |
375 |
+ --without-imagemagick |
376 |
+ --without-qt |
377 |
+ ) |
378 |
+ |
379 |
+ # zbarimg tests with native abi only |
380 |
+ # (this option from the patch above, stay up to date) |
381 |
+ use test && myeconfargs+=( --without-zbarimg-tests ) |
382 |
+ fi |
383 |
+ |
384 |
+ # use bash (bug 721370) |
385 |
+ CONFIG_SHELL='/bin/bash' \ |
386 |
+ ECONF_SOURCE="${S}" \ |
387 |
+ MOC="$(qt5_get_bindir)"/moc \ |
388 |
+ econf "${myeconfargs[@]}" |
389 |
+ |
390 |
+ # work around out-of-source build issues for multilib systems (bug 672184) |
391 |
+ mkdir qt zbarcam || die |
392 |
+} |
393 |
+ |
394 |
+src_test() { |
395 |
+ virtx multilib-minimal_src_test |
396 |
+} |
397 |
+ |
398 |
+src_install() { |
399 |
+ if use qt5; then |
400 |
+ local MULTILIB_WRAPPED_HEADERS=( |
401 |
+ /usr/include/zbar/QZBar.h |
402 |
+ /usr/include/zbar/QZBarImage.h |
403 |
+ ) |
404 |
+ fi |
405 |
+ multilib-minimal_src_install |
406 |
+} |
407 |
+ |
408 |
+multilib_src_install_all() { |
409 |
+ einstalldocs |
410 |
+ find "${D}" -name '*.la' -delete || die |
411 |
+} |
412 |
+ |
413 |
+pkg_preinst() { |
414 |
+ use java && java-pkg-opt-2_pkg_preinst |
415 |
+} |