Gentoo Archives: gentoo-commits

From: Pacho Ramos <pacho@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: media-gfx/zbar/
Date: Sat, 12 Jan 2019 10:59:16
Message-Id: 1547289566.5270ac15b862fb09380ac93cbb5c9b37b4e33f15.pacho@gentoo
1 commit: 5270ac15b862fb09380ac93cbb5c9b37b4e33f15
2 Author: Pacho Ramos <pacho <AT> gentoo <DOT> org>
3 AuthorDate: Sat Jan 12 10:39:26 2019 +0000
4 Commit: Pacho Ramos <pacho <AT> gentoo <DOT> org>
5 CommitDate: Sat Jan 12 10:39:26 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5270ac15
7
8 media-gfx/zbar: Fix deps for v4l
9
10 Closes: https://bugs.gentoo.org/673994
11 Package-Manager: Portage-2.3.53, Repoman-2.3.12
12 Signed-off-by: Pacho Ramos <pacho <AT> gentoo.org>
13
14 media-gfx/zbar/zbar-0.20.1-r1.ebuild | 163 +++++++++++++++++++++++++++++++++++
15 1 file changed, 163 insertions(+)
16
17 diff --git a/media-gfx/zbar/zbar-0.20.1-r1.ebuild b/media-gfx/zbar/zbar-0.20.1-r1.ebuild
18 new file mode 100644
19 index 00000000000..a374101200a
20 --- /dev/null
21 +++ b/media-gfx/zbar/zbar-0.20.1-r1.ebuild
22 @@ -0,0 +1,163 @@
23 +# Copyright 1999-2019 Gentoo Authors
24 +# Distributed under the terms of the GNU General Public License v2
25 +
26 +EAPI=6
27 +PYTHON_COMPAT=( python2_7 )
28 +
29 +inherit autotools flag-o-matic java-pkg-opt-2 multilib-minimal python-single-r1 virtualx
30 +
31 +DESCRIPTION="Library and tools for reading barcodes from images or video"
32 +HOMEPAGE="https://github.com/mchehab/zbar"
33 +SRC_URI="https://linuxtv.org/downloads/${PN}/${P}.tar.gz"
34 +
35 +LICENSE="LGPL-2.1"
36 +SLOT="0"
37 +KEYWORDS="~amd64 ~arm ~x86"
38 +
39 +IUSE="graphicsmagick gtk imagemagick java jpeg python qt5 static-libs test +threads v4l X xv"
40 +REQUIRED_USE="
41 + python? ( ${PYTHON_REQUIRED_USE} )
42 + test? ( X ${PYTHON_REQUIRED_USE} )
43 +"
44 +
45 +COMMON_DEPEND="
46 + gtk? (
47 + dev-libs/glib:2[${MULTILIB_USEDEP}]
48 + x11-libs/gtk+:2[${MULTILIB_USEDEP}]
49 + )
50 + imagemagick? (
51 + !graphicsmagick? ( media-gfx/imagemagick:= )
52 + graphicsmagick? ( media-gfx/graphicsmagick:= )
53 + )
54 + jpeg? ( virtual/jpeg:0[${MULTILIB_USEDEP}] )
55 + python? (
56 + ${PYTHON_DEPS}
57 + gtk? ( >=dev-python/pygtk-2[${PYTHON_USEDEP}] )
58 + )
59 + qt5? (
60 + dev-qt/qtcore:5
61 + dev-qt/qtgui:5
62 + dev-qt/qtwidgets:5
63 + dev-qt/qtx11extras:5
64 + )
65 + v4l? ( media-libs/libv4l:0= )
66 + X? (
67 + x11-libs/libX11[${MULTILIB_USEDEP}]
68 + x11-libs/libXext[${MULTILIB_USEDEP}]
69 + xv? ( x11-libs/libXv[${MULTILIB_USEDEP}] )
70 + )
71 +"
72 +RDEPEND="${COMMON_DEPEND}
73 + java? ( >=virtual/jre-1.8 )
74 +"
75 +DEPEND="${COMMON_DEPEND}
76 + sys-devel/gettext
77 + virtual/pkgconfig
78 + gtk? ( dev-util/glib-utils )
79 + java? (
80 + >=virtual/jdk-1.8
81 + test? (
82 + dev-java/junit:4
83 + dev-java/hamcrest-core:1.3
84 + )
85 + )
86 + test? ( ${PYTHON_DEPS} )
87 +"
88 +
89 +PATCHES=( "${FILESDIR}"/${PN}-0.10-errors.patch )
90 +
91 +pkg_setup() {
92 + if use python || use test; then
93 + python-single-r1_pkg_setup
94 + fi
95 + java-pkg-opt-2_pkg_setup
96 +}
97 +
98 +src_prepare() {
99 + default
100 +
101 + if has_version '>=media-gfx/imagemagick-7.0.1.0' ; then
102 + eapply "${FILESDIR}/${PN}-0.10_p20121015-ImageMagick-7.patch"
103 + fi
104 +
105 + use python && python_fix_shebang examples/upcrpc.py test/*.py
106 + java-pkg-opt-2_src_prepare
107 +
108 + sed -e '/AM_INIT_AUTOMAKE/s: -Werror : :' \
109 + -e '/^AM_CFLAGS=/s: -Werror::' \
110 + -i configure.ac || die
111 + sed "s|javadir = \$(pkgdatadir)|javadir = /usr/$(get_libdir)/zbar|" \
112 + -i java/Makefile.am || die
113 + eautoreconf
114 +}
115 +
116 +multilib_src_configure() {
117 + append-cppflags -DNDEBUG
118 +
119 + local myeconfargs=(
120 + $(use_with gtk)
121 + $(multilib_native_use_with graphicsmagick graphicsmagick)
122 + $(multilib_native_use_with imagemagick)
123 + $(multilib_native_use_with java)
124 + $(use_with jpeg)
125 + $(multilib_native_use_with python python2)
126 + $(use_enable static-libs static)
127 + $(use_enable threads pthread)
128 + $(use_enable v4l video)
129 + $(use_with X x)
130 + $(use_with X xshm)
131 + $(use_with xv xv)
132 + )
133 +
134 + if multilib_is_native_abi; then
135 + if use java; then
136 + export JAVACFLAGS="$(java-pkg_javac-args)"
137 + export JAVA_CFLAGS="$(java-pkg_get-jni-cflags)"
138 + if use test ; then # bug 629078
139 + java-pkg_append_ CLASSPATH .
140 + java-pkg_append_ CLASSPATH $(java-pkg_getjar --build-only junit-4 junit.jar)
141 + java-pkg_append_ CLASSPATH $(java-pkg_getjar --build-only hamcrest-core-1.3 hamcrest-core.jar)
142 + fi
143 + fi
144 + if use qt5; then
145 + myeconfargs+=(
146 + $(use_with qt5 qt)
147 + $(use_with qt5)
148 + )
149 + else
150 + myeconfargs+=( --without-qt )
151 + fi
152 + else
153 + myeconfargs+=( --without-qt )
154 + fi
155 +
156 + ECONF_SOURCE=${S} \
157 + econf "${myeconfargs[@]}"
158 +
159 + # work around out-of-source build issues for multilib systems
160 + # https://bugs.gentoo.org/672184
161 + mkdir gtk pygtk qt test zbarcam || die
162 +}
163 +
164 +src_test() {
165 + virtx multilib-minimal_src_test
166 +}
167 +
168 +src_install() {
169 + if use qt5; then
170 + local MULTILIB_WRAPPED_HEADERS=(
171 + /usr/include/zbar/QZBar.h
172 + /usr/include/zbar/QZBarImage.h
173 + )
174 + fi
175 + multilib-minimal_src_install
176 +}
177 +
178 +multilib_src_install_all() {
179 + einstalldocs
180 + find "${D}" -name '*.la' -delete || die
181 +}
182 +
183 +pkg_preinst() {
184 + java-pkg-opt-2_pkg_preinst
185 +}