Lines 5-34
Link Here
|
5 |
|
5 |
|
6 |
PYTHON_COMPAT=( python2_7 ) |
6 |
PYTHON_COMPAT=( python2_7 ) |
7 |
|
7 |
|
8 |
inherit autotools flag-o-matic java-pkg-opt-2 multilib-minimal \ |
8 |
inherit autotools flag-o-matic java-pkg-opt-2 multilib-minimal python-single-r1 virtualx |
9 |
python-single-r1 virtualx |
|
|
10 |
|
9 |
|
11 |
DESCRIPTION="Library and tools for reading barcodes from images or video" |
10 |
DESCRIPTION="Library and tools for reading barcodes from images or video" |
12 |
HOMEPAGE="http://zbar.sourceforge.net/" |
11 |
HOMEPAGE="https://github.com/procxx/zbar" |
13 |
SRC_URI="https://dev.gentoo.org/~xmw/zbar-0.10_p20121015.zip" |
12 |
SRC_URI="https://github.com/procxx/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz" |
14 |
|
13 |
|
15 |
LICENSE="LGPL-2.1" |
14 |
LICENSE="LGPL-2.1" |
16 |
SLOT="0" |
15 |
SLOT="0" |
17 |
KEYWORDS="amd64 ~arm x86" |
16 |
KEYWORDS="~amd64 ~arm ~x86" |
18 |
IUSE="gtk imagemagick java jpeg python qt4 static-libs test +threads v4l X xv" |
17 |
IUSE="gtk imagemagick java jpeg python qt5 static-libs test +threads v4l X xv" |
19 |
REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} ) |
18 |
REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} ) |
20 |
test? ( X ${PYTHON_REQUIRED_USE} )" |
19 |
test? ( X ${PYTHON_REQUIRED_USE} )" |
21 |
|
20 |
|
22 |
CDEPEND="gtk? ( dev-libs/glib:2[${MULTILIB_USEDEP}] |
21 |
CDEPEND=" |
23 |
x11-libs/gtk+:2[${MULTILIB_USEDEP}] ) |
22 |
gtk? ( |
|
|
23 |
dev-libs/glib:2[${MULTILIB_USEDEP}] |
24 |
x11-libs/gtk+:2[${MULTILIB_USEDEP}] |
25 |
) |
24 |
imagemagick? ( virtual/imagemagick-tools ) |
26 |
imagemagick? ( virtual/imagemagick-tools ) |
25 |
jpeg? ( virtual/jpeg:0[${MULTILIB_USEDEP}] ) |
27 |
jpeg? ( virtual/jpeg:0[${MULTILIB_USEDEP}] ) |
26 |
python? ( |
28 |
python? ( |
27 |
${PYTHON_DEPS} |
29 |
${PYTHON_DEPS} |
28 |
gtk? ( >=dev-python/pygtk-2[${PYTHON_USEDEP}] ) |
30 |
gtk? ( >=dev-python/pygtk-2[${PYTHON_USEDEP}] ) |
29 |
) |
31 |
) |
30 |
qt4? ( dev-qt/qtcore:4[${MULTILIB_USEDEP}] |
32 |
qt5? ( |
31 |
dev-qt/qtgui:4[${MULTILIB_USEDEP}] ) |
33 |
dev-qt/qtcore:5 |
|
|
34 |
dev-qt/qtgui:5 |
35 |
) |
32 |
X? ( |
36 |
X? ( |
33 |
x11-libs/libXext[${MULTILIB_USEDEP}] |
37 |
x11-libs/libXext[${MULTILIB_USEDEP}] |
34 |
xv? ( x11-libs/libXv[${MULTILIB_USEDEP}] ) |
38 |
xv? ( x11-libs/libXv[${MULTILIB_USEDEP}] ) |
Lines 36-48
Link Here
|
36 |
RDEPEND="${CDEPEND} |
40 |
RDEPEND="${CDEPEND} |
37 |
java? ( >=virtual/jre-1.4 )" |
41 |
java? ( >=virtual/jre-1.4 )" |
38 |
DEPEND="${CDEPEND} |
42 |
DEPEND="${CDEPEND} |
39 |
java? ( >=virtual/jdk-1.4 |
43 |
java? ( |
40 |
test? ( dev-java/junit:4 |
44 |
>=virtual/jdk-1.4 |
41 |
dev-java/hamcrest-core:1.3 ) ) |
45 |
test? ( |
|
|
46 |
dev-java/junit:4 |
47 |
dev-java/hamcrest-core:1.3 |
48 |
) |
49 |
) |
42 |
test? ( ${PYTHON_DEPS} ) |
50 |
test? ( ${PYTHON_DEPS} ) |
43 |
app-arch/unzip |
51 |
app-arch/unzip |
44 |
sys-devel/gettext |
52 |
sys-devel/gettext |
45 |
virtual/pkgconfig" |
53 |
virtual/pkgconfig |
|
|
54 |
" |
55 |
|
56 |
PATCHES=( "${FILESDIR}"/${PN}-0.10-errors.patch ) |
46 |
|
57 |
|
47 |
pkg_setup() { |
58 |
pkg_setup() { |
48 |
if use python || use test; then |
59 |
if use python || use test; then |
Lines 51-73
Link Here
|
51 |
java-pkg-opt-2_pkg_setup |
62 |
java-pkg-opt-2_pkg_setup |
52 |
} |
63 |
} |
53 |
|
64 |
|
54 |
src_unpack() { |
|
|
55 |
#vcs-snapshot doesn't work on .zip |
56 |
default |
57 |
mv * ${P} || die |
58 |
} |
59 |
|
60 |
src_prepare() { |
65 |
src_prepare() { |
61 |
eapply "${FILESDIR}"/${PN}-0.10-errors.patch \ |
66 |
default |
62 |
"${FILESDIR}"/${PN}-0.10-python-crash.patch \ |
|
|
63 |
"${FILESDIR}"/${PN}-0.10-v4l2-uvcvideo.patch |
64 |
|
65 |
# fix use of deprecated qt4 function, bug 572488 |
66 |
sed -e 's:numBytes:byteCount:g' \ |
67 |
-i "${S}"/include/zbar/QZBarImage.h || die |
68 |
|
67 |
|
69 |
if has_version '>=media-gfx/imagemagick-7.0.1.0' ; then |
68 |
if has_version '>=media-gfx/imagemagick-7.0.1.0' ; then |
70 |
eapply "${FILESDIR}/${P}-ImageMagick-7.diff" |
69 |
eapply "${FILESDIR}/${PN}-0.10_p20121015-ImageMagick-7.diff" |
71 |
fi |
70 |
fi |
72 |
|
71 |
|
73 |
use python && python_fix_shebang examples/upcrpc.py test/*.py |
72 |
use python && python_fix_shebang examples/upcrpc.py test/*.py |
Lines 82-120
Link Here
|
82 |
} |
81 |
} |
83 |
|
82 |
|
84 |
multilib_src_configure() { |
83 |
multilib_src_configure() { |
85 |
if multilib_is_native_abi && use java; then |
|
|
86 |
export JAVACFLAGS="$(java-pkg_javac-args)" |
87 |
export JAVA_CFLAGS="$(java-pkg_get-jni-cflags)" |
88 |
if use test ; then # bug 629078 |
89 |
java-pkg_append_ CLASSPATH . |
90 |
java-pkg_append_ CLASSPATH $(java-pkg_getjar --build-only junit-4 junit.jar) |
91 |
java-pkg_append_ CLASSPATH $(java-pkg_getjar --build-only hamcrest-core-1.3 hamcrest-core.jar) |
92 |
fi |
93 |
fi |
94 |
|
95 |
append-cppflags -DNDEBUG |
84 |
append-cppflags -DNDEBUG |
96 |
|
85 |
|
|
|
86 |
local myeconfargs=( |
87 |
$(multilib_native_use_with java) |
88 |
$(use_with jpeg) |
89 |
$(use_with gtk) |
90 |
$(multilib_native_use_with python) |
91 |
$(use_enable static-libs static) |
92 |
$(use_enable threads pthread) |
93 |
$(use_with X x) |
94 |
$(use_with xv xv) |
95 |
$(use_enable v4l video) |
96 |
) |
97 |
|
97 |
# different flags for image/graphics magick (bug 552350) |
98 |
# different flags for image/graphics magick (bug 552350) |
98 |
myimagemagick="--without-imagemagick" |
99 |
if has_version media-gfx/imagemagick; then |
99 |
has_version media-gfx/imagemagick && |
100 |
myeconfargs+=( $(multilib_native_use_with imagemagick) ) |
100 |
myimagemagick="$(multilib_native_use_with imagemagick)" |
101 |
else |
101 |
mygraphicsmagick="--without-graphicsmagick" |
102 |
myeconfargs+=( --without-imagemagick ) |
102 |
has_version media-gfx/graphicsmagick && |
103 |
fi |
103 |
mygraphicsmagick="$(multilib_native_use_with imagemagick graphicsmagick)" |
104 |
if has_version media-gfx/graphicsmagick; then |
|
|
105 |
myeconfargs+=( $(multilib_native_use_with imagemagick graphicsmagick) ) |
106 |
else |
107 |
myeconfargs+=( --without-graphicsmagick ) |
108 |
fi |
109 |
|
110 |
if multilib_is_native_abi; then |
111 |
if use java; then |
112 |
export JAVACFLAGS="$(java-pkg_javac-args)" |
113 |
export JAVA_CFLAGS="$(java-pkg_get-jni-cflags)" |
114 |
if use test ; then # bug 629078 |
115 |
java-pkg_append_ CLASSPATH . |
116 |
java-pkg_append_ CLASSPATH $(java-pkg_getjar --build-only junit-4 junit.jar) |
117 |
java-pkg_append_ CLASSPATH $(java-pkg_getjar --build-only hamcrest-core-1.3 hamcrest-core.jar) |
118 |
fi |
119 |
fi |
120 |
if use qt5; then |
121 |
myeconfargs+=( |
122 |
$(use_with qt5 qt) |
123 |
$(use_with qt5) |
124 |
) |
125 |
else |
126 |
myeconfargs+=( --without-qt ) |
127 |
fi |
128 |
fi |
129 |
|
104 |
ECONF_SOURCE=${S} \ |
130 |
ECONF_SOURCE=${S} \ |
105 |
econf \ |
131 |
econf "${myeconfargs[@]}" |
106 |
$(multilib_native_use_with java) \ |
|
|
107 |
$(use_with jpeg) \ |
108 |
$(use_with gtk) \ |
109 |
${myimagemagick} \ |
110 |
${mygraphicsmagick} \ |
111 |
$(multilib_native_use_with python) \ |
112 |
$(use_with qt4 qt) \ |
113 |
$(use_enable static-libs static) \ |
114 |
$(use_enable threads pthread) \ |
115 |
$(use_with X x) \ |
116 |
$(use_with xv xv) \ |
117 |
$(use_enable v4l video) |
118 |
|
132 |
|
119 |
# work-around out-of-source build issue |
133 |
# work-around out-of-source build issue |
120 |
mkdir gtk pygtk qt test || die |
134 |
mkdir gtk pygtk qt test || die |
Lines 125-131
Link Here
|
125 |
} |
139 |
} |
126 |
|
140 |
|
127 |
multilib_src_install_all() { |
141 |
multilib_src_install_all() { |
128 |
dodoc HACKING NEWS README TODO |
142 |
einstalldocs |
129 |
find "${D}" -name '*.la' -delete || die |
143 |
find "${D}" -name '*.la' -delete || die |
130 |
} |
144 |
} |
131 |
|
145 |
|