Skip to contentSkip to conversation

zbar: new package

PATCH New Viacheslav Volkov 2 participants 2 messages Oct 29, 2015 – Dec 20, 2015

lore
Share & tools
lore
#0 lore raw

PATCH v5 1/1 zbar: new package

---
Changes v4 -> v5:
- add patch description (suggested by Vincent.Riera at imgtec.com)

Changes v3 -> v4:
- correct zbar.mk, Config.in add hash (suggested by Vincent.Riera at imgtec.com)
- license -> LGPL (suggested by martin at barkynet.com)

Changes v2 -> v3:
- intendation in the Config.in (suggested by Yegor Yefremov)
- add license info

Changes v1 -> v2:
- many changes

---
 package/Config.in                     |  1 +
 package/zbar/0001-zbar-autoconf.patch | 27 +++++++++++++++++++++++++++
 package/zbar/0002-zbar-jpeg.patch     | 21 +++++++++++++++++++++
 package/zbar/Config.in                | 21 +++++++++++++++++++++
 package/zbar/zbar.hash                |  3 +++
 package/zbar/zbar.mk                  | 32 ++++++++++++++++++++++++++++++++
 6 files changed, 105 insertions(+)
 create mode 100644 package/zbar/0001-zbar-autoconf.patch
 create mode 100644 package/zbar/0002-zbar-jpeg.patch
 create mode 100644 package/zbar/Config.in
 create mode 100644 package/zbar/zbar.hash
 create mode 100644 package/zbar/zbar.mk
package/Config.in +1 -0
index 10ff94e..778b1e1 100644
@@ -854,6 +854,7 @@ menu "Graphics"
 	source "package/webkit/Config.in"
 	source "package/webkitgtk24/Config.in"
 	source "package/webp/Config.in"
+	source "package/zbar/Config.in"
 	source "package/zxing-cpp/Config.in"
 endmenu
 
package/zbar/0001-zbar-autoconf.patch new file +27 -0
new file mode 100644
index 0000000..671cc6e
@@ -0,0 +1,27 @@
+Correct configuration error on recent version autoreconf.
+
+Need call AM_PROG_AR macro.
+And not portable patterns %. in the make files.
+
+Last update distribution in the 2012.
+
+Signed-off-by: Viacheslav Volkov <[email protected]>
+
+Index: b/configure.ac
+===================================================================
+diff --git a/configure.ac b/configure.ac
+index 256aedb..5aa5689 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -3,10 +3,11 @@ AC_PREREQ([2.61])
+ AC_INIT([zbar], [0.10], [spadix at users.sourceforge.net])
+ AC_CONFIG_AUX_DIR(config)
+ AC_CONFIG_MACRO_DIR(config)
+-AM_INIT_AUTOMAKE([1.10 -Wall -Werror foreign subdir-objects std-options dist-bzip2])
++AM_INIT_AUTOMAKE([1.10 -Wall -Werror -Wno-portability foreign subdir-objects std-options dist-bzip2])
+ AC_CONFIG_HEADERS([include/config.h])
+ AC_CONFIG_SRCDIR(zbar/scanner.c)
+ LT_PREREQ([2.2])
++m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
+ LT_INIT([dlopen win32-dll])
+ LT_LANG([Windows Resource])
package/zbar/0002-zbar-jpeg.patch new file +21 -0
new file mode 100644
index 0000000..661749d
@@ -0,0 +1,21 @@
+Correct function prototipe for using with libjpeg.
+
+Last update distribution in the 2012.
+
+Signed-off-by: Viacheslav Volkov <[email protected]>
+
+Index: b/zbar/jpeg.c
+===================================================================
+diff --git a/zbar/jpeg.c b/zbar/jpeg.c
+index 972bfea..fdd1619 100644
+--- a/zbar/jpeg.c
++++ b/zbar/jpeg.c
+@@ -68,7 +68,7 @@ void init_source (j_decompress_ptr cinfo)
+     cinfo->src->bytes_in_buffer = img->datalen;
+ }
+ 
+-int fill_input_buffer (j_decompress_ptr cinfo)
++boolean fill_input_buffer (j_decompress_ptr cinfo)
+ {
+     /* buffer underrun error case */
+     cinfo->src->next_input_byte = fake_eoi;
package/zbar/Config.in new file +21 -0
new file mode 100644
index 0000000..5fac0c3
@@ -0,0 +1,21 @@
+config BR2_PACKAGE_ZBAR
+	bool "zbar"
+	depends on BR2_TOOLCHAIN_HAS_THREADS # libv4l
+	depends on BR2_USE_MMU # libv4l
+	depends on !BR2_STATIC_LIBS # libv4l
+	depends on BR2_INSTALL_LIBSTDCPP # libv4l
+	depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_0 # libv4l
+	depends on BR2_TOOLCHAIN_USES_GLIBC || \
+		BR2_TOOLCHAIN_USES_UCLIBC # libv4l
+	select BR2_PACKAGE_JPEG
+	select BR2_PACKAGE_LIBV4L
+	help
+	  QR and barcode scanner
+
+	  http://zbar.sourceforge.net/
+
+comment "zbar needs an uClibc or (e)glibc toolchain w/ threads, dynamic library, C++ and headers >= 3.0"
+	depends on BR2_USE_MMU
+	depends on !BR2_TOOLCHAIN_HAS_THREADS || BR2_STATIC_LIBS \
+		|| !BR2_INSTALL_LIBSTDCPP || !BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_0 \
+		|| !(BR2_TOOLCHAIN_USES_UCLIBC || BR2_TOOLCHAIN_USES_GLIBC)
package/zbar/zbar.hash new file +3 -0
new file mode 100644
index 0000000..5c04d9b
@@ -0,0 +1,3 @@
+# Locally computed:
+sha256 38f8535a3c4c526ecaa968a992efcbf7392623e68db45dc2f181d4c9d3002d69 zbar-854a5d97059e395807091ac4d80c53f7968abb8f.tar.gz
+
package/zbar/zbar.mk new file +32 -0
new file mode 100644
index 0000000..bd3c197
@@ -0,0 +1,32 @@
+################################################################################
+#
+# zbar
+#
+################################################################################
+
+# github have some additional commits for compilling with recent kernel
+ZBAR_VERSION = 854a5d97059e395807091ac4d80c53f7968abb8f
+ZBAR_SITE = $(call github,ZBar,Zbar,$(ZBAR_VERSION))
+ZBAR_LICENSE = LGPLv2.1
+ZBAR_LICENSE_FILES = LICENSE
+ZBAR_INSTALL_STAGING = YES
+ZBAR_AUTORECONF = YES
+ZBAR_DEPENDENCIES = libv4l libjpeg
+ZBAR_CONF_OPTS = \
+	--without-imagemagick \
+	--without-qt \
+	--without-gtk \
+	--without-python \
+	--without-x \
+	--enable-shared=yes
+
+# fix /usr/bin/install: cannot stat ?./doc/man/zbarcam.1?: No such file or
+#   directory
+# make[5]: *** [install-man1] Error 1
+define ZBAR_INSTALL_FIXUP
+	touch $(@D)/doc/man/zbarcam.1
+endef
+
+ZBAR_POST_BUILD_HOOKS += ZBAR_INSTALL_FIXUP
+
+$(eval $(autotools-package))
Signature · 1 line
2.6.1
#1 lore raw

PATCH v5 1/1 zbar: new package

Dear Viacheslav Volkov,

Quoted 4 lines · Viacheslav Volkov

---
Changes v4 -> v5:
- add patch description (suggested by Vincent.Riera at imgtec.com)

Applied with a number of changes:

[Thomas:
- replace patch 0001 fixing autoreconf by a simpler patch that simply drops the -Wall and -Werror flags passed to automake.
- reformat the two patches using Git
- drop the "uclibc || glibc" dependency inherited from libv4l, since libv4l has now been fixed to build on musl.
- drop the hook work arounding a build issue around man pages, and replace by a patch that completely disables the build/installation of documentation.
- change license to LGPLv2.1+, as noted in the COPYING file.
- drop --enable-shared=yes, since it is already passed by the autotools-package infrastructure]

Thanks a lot!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com