diff options
author | Daniel Gomez <daniel@qtec.com> | 2021-01-21 21:44:51 +0100 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2021-01-21 13:41:58 -0800 |
commit | f24914a843973d760ce5b19ad746295f920199e1 (patch) | |
tree | 1702ed7201cce74534694dd172c31e3ab77cb120 /meta-oe/recipes-support/zbar | |
parent | 1c2b1b919ca45bed16dc6b2bc96d7ce787bf0fa9 (diff) | |
download | meta-openembedded-f24914a843973d760ce5b19ad746295f920199e1.tar.gz |
zbar: Add support for mchehab/zbar
ZBar project development stopped in 2012 but it was forked and
maintained by Mauro Carvalho Chehab to keep it up to date with V4L2 api.
Main repository:
https://github.com/mchehab/zbar
Add support for zbar library mantained by mchehab. Use latest
version available 0.23.1.
Compile by default with options: video & python3.
As ZBar (original project) and mchehab/zbar (new & updated) are
different, keep both recipes as:
- zbar_0.10.bb: ZBar version 0.10
- zbar_git.bb: mchehab/zbar Version 0.23.1
Signed-off-by: Daniel Gomez <daniel@qtec.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-oe/recipes-support/zbar')
4 files changed, 151 insertions, 17 deletions
diff --git a/meta-oe/recipes-support/zbar/zbar/0001-qt-Create-subdir-in-Makefile.patch b/meta-oe/recipes-support/zbar/zbar/0001-qt-Create-subdir-in-Makefile.patch new file mode 100644 index 000000000..d7ca15207 --- /dev/null +++ b/meta-oe/recipes-support/zbar/zbar/0001-qt-Create-subdir-in-Makefile.patch | |||
@@ -0,0 +1,35 @@ | |||
1 | From 9c67f377477a07495a712f478eabfa8d33164c45 Mon Sep 17 00:00:00 2001 | ||
2 | From: Daniel Gomez <dagmcr@gmail.com> | ||
3 | Date: Sun, 17 Jan 2021 23:32:51 +0100 | ||
4 | Subject: [PATCH 1/2] qt: Create subdir in Makefile | ||
5 | |||
6 | Create builddir/qt subdir when --with-qt5 is enabled. | ||
7 | |||
8 | Fixes the following error: | ||
9 | |||
10 | moc -Iqt -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB | ||
11 | -I/var/lib/yocto/gallium/tmp_20210113/work/znver1-poky-linux/zbar/0.23.1+gitAUTOINC+89e7900d85-r0/recipe-sysroot/usr/include/QtWidgets | ||
12 | -I/var/lib/yocto/gallium/tmp_20210113/work/znver1-poky-linux/zbar/0.23.1+gitAUTOINC+89e7900d85-r0/recipe-sysroot/usr/include/QtGui | ||
13 | -I/var/lib/yocto/gallium/tmp_20210113/work/znver1-poky-linux/zbar/0.23.1+gitAUTOINC+89e7900d85-r0/recipe-sysroot/usr/include/QtCore | ||
14 | -I../git/include ../git/include/zbar/QZBar.h -o qt/moc_QZBar.cpp | ||
15 | moc: Cannot create qt/moc_QZBar.cpp | ||
16 | make: *** [Makefile:2459: qt/moc_QZBar.cpp] Error 1 | ||
17 | |||
18 | Signed-off-by: Daniel Gomez <dagmcr@gmail.com> | ||
19 | --- | ||
20 | qt/Makefile.am.inc | 1 + | ||
21 | 1 file changed, 1 insertion(+) | ||
22 | |||
23 | diff --git a/qt/Makefile.am.inc b/qt/Makefile.am.inc | ||
24 | index b099c2b..c98fbeb 100644 | ||
25 | --- a/qt/Makefile.am.inc | ||
26 | +++ b/qt/Makefile.am.inc | ||
27 | @@ -15,4 +15,5 @@ qt/moc_%.cpp: qt/%.h | ||
28 | $(MOC) $(qt_libzbarqt_la_CPPFLAGS) $< -o $@ | ||
29 | |||
30 | qt/moc_%.cpp: include/zbar/%.h | ||
31 | + @$(mkdir_p) qt 2>/dev/null | ||
32 | $(MOC) $(qt_libzbarqt_la_CPPFLAGS) $< -o $@ | ||
33 | -- | ||
34 | 2.29.2 | ||
35 | |||
diff --git a/meta-oe/recipes-support/zbar/zbar/0002-zbarcam-Create-subdir-in-Makefile.patch b/meta-oe/recipes-support/zbar/zbar/0002-zbarcam-Create-subdir-in-Makefile.patch new file mode 100644 index 000000000..a1c27b8b4 --- /dev/null +++ b/meta-oe/recipes-support/zbar/zbar/0002-zbarcam-Create-subdir-in-Makefile.patch | |||
@@ -0,0 +1,40 @@ | |||
1 | From fe751929ccc8fd75e350ed6db9d28d04bd31fc79 Mon Sep 17 00:00:00 2001 | ||
2 | From: Daniel Gomez <dagmcr@gmail.com> | ||
3 | Date: Sun, 17 Jan 2021 23:33:19 +0100 | ||
4 | Subject: [PATCH 2/2] zbarcam: Create subdir in Makefile | ||
5 | |||
6 | Create builddir/zbarcam when --with-qt5 is enabled. | ||
7 | |||
8 | Fixes the following error: | ||
9 | |||
10 | moc -i -Izbarcam -DQT_WIDGETS_LIB -DQT_X11EXTRAS_LIB -DQT_GUI_LIB | ||
11 | -DQT_CORE_LIB | ||
12 | -I/var/lib/yocto/gallium/tmp_20210113/work/znver1-poky-linux/zbar/0.23.1+gitAUTOINC+89e7900d85-r0/recipe-sysroot/usr/include/QtWidgets | ||
13 | -I/var/lib/yocto/gallium/tmp_20210113/work/znver1-poky-linux/zbar/0.23.1+gitAUTOINC+89e7900d85-r0/recipe-sysroot/usr/include/QtX11Extras | ||
14 | -I/var/lib/yocto/gallium/tmp_20210113/work/znver1-poky-linux/zbar/0.23.1+gitAUTOINC+89e7900d85-r0/recipe-sysroot/usr/include/QtGui | ||
15 | -I/var/lib/yocto/gallium/tmp_20210113/work/znver1-poky-linux/zbar/0.23.1+gitAUTOINC+89e7900d85-r0/recipe-sysroot/usr/include/QtCore | ||
16 | -I../git/include ../git/zbarcam/zbarcam-qt.cpp -o | ||
17 | zbarcam/moc_zbarcam_qt.h | ||
18 | moc: Cannot create zbarcam/moc_zbarcam_qt.h | ||
19 | make: *** [Makefile:2438: zbarcam/moc_zbarcam_qt.h] Error 1 | ||
20 | |||
21 | Signed-off-by: Daniel Gomez <dagmcr@gmail.com> | ||
22 | --- | ||
23 | zbarcam/Makefile.am.inc | 1 + | ||
24 | 1 file changed, 1 insertion(+) | ||
25 | |||
26 | diff --git a/zbarcam/Makefile.am.inc b/zbarcam/Makefile.am.inc | ||
27 | index b6de82c..e90c50c 100644 | ||
28 | --- a/zbarcam/Makefile.am.inc | ||
29 | +++ b/zbarcam/Makefile.am.inc | ||
30 | @@ -28,6 +28,7 @@ DISTCLEANFILES += $(nodist_zbarcam_zbarcam_qt_SOURCES) zbarcam/moc_zbarcam_qt.h | ||
31 | |||
32 | |||
33 | zbarcam/moc_zbarcam_qt.h: zbarcam/zbarcam-qt.cpp | ||
34 | + @$(mkdir_p) zbarcam 2>/dev/null | ||
35 | $(MOC) -i $(zbarcam_zbarcam_qt_CPPFLAGS) $< -o $@ | ||
36 | endif | ||
37 | |||
38 | -- | ||
39 | 2.29.2 | ||
40 | |||
diff --git a/meta-oe/recipes-support/zbar/zbar_0.10.bb b/meta-oe/recipes-support/zbar/zbar_0.10.bb new file mode 100644 index 000000000..181d7ae43 --- /dev/null +++ b/meta-oe/recipes-support/zbar/zbar_0.10.bb | |||
@@ -0,0 +1,31 @@ | |||
1 | DESCRIPTION = "2D barcode scanner toolkit." | ||
2 | SECTION = "graphics" | ||
3 | LICENSE = "LGPL-2.1" | ||
4 | |||
5 | DEPENDS = "pkgconfig intltool-native libpng jpeg" | ||
6 | |||
7 | LIC_FILES_CHKSUM = "file://COPYING;md5=4015840237ca7f0175cd626f78714ca8" | ||
8 | |||
9 | PV = "0.10+git${SRCPV}" | ||
10 | |||
11 | # iPhoneSDK-1.3.1 tag | ||
12 | SRCREV = "67003d2a985b5f9627bee2d8e3e0b26d0c474b57" | ||
13 | SRC_URI = "git://github.com/ZBar/Zbar \ | ||
14 | file://0001-make-relies-GNU-extentions.patch \ | ||
15 | " | ||
16 | S = "${WORKDIR}/git" | ||
17 | |||
18 | inherit autotools pkgconfig | ||
19 | |||
20 | PACKAGECONFIG = "${@bb.utils.filter('DISTRO_FEATURES', 'x11', d)}" | ||
21 | |||
22 | PACKAGECONFIG[x11] = "--with-x,-without-x,libxcb libx11 libsm libxau libxext libxv libice libxdmcp" | ||
23 | |||
24 | EXTRA_OECONF = "--without-imagemagick --without-qt --without-python --disable-video --without-gtk" | ||
25 | |||
26 | CPPFLAGS += "-Wno-error" | ||
27 | |||
28 | do_install_append() { | ||
29 | #remove usr/bin if empty | ||
30 | rmdir ${D}${bindir} | ||
31 | } | ||
diff --git a/meta-oe/recipes-support/zbar/zbar_git.bb b/meta-oe/recipes-support/zbar/zbar_git.bb index 181d7ae43..dae912252 100644 --- a/meta-oe/recipes-support/zbar/zbar_git.bb +++ b/meta-oe/recipes-support/zbar/zbar_git.bb | |||
@@ -1,31 +1,59 @@ | |||
1 | DESCRIPTION = "2D barcode scanner toolkit." | 1 | HOMEPAGE = "https://github.com/mchehab/zbar" |
2 | SUMMARY = "A bar code library" | ||
3 | DESRIPTION = "ZBar is an open source software suite for reading bar codes \ | ||
4 | from various sources, such as video streams, image files and raw \ | ||
5 | intensity sensors. It supports EAN-13/UPC-A, UPC-E, EAN-8, Code 128, \ | ||
6 | Code 93, Code 39, Codabar, Interleaved 2 of 5, QR Code and SQ Code" | ||
2 | SECTION = "graphics" | 7 | SECTION = "graphics" |
8 | |||
3 | LICENSE = "LGPL-2.1" | 9 | LICENSE = "LGPL-2.1" |
10 | LIC_FILES_CHKSUM = "file://LICENSE.md;md5=5e9ee833a2118adc7d8b5ea38e5b1cef" | ||
4 | 11 | ||
5 | DEPENDS = "pkgconfig intltool-native libpng jpeg" | 12 | SRC_URI = "git://github.com/mchehab/zbar.git;branch=master \ |
13 | file://0001-qt-Create-subdir-in-Makefile.patch \ | ||
14 | file://0002-zbarcam-Create-subdir-in-Makefile.patch \ | ||
15 | " | ||
16 | SRCREV = "89e7900d85dd54ef351a7ed582aec6a5a5d7fa37" | ||
6 | 17 | ||
7 | LIC_FILES_CHKSUM = "file://COPYING;md5=4015840237ca7f0175cd626f78714ca8" | 18 | S = "${WORKDIR}/git" |
19 | PV = "0.23.1+git${SRCPV}" | ||
8 | 20 | ||
9 | PV = "0.10+git${SRCPV}" | 21 | DEPENDS += "xmlto-native" |
10 | 22 | ||
11 | # iPhoneSDK-1.3.1 tag | 23 | PACKAGECONFIG ??= "\ |
12 | SRCREV = "67003d2a985b5f9627bee2d8e3e0b26d0c474b57" | 24 | ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', '', d)} \ |
13 | SRC_URI = "git://github.com/ZBar/Zbar \ | ||
14 | file://0001-make-relies-GNU-extentions.patch \ | ||
15 | " | 25 | " |
16 | S = "${WORKDIR}/git" | ||
17 | 26 | ||
18 | inherit autotools pkgconfig | 27 | PACKAGECONFIG ??= "video python3" |
19 | 28 | ||
20 | PACKAGECONFIG = "${@bb.utils.filter('DISTRO_FEATURES', 'x11', d)}" | 29 | inherit autotools pkgconfig gettext \ |
30 | ${@bb.utils.contains('PACKAGECONFIG', 'python3', 'python3native', '', d)} \ | ||
31 | ${@bb.utils.contains('PACKAGECONFIG', 'gtk3', 'gobject-introspection', '', d)} \ | ||
32 | ${@bb.utils.contains('PACKAGECONFIG', 'qt5', 'qmake5_paths', '', d)} | ||
21 | 33 | ||
22 | PACKAGECONFIG[x11] = "--with-x,-without-x,libxcb libx11 libsm libxau libxext libxv libice libxdmcp" | 34 | PACKAGECONFIG[x11] = "--with-x, --without-x, libxv" |
35 | PACKAGECONFIG[video] = "--enable-video, --disable-video, v4l-utils libv4l" | ||
36 | PACKAGECONFIG[jpeg] = "--with-jpeg, --without-jpeg, jpeg" | ||
37 | PACKAGECONFIG[python3] = "--with-python=auto, --without-python, python3" | ||
38 | PACKAGECONFIG[gtk3] = "--with-gtk=gtk3, --without-gtk, gtk+3" | ||
39 | PACKAGECONFIG[qt5] = "--with-qt5, --without-qt5, qtbase qtbase-native qtx11extras qtsvg, qtbase" | ||
40 | PACKAGECONFIG[imagemagick] = "--with-imagemagick, --without-imagemagick, imagemagick" | ||
23 | 41 | ||
24 | EXTRA_OECONF = "--without-imagemagick --without-qt --without-python --disable-video --without-gtk" | 42 | FILES_${PN} += "${bindir} \ |
43 | ${@bb.utils.contains('DEPENDS', 'python3-native', '${libdir}', '', d)} \ | ||
44 | " | ||
45 | |||
46 | CPPFLAGS_append = "\ | ||
47 | ${@bb.utils.contains('PACKAGECONFIG', 'qt5', '\ | ||
48 | -I${STAGING_INCDIR}/QtX11Extras \ | ||
49 | -I${STAGING_INCDIR}/dbus-1.0 \ | ||
50 | -I${STAGING_LIBDIR}/dbus-1.0/include \ | ||
51 | ', '', d)} \ | ||
52 | " | ||
25 | 53 | ||
26 | CPPFLAGS += "-Wno-error" | 54 | TARGET_CXXFLAGS_append = " -fPIC" |
27 | 55 | ||
28 | do_install_append() { | 56 | do_prepare_recipe_sysroot_gettext() { |
29 | #remove usr/bin if empty | 57 | install -m 755 ${STAGING_DATADIR_NATIVE}/gettext/ABOUT-NLS ${S}/ |
30 | rmdir ${D}${bindir} | ||
31 | } | 58 | } |
59 | addtask do_prepare_recipe_sysroot_gettext after do_prepare_recipe_sysroot before do_configure \ No newline at end of file | ||