From 85885807112391cee7441d90624f91209a410317 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 11 Feb 2017 18:22:55 +0000 Subject: [PATCH 01/99] - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild --- zbar.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/zbar.spec b/zbar.spec index 62d9519..4f7ff68 100644 --- a/zbar.spec +++ b/zbar.spec @@ -3,7 +3,7 @@ Name: zbar Version: 0.10 -Release: 27%{?dist} +Release: 28%{?dist} Summary: Bar code reader Group: User Interface/X Hardware Support @@ -183,6 +183,9 @@ rm -rf $RPM_BUILD_ROOT %{_includedir}/zbar/QZBar*.h %changelog +* Sat Feb 11 2017 Fedora Release Engineering - 0.10-28 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild + * Tue Jul 19 2016 Fedora Release Engineering - 0.10-27 - https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages From 7715ab8df28ecfcd49e2492519ed6e0240e7fd93 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Sun, 26 Mar 2017 08:42:45 -0300 Subject: [PATCH 02/99] make zbar-qt to use Qt5 Signed-off-by: Mauro Carvalho Chehab --- zbar.spec | 5 ++ zbar_add_support_for_qt5.patch | 140 +++++++++++++++++++++++++++++++++ 2 files changed, 145 insertions(+) create mode 100644 zbar_add_support_for_qt5.patch diff --git a/zbar.spec b/zbar.spec index 4f7ff68..a15663e 100644 --- a/zbar.spec +++ b/zbar.spec @@ -15,6 +15,7 @@ Patch1: zbar_use_libv4l.patch Patch2: zbar_choose_supported_format_first.patch Patch3: zbar_use_REQBUFS_properly.patch Patch4: zbar_configure_ac_use_m4_pattern_allow.patch +Patch5: zbar_add_support_for_qt5.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: autoconf automake libtool python-devel gettext-devel @@ -90,6 +91,7 @@ scanning widget. %patch2 -p1 %patch3 -p1 %patch4 -p1 +%patch5 -p1 %build autoreconf -vfi @@ -183,6 +185,9 @@ rm -rf $RPM_BUILD_ROOT %{_includedir}/zbar/QZBar*.h %changelog +* Sun Mar 26 2017 Mauro Carvalho Chehab - 0.10-29 +- Make zbar-qt to use Qt5 + * Sat Feb 11 2017 Fedora Release Engineering - 0.10-28 - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild diff --git a/zbar_add_support_for_qt5.patch b/zbar_add_support_for_qt5.patch new file mode 100644 index 0000000..519645f --- /dev/null +++ b/zbar_add_support_for_qt5.patch @@ -0,0 +1,140 @@ +diff --git a/configure.ac b/configure.ac +index dbd7153fb13b..7bcb18219853 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -476,18 +476,33 @@ AM_CONDITIONAL([HAVE_PYTHON], [test "x$with_python" = "xyes"]) + dnl Qt + AC_ARG_WITH([qt], + [AS_HELP_STRING([--without-qt], +- [disable support for Qt4 widget])], ++ [disable support for Qt widget])], + [], + [with_qt="yes"]) + ++dnl Qt5 ++AC_ARG_WITH([qt5], ++ [AS_HELP_STRING([--without-qt5], ++ [disable support for Qt5 widget. if --with-qt, it will seek only for Qt4])], ++ [], ++ [with_qt5="yes"]) ++ + AC_ARG_VAR([MOC], [full path to Qt moc program]) + + AS_IF([test "x$with_qt" != "xno"], +- [PKG_CHECK_MODULES([QT], [QtCore >= 4 QtGui >= 4]) +- MOC=`$PKG_CONFIG QtGui --variable=moc_location` +- AC_MSG_NOTICE([using moc from $MOC]) +- QT_VERSION=`$PKG_CONFIG QtGui --modversion` +- AC_MSG_NOTICE([using Qt version $QT_VERSION])]) ++ AS_IF([test "x$with_qt5" != "xno"], ++ [PKG_CHECK_MODULES([QT], [Qt5Core >= 5 Qt5Gui >= 5 Qt5Widgets >= 5.0 Qt5X11Extras >= 5.0]) ++ AC_CHECK_PROGS(MOC, [moc-qt5 moc]) ++ AC_MSG_NOTICE([using moc from $MOC]) ++ QT_VERSION=`$PKG_CONFIG Qt5Gui --modversion` ++ CPPFLAGS="$CPPFLAGS $QT_CPPFLAGS -fPIC" ++ AC_MSG_NOTICE([using Qt version $QT_VERSION])], ++ ++ [PKG_CHECK_MODULES([QT], [QtCore >= 4 QtGui >= 4]) ++ MOC=`$PKG_CONFIG QtGui --variable=moc_location` ++ AC_MSG_NOTICE([using moc from $MOC]) ++ QT_VERSION=`$PKG_CONFIG QtGui --modversion` ++ AC_MSG_NOTICE([using Qt version $QT_VERSION])])) + + AM_CONDITIONAL([HAVE_QT], [test "x$with_qt" = "xyes"]) + +@@ -596,9 +611,9 @@ AS_IF([test "x$with_gtk" != "xyes"], + [echo " => the GTK+ widget will *NOT* be built"], + [AS_IF([test "x$with_python" != "xyes"], + [echo " => the PyGTK widget wrapper will *NOT* be built"])]) +-echo "Qt4 --with-qt=$with_qt" ++echo "Qt${QT_VERSION} --with-qt=$with_qt" + AS_IF([test "x$with_qt" != "xyes"], +- [echo " => the Qt4 widget will *NOT* be built"]) ++ [echo " => the Qt widget will *NOT* be built"]) + echo "Java --with-java=$with_java" + AS_IF([test "x$with_java" != "xyes"], + [echo " => the Java interface will *NOT* be built"]) +diff --git a/include/zbar/QZBar.h b/include/zbar/QZBar.h +index 104449928e2d..1a4716565047 100644 +--- a/include/zbar/QZBar.h ++++ b/include/zbar/QZBar.h +@@ -26,7 +26,12 @@ + /// @file + /// Barcode Reader Qt4 Widget + +-#include ++#include ++#if QT_VERSION >= 0x050000 ++# include ++#else ++# include ++#endif + + namespace zbar { + +diff --git a/include/zbar/QZBarImage.h b/include/zbar/QZBarImage.h +index 1505177e07a9..b862c8085576 100644 +--- a/include/zbar/QZBarImage.h ++++ b/include/zbar/QZBarImage.h +@@ -54,7 +54,11 @@ public: + unsigned height = qimg.height(); + set_size(width, height); + set_format(zbar_fourcc('B','G','R','4')); ++#if QT_VERSION >= 0x050000 ++ unsigned long datalen = qimg.byteCount(); ++#else + unsigned long datalen = qimg.numBytes(); ++#endif + set_data(qimg.bits(), datalen); + + if((width * 4 != bpl) || +diff --git a/qt/QZBar.cpp b/qt/QZBar.cpp +index e1001b09cff5..a5b956b342ad 100644 +--- a/qt/QZBar.cpp ++++ b/qt/QZBar.cpp +@@ -23,7 +23,7 @@ + + #include + #include +-#include ++#include + #include + #include "QZBarThread.h" + +@@ -49,7 +49,11 @@ QZBar::QZBar (QWidget *parent) + + thread = new QZBarThread; + if(testAttribute(Qt::WA_WState_Created)) { ++#if QT_VERSION >= 0x050000 ++ thread->window.attach(QX11Info::display(), winId()); ++#else + thread->window.attach(x11Info().display(), winId()); ++#endif + _attached = 1; + } + connect(thread, SIGNAL(videoOpened(bool)), +@@ -204,7 +208,12 @@ void QZBar::changeEvent(QEvent *event) + try { + QMutexLocker locker(&thread->mutex); + if(event->type() == QEvent::ParentChange) ++#if QT_VERSION >= 0x050000 ++ thread->window.attach(QX11Info::display(), winId()); ++#else + thread->window.attach(x11Info().display(), winId()); ++#endif ++ + } + catch(Exception) { /* ignore (FIXME do something w/error) */ } + } +@@ -215,7 +224,11 @@ void QZBar::attach () + return; + + try { ++#if QT_VERSION >= 0x050000 ++ thread->window.attach(QX11Info::display(), winId()); ++#else + thread->window.attach(x11Info().display(), winId()); ++#endif + _attached = 1; + + _videoEnabled = !_videoDevice.isEmpty(); From f637bc228003fd879c438158201430d46cf720cc Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Sun, 26 Mar 2017 10:14:00 -0300 Subject: [PATCH 03/99] Generate qt and gtk zbarcam applications Signed-off-by: Mauro Carvalho Chehab --- zbar.spec | 9 +- zbar_generate_qt_gtk_apps.patch | 148 ++++++++++++++++++++++++++++++++ 2 files changed, 155 insertions(+), 2 deletions(-) create mode 100644 zbar_generate_qt_gtk_apps.patch diff --git a/zbar.spec b/zbar.spec index a15663e..fe85b4a 100644 --- a/zbar.spec +++ b/zbar.spec @@ -3,7 +3,7 @@ Name: zbar Version: 0.10 -Release: 28%{?dist} +Release: 29%{?dist} Summary: Bar code reader Group: User Interface/X Hardware Support @@ -16,6 +16,8 @@ Patch2: zbar_choose_supported_format_first.patch Patch3: zbar_use_REQBUFS_properly.patch Patch4: zbar_configure_ac_use_m4_pattern_allow.patch Patch5: zbar_add_support_for_qt5.patch +Patch6: zbar_generate_qt_gtk_apps.patch + BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: autoconf automake libtool python-devel gettext-devel @@ -92,6 +94,7 @@ scanning widget. %patch3 -p1 %patch4 -p1 %patch5 -p1 +%patch6 -p1 %build autoreconf -vfi @@ -162,6 +165,7 @@ rm -rf $RPM_BUILD_ROOT %files gtk %defattr(-,root,root,-) %{_libdir}/libzbargtk.so.* +%{_bindir}/zbarcam-gtk %files gtk-devel %defattr(-,root,root,-) @@ -177,6 +181,7 @@ rm -rf $RPM_BUILD_ROOT %files qt %defattr(-,root,root,-) %{_libdir}/libzbarqt.so.* +%{_bindir}/zbarcam-qt %files qt-devel %defattr(-,root,root,-) @@ -186,7 +191,7 @@ rm -rf $RPM_BUILD_ROOT %changelog * Sun Mar 26 2017 Mauro Carvalho Chehab - 0.10-29 -- Make zbar-qt to use Qt5 +- Make zbar-qt to use Qt5 and generate gtk and qt applications * Sat Feb 11 2017 Fedora Release Engineering - 0.10-28 - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild diff --git a/zbar_generate_qt_gtk_apps.patch b/zbar_generate_qt_gtk_apps.patch new file mode 100644 index 0000000..17c6856 --- /dev/null +++ b/zbar_generate_qt_gtk_apps.patch @@ -0,0 +1,148 @@ +From 76a286fd34d5159b55de4d4f276dcbf69d1b263e Mon Sep 17 00:00:00 2001 +From: Mauro Carvalho Chehab +Date: Sun, 26 Mar 2017 09:43:07 -0300 +Subject: [PATCH] zbarcam: add qt and gtk variants + +The original zbarcam use standard X11 libraries to display +video. That provides an ugly interface, and could be +slow on high resolutions. + +As Zbar has already test examples for qt and gtk, let's +promote them to real applications. One advantage is that +both qt and gtk libraries will be tested when building +those. + +Signed-off-by: Mauro Carvalho Chehab + +diff --git a/qt/Makefile.am.inc b/qt/Makefile.am.inc +index dc1525e0d52a..5f860bfa31bc 100644 +--- a/qt/Makefile.am.inc ++++ b/qt/Makefile.am.inc +@@ -7,6 +7,7 @@ qt_libzbarqt_la_SOURCES = qt/QZBar.cpp qt/QZBarThread.h qt/QZBarThread.cpp + nodist_qt_libzbarqt_la_SOURCES = qt/moc_QZBar.cpp qt/moc_QZBarThread.cpp + BUILT_SOURCES += $(nodist_qt_libzbarqt_la_SOURCES) + DISTCLEANFILES += $(nodist_qt_libzbarqt_la_SOURCES) ++CLEANFILES += qt/moc_%.cpp + + qt/moc_%.cpp: qt/%.h + $(MOC) $(qt_libzbarqt_la_CPPFLAGS) $< -o $@ +diff --git a/test/Makefile.am.inc b/test/Makefile.am.inc +index 7340a7f2f61f..8496eb30f3cc 100644 +--- a/test/Makefile.am.inc ++++ b/test/Makefile.am.inc +@@ -45,26 +45,6 @@ test_dbg_scan_CPPFLAGS = $(MAGICK_CFLAGS) $(AM_CPPFLAGS) + test_dbg_scan_LDADD = $(MAGICK_LIBS) -lMagick++ zbar/libzbar.la $(AM_LDADD) + endif + +-if HAVE_GTK +-check_PROGRAMS += test/test_gtk +-test_test_gtk_SOURCES = test/test_gtk.c test/scan_video.c +-test_test_gtk_CPPFLAGS = $(GTK_CFLAGS) $(AM_CPPFLAGS) +-test_test_gtk_LDADD = $(GTK_LIBS) gtk/libzbargtk.la $(AM_LDADD) +-endif +- +-if HAVE_QT +-check_PROGRAMS += test/test_qt +-test_test_qt_SOURCES = test/test_qt.cpp test/scan_video.c +-nodist_test_test_qt_SOURCES = test/moc_test_qt.h +-test_test_qt_CPPFLAGS = -Itest $(QT_CFLAGS) $(AM_CPPFLAGS) +-test_test_qt_LDADD = $(QT_LIBS) qt/libzbarqt.la $(AM_LDADD) +-BUILT_SOURCES += $(nodist_test_test_qt_SOURCES) +-DISTCLEANFILES += $(nodist_test_test_qt_SOURCES) +- +-test/moc_%.h: test/%.cpp +- $(MOC) -i $(test_test_qt_CPPFLAGS) $< -o $@ +-endif +- + EXTRA_DIST += test/test_pygtk.py test/test_perl.pl + + # automake bug in "monolithic mode"? +diff --git a/zbarcam/Makefile.am.inc b/zbarcam/Makefile.am.inc +index ea869bcd2e11..5aa788a23da5 100644 +--- a/zbarcam/Makefile.am.inc ++++ b/zbarcam/Makefile.am.inc +@@ -2,7 +2,32 @@ bin_PROGRAMS += zbarcam/zbarcam + zbarcam_zbarcam_SOURCES = zbarcam/zbarcam.c + zbarcam_zbarcam_LDADD = zbar/libzbar.la + # automake bug in "monolithic mode"? +-CLEANFILES += zbarcam/.libs/zbarcam ++CLEANFILES += zbarcam/.libs/zbarcam zbarcam/moc_zbarcam_qt.h ++ ++if HAVE_GTK ++bin_PROGRAMS += zbarcam/zbarcam-gtk ++check_PROGRAMS += zbarcam/zbarcam-gtk ++zbarcam_zbarcam_gtk_SOURCES = zbarcam/zbarcam-gtk.c zbarcam/scan_video.c ++zbarcam_zbarcam_gtk_CPPFLAGS = $(GTK_CFLAGS) $(AM_CPPFLAGS) ++zbarcam_zbarcam_gtk_LDADD = $(GTK_LIBS) gtk/libzbargtk.la $(AM_LDADD) ++endif ++ ++if HAVE_QT ++bin_PROGRAMS += zbarcam/zbarcam-qt ++check_PROGRAMS += zbarcam/zbarcam-qt ++ ++zbarcam_zbarcam_qt_SOURCES = zbarcam/zbarcam-qt.cpp zbarcam/scan_video.c ++nodist_zbarcam_zbarcam_qt_SOURCES = zbarcam/moc_zbarcam_qt.h ++zbarcam_zbarcam_qt_CPPFLAGS = -Izbarcam $(QT_CFLAGS) $(AM_CPPFLAGS) ++zbarcam_zbarcam_qt_LDADD = $(QT_LIBS) qt/libzbarqt.la $(AM_LDADD) ++BUILT_SOURCES += $(nodist_zbarcam_zbarcam_qt_SOURCES) ++DISTCLEANFILES += $(nodist_zbarcam_zbarcam_qt_SOURCES) zbarcam/moc_zbarcam_qt.h ++ ++ ++zbarcam/moc_zbarcam_qt.h: zbarcam/zbarcam-qt.cpp ++ $(MOC) -i $(zbarcam_zbarcam_qt_CPPFLAGS) $< -o $@ ++endif ++ + + if WIN32 + zbarcam_zbarcam_SOURCES += zbarcam/zbarcam.rc +diff --git a/test/scan_video.c b/zbarcam/scan_video.c +similarity index 100% +rename from test/scan_video.c +rename to zbarcam/scan_video.c +diff --git a/test/test_gtk.c b/zbarcam/zbarcam-gtk.c +similarity index 100% +rename from test/test_gtk.c +rename to zbarcam/zbarcam-gtk.c +diff --git a/test/test_qt.cpp b/zbarcam/zbarcam-qt.cpp +similarity index 97% +rename from test/test_qt.cpp +rename to zbarcam/zbarcam-qt.cpp +index 96d2f9541453..3a39a338b59d 100644 +--- a/test/test_qt.cpp ++++ b/zbarcam/zbarcam-qt.cpp +@@ -40,7 +40,7 @@ int scan_video(void *add_device, + const char *default_device); + } + +-class TestQZBar : public QWidget ++class ZbarcamQZBar : public QWidget + { + Q_OBJECT + +@@ -52,7 +52,7 @@ protected: + } + + public: +- TestQZBar (const char *default_device) ++ ZbarcamQZBar (const char *default_device) + { + // drop-down list of video devices + QComboBox *videoList = new QComboBox; +@@ -142,7 +142,7 @@ private: + zbar::QZBar *zbar; + }; + +-#include "moc_test_qt.h" ++#include "moc_zbarcam_qt.h" + + int main (int argc, char *argv[]) + { +@@ -152,7 +152,7 @@ int main (int argc, char *argv[]) + if(argc > 1) + dev = argv[1]; + +- TestQZBar window(dev); ++ ZbarcamQZBar window(dev); + window.show(); + return(app.exec()); + } From 6e78a1e63333e34ca6507163ea8c5f7f45ebb5c5 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Sun, 26 Mar 2017 10:25:01 -0300 Subject: [PATCH 04/99] compile also zbarcam-qt and zbarcam-gtk Those applications are there for a while, but weren't compiled by default, as they used to be at the test directory. Compile them too. For Fedora 25, let's not switch to Qt5, as this could break some other application that would be dependent on libqt4 and zbar-qt. So, let's build it with --without-qt5. On future versions, we'll switch it to qt5. Signed-off-by: Mauro Carvalho Chehab --- zbar.spec | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/zbar.spec b/zbar.spec index 62d9519..b5bf5fb 100644 --- a/zbar.spec +++ b/zbar.spec @@ -3,7 +3,7 @@ Name: zbar Version: 0.10 -Release: 27%{?dist} +Release: 29%{?dist} Summary: Bar code reader Group: User Interface/X Hardware Support @@ -15,6 +15,9 @@ Patch1: zbar_use_libv4l.patch Patch2: zbar_choose_supported_format_first.patch Patch3: zbar_use_REQBUFS_properly.patch Patch4: zbar_configure_ac_use_m4_pattern_allow.patch +Patch5: zbar_add_support_for_qt5.patch +Patch6: zbar_generate_qt_gtk_apps.patch + BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: autoconf automake libtool python-devel gettext-devel @@ -90,10 +93,12 @@ scanning widget. %patch2 -p1 %patch3 -p1 %patch4 -p1 +%patch5 -p1 +%patch6 -p1 %build autoreconf -vfi -%configure --with-graphicsmagick --docdir=%{_docdir}/%{name}-%{version} +%configure --with-graphicsmagick --without-qt5 --docdir=%{_docdir}/%{name}-%{version} # rpath sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool @@ -160,6 +165,7 @@ rm -rf $RPM_BUILD_ROOT %files gtk %defattr(-,root,root,-) %{_libdir}/libzbargtk.so.* +%{_bindir}/zbarcam-gtk %files gtk-devel %defattr(-,root,root,-) @@ -175,6 +181,7 @@ rm -rf $RPM_BUILD_ROOT %files qt %defattr(-,root,root,-) %{_libdir}/libzbarqt.so.* +%{_bindir}/zbarcam-qt %files qt-devel %defattr(-,root,root,-) @@ -183,6 +190,9 @@ rm -rf $RPM_BUILD_ROOT %{_includedir}/zbar/QZBar*.h %changelog +* Sun Mar 26 2017 Mauro Carvalho Chehab - 0.10-29 +- Make zbar-qt to use Qt5 and generate gtk and qt applications + * Tue Jul 19 2016 Fedora Release Engineering - 0.10-27 - https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages From b1573ef1e2403ad6f6262fa224b8650f1cdfe364 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Sun, 26 Mar 2017 10:34:31 -0300 Subject: [PATCH 05/99] Added two missing patches Signed-off-by: Mauro Carvalho Chehab --- zbar_add_support_for_qt5.patch | 140 ++++++++++++++++++++++++++++++ zbar_generate_qt_gtk_apps.patch | 148 ++++++++++++++++++++++++++++++++ 2 files changed, 288 insertions(+) create mode 100644 zbar_add_support_for_qt5.patch create mode 100644 zbar_generate_qt_gtk_apps.patch diff --git a/zbar_add_support_for_qt5.patch b/zbar_add_support_for_qt5.patch new file mode 100644 index 0000000..519645f --- /dev/null +++ b/zbar_add_support_for_qt5.patch @@ -0,0 +1,140 @@ +diff --git a/configure.ac b/configure.ac +index dbd7153fb13b..7bcb18219853 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -476,18 +476,33 @@ AM_CONDITIONAL([HAVE_PYTHON], [test "x$with_python" = "xyes"]) + dnl Qt + AC_ARG_WITH([qt], + [AS_HELP_STRING([--without-qt], +- [disable support for Qt4 widget])], ++ [disable support for Qt widget])], + [], + [with_qt="yes"]) + ++dnl Qt5 ++AC_ARG_WITH([qt5], ++ [AS_HELP_STRING([--without-qt5], ++ [disable support for Qt5 widget. if --with-qt, it will seek only for Qt4])], ++ [], ++ [with_qt5="yes"]) ++ + AC_ARG_VAR([MOC], [full path to Qt moc program]) + + AS_IF([test "x$with_qt" != "xno"], +- [PKG_CHECK_MODULES([QT], [QtCore >= 4 QtGui >= 4]) +- MOC=`$PKG_CONFIG QtGui --variable=moc_location` +- AC_MSG_NOTICE([using moc from $MOC]) +- QT_VERSION=`$PKG_CONFIG QtGui --modversion` +- AC_MSG_NOTICE([using Qt version $QT_VERSION])]) ++ AS_IF([test "x$with_qt5" != "xno"], ++ [PKG_CHECK_MODULES([QT], [Qt5Core >= 5 Qt5Gui >= 5 Qt5Widgets >= 5.0 Qt5X11Extras >= 5.0]) ++ AC_CHECK_PROGS(MOC, [moc-qt5 moc]) ++ AC_MSG_NOTICE([using moc from $MOC]) ++ QT_VERSION=`$PKG_CONFIG Qt5Gui --modversion` ++ CPPFLAGS="$CPPFLAGS $QT_CPPFLAGS -fPIC" ++ AC_MSG_NOTICE([using Qt version $QT_VERSION])], ++ ++ [PKG_CHECK_MODULES([QT], [QtCore >= 4 QtGui >= 4]) ++ MOC=`$PKG_CONFIG QtGui --variable=moc_location` ++ AC_MSG_NOTICE([using moc from $MOC]) ++ QT_VERSION=`$PKG_CONFIG QtGui --modversion` ++ AC_MSG_NOTICE([using Qt version $QT_VERSION])])) + + AM_CONDITIONAL([HAVE_QT], [test "x$with_qt" = "xyes"]) + +@@ -596,9 +611,9 @@ AS_IF([test "x$with_gtk" != "xyes"], + [echo " => the GTK+ widget will *NOT* be built"], + [AS_IF([test "x$with_python" != "xyes"], + [echo " => the PyGTK widget wrapper will *NOT* be built"])]) +-echo "Qt4 --with-qt=$with_qt" ++echo "Qt${QT_VERSION} --with-qt=$with_qt" + AS_IF([test "x$with_qt" != "xyes"], +- [echo " => the Qt4 widget will *NOT* be built"]) ++ [echo " => the Qt widget will *NOT* be built"]) + echo "Java --with-java=$with_java" + AS_IF([test "x$with_java" != "xyes"], + [echo " => the Java interface will *NOT* be built"]) +diff --git a/include/zbar/QZBar.h b/include/zbar/QZBar.h +index 104449928e2d..1a4716565047 100644 +--- a/include/zbar/QZBar.h ++++ b/include/zbar/QZBar.h +@@ -26,7 +26,12 @@ + /// @file + /// Barcode Reader Qt4 Widget + +-#include ++#include ++#if QT_VERSION >= 0x050000 ++# include ++#else ++# include ++#endif + + namespace zbar { + +diff --git a/include/zbar/QZBarImage.h b/include/zbar/QZBarImage.h +index 1505177e07a9..b862c8085576 100644 +--- a/include/zbar/QZBarImage.h ++++ b/include/zbar/QZBarImage.h +@@ -54,7 +54,11 @@ public: + unsigned height = qimg.height(); + set_size(width, height); + set_format(zbar_fourcc('B','G','R','4')); ++#if QT_VERSION >= 0x050000 ++ unsigned long datalen = qimg.byteCount(); ++#else + unsigned long datalen = qimg.numBytes(); ++#endif + set_data(qimg.bits(), datalen); + + if((width * 4 != bpl) || +diff --git a/qt/QZBar.cpp b/qt/QZBar.cpp +index e1001b09cff5..a5b956b342ad 100644 +--- a/qt/QZBar.cpp ++++ b/qt/QZBar.cpp +@@ -23,7 +23,7 @@ + + #include + #include +-#include ++#include + #include + #include "QZBarThread.h" + +@@ -49,7 +49,11 @@ QZBar::QZBar (QWidget *parent) + + thread = new QZBarThread; + if(testAttribute(Qt::WA_WState_Created)) { ++#if QT_VERSION >= 0x050000 ++ thread->window.attach(QX11Info::display(), winId()); ++#else + thread->window.attach(x11Info().display(), winId()); ++#endif + _attached = 1; + } + connect(thread, SIGNAL(videoOpened(bool)), +@@ -204,7 +208,12 @@ void QZBar::changeEvent(QEvent *event) + try { + QMutexLocker locker(&thread->mutex); + if(event->type() == QEvent::ParentChange) ++#if QT_VERSION >= 0x050000 ++ thread->window.attach(QX11Info::display(), winId()); ++#else + thread->window.attach(x11Info().display(), winId()); ++#endif ++ + } + catch(Exception) { /* ignore (FIXME do something w/error) */ } + } +@@ -215,7 +224,11 @@ void QZBar::attach () + return; + + try { ++#if QT_VERSION >= 0x050000 ++ thread->window.attach(QX11Info::display(), winId()); ++#else + thread->window.attach(x11Info().display(), winId()); ++#endif + _attached = 1; + + _videoEnabled = !_videoDevice.isEmpty(); diff --git a/zbar_generate_qt_gtk_apps.patch b/zbar_generate_qt_gtk_apps.patch new file mode 100644 index 0000000..17c6856 --- /dev/null +++ b/zbar_generate_qt_gtk_apps.patch @@ -0,0 +1,148 @@ +From 76a286fd34d5159b55de4d4f276dcbf69d1b263e Mon Sep 17 00:00:00 2001 +From: Mauro Carvalho Chehab +Date: Sun, 26 Mar 2017 09:43:07 -0300 +Subject: [PATCH] zbarcam: add qt and gtk variants + +The original zbarcam use standard X11 libraries to display +video. That provides an ugly interface, and could be +slow on high resolutions. + +As Zbar has already test examples for qt and gtk, let's +promote them to real applications. One advantage is that +both qt and gtk libraries will be tested when building +those. + +Signed-off-by: Mauro Carvalho Chehab + +diff --git a/qt/Makefile.am.inc b/qt/Makefile.am.inc +index dc1525e0d52a..5f860bfa31bc 100644 +--- a/qt/Makefile.am.inc ++++ b/qt/Makefile.am.inc +@@ -7,6 +7,7 @@ qt_libzbarqt_la_SOURCES = qt/QZBar.cpp qt/QZBarThread.h qt/QZBarThread.cpp + nodist_qt_libzbarqt_la_SOURCES = qt/moc_QZBar.cpp qt/moc_QZBarThread.cpp + BUILT_SOURCES += $(nodist_qt_libzbarqt_la_SOURCES) + DISTCLEANFILES += $(nodist_qt_libzbarqt_la_SOURCES) ++CLEANFILES += qt/moc_%.cpp + + qt/moc_%.cpp: qt/%.h + $(MOC) $(qt_libzbarqt_la_CPPFLAGS) $< -o $@ +diff --git a/test/Makefile.am.inc b/test/Makefile.am.inc +index 7340a7f2f61f..8496eb30f3cc 100644 +--- a/test/Makefile.am.inc ++++ b/test/Makefile.am.inc +@@ -45,26 +45,6 @@ test_dbg_scan_CPPFLAGS = $(MAGICK_CFLAGS) $(AM_CPPFLAGS) + test_dbg_scan_LDADD = $(MAGICK_LIBS) -lMagick++ zbar/libzbar.la $(AM_LDADD) + endif + +-if HAVE_GTK +-check_PROGRAMS += test/test_gtk +-test_test_gtk_SOURCES = test/test_gtk.c test/scan_video.c +-test_test_gtk_CPPFLAGS = $(GTK_CFLAGS) $(AM_CPPFLAGS) +-test_test_gtk_LDADD = $(GTK_LIBS) gtk/libzbargtk.la $(AM_LDADD) +-endif +- +-if HAVE_QT +-check_PROGRAMS += test/test_qt +-test_test_qt_SOURCES = test/test_qt.cpp test/scan_video.c +-nodist_test_test_qt_SOURCES = test/moc_test_qt.h +-test_test_qt_CPPFLAGS = -Itest $(QT_CFLAGS) $(AM_CPPFLAGS) +-test_test_qt_LDADD = $(QT_LIBS) qt/libzbarqt.la $(AM_LDADD) +-BUILT_SOURCES += $(nodist_test_test_qt_SOURCES) +-DISTCLEANFILES += $(nodist_test_test_qt_SOURCES) +- +-test/moc_%.h: test/%.cpp +- $(MOC) -i $(test_test_qt_CPPFLAGS) $< -o $@ +-endif +- + EXTRA_DIST += test/test_pygtk.py test/test_perl.pl + + # automake bug in "monolithic mode"? +diff --git a/zbarcam/Makefile.am.inc b/zbarcam/Makefile.am.inc +index ea869bcd2e11..5aa788a23da5 100644 +--- a/zbarcam/Makefile.am.inc ++++ b/zbarcam/Makefile.am.inc +@@ -2,7 +2,32 @@ bin_PROGRAMS += zbarcam/zbarcam + zbarcam_zbarcam_SOURCES = zbarcam/zbarcam.c + zbarcam_zbarcam_LDADD = zbar/libzbar.la + # automake bug in "monolithic mode"? +-CLEANFILES += zbarcam/.libs/zbarcam ++CLEANFILES += zbarcam/.libs/zbarcam zbarcam/moc_zbarcam_qt.h ++ ++if HAVE_GTK ++bin_PROGRAMS += zbarcam/zbarcam-gtk ++check_PROGRAMS += zbarcam/zbarcam-gtk ++zbarcam_zbarcam_gtk_SOURCES = zbarcam/zbarcam-gtk.c zbarcam/scan_video.c ++zbarcam_zbarcam_gtk_CPPFLAGS = $(GTK_CFLAGS) $(AM_CPPFLAGS) ++zbarcam_zbarcam_gtk_LDADD = $(GTK_LIBS) gtk/libzbargtk.la $(AM_LDADD) ++endif ++ ++if HAVE_QT ++bin_PROGRAMS += zbarcam/zbarcam-qt ++check_PROGRAMS += zbarcam/zbarcam-qt ++ ++zbarcam_zbarcam_qt_SOURCES = zbarcam/zbarcam-qt.cpp zbarcam/scan_video.c ++nodist_zbarcam_zbarcam_qt_SOURCES = zbarcam/moc_zbarcam_qt.h ++zbarcam_zbarcam_qt_CPPFLAGS = -Izbarcam $(QT_CFLAGS) $(AM_CPPFLAGS) ++zbarcam_zbarcam_qt_LDADD = $(QT_LIBS) qt/libzbarqt.la $(AM_LDADD) ++BUILT_SOURCES += $(nodist_zbarcam_zbarcam_qt_SOURCES) ++DISTCLEANFILES += $(nodist_zbarcam_zbarcam_qt_SOURCES) zbarcam/moc_zbarcam_qt.h ++ ++ ++zbarcam/moc_zbarcam_qt.h: zbarcam/zbarcam-qt.cpp ++ $(MOC) -i $(zbarcam_zbarcam_qt_CPPFLAGS) $< -o $@ ++endif ++ + + if WIN32 + zbarcam_zbarcam_SOURCES += zbarcam/zbarcam.rc +diff --git a/test/scan_video.c b/zbarcam/scan_video.c +similarity index 100% +rename from test/scan_video.c +rename to zbarcam/scan_video.c +diff --git a/test/test_gtk.c b/zbarcam/zbarcam-gtk.c +similarity index 100% +rename from test/test_gtk.c +rename to zbarcam/zbarcam-gtk.c +diff --git a/test/test_qt.cpp b/zbarcam/zbarcam-qt.cpp +similarity index 97% +rename from test/test_qt.cpp +rename to zbarcam/zbarcam-qt.cpp +index 96d2f9541453..3a39a338b59d 100644 +--- a/test/test_qt.cpp ++++ b/zbarcam/zbarcam-qt.cpp +@@ -40,7 +40,7 @@ int scan_video(void *add_device, + const char *default_device); + } + +-class TestQZBar : public QWidget ++class ZbarcamQZBar : public QWidget + { + Q_OBJECT + +@@ -52,7 +52,7 @@ protected: + } + + public: +- TestQZBar (const char *default_device) ++ ZbarcamQZBar (const char *default_device) + { + // drop-down list of video devices + QComboBox *videoList = new QComboBox; +@@ -142,7 +142,7 @@ private: + zbar::QZBar *zbar; + }; + +-#include "moc_test_qt.h" ++#include "moc_zbarcam_qt.h" + + int main (int argc, char *argv[]) + { +@@ -152,7 +152,7 @@ int main (int argc, char *argv[]) + if(argc > 1) + dev = argv[1]; + +- TestQZBar window(dev); ++ ZbarcamQZBar window(dev); + window.show(); + return(app.exec()); + } From 8793112f3495587aa3cfba32ab350e723d94fd86 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Mon, 3 Apr 2017 17:50:50 -0300 Subject: [PATCH 06/99] Fix qt5 dependencies Signed-off-by: Mauro Carvalho Chehab --- zbar.spec | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/zbar.spec b/zbar.spec index fe85b4a..f1d49fb 100644 --- a/zbar.spec +++ b/zbar.spec @@ -21,7 +21,8 @@ Patch6: zbar_generate_qt_gtk_apps.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: autoconf automake libtool python-devel gettext-devel -BuildRequires: qt4-devel gtk2-devel pygtk2-devel GraphicsMagick-c++-devel +BuildRequires: qt5-qtbase-devel qt5-qtx11extras +BuildRequires: gtk2-devel pygtk2-devel GraphicsMagick-c++-devel BuildRequires: libv4l-devel libXv-devel xmlto %description From ff06c02600926afd3777261a7a7f149648b0d198 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Mon, 3 Apr 2017 21:09:18 -0300 Subject: [PATCH 07/99] zbar.spec: add qt5-qtx11extras-devel dependency Signed-off-by: Mauro Carvalho Chehab --- zbar.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zbar.spec b/zbar.spec index f1d49fb..4df8ab7 100644 --- a/zbar.spec +++ b/zbar.spec @@ -21,7 +21,7 @@ Patch6: zbar_generate_qt_gtk_apps.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: autoconf automake libtool python-devel gettext-devel -BuildRequires: qt5-qtbase-devel qt5-qtx11extras +BuildRequires: qt5-qtbase-devel qt5-qtx11extras-devel BuildRequires: gtk2-devel pygtk2-devel GraphicsMagick-c++-devel BuildRequires: libv4l-devel libXv-devel xmlto From 658da811302fec4ca44f10f01e647a28d003520f Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Tue, 11 Apr 2017 14:03:39 -0300 Subject: [PATCH 08/99] Bump to version 0.20 Point to the new place where we're storing zbar tarballs and bump it to version 0.20. Signed-off-by: Mauro Carvalho Chehab --- .gitignore | 1 + sources | 2 +- zbar.spec | 27 ++++++++------------------- 3 files changed, 10 insertions(+), 20 deletions(-) diff --git a/.gitignore b/.gitignore index f0c8280..4776e5c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ zbar-0.10.tar.bz2 /zbar-0.10.tar.bz2 +/zbar-0.20.tar.bz2 diff --git a/sources b/sources index e58d80a..b19f94e 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -d8b9dddcf28d6603d8b066816941a9d2 zbar-0.10.tar.bz2 +SHA512 (zbar-0.20.tar.bz2) = 776c75c1b43197645b0daa2e490dbe7ccf7fe0117a6bf96325357904c8974880a313a55dc1c5c8c8dc5bc7a94ce2dd762cdd203fdf1e0bce6b30d5ce9dc1bc29 diff --git a/zbar.spec b/zbar.spec index 4df8ab7..9958342 100644 --- a/zbar.spec +++ b/zbar.spec @@ -2,21 +2,14 @@ %{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")} Name: zbar -Version: 0.10 -Release: 29%{?dist} +Version: 0.20 +Release: 1%{?dist} Summary: Bar code reader Group: User Interface/X Hardware Support License: LGPLv2+ URL: http://zbar.sourceforge.net/ -Source0: http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.bz2 -Patch0: zbar_update_to_hg.patch -Patch1: zbar_use_libv4l.patch -Patch2: zbar_choose_supported_format_first.patch -Patch3: zbar_use_REQBUFS_properly.patch -Patch4: zbar_configure_ac_use_m4_pattern_allow.patch -Patch5: zbar_add_support_for_qt5.patch -Patch6: zbar_generate_qt_gtk_apps.patch +Source0: https://linuxtv.org/downloads/%{name}/%{name}-%{version}.tar.bz2 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -89,17 +82,10 @@ scanning widget. %prep %setup -q -%patch0 -p1 -%patch1 -p1 -%patch2 -p1 -%patch3 -p1 -%patch4 -p1 -%patch5 -p1 -%patch6 -p1 %build autoreconf -vfi -%configure --with-graphicsmagick --docdir=%{_docdir}/%{name}-%{version} +%configure --without-java --with-graphicsmagick --docdir=%{_docdir}/%{name}-%{version} # rpath sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool @@ -115,7 +101,7 @@ make install DESTDIR=$RPM_BUILD_ROOT INSTALL="install -p" find ${RPM_BUILD_ROOT} -name '*.la' -or -name '*.a' | xargs rm -f # Remove installed doc -rm -rf $RPM_BUILD_ROOT/usr/share/doc/zbar-0.10/ +rm -rf $RPM_BUILD_ROOT/usr/share/doc/zbar-%{version}/ %clean rm -rf $RPM_BUILD_ROOT @@ -191,6 +177,9 @@ rm -rf $RPM_BUILD_ROOT %{_includedir}/zbar/QZBar*.h %changelog +* Tue Apr 11 2017 Mauro Carvalho Chehab - 0.20-1 +- Update it to version 0.20 with brings V4L2 controls to zbarcam-qt + * Sun Mar 26 2017 Mauro Carvalho Chehab - 0.10-29 - Make zbar-qt to use Qt5 and generate gtk and qt applications From 4457e7c741ccda384202f9ca27dbdf93708d7db1 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Tue, 11 Apr 2017 14:44:36 -0300 Subject: [PATCH 09/99] Bump to version 0.20 Point to the new place where we're storing zbar tarballs and bump it to version 0.20. Signed-off-by: Mauro Carvalho Chehab --- .gitignore | 1 + sources | 2 +- zbar.spec | 27 ++++++++------------------- 3 files changed, 10 insertions(+), 20 deletions(-) diff --git a/.gitignore b/.gitignore index f0c8280..4776e5c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ zbar-0.10.tar.bz2 /zbar-0.10.tar.bz2 +/zbar-0.20.tar.bz2 diff --git a/sources b/sources index e58d80a..4148b2d 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -d8b9dddcf28d6603d8b066816941a9d2 zbar-0.10.tar.bz2 +SHA512 (zbar-0.20.tar.bz2) = d967b250d2bf021aa02583751dc62ffc3f8d220224df1a3644f52eee6d0ec5bd5c5cceb36c3d765a85afafd7a0ba182ed9d8263ef1be1852456687b687de5375 diff --git a/zbar.spec b/zbar.spec index b5bf5fb..45148b3 100644 --- a/zbar.spec +++ b/zbar.spec @@ -2,21 +2,14 @@ %{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")} Name: zbar -Version: 0.10 -Release: 29%{?dist} +Version: 0.20 +Release: 1%{?dist} Summary: Bar code reader Group: User Interface/X Hardware Support License: LGPLv2+ URL: http://zbar.sourceforge.net/ -Source0: http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.bz2 -Patch0: zbar_update_to_hg.patch -Patch1: zbar_use_libv4l.patch -Patch2: zbar_choose_supported_format_first.patch -Patch3: zbar_use_REQBUFS_properly.patch -Patch4: zbar_configure_ac_use_m4_pattern_allow.patch -Patch5: zbar_add_support_for_qt5.patch -Patch6: zbar_generate_qt_gtk_apps.patch +Source0: https://linuxtv.org/downloads/%{name}/%{name}-%{version}.tar.bz2 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -88,17 +81,10 @@ scanning widget. %prep %setup -q -%patch0 -p1 -%patch1 -p1 -%patch2 -p1 -%patch3 -p1 -%patch4 -p1 -%patch5 -p1 -%patch6 -p1 %build autoreconf -vfi -%configure --with-graphicsmagick --without-qt5 --docdir=%{_docdir}/%{name}-%{version} +%configure --without-java --with-graphicsmagick --without-qt5 --docdir=%{_docdir}/%{name}-%{version} # rpath sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool @@ -114,7 +100,7 @@ make install DESTDIR=$RPM_BUILD_ROOT INSTALL="install -p" find ${RPM_BUILD_ROOT} -name '*.la' -or -name '*.a' | xargs rm -f # Remove installed doc -rm -rf $RPM_BUILD_ROOT/usr/share/doc/zbar-0.10/ +rm -rf $RPM_BUILD_ROOT/usr/share/doc/zbar-%{version}/ %clean rm -rf $RPM_BUILD_ROOT @@ -190,6 +176,9 @@ rm -rf $RPM_BUILD_ROOT %{_includedir}/zbar/QZBar*.h %changelog +* Tue Apr 11 2017 Mauro Carvalho Chehab - 0.20-1 +- Update it to version 0.20 with brings V4L2 controls to zbarcam-qt + * Sun Mar 26 2017 Mauro Carvalho Chehab - 0.10-29 - Make zbar-qt to use Qt5 and generate gtk and qt applications From befb62003058ee16d3809a77bbfd88a7cb5b31a3 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Tue, 11 Apr 2017 14:53:45 -0300 Subject: [PATCH 10/99] Use the right source file There was a problem with the older tarball upstream, causing it to increment version number on a wrong way. This was fixed, but the new tarball need to be used. Signed-off-by: Mauro Carvalho Chehab --- sources | 2 +- zbar.spec | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sources b/sources index b19f94e..4148b2d 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (zbar-0.20.tar.bz2) = 776c75c1b43197645b0daa2e490dbe7ccf7fe0117a6bf96325357904c8974880a313a55dc1c5c8c8dc5bc7a94ce2dd762cdd203fdf1e0bce6b30d5ce9dc1bc29 +SHA512 (zbar-0.20.tar.bz2) = d967b250d2bf021aa02583751dc62ffc3f8d220224df1a3644f52eee6d0ec5bd5c5cceb36c3d765a85afafd7a0ba182ed9d8263ef1be1852456687b687de5375 diff --git a/zbar.spec b/zbar.spec index 9958342..20f9f73 100644 --- a/zbar.spec +++ b/zbar.spec @@ -3,7 +3,7 @@ Name: zbar Version: 0.20 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Bar code reader Group: User Interface/X Hardware Support From 9dc8307e57aad0ae8a05761551d7f6a22c870fe9 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Tue, 11 Apr 2017 15:03:36 -0300 Subject: [PATCH 11/99] Make rpmlint happy - Remove weird white spaces; - don't mix tabs with white spaces; - Use "bar code" instead of: "barcode". - Use "e. g." instead of "eg". Signed-off-by: Mauro Carvalho Chehab --- zbar.spec | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/zbar.spec b/zbar.spec index 20f9f73..a1591ce 100644 --- a/zbar.spec +++ b/zbar.spec @@ -1,28 +1,28 @@ %{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} %{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")} -Name: zbar -Version: 0.20 -Release: 2%{?dist} -Summary: Bar code reader +Name: zbar +Version: 0.20 +Release: 2%{?dist} +Summary: Bar code reader -Group: User Interface/X Hardware Support -License: LGPLv2+ -URL: http://zbar.sourceforge.net/ -Source0: https://linuxtv.org/downloads/%{name}/%{name}-%{version}.tar.bz2 +Group: User Interface/X Hardware Support +License: LGPLv2+ +URL: http://zbar.sourceforge.net/ +Source0: https://linuxtv.org/downloads/%{name}/%{name}-%{version}.tar.bz2 + +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) -BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) - BuildRequires: autoconf automake libtool python-devel gettext-devel BuildRequires: qt5-qtbase-devel qt5-qtx11extras-devel BuildRequires: gtk2-devel pygtk2-devel GraphicsMagick-c++-devel BuildRequires: libv4l-devel libXv-devel xmlto %description -A layered barcode scanning and decoding library. Supports EAN, UPC, Code 128, +A layered bar code scanning and decoding library. Supports EAN, UPC, Code 128, Code 39 and Interleaved 2 of 5. -Includes applications for decoding captured barcode images and using a video -device (eg, webcam) as a barcode scanner. +Includes applications for decoding captured bar code images and using a video +device (e. g., webcam) as a bar code scanner. %package devel Group: Development/Libraries @@ -282,7 +282,7 @@ rm -rf $RPM_BUILD_ROOT - Removed ldconfig calls to devel subpackages - Fixed directory ownership issue -pygtk - Added %%{name} to URL -- Added comment to rpath +- Added comment to rpath - Improved comment for removing .la and .a files * Mon Jul 27 2009 Douglas Schilling Landgraf - 0.8-4 @@ -292,7 +292,7 @@ rm -rf $RPM_BUILD_ROOT - Removed Provides for not included static libs - Removed redundant requires to subpackages -qt and -gtk - Removed redundant {name} = %%{version}-%%{release} from -pygtk -- Replaced macros from % to %% in changelog +- Replaced macros from % to %% in changelog - Fixed ownership issue - Added ldconfig call to devel, qt-devel and gtk-devel @@ -319,8 +319,8 @@ rm -rf $RPM_BUILD_ROOT - Fixed rpath error * Thu Jul 16 2009 Douglas Schilling Landgraf - 0.8-2 -- Added pkgconfig to devel package -- Fixed syntax to ldconfig +- Added pkgconfig to devel package +- Fixed syntax to ldconfig - Fixed warnings from rpmlint - Fixed static path to docs From 29f2f8e92ca6061ea6dcf2da722af5a2f0d625ff Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Tue, 11 Apr 2017 15:07:33 -0300 Subject: [PATCH 12/99] Make rpmlint happy - Remove weird white spaces; - don't mix tabs with white spaces; - Use "bar code" instead of: "barcode". - Use "e. g." instead of "eg". Signed-off-by: Mauro Carvalho Chehab --- zbar.spec | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/zbar.spec b/zbar.spec index 45148b3..2c3296b 100644 --- a/zbar.spec +++ b/zbar.spec @@ -1,27 +1,27 @@ %{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} %{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")} -Name: zbar -Version: 0.20 -Release: 1%{?dist} -Summary: Bar code reader +Name: zbar +Version: 0.20 +Release: 1%{?dist} +Summary: Bar code reader -Group: User Interface/X Hardware Support -License: LGPLv2+ -URL: http://zbar.sourceforge.net/ -Source0: https://linuxtv.org/downloads/%{name}/%{name}-%{version}.tar.bz2 +Group: User Interface/X Hardware Support +License: LGPLv2+ +URL: http://zbar.sourceforge.net/ +Source0: https://linuxtv.org/downloads/%{name}/%{name}-%{version}.tar.bz2 + +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) -BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) - BuildRequires: autoconf automake libtool python-devel gettext-devel BuildRequires: qt4-devel gtk2-devel pygtk2-devel GraphicsMagick-c++-devel BuildRequires: libv4l-devel libXv-devel xmlto %description -A layered barcode scanning and decoding library. Supports EAN, UPC, Code 128, +A layered bar code scanning and decoding library. Supports EAN, UPC, Code 128, Code 39 and Interleaved 2 of 5. -Includes applications for decoding captured barcode images and using a video -device (eg, webcam) as a barcode scanner. +Includes applications for decoding captured bar code images and using a video +device (e. g., webcam) as a bar code scanner. %package devel Group: Development/Libraries @@ -278,7 +278,7 @@ rm -rf $RPM_BUILD_ROOT - Removed ldconfig calls to devel subpackages - Fixed directory ownership issue -pygtk - Added %%{name} to URL -- Added comment to rpath +- Added comment to rpath - Improved comment for removing .la and .a files * Mon Jul 27 2009 Douglas Schilling Landgraf - 0.8-4 @@ -288,7 +288,7 @@ rm -rf $RPM_BUILD_ROOT - Removed Provides for not included static libs - Removed redundant requires to subpackages -qt and -gtk - Removed redundant {name} = %%{version}-%%{release} from -pygtk -- Replaced macros from % to %% in changelog +- Replaced macros from % to %% in changelog - Fixed ownership issue - Added ldconfig call to devel, qt-devel and gtk-devel @@ -315,8 +315,8 @@ rm -rf $RPM_BUILD_ROOT - Fixed rpath error * Thu Jul 16 2009 Douglas Schilling Landgraf - 0.8-2 -- Added pkgconfig to devel package -- Fixed syntax to ldconfig +- Added pkgconfig to devel package +- Fixed syntax to ldconfig - Fixed warnings from rpmlint - Fixed static path to docs From 2896e095139818cd875e69107f75787aea775045 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 27 Jul 2017 22:41:07 +0000 Subject: [PATCH 13/99] - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild --- zbar.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/zbar.spec b/zbar.spec index a1591ce..d1d9fe5 100644 --- a/zbar.spec +++ b/zbar.spec @@ -3,7 +3,7 @@ Name: zbar Version: 0.20 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Bar code reader Group: User Interface/X Hardware Support @@ -177,6 +177,9 @@ rm -rf $RPM_BUILD_ROOT %{_includedir}/zbar/QZBar*.h %changelog +* Thu Jul 27 2017 Fedora Release Engineering - 0.20-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + * Tue Apr 11 2017 Mauro Carvalho Chehab - 0.20-1 - Update it to version 0.20 with brings V4L2 controls to zbarcam-qt From 7877cf2706e0ce8168ee99b58ac79535fc6caf7f Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 3 Aug 2017 11:09:35 +0000 Subject: [PATCH 14/99] - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild --- zbar.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/zbar.spec b/zbar.spec index d1d9fe5..adeb201 100644 --- a/zbar.spec +++ b/zbar.spec @@ -3,7 +3,7 @@ Name: zbar Version: 0.20 -Release: 3%{?dist} +Release: 4%{?dist} Summary: Bar code reader Group: User Interface/X Hardware Support @@ -177,6 +177,9 @@ rm -rf $RPM_BUILD_ROOT %{_includedir}/zbar/QZBar*.h %changelog +* Thu Aug 03 2017 Fedora Release Engineering - 0.20-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild + * Thu Jul 27 2017 Fedora Release Engineering - 0.20-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild From b2260ef693bfad80695e4719240d6a1483bd4b77 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 9 Feb 2018 22:25:11 +0000 Subject: [PATCH 15/99] - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- zbar.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/zbar.spec b/zbar.spec index adeb201..3e8ee19 100644 --- a/zbar.spec +++ b/zbar.spec @@ -3,7 +3,7 @@ Name: zbar Version: 0.20 -Release: 4%{?dist} +Release: 5%{?dist} Summary: Bar code reader Group: User Interface/X Hardware Support @@ -177,6 +177,9 @@ rm -rf $RPM_BUILD_ROOT %{_includedir}/zbar/QZBar*.h %changelog +* Fri Feb 09 2018 Fedora Release Engineering - 0.20-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + * Thu Aug 03 2017 Fedora Release Engineering - 0.20-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild From 08e8c3cb2fa98c9276eb9b4ee53c0f6ad26979c9 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Wed, 14 Feb 2018 00:52:35 +0100 Subject: [PATCH 16/99] Remove BuildRoot definition None of currently supported distributions need that. It was needed last for EL5 which is EOL now Signed-off-by: Igor Gnatenko --- zbar.spec | 1 - 1 file changed, 1 deletion(-) diff --git a/zbar.spec b/zbar.spec index 3e8ee19..4e5f0fc 100644 --- a/zbar.spec +++ b/zbar.spec @@ -11,7 +11,6 @@ License: LGPLv2+ URL: http://zbar.sourceforge.net/ Source0: https://linuxtv.org/downloads/%{name}/%{name}-%{version}.tar.bz2 -BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: autoconf automake libtool python-devel gettext-devel BuildRequires: qt5-qtbase-devel qt5-qtx11extras-devel From 9e080c57c021dd55f2fd2d3f5acc4d0b23a3d7c0 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Wed, 14 Feb 2018 09:02:50 +0100 Subject: [PATCH 17/99] Remove %clean section None of currently supported distributions need that. Last one was EL5 which is EOL for a while. Signed-off-by: Igor Gnatenko --- zbar.spec | 3 --- 1 file changed, 3 deletions(-) diff --git a/zbar.spec b/zbar.spec index 4e5f0fc..2d4f2a4 100644 --- a/zbar.spec +++ b/zbar.spec @@ -102,9 +102,6 @@ find ${RPM_BUILD_ROOT} -name '*.la' -or -name '*.a' | xargs rm -f # Remove installed doc rm -rf $RPM_BUILD_ROOT/usr/share/doc/zbar-%{version}/ -%clean -rm -rf $RPM_BUILD_ROOT - %post -p /sbin/ldconfig %post devel -p /sbin/ldconfig From 564f3745618e23f54b8ed0ef3b125470985c4ee2 Mon Sep 17 00:00:00 2001 From: Iryna Shcherbina Date: Wed, 14 Feb 2018 17:28:07 +0100 Subject: [PATCH 18/99] Update Python 2 dependency declarations to new packaging standards --- zbar.spec | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/zbar.spec b/zbar.spec index 2d4f2a4..c9d1041 100644 --- a/zbar.spec +++ b/zbar.spec @@ -3,7 +3,7 @@ Name: zbar Version: 0.20 -Release: 5%{?dist} +Release: 6%{?dist} Summary: Bar code reader Group: User Interface/X Hardware Support @@ -12,7 +12,7 @@ URL: http://zbar.sourceforge.net/ Source0: https://linuxtv.org/downloads/%{name}/%{name}-%{version}.tar.bz2 -BuildRequires: autoconf automake libtool python-devel gettext-devel +BuildRequires: autoconf automake libtool python2-devel gettext-devel BuildRequires: qt5-qtbase-devel qt5-qtx11extras-devel BuildRequires: gtk2-devel pygtk2-devel GraphicsMagick-c++-devel BuildRequires: libv4l-devel libXv-devel xmlto @@ -173,6 +173,10 @@ rm -rf $RPM_BUILD_ROOT/usr/share/doc/zbar-%{version}/ %{_includedir}/zbar/QZBar*.h %changelog +* Wed Feb 14 2018 Iryna Shcherbina - 0.20-6 +- Update Python 2 dependency declarations to new packaging standards + (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3) + * Fri Feb 09 2018 Fedora Release Engineering - 0.20-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild From cc5b455a3183c37f96f7b8369391f1fead490dff Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Thu, 24 May 2018 12:50:53 -0400 Subject: [PATCH 19/99] Only build pygtk support on Fedora --- zbar.spec | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/zbar.spec b/zbar.spec index c9d1041..f8a548e 100644 --- a/zbar.spec +++ b/zbar.spec @@ -12,10 +12,15 @@ URL: http://zbar.sourceforge.net/ Source0: https://linuxtv.org/downloads/%{name}/%{name}-%{version}.tar.bz2 -BuildRequires: autoconf automake libtool python2-devel gettext-devel +BuildRequires: autoconf automake libtool gettext-devel BuildRequires: qt5-qtbase-devel qt5-qtx11extras-devel -BuildRequires: gtk2-devel pygtk2-devel GraphicsMagick-c++-devel +BuildRequires: gtk2-devel GraphicsMagick-c++-devel BuildRequires: libv4l-devel libXv-devel xmlto +%if 0%{?fedora} +BuildRequires: python2-devel pygtk2-devel +%else +%global without_python --without-python +%endif %description A layered bar code scanning and decoding library. Supports EAN, UPC, Code 128, @@ -51,6 +56,7 @@ This package contains header files and additional libraries used for developing GUI applications based on GTK+-2.0 that include a bar code scanning widget. +%if 0%{?fedora} %package pygtk Group: Development/Libraries Summary: Bar code reader PyGTK widget @@ -59,6 +65,7 @@ Requires: pygtk2, %{name}-gtk = %{version}-%{release} %description pygtk This package contains a bar code scanning widget for use in GUI applications based on PyGTK. +%endif %package qt Group: Development/Libraries @@ -84,7 +91,7 @@ scanning widget. %build autoreconf -vfi -%configure --without-java --with-graphicsmagick --docdir=%{_docdir}/%{name}-%{version} +%configure --without-java --with-graphicsmagick --docdir=%{_docdir}/%{name}-%{version} %{?without_python} # rpath sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool @@ -156,10 +163,12 @@ rm -rf $RPM_BUILD_ROOT/usr/share/doc/zbar-%{version}/ %{_libdir}/pkgconfig/zbar-gtk.pc %{_includedir}/zbar/zbargtk.h +%if 0%{?fedora} %files pygtk %defattr(-,root,root,-) %{python_sitearch}/zbarpygtk.so %{python_sitearch}/zbar.so +%endif %files qt %defattr(-,root,root,-) From 1b7ace63bed41d82e87598015091eb754c7226d0 Mon Sep 17 00:00:00 2001 From: Jason Tibbitts Date: Mon, 9 Jul 2018 23:14:27 -0500 Subject: [PATCH 20/99] Remove needless use of %defattr --- zbar.spec | 7 ------- 1 file changed, 7 deletions(-) diff --git a/zbar.spec b/zbar.spec index f8a548e..2bd8366 100644 --- a/zbar.spec +++ b/zbar.spec @@ -126,7 +126,6 @@ rm -rf $RPM_BUILD_ROOT/usr/share/doc/zbar-%{version}/ %postun qt -p /sbin/ldconfig %files -%defattr(-,root,root,-) %doc COPYING LICENSE NEWS %{_bindir}/zbarimg @@ -135,7 +134,6 @@ rm -rf $RPM_BUILD_ROOT/usr/share/doc/zbar-%{version}/ %{_mandir}/man1/* %files devel -%defattr(-,root,root,-) %doc HACKING TODO %{_libdir}/libzbar.so @@ -153,30 +151,25 @@ rm -rf $RPM_BUILD_ROOT/usr/share/doc/zbar-%{version}/ %{_includedir}/zbar/Processor.h %files gtk -%defattr(-,root,root,-) %{_libdir}/libzbargtk.so.* %{_bindir}/zbarcam-gtk %files gtk-devel -%defattr(-,root,root,-) %{_libdir}/libzbargtk.so %{_libdir}/pkgconfig/zbar-gtk.pc %{_includedir}/zbar/zbargtk.h %if 0%{?fedora} %files pygtk -%defattr(-,root,root,-) %{python_sitearch}/zbarpygtk.so %{python_sitearch}/zbar.so %endif %files qt -%defattr(-,root,root,-) %{_libdir}/libzbarqt.so.* %{_bindir}/zbarcam-qt %files qt-devel -%defattr(-,root,root,-) %{_libdir}/libzbarqt.so %{_libdir}/pkgconfig/zbar-qt.pc %{_includedir}/zbar/QZBar*.h From 8f63028ae5eb5d8bebb78bd3b9d400260ed24bd1 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 14 Jul 2018 09:48:35 +0000 Subject: [PATCH 21/99] - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- zbar.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/zbar.spec b/zbar.spec index 2bd8366..abccde1 100644 --- a/zbar.spec +++ b/zbar.spec @@ -3,7 +3,7 @@ Name: zbar Version: 0.20 -Release: 6%{?dist} +Release: 7%{?dist} Summary: Bar code reader Group: User Interface/X Hardware Support @@ -175,6 +175,9 @@ rm -rf $RPM_BUILD_ROOT/usr/share/doc/zbar-%{version}/ %{_includedir}/zbar/QZBar*.h %changelog +* Sat Jul 14 2018 Fedora Release Engineering - 0.20-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild + * Wed Feb 14 2018 Iryna Shcherbina - 0.20-6 - Update Python 2 dependency declarations to new packaging standards (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3) From 53f2cbce7a3ade2737acb2c0f9f0b3d4cbf30a7f Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Mon, 30 Jul 2018 00:22:29 +0200 Subject: [PATCH 22/99] =?UTF-8?q?%{python=5Fsitearch}=20=E2=86=92=20%{pyth?= =?UTF-8?q?on2=5Fsitearch}?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Igor Gnatenko --- zbar.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zbar.spec b/zbar.spec index abccde1..05496b6 100644 --- a/zbar.spec +++ b/zbar.spec @@ -161,8 +161,8 @@ rm -rf $RPM_BUILD_ROOT/usr/share/doc/zbar-%{version}/ %if 0%{?fedora} %files pygtk -%{python_sitearch}/zbarpygtk.so -%{python_sitearch}/zbar.so +%{python2_sitearch}/zbarpygtk.so +%{python2_sitearch}/zbar.so %endif %files qt From 9c48b8c57a70c082af8df707f2797e0a14b450f4 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Tue, 7 Aug 2018 15:06:35 -0300 Subject: [PATCH 23/99] Set python via env Signed-off-by: Mauro Carvalho Chehab --- zbar.spec | 2 ++ zbar_set_python_via_env.patch | 50 +++++++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 zbar_set_python_via_env.patch diff --git a/zbar.spec b/zbar.spec index 05496b6..9521cc4 100644 --- a/zbar.spec +++ b/zbar.spec @@ -10,6 +10,7 @@ Group: User Interface/X Hardware Support License: LGPLv2+ URL: http://zbar.sourceforge.net/ Source0: https://linuxtv.org/downloads/%{name}/%{name}-%{version}.tar.bz2 +Patch0: zbar_set_python_via_env.patch BuildRequires: autoconf automake libtool gettext-devel @@ -88,6 +89,7 @@ scanning widget. %prep %setup -q +%patch0 %build autoreconf -vfi diff --git a/zbar_set_python_via_env.patch b/zbar_set_python_via_env.patch new file mode 100644 index 0000000..1809460 --- /dev/null +++ b/zbar_set_python_via_env.patch @@ -0,0 +1,50 @@ +From c750417b3e7c1dc55f2a50fb83fb3713e2f2dde4 Mon Sep 17 00:00:00 2001 +From: Mauro Carvalho Chehab +Date: Tue, 7 Aug 2018 15:02:11 -0300 +Subject: [PATCH] python: use env to get python's location + +Instead of hardcoding python at /usr/bin, use env to get its +path. + +Signed-off-by: Mauro Carvalho Chehab + +diff --git a/python/examples/processor.py b/python/examples/processor.py +index 52996d16cf0d..1114c0bf4a3c 100644 +--- a/python/examples/processor.py ++++ b/python/examples/processor.py +@@ -1,4 +1,4 @@ +-#!/usr/bin/python ++#!/usr/bin/env python + from sys import argv + import zbar + +diff --git a/python/examples/read_one.py b/python/examples/read_one.py +index 426b9994155e..3e41c438984c 100644 +--- a/python/examples/read_one.py ++++ b/python/examples/read_one.py +@@ -1,4 +1,4 @@ +-#!/usr/bin/python ++#!/usr/bin/env python + from sys import argv + import zbar + +diff --git a/python/examples/scan_image.py b/python/examples/scan_image.py +index 2a80759da7b5..8c288631e1fc 100644 +--- a/python/examples/scan_image.py ++++ b/python/examples/scan_image.py +@@ -1,4 +1,4 @@ +-#!/usr/bin/python ++#!/usr/bin/env python + from sys import argv + import zbar + import Image +diff --git a/python/test/test_zbar.py b/python/test/test_zbar.py +index dbe180324378..78d4f041ed9f 100755 +--- a/python/test/test_zbar.py ++++ b/python/test/test_zbar.py +@@ -1,4 +1,4 @@ +-#!/usr/bin/python ++#!/usr/bin/env python + import sys, os, re + import unittest as ut + import zbar From b61f85891f38c4991ddb44b508fc7f4fb793e6f4 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Tue, 7 Aug 2018 16:27:14 -0300 Subject: [PATCH 24/99] Get rid of old patches that aren't needed anymore None of those patches are needed, as they got merged at the zbar 0.20 version. Signed-off-by: Mauro Carvalho Chehab --- zbar_add_support_for_qt5.patch | 140 - zbar_choose_supported_format_first.patch | 128 - zbar_configure_ac_use_m4_pattern_allow.patch | 11 - zbar_generate_qt_gtk_apps.patch | 148 - zbar_update_to_hg.patch | 35551 ----------------- zbar_use_REQBUFS_properly.patch | 124 - zbar_use_libv4l.patch | 305 - 7 files changed, 36407 deletions(-) delete mode 100644 zbar_add_support_for_qt5.patch delete mode 100644 zbar_choose_supported_format_first.patch delete mode 100644 zbar_configure_ac_use_m4_pattern_allow.patch delete mode 100644 zbar_generate_qt_gtk_apps.patch delete mode 100644 zbar_update_to_hg.patch delete mode 100644 zbar_use_REQBUFS_properly.patch delete mode 100644 zbar_use_libv4l.patch diff --git a/zbar_add_support_for_qt5.patch b/zbar_add_support_for_qt5.patch deleted file mode 100644 index 519645f..0000000 --- a/zbar_add_support_for_qt5.patch +++ /dev/null @@ -1,140 +0,0 @@ -diff --git a/configure.ac b/configure.ac -index dbd7153fb13b..7bcb18219853 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -476,18 +476,33 @@ AM_CONDITIONAL([HAVE_PYTHON], [test "x$with_python" = "xyes"]) - dnl Qt - AC_ARG_WITH([qt], - [AS_HELP_STRING([--without-qt], -- [disable support for Qt4 widget])], -+ [disable support for Qt widget])], - [], - [with_qt="yes"]) - -+dnl Qt5 -+AC_ARG_WITH([qt5], -+ [AS_HELP_STRING([--without-qt5], -+ [disable support for Qt5 widget. if --with-qt, it will seek only for Qt4])], -+ [], -+ [with_qt5="yes"]) -+ - AC_ARG_VAR([MOC], [full path to Qt moc program]) - - AS_IF([test "x$with_qt" != "xno"], -- [PKG_CHECK_MODULES([QT], [QtCore >= 4 QtGui >= 4]) -- MOC=`$PKG_CONFIG QtGui --variable=moc_location` -- AC_MSG_NOTICE([using moc from $MOC]) -- QT_VERSION=`$PKG_CONFIG QtGui --modversion` -- AC_MSG_NOTICE([using Qt version $QT_VERSION])]) -+ AS_IF([test "x$with_qt5" != "xno"], -+ [PKG_CHECK_MODULES([QT], [Qt5Core >= 5 Qt5Gui >= 5 Qt5Widgets >= 5.0 Qt5X11Extras >= 5.0]) -+ AC_CHECK_PROGS(MOC, [moc-qt5 moc]) -+ AC_MSG_NOTICE([using moc from $MOC]) -+ QT_VERSION=`$PKG_CONFIG Qt5Gui --modversion` -+ CPPFLAGS="$CPPFLAGS $QT_CPPFLAGS -fPIC" -+ AC_MSG_NOTICE([using Qt version $QT_VERSION])], -+ -+ [PKG_CHECK_MODULES([QT], [QtCore >= 4 QtGui >= 4]) -+ MOC=`$PKG_CONFIG QtGui --variable=moc_location` -+ AC_MSG_NOTICE([using moc from $MOC]) -+ QT_VERSION=`$PKG_CONFIG QtGui --modversion` -+ AC_MSG_NOTICE([using Qt version $QT_VERSION])])) - - AM_CONDITIONAL([HAVE_QT], [test "x$with_qt" = "xyes"]) - -@@ -596,9 +611,9 @@ AS_IF([test "x$with_gtk" != "xyes"], - [echo " => the GTK+ widget will *NOT* be built"], - [AS_IF([test "x$with_python" != "xyes"], - [echo " => the PyGTK widget wrapper will *NOT* be built"])]) --echo "Qt4 --with-qt=$with_qt" -+echo "Qt${QT_VERSION} --with-qt=$with_qt" - AS_IF([test "x$with_qt" != "xyes"], -- [echo " => the Qt4 widget will *NOT* be built"]) -+ [echo " => the Qt widget will *NOT* be built"]) - echo "Java --with-java=$with_java" - AS_IF([test "x$with_java" != "xyes"], - [echo " => the Java interface will *NOT* be built"]) -diff --git a/include/zbar/QZBar.h b/include/zbar/QZBar.h -index 104449928e2d..1a4716565047 100644 ---- a/include/zbar/QZBar.h -+++ b/include/zbar/QZBar.h -@@ -26,7 +26,12 @@ - /// @file - /// Barcode Reader Qt4 Widget - --#include -+#include -+#if QT_VERSION >= 0x050000 -+# include -+#else -+# include -+#endif - - namespace zbar { - -diff --git a/include/zbar/QZBarImage.h b/include/zbar/QZBarImage.h -index 1505177e07a9..b862c8085576 100644 ---- a/include/zbar/QZBarImage.h -+++ b/include/zbar/QZBarImage.h -@@ -54,7 +54,11 @@ public: - unsigned height = qimg.height(); - set_size(width, height); - set_format(zbar_fourcc('B','G','R','4')); -+#if QT_VERSION >= 0x050000 -+ unsigned long datalen = qimg.byteCount(); -+#else - unsigned long datalen = qimg.numBytes(); -+#endif - set_data(qimg.bits(), datalen); - - if((width * 4 != bpl) || -diff --git a/qt/QZBar.cpp b/qt/QZBar.cpp -index e1001b09cff5..a5b956b342ad 100644 ---- a/qt/QZBar.cpp -+++ b/qt/QZBar.cpp -@@ -23,7 +23,7 @@ - - #include - #include --#include -+#include - #include - #include "QZBarThread.h" - -@@ -49,7 +49,11 @@ QZBar::QZBar (QWidget *parent) - - thread = new QZBarThread; - if(testAttribute(Qt::WA_WState_Created)) { -+#if QT_VERSION >= 0x050000 -+ thread->window.attach(QX11Info::display(), winId()); -+#else - thread->window.attach(x11Info().display(), winId()); -+#endif - _attached = 1; - } - connect(thread, SIGNAL(videoOpened(bool)), -@@ -204,7 +208,12 @@ void QZBar::changeEvent(QEvent *event) - try { - QMutexLocker locker(&thread->mutex); - if(event->type() == QEvent::ParentChange) -+#if QT_VERSION >= 0x050000 -+ thread->window.attach(QX11Info::display(), winId()); -+#else - thread->window.attach(x11Info().display(), winId()); -+#endif -+ - } - catch(Exception) { /* ignore (FIXME do something w/error) */ } - } -@@ -215,7 +224,11 @@ void QZBar::attach () - return; - - try { -+#if QT_VERSION >= 0x050000 -+ thread->window.attach(QX11Info::display(), winId()); -+#else - thread->window.attach(x11Info().display(), winId()); -+#endif - _attached = 1; - - _videoEnabled = !_videoDevice.isEmpty(); diff --git a/zbar_choose_supported_format_first.patch b/zbar_choose_supported_format_first.patch deleted file mode 100644 index 5289d25..0000000 --- a/zbar_choose_supported_format_first.patch +++ /dev/null @@ -1,128 +0,0 @@ -diff -r 60f92d860a1f zbar/convert.c ---- a/zbar/convert.c Sat Dec 25 08:29:33 2010 -0200 -+++ b/zbar/convert.c Sat Dec 25 14:36:04 2010 -0200 -@@ -1157,6 +1157,42 @@ - break; - } - } -+ if(!min_fmt && vdo->emu_formats) { -+ /* As vdo->formats aren't compatible, just free them */ -+ free(vdo->formats); -+ vdo->formats = vdo->emu_formats; -+ vdo->emu_formats = NULL; -+ -+ /* -+ * Use the same cost algorithm to select emulated formats. -+ * This might select a sub-optimal conversion, but, in practice, -+ * it will select a conversion to YUV at libv4l, and a YUY->Y8 -+ * in zbar, with it is OK. Yet, it is better to not select the -+ * most performatic conversion than to not support the webcam. -+ */ -+ for(fmt = _zbar_formats; *fmt; fmt++) { -+ /* only consider formats supported by video device */ -+ uint32_t win_fmt = 0; -+ int cost; -+ if(!has_format(*fmt, srcs)) -+ continue; -+ cost = _zbar_best_format(*fmt, &win_fmt, dsts); -+ if(cost < 0) { -+ zprintf(4, "%.4s(%08" PRIx32 ") -> ? (unsupported)\n", -+ (char*)fmt, *fmt); -+ continue; -+ } -+ zprintf(4, "%.4s(%08" PRIx32 ") -> %.4s(%08" PRIx32 ") (%d)\n", -+ (char*)fmt, *fmt, (char*)&win_fmt, win_fmt, cost); -+ if(min_cost > cost) { -+ min_cost = cost; -+ min_fmt = *fmt; -+ if(!cost) -+ break; -+ } -+ } -+ } -+ - if(win) - (void)window_unlock(win); - -diff -r 60f92d860a1f zbar/video.c ---- a/zbar/video.c Sat Dec 25 08:29:33 2010 -0200 -+++ b/zbar/video.c Sat Dec 25 14:36:04 2010 -0200 -@@ -111,6 +111,9 @@ - free(vdo->buf); - if(vdo->formats) - free(vdo->formats); -+ if(vdo->emu_formats) -+ free(vdo->emu_formats); -+ - err_cleanup(&vdo->err); - _zbar_mutex_destroy(&vdo->qlock); - -diff -r 60f92d860a1f zbar/video.h ---- a/zbar/video.h Sat Dec 25 08:29:33 2010 -0200 -+++ b/zbar/video.h Sat Dec 25 14:36:04 2010 -0200 -@@ -69,6 +69,7 @@ - uint32_t format; /* selected fourcc */ - unsigned palette; /* v4l1 format index corresponding to format */ - uint32_t *formats; /* 0 terminated list of supported formats */ -+ uint32_t *emu_formats; /* 0 terminated list of emulated formats */ - - unsigned long datalen; /* size of image data for selected format */ - unsigned long buflen; /* total size of image data buffer */ -diff -r 60f92d860a1f zbar/video/v4l2.c ---- a/zbar/video/v4l2.c Sat Dec 25 08:29:33 2010 -0200 -+++ b/zbar/video/v4l2.c Sat Dec 25 14:36:04 2010 -0200 -@@ -347,6 +347,8 @@ - - static inline int v4l2_probe_formats (zbar_video_t *vdo) - { -+ int n_formats = 0, n_emu_formats = 0; -+ - zprintf(2, "enumerating supported formats:\n"); - struct v4l2_fmtdesc desc; - memset(&desc, 0, sizeof(desc)); -@@ -354,17 +356,39 @@ - for(desc.index = 0; desc.index < V4L2_FORMATS_MAX; desc.index++) { - if(v4l2_ioctl(vdo->fd, VIDIOC_ENUM_FMT, &desc) < 0) - break; -- zprintf(2, " [%d] %.4s : %s%s\n", -+ zprintf(2, " [%d] %.4s : %s%s%s\n", - desc.index, (char*)&desc.pixelformat, desc.description, -- (desc.flags & V4L2_FMT_FLAG_COMPRESSED) ? " COMPRESSED" : ""); -- vdo->formats = realloc(vdo->formats, -- (desc.index + 2) * sizeof(uint32_t)); -- vdo->formats[desc.index] = desc.pixelformat; -+ (desc.flags & V4L2_FMT_FLAG_COMPRESSED) ? " COMPRESSED" : "", -+ (desc.flags & V4L2_FMT_FLAG_EMULATED) ? " EMULATED" : ""); -+ if (desc.flags & V4L2_FMT_FLAG_EMULATED) { -+ vdo->emu_formats = realloc(vdo->emu_formats, -+ (n_emu_formats + 2) * sizeof(uint32_t)); -+ vdo->emu_formats[n_emu_formats++] = desc.pixelformat; -+ } else { -+ vdo->formats = realloc(vdo->formats, -+ (n_formats + 2) * sizeof(uint32_t)); -+ vdo->formats[n_formats++] = desc.pixelformat; -+ } - } - if(!desc.index) - return(err_capture(vdo, SEV_ERROR, ZBAR_ERR_SYSTEM, __func__, - "enumerating video formats (VIDIOC_ENUM_FMT)")); -- vdo->formats[desc.index] = 0; -+ if(vdo->formats) -+ vdo->formats[n_formats] = 0; -+ if(vdo->emu_formats) -+ vdo->emu_formats[n_emu_formats] = 0; -+ if(!vdo->formats && vdo->emu_formats) { -+ /* -+ * If only emu formats are available, just move them to vdo->formats. -+ * This happens when libv4l detects that the only available fourcc -+ * formats are webcam proprietary formats or bayer formats. -+ */ -+ vdo->formats = vdo->emu_formats; -+ vdo->emu_formats = NULL; -+ } -+ -+ zprintf(2, "Found %d formats and %d emulated formats.\n", -+ n_formats, n_emu_formats); - - struct v4l2_format fmt; - struct v4l2_pix_format *pix = &fmt.fmt.pix; diff --git a/zbar_configure_ac_use_m4_pattern_allow.patch b/zbar_configure_ac_use_m4_pattern_allow.patch deleted file mode 100644 index 38b39ec..0000000 --- a/zbar_configure_ac_use_m4_pattern_allow.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/configure.ac 2015-08-14 16:26:09.661856984 -0300 -+++ b/configure.ac 2015-08-14 16:26:20.209851076 -0300 -@@ -4,7 +4,7 @@ - AC_CONFIG_AUX_DIR(config) - AC_CONFIG_MACRO_DIR(config) - AM_INIT_AUTOMAKE([1.10 -Werror foreign subdir-objects std-options dist-bzip2]) --AM_PROG_AR -+m4_pattern_allow([AM_PROG_AR]) - AC_CONFIG_HEADERS([include/config.h]) - AC_CONFIG_SRCDIR(zbar/scanner.c) - LT_PREREQ([2.2]) diff --git a/zbar_generate_qt_gtk_apps.patch b/zbar_generate_qt_gtk_apps.patch deleted file mode 100644 index 17c6856..0000000 --- a/zbar_generate_qt_gtk_apps.patch +++ /dev/null @@ -1,148 +0,0 @@ -From 76a286fd34d5159b55de4d4f276dcbf69d1b263e Mon Sep 17 00:00:00 2001 -From: Mauro Carvalho Chehab -Date: Sun, 26 Mar 2017 09:43:07 -0300 -Subject: [PATCH] zbarcam: add qt and gtk variants - -The original zbarcam use standard X11 libraries to display -video. That provides an ugly interface, and could be -slow on high resolutions. - -As Zbar has already test examples for qt and gtk, let's -promote them to real applications. One advantage is that -both qt and gtk libraries will be tested when building -those. - -Signed-off-by: Mauro Carvalho Chehab - -diff --git a/qt/Makefile.am.inc b/qt/Makefile.am.inc -index dc1525e0d52a..5f860bfa31bc 100644 ---- a/qt/Makefile.am.inc -+++ b/qt/Makefile.am.inc -@@ -7,6 +7,7 @@ qt_libzbarqt_la_SOURCES = qt/QZBar.cpp qt/QZBarThread.h qt/QZBarThread.cpp - nodist_qt_libzbarqt_la_SOURCES = qt/moc_QZBar.cpp qt/moc_QZBarThread.cpp - BUILT_SOURCES += $(nodist_qt_libzbarqt_la_SOURCES) - DISTCLEANFILES += $(nodist_qt_libzbarqt_la_SOURCES) -+CLEANFILES += qt/moc_%.cpp - - qt/moc_%.cpp: qt/%.h - $(MOC) $(qt_libzbarqt_la_CPPFLAGS) $< -o $@ -diff --git a/test/Makefile.am.inc b/test/Makefile.am.inc -index 7340a7f2f61f..8496eb30f3cc 100644 ---- a/test/Makefile.am.inc -+++ b/test/Makefile.am.inc -@@ -45,26 +45,6 @@ test_dbg_scan_CPPFLAGS = $(MAGICK_CFLAGS) $(AM_CPPFLAGS) - test_dbg_scan_LDADD = $(MAGICK_LIBS) -lMagick++ zbar/libzbar.la $(AM_LDADD) - endif - --if HAVE_GTK --check_PROGRAMS += test/test_gtk --test_test_gtk_SOURCES = test/test_gtk.c test/scan_video.c --test_test_gtk_CPPFLAGS = $(GTK_CFLAGS) $(AM_CPPFLAGS) --test_test_gtk_LDADD = $(GTK_LIBS) gtk/libzbargtk.la $(AM_LDADD) --endif -- --if HAVE_QT --check_PROGRAMS += test/test_qt --test_test_qt_SOURCES = test/test_qt.cpp test/scan_video.c --nodist_test_test_qt_SOURCES = test/moc_test_qt.h --test_test_qt_CPPFLAGS = -Itest $(QT_CFLAGS) $(AM_CPPFLAGS) --test_test_qt_LDADD = $(QT_LIBS) qt/libzbarqt.la $(AM_LDADD) --BUILT_SOURCES += $(nodist_test_test_qt_SOURCES) --DISTCLEANFILES += $(nodist_test_test_qt_SOURCES) -- --test/moc_%.h: test/%.cpp -- $(MOC) -i $(test_test_qt_CPPFLAGS) $< -o $@ --endif -- - EXTRA_DIST += test/test_pygtk.py test/test_perl.pl - - # automake bug in "monolithic mode"? -diff --git a/zbarcam/Makefile.am.inc b/zbarcam/Makefile.am.inc -index ea869bcd2e11..5aa788a23da5 100644 ---- a/zbarcam/Makefile.am.inc -+++ b/zbarcam/Makefile.am.inc -@@ -2,7 +2,32 @@ bin_PROGRAMS += zbarcam/zbarcam - zbarcam_zbarcam_SOURCES = zbarcam/zbarcam.c - zbarcam_zbarcam_LDADD = zbar/libzbar.la - # automake bug in "monolithic mode"? --CLEANFILES += zbarcam/.libs/zbarcam -+CLEANFILES += zbarcam/.libs/zbarcam zbarcam/moc_zbarcam_qt.h -+ -+if HAVE_GTK -+bin_PROGRAMS += zbarcam/zbarcam-gtk -+check_PROGRAMS += zbarcam/zbarcam-gtk -+zbarcam_zbarcam_gtk_SOURCES = zbarcam/zbarcam-gtk.c zbarcam/scan_video.c -+zbarcam_zbarcam_gtk_CPPFLAGS = $(GTK_CFLAGS) $(AM_CPPFLAGS) -+zbarcam_zbarcam_gtk_LDADD = $(GTK_LIBS) gtk/libzbargtk.la $(AM_LDADD) -+endif -+ -+if HAVE_QT -+bin_PROGRAMS += zbarcam/zbarcam-qt -+check_PROGRAMS += zbarcam/zbarcam-qt -+ -+zbarcam_zbarcam_qt_SOURCES = zbarcam/zbarcam-qt.cpp zbarcam/scan_video.c -+nodist_zbarcam_zbarcam_qt_SOURCES = zbarcam/moc_zbarcam_qt.h -+zbarcam_zbarcam_qt_CPPFLAGS = -Izbarcam $(QT_CFLAGS) $(AM_CPPFLAGS) -+zbarcam_zbarcam_qt_LDADD = $(QT_LIBS) qt/libzbarqt.la $(AM_LDADD) -+BUILT_SOURCES += $(nodist_zbarcam_zbarcam_qt_SOURCES) -+DISTCLEANFILES += $(nodist_zbarcam_zbarcam_qt_SOURCES) zbarcam/moc_zbarcam_qt.h -+ -+ -+zbarcam/moc_zbarcam_qt.h: zbarcam/zbarcam-qt.cpp -+ $(MOC) -i $(zbarcam_zbarcam_qt_CPPFLAGS) $< -o $@ -+endif -+ - - if WIN32 - zbarcam_zbarcam_SOURCES += zbarcam/zbarcam.rc -diff --git a/test/scan_video.c b/zbarcam/scan_video.c -similarity index 100% -rename from test/scan_video.c -rename to zbarcam/scan_video.c -diff --git a/test/test_gtk.c b/zbarcam/zbarcam-gtk.c -similarity index 100% -rename from test/test_gtk.c -rename to zbarcam/zbarcam-gtk.c -diff --git a/test/test_qt.cpp b/zbarcam/zbarcam-qt.cpp -similarity index 97% -rename from test/test_qt.cpp -rename to zbarcam/zbarcam-qt.cpp -index 96d2f9541453..3a39a338b59d 100644 ---- a/test/test_qt.cpp -+++ b/zbarcam/zbarcam-qt.cpp -@@ -40,7 +40,7 @@ int scan_video(void *add_device, - const char *default_device); - } - --class TestQZBar : public QWidget -+class ZbarcamQZBar : public QWidget - { - Q_OBJECT - -@@ -52,7 +52,7 @@ protected: - } - - public: -- TestQZBar (const char *default_device) -+ ZbarcamQZBar (const char *default_device) - { - // drop-down list of video devices - QComboBox *videoList = new QComboBox; -@@ -142,7 +142,7 @@ private: - zbar::QZBar *zbar; - }; - --#include "moc_test_qt.h" -+#include "moc_zbarcam_qt.h" - - int main (int argc, char *argv[]) - { -@@ -152,7 +152,7 @@ int main (int argc, char *argv[]) - if(argc > 1) - dev = argv[1]; - -- TestQZBar window(dev); -+ ZbarcamQZBar window(dev); - window.show(); - return(app.exec()); - } diff --git a/zbar_update_to_hg.patch b/zbar_update_to_hg.patch deleted file mode 100644 index bbe77fb..0000000 --- a/zbar_update_to_hg.patch +++ /dev/null @@ -1,35551 +0,0 @@ -diff -r 563557a923d0 .hgignore ---- a/.hgignore Tue Oct 27 11:25:59 2009 -0400 -+++ b/.hgignore Fri Feb 22 08:54:29 2013 -0300 -@@ -7,7 +7,7 @@ - configure - config - config.guess --config.h -+config/config.h - config.h.in - config.log - config.status -@@ -19,3 +19,18 @@ - ltmain.sh - autom4te.cache - missing -+python/MANIFEST -+build -+*.xcodeproj/*.mode1v3 -+*.xcodeproj/*.pbxuser -+xcuserdata -+contents.xcworkspacedata -+.DS_Store -+android/obj -+*.class -+*.dex -+android/libs -+android/examples/*/libs -+android/*.zip -+android/local.properties -+android/examples/*/local.properties -diff -r 563557a923d0 .hgtags ---- a/.hgtags Tue Oct 27 11:25:59 2009 -0400 -+++ b/.hgtags Fri Feb 22 08:54:29 2013 -0300 -@@ -9,3 +9,21 @@ - 38265c7b4ad4dfafe7b5e9eae4bb0d43d68b4143 0.9 - 2dc2d73c468a032edc68a127e9ddbbfe5f520777 0.9 - f3670ba47f2e070f4c43e97f4de3200903720e73 0.10 -+f3670ba47f2e070f4c43e97f4de3200903720e73 0.10 -+563557a923d0e23e36c81878d660aefc1c0fe3e7 0.10 -+b21098d27ff88c4f1a529fe0762f1cb307e04399 iPhoneSDK-0.1 -+b0bda6247b2fe4ffb52db89a776f91244f25d897 iPhoneSDK-0.1.1 -+d1655a680c3df68b3466d3b2c714f30af7223ec6 iPhoneSDK-0.1.2 -+4556c996acaaa6fcd5e8e9879f410f8120746e2b iPhoneSDK-1.0 -+12de07e51dce0d1cfc3e9699bbf9d5c8774a5371 iPhoneSDK-1.0.1 -+12de07e51dce0d1cfc3e9699bbf9d5c8774a5371 iPhoneSDK-1.0.1 -+2541a66ae7d64fbd923168ae677abb156021e88d iPhoneSDK-1.0.1 -+5e5060b563a1878ea297af5a50261d14cf1cb449 iPhoneSDK-1.1 -+f9e46865dbcebd04683ca7592ab32aeda615e772 iPhoneSDK-1.1.1 -+801318a6195060c31259da1f076ecc9a609616cc iPhoneSDK-1.1.2 -+4bbb4e2bdba8c41a282df7e65a02797250f44daa iPhoneSDK-1.1.3 -+1ad84c3c03252c366a82552fa952674ec593c73f iPhoneSDK-1.2 -+9e7bad13ae6a4b65e0f0964512f96284d37f0dc8 iPhoneSDK-1.2.1 -+146b857ff41ae462cc52f8dddf46d867763433a1 iPhoneSDK-1.2.2 -+9b946a7ead73ac99e121de2e7f495213cda88e6f AndroidSDK-0.1 -+5eb3c8786845fe3ad2c74f6a660e70176b88347f iPhoneSDK-1.3.1 -diff -r 563557a923d0 COPYING ---- a/COPYING Tue Oct 27 11:25:59 2009 -0400 -+++ b/COPYING Fri Feb 22 08:54:29 2013 -0300 -@@ -1,4 +1,4 @@ --The ZBar Bar Code Reader is Copyright (C) 2007-2009 Jeff Brown -+The ZBar Bar Code Reader is Copyright (C) 2007-2011 Jeff Brown - - The QR Code reader is Copyright (C) 1999-2009 Timothy B. Terriberry - -diff -r 563557a923d0 ChangeLog ---- a/ChangeLog Tue Oct 27 11:25:59 2009 -0400 -+++ b/ChangeLog Fri Feb 22 08:54:29 2013 -0300 -@@ -1,3 +1,95 @@ -+current: -+ * Codabar reliability enhancements -+ - fix missing check -+ - require minimum quality -+ - bump default uncertainty -+ * tweak Codabar bar/space ratio validation -+ * finish Codabar support for python, perl, java and iPhone interfaces -+ - reduce Codabar uncertainty to minimum -+ * add core support for Codabar symbology -+ - TBD: python, perl, java and iPhone interfaces -+ * fix v4l config and build variations (bug #3348888) -+ - thanks to jarekczek for reporting this! -+ - NB v4l1 removed from kernel as of 2.6.38 -+ * fix missing python thread initialization (bug #3349199) -+ - thanks to jarekczek for reporting this problem! -+ * fix missing configure check for Python.h (bug #3092663) -+ - thanks to Zoltan Kovacs for reporting this problem! -+ * fix C++ wrapper missing Symbol.quality (bug #3076524) -+ - thanks to Rudy Melli for pointing this out! -+ * fix C++ wrapper bugs (bug #3396068) -+ - thanks to anotheruser1 for reporting this! -+ - add new C++ wrapper test -+ * fix avoid compositing ISBN10 data -+ * add support for GraphicsMagick as ImageMagick alternative -+ * mention xmlto in HACKING (patch #3297039) -+ - thanks to jarekczek for the patch! -+ * disable addons by default until synchronization with main symbol is working -+ * fix image scanner min quality filtering -+ * fix i25 buffer overrun corner case -+ * fix EAN addon enables -+ * fix zbarimg to accept autodetected stdin (lone dash) -+ * fix Qt 4.6.3 compilation error (patch #3178244) -+ - thanks to hrhristov for the patch! -+ * add Python Processor support for request_size interface -+ * fix Python Processor support for GIL, allowing asynchronous scanning -+ * fix jpeg decoder skip handling -+ - thanks to jarekczek for the patch! -+ * rename dprintf macro to avoid conflicts (patch #3128538) -+ - thanks to maurochehab for the patch! -+ * add support for EAN/UPC 2 and 5 digit add-on symbols -+ - deprecate original, unfinished add-on APIs -+ - add self-checking to test_decode -+ * fix support for GS1 AIs -+ - thanks to jockusch for a patch! -+ - add decoder/symbol "modifier" flags and config read access -+ - set flags or emit GS appropriately for Code 128 FNC1 -+ - add iphone, java, perl, python bindings for modifiers and configs -+ * add support for Code 93 symbology -+ * add video size request to (Py)GTK widget (req #3034522) -+ - thanks to Jerome Charaoui for the patch! -+ * add support for GS1 DataBar Expanded (RSS Expanded) symbology -+ * add language bindings for DataBar -+ * add preliminary support for GS1 DataBar (RSS-14) symbology -+ * enhance decoder reliability (EAN, Code 39, Code 128) -+ - enhance decoder test -+ * fix documentation of command exit codes (bug #3017322) -+ * fix C++ video callback bug -+ - add C and C++ processor examples -+ * add per-symbology cache consistency -+ - reliable symbologies decode immediately by default -+ - no more need to disable cache with video -+ - also fix crop bugs w/video scanning -+ * add support for scanning partial images (cropping) -+ - update c++, python, perl, java bindings and tests -+ * fix couple of leaks -+ * remove doc hints about GFDL (bug #3004411) -+ - apply LGPL to API docs -+ * relax Code 39 width ratio checks -+ * core library portability improvements -+ - remove some unnecessary C99 syntax -+ - add configure checks for errno -+ - enhance C++ Symbol interface -+ * adjust Python module README (add examples and note DLL in path) -+ * fix QR Code missing from man pages (bug #2969857) -+ * cleanup decoder assertions and locking (bug #2966916) -+ * add Java interface to library via JNI -+ - add Java tools and JNI build tests to configure -+ - fix compiler warnings from binary output changes -+ * fix output of binary data in zbarimg and zbarcam -+ - thanks to fukuchi for a patch! -+ - add base64 format for binary xml output -+ * add coarse symbol orientation information (patch #2913094) -+ - thanks to Anssi for a patch! -+ - add decode direction feedback to decoder -+ - update C++, Python, Perl and ObjC wrappers -+ - add orientation to test suites -+ * fix inconsistent fourcc endian handling bugs (bug #2918994) -+ - thanks to jdccdevel for a patch! -+ - add fourcc conversion and parse interfaces to zbar.h -+ * report QR immediately for video (no inter-frame consistency check) -+ * add python distutils build infrastructure -+ - version 0.10: - * hotfix add MinGW import lib to Windows installer - * attempt fix for Qt4 < 4.4 -diff -r 563557a923d0 HACKING ---- a/HACKING Tue Oct 27 11:25:59 2009 -0400 -+++ b/HACKING Fri Feb 22 08:54:29 2013 -0300 -@@ -13,6 +13,12 @@ - GNU autoconf 2.61 - GNU automake 1.10.1 - GNU libtool 2.2.6 -+ GNU gettext 0.18.1.1 -+ GNU pkg-config 0.25 -+ xmlto 0.0.20-5 (for docs building) -+all above mentioned tools (except xmlto) must be installed in the same -+prefix. mixing prefixes (i.g. /usr/bin and /usr/local/bin) may lead to -+errors in configuration stages - - when you're done hacking and want to make your patch, run: - -diff -r 563557a923d0 Makefile.am ---- a/Makefile.am Tue Oct 27 11:25:59 2009 -0400 -+++ b/Makefile.am Fri Feb 22 08:54:29 2013 -0300 -@@ -1,6 +1,3 @@ --AM_CPPFLAGS = -I$(srcdir)/include --AM_CFLAGS = -Wall -Wno-parentheses --AM_CXXFLAGS = $(AM_CFLAGS) - ACLOCAL_AMFLAGS = -I config - bin_PROGRAMS = - check_PROGRAMS = -@@ -9,8 +6,10 @@ - pyexec_LTLIBRARIES = - CLEANFILES = - DISTCLEANFILES = -+MAINTAINERCLEANFILES = - BUILT_SOURCES = - EXTRA_DIST = -+SUBDIRS = . - - pkgconfigdir = $(libdir)/pkgconfig - pkgconfig_DATA = zbar.pc -@@ -39,6 +38,9 @@ - include $(srcdir)/qt/Makefile.am.inc - pkgconfig_DATA += zbar-qt.pc - endif -+if HAVE_JAVA -+SUBDIRS += java -+endif - if HAVE_NPAPI - include $(srcdir)/plugin/Makefile.am.inc - endif -@@ -47,11 +49,8 @@ - - EXTRA_DIST += zbar.ico zbar.nsi - --EXTRA_DIST += examples/upcrpc.pl examples/upcrpc.py examples/paginate.pl \ -- examples/barcode.png examples/processor.pl examples/processor.py \ -- examples/read_one.py examples/read_one.pl \ -- examples/scan_image.c examples/scan_image.cpp examples/scan_image.pl \ -- examples/scan_image.py examples/scan_image.vcproj -+EXTRA_DIST += examples/barcode.png examples/upcrpc.py examples/upcrpc.pl \ -+ examples/scan_image.c examples/scan_image.cpp examples/scan_image.vcproj - - EXTRA_DIST += perl/MANIFEST perl/README perl/Changes perl/COPYING.LIB \ - perl/Makefile.PL perl/typemap perl/ZBar.xs perl/ppport.h \ -diff -r 563557a923d0 README ---- a/README Tue Oct 27 11:25:59 2009 -0400 -+++ b/README Fri Feb 22 08:54:29 2013 -0300 -@@ -4,9 +4,9 @@ - ZBar Bar Code Reader is an open source software suite for reading bar - codes from various sources, such as video streams, image files and raw - intensity sensors. It supports EAN-13/UPC-A, UPC-E, EAN-8, Code 128, --Code 39, Interleaved 2 of 5 and QR Code. Included with the library --are basic applications for decoding captured bar code images and using --a video device (eg, webcam) as a bar code scanner. For application -+Code 39, Codabar, Interleaved 2 of 5 and QR Code. Included with the -+library are basic applications for decoding captured bar code images and -+using a video device (eg, webcam) as a bar code scanner. For application - developers, language bindings are included for C, C++, Python and Perl - as well as GUI widgets for Qt, GTK and PyGTK. - -diff -r 563557a923d0 README.windows ---- a/README.windows Tue Oct 27 11:25:59 2009 -0400 -+++ b/README.windows Fri Feb 22 08:54:29 2013 -0300 -@@ -3,8 +3,8 @@ - - ZBar Bar Code Reader is an open source software suite for reading bar codes - from various sources, such as video streams, image files and raw intensity --sensors. It supports EAN-13/UPC-A, UPC-E, EAN-8, Code 128, Code 39, --Interleaved 2 of 5 and QR Code. Included with the library are basic -+sensors. It supports EAN-13/UPC-A, UPC-E, EAN-8, Code 128, Code 93, Code 39, -+Codabar, Interleaved 2 of 5 and QR Code. Included with the library are basic - applications for decoding captured bar code images and using a video device - (eg, webcam) as a bar code scanner. For application developers, language - bindings are included for C, C++, Python and Perl as well as GUI widgets for -diff -r 563557a923d0 TODO ---- a/TODO Tue Oct 27 11:25:59 2009 -0400 -+++ b/TODO Fri Feb 22 08:54:29 2013 -0300 -@@ -25,7 +25,6 @@ - * Code 39, i25 optional features (check digit and ASCII escapes) - * handle Code 128 function characters (FNC1-4) - * Code 128 trailing quiet zone checks -- * finish addon decoding - - decoder: - * start/stop/abort and location detail APIs (PDF417, OMR) -diff -r 563557a923d0 android/AndroidManifest.xml ---- /dev/null Thu Jan 01 00:00:00 1970 +0000 -+++ b/android/AndroidManifest.xml Fri Feb 22 08:54:29 2013 -0300 -@@ -0,0 +1,15 @@ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -diff -r 563557a923d0 android/ChangeLog ---- /dev/null Thu Jan 01 00:00:00 1970 +0000 -+++ b/android/ChangeLog Fri Feb 22 08:54:29 2013 -0300 -@@ -0,0 +1,2 @@ -+version 0.1: -+ * Add initial support for Android platform -diff -r 563557a923d0 android/README ---- /dev/null Thu Jan 01 00:00:00 1970 +0000 -+++ b/android/README Fri Feb 22 08:54:29 2013 -0300 -@@ -0,0 +1,112 @@ -+ZBar Android SDK -+================ -+ -+ZBar Bar Code Reader is an open source software suite for reading bar -+codes from various sources, such as video streams, image files and raw -+intensity sensors. It supports EAN-13/UPC-A, UPC-E, EAN-8, Code 128, -+Code 93, Code 39, Codabar, Interleaved 2 of 5, QR Code and -+DataBar. These are the JNI wrappers for developing the library on -+Android platform. -+ -+Check the ZBar home page for the latest release, mailing lists, etc. -+ http://zbar.sourceforge.net/ -+ -+Copyright and License -+--------------------- -+Licensed under the GNU Lesser General Public License, version 2.1. -+http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt -+ -+Copyright 2008-2012 © Jeff Brown et al -+ -+The Android distribution also includes pre-compiled binaries of -+supporting libaries, for which copyright, license and source code -+locations are as follows: -+ * The GNU libiconv character set conversion library -+ Copyright (C) 1999-2011 Free Software Foundation, Inc. -+ This distribution includes GNU libiconv version 1.14, licensed under -+ the LGPL version 2. The source code is available from -+ http://www.gnu.org/software/libiconv -+ -+See included files COPYING and LICENSE for details. -+ -+ -+Installation -+------------ -+ -+After downloading the ZBar-Android-Lib-.zip file, you need to -+unzip the file and add it to your Android project. Unzip the file -+using your favorite method (ie: command-line, finder, windows -+explorer...) -+ -+Follow one of the two options. -+Option 1 - via command line -+ cd -+ cp -r ZBar-Android-SDK-/libs . -+ -+Option 2 - via Eclipse -+ Right click on Android Project -+ Select "Import" -> "File System" -+ Select "Browse" (next to "From directory File" and select the -+ ZBar-Android-SDK-/libs directory and click "Open". -+ Click the check box next to "libs" and the "Options" "Create top-level folder" -+ check box (below). -+ Then click "Finish". -+ -+ You should then see a "libs" folder under your project. -+ -+Building -+-------- -+ -+Via Eclipse -+You have to add the zbar.jar file to your build path -+ 1) select zbar.jar under libs -+ 2) right-click, select "Build Path" -> "Add to Build Path" -+ -+Via command-line -+You are all set; ant will automatcially find jar files under the "libs" -+subdirectory. -+ -+Documentation -+------------- -+ TDB -+ -+Examples -+-------- -+ -+You should be able to open and build the examples directly from the -+unzipped directory. You will need to run the android tools to setup -+the local.properties file which sets sdk.dir. -+ 1) cd /examples/CameraTest -+ 2) android update project --path . -+ 3) ant debug install -+ -+If you have problems with this, please create a new Android project -+and copy the necessary files from the examples. -+ -+examples/CameraTest is a simple demonstration of how to integrate the -+ZBar image scanner with the camera. -+ -+Manually building ZBar JNI library -+---------------------------------- -+First download and unzip the iconv library source from -+ http://www.gnu.org/software/libiconv/ -+ -+Then kick off the build from the ZBar android directory. You will -+need to run the android tools to setup the local.properties file which -+setups sdk.dir. -+ -+ 1) cd /android -+ 2) android update project --path . -+ 3) ant -Dndk.dir= -Diconv.src= zbar-all -+ -+This will rebuild all source files, create zbar.jar and -+ZBarAndroidSDK.zip file (which bundles the jar and shared -+libraries). From here, you can follow the steps for "Integrating ZBar -+JNI library in Android project". -+ -+To clean run: -+ ant -Dndk.dir= zbar-clean -+ -+See build-ndk.xml for additional target options. -+ -+ -diff -r 563557a923d0 android/ant.properties ---- /dev/null Thu Jan 01 00:00:00 1970 +0000 -+++ b/android/ant.properties Fri Feb 22 08:54:29 2013 -0300 -@@ -0,0 +1,17 @@ -+# This file is used to override default values used by the Ant build system. -+# -+# This file must be checked in Version Control Systems, as it is -+# integral to the build system of your project. -+ -+# This file is only used by the Ant script. -+ -+# You can use this to override default values such as -+# 'source.dir' for the location of your java source folder and -+# 'out.dir' for the location of your output folder. -+ -+# You can also use it define how the release builds are signed by declaring -+# the following properties: -+# 'key.store' for the location of your keystore and -+# 'key.alias' for the name of the key to use. -+# The password will be asked during the build when you use the 'release' target. -+ -diff -r 563557a923d0 android/build-ndk.xml ---- /dev/null Thu Jan 01 00:00:00 1970 +0000 -+++ b/android/build-ndk.xml Fri Feb 22 08:54:29 2013 -0300 -@@ -0,0 +1,66 @@ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -diff -r 563557a923d0 android/build.xml ---- /dev/null Thu Jan 01 00:00:00 1970 +0000 -+++ b/android/build.xml Fri Feb 22 08:54:29 2013 -0300 -@@ -0,0 +1,86 @@ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -diff -r 563557a923d0 android/examples/CameraTest/AndroidManifest.xml ---- /dev/null Thu Jan 01 00:00:00 1970 +0000 -+++ b/android/examples/CameraTest/AndroidManifest.xml Fri Feb 22 08:54:29 2013 -0300 -@@ -0,0 +1,19 @@ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -diff -r 563557a923d0 android/examples/CameraTest/ant.properties ---- /dev/null Thu Jan 01 00:00:00 1970 +0000 -+++ b/android/examples/CameraTest/ant.properties Fri Feb 22 08:54:29 2013 -0300 -@@ -0,0 +1,17 @@ -+# This file is used to override default values used by the Ant build system. -+# -+# This file must be checked in Version Control Systems, as it is -+# integral to the build system of your project. -+ -+# This file is only used by the Ant script. -+ -+# You can use this to override default values such as -+# 'source.dir' for the location of your java source folder and -+# 'out.dir' for the location of your output folder. -+ -+# You can also use it define how the release builds are signed by declaring -+# the following properties: -+# 'key.store' for the location of your keystore and -+# 'key.alias' for the name of the key to use. -+# The password will be asked during the build when you use the 'release' target. -+ -diff -r 563557a923d0 android/examples/CameraTest/build.xml ---- /dev/null Thu Jan 01 00:00:00 1970 +0000 -+++ b/android/examples/CameraTest/build.xml Fri Feb 22 08:54:29 2013 -0300 -@@ -0,0 +1,85 @@ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -diff -r 563557a923d0 android/examples/CameraTest/proguard.cfg ---- /dev/null Thu Jan 01 00:00:00 1970 +0000 -+++ b/android/examples/CameraTest/proguard.cfg Fri Feb 22 08:54:29 2013 -0300 -@@ -0,0 +1,40 @@ -+-optimizationpasses 5 -+-dontusemixedcaseclassnames -+-dontskipnonpubliclibraryclasses -+-dontpreverify -+-verbose -+-optimizations !code/simplification/arithmetic,!field/*,!class/merging/* -+ -+-keep public class * extends android.app.Activity -+-keep public class * extends android.app.Application -+-keep public class * extends android.app.Service -+-keep public class * extends android.content.BroadcastReceiver -+-keep public class * extends android.content.ContentProvider -+-keep public class * extends android.app.backup.BackupAgentHelper -+-keep public class * extends android.preference.Preference -+-keep public class com.android.vending.licensing.ILicensingService -+ -+-keepclasseswithmembernames class * { -+ native ; -+} -+ -+-keepclasseswithmembers class * { -+ public (android.content.Context, android.util.AttributeSet); -+} -+ -+-keepclasseswithmembers class * { -+ public (android.content.Context, android.util.AttributeSet, int); -+} -+ -+-keepclassmembers class * extends android.app.Activity { -+ public void *(android.view.View); -+} -+ -+-keepclassmembers enum * { -+ public static **[] values(); -+ public static ** valueOf(java.lang.String); -+} -+ -+-keep class * implements android.os.Parcelable { -+ public static final android.os.Parcelable$Creator *; -+} -diff -r 563557a923d0 android/examples/CameraTest/project.properties ---- /dev/null Thu Jan 01 00:00:00 1970 +0000 -+++ b/android/examples/CameraTest/project.properties Fri Feb 22 08:54:29 2013 -0300 -@@ -0,0 +1,11 @@ -+# This file is automatically generated by Android Tools. -+# Do not modify this file -- YOUR CHANGES WILL BE ERASED! -+# -+# This file must be checked in Version Control Systems. -+# -+# To customize properties used by the Ant build system use, -+# "ant.properties", and override values to adapt the script to your -+# project structure. -+ -+# Project target. -+target=android-15 -diff -r 563557a923d0 android/examples/CameraTest/res/layout/main.xml ---- /dev/null Thu Jan 01 00:00:00 1970 +0000 -+++ b/android/examples/CameraTest/res/layout/main.xml Fri Feb 22 08:54:29 2013 -0300 -@@ -0,0 +1,28 @@ -+ -+ -+ -+ -+ -+ -+ -+