Accepting request 668153 from Application:Geo

- Update Zbar to v0.20.1
  * switch from the old abandoned codebase to the new codebase
    maintained by linuxtv.org
  * improved v4l2 support
  * compatible with Qt5
  * various fixes
- Removed fix_build.patch
- Removed fix-gcc5.patch
- Removed zbar-Qt5.patch
- Removed fix-gcc8.patch

OBS-URL: https://build.opensuse.org/request/show/668153
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/zbar?expand=0&rev=7
This commit is contained in:
Dominique Leuenberger 2019-01-26 21:19:41 +00:00 committed by Git OBS Bridge
commit cbe49dfd8b
9 changed files with 63 additions and 268 deletions

View File

@ -1,59 +0,0 @@
zbar/decoder/ean.c | 4 ++--
zbar/qrcode/qrdec.c | 8 ++++----
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/zbar/decoder/ean.c b/zbar/decoder/ean.c
index c20f538..fe38eaa 100644
--- a/zbar/decoder/ean.c
+++ b/zbar/decoder/ean.c
@@ -294,7 +294,7 @@ static inline zbar_symbol_type_t ean_part_end4 (ean_pass_t *pass,
/* invalid parity combination */
return(ZBAR_NONE);
- if(!par == fwd) {
+ if(!(par == fwd)) {
/* reverse sampled digits */
unsigned char tmp = pass->raw[1];
pass->state |= STATE_REV;
@@ -380,7 +380,7 @@ static inline zbar_symbol_type_t ean_part_end7 (ean_decoder_t *ean,
/* invalid parity combination */
return(ZBAR_NONE);
- if(!par == fwd) {
+ if(!(par == fwd)) {
unsigned char i;
pass->state |= STATE_REV;
/* reverse sampled digits */
diff --git a/zbar/qrcode/qrdec.c b/zbar/qrcode/qrdec.c
index d8fa802..fd42c33 100644
--- a/zbar/qrcode/qrdec.c
+++ b/zbar/qrcode/qrdec.c
@@ -1219,8 +1219,8 @@ static int qr_finder_quick_crossing_check(const unsigned char *_img,
_x1<0||_x1>=_width||_y1<0||_y1>=_height){
return -1;
}
- if(!_img[_y0*_width+_x0]!=_v||!_img[_y1*_width+_x1]!=_v)return 1;
- if(!_img[(_y0+_y1>>1)*_width+(_x0+_x1>>1)]==_v)return -1;
+ if(!(_img[_y0*_width+_x0]!=_v)||!(_img[_y1*_width+_x1]!=_v))return 1;
+ if(!(_img[(_y0+_y1>>1)*_width+(_x0+_x1>>1)]==_v))return -1;
return 0;
}
@@ -1261,7 +1261,7 @@ static int qr_finder_locate_crossing(const unsigned char *_img,
x0[1-steep]+=step[1-steep];
err-=dx[steep];
}
- if(!_img[x0[1]*_width+x0[0]]!=_v)break;
+ if(!(_img[x0[1]*_width+x0[0]]!=_v))break;
}
/*Find the last crossing from _v to !_v.*/
err=0;
@@ -1273,7 +1273,7 @@ static int qr_finder_locate_crossing(const unsigned char *_img,
x1[1-steep]-=step[1-steep];
err-=dx[steep];
}
- if(!_img[x1[1]*_width+x1[0]]!=_v)break;
+ if(!(_img[x1[1]*_width+x1[0]]!=_v))break;
}
/*Return the midpoint of the _v segment.*/
_p[0]=(x0[0]+x1[0]+1<<QR_FINDER_SUBPREC)>>1;

View File

@ -1,38 +0,0 @@
--- a/qt/QZBar.cpp 2018-04-10 16:20:27.946677757 +0200
+++ b/qt/QZBar.cpp 2018-04-10 16:17:21.839009342 +0200
@@ -183,7 +183,7 @@
if(thread)
thread->window.redraw();
}
- catch(Exception) {
+ catch(Exception *) {
// sometimes Qt attempts to paint the widget before it's parented(?)
// just ignore this (can't throw from event anyway)
}
@@ -196,7 +196,7 @@
if(thread)
thread->window.resize(size.rwidth(), size.rheight());
}
- catch(Exception) { /* ignore */ }
+ catch(Exception *) { /* ignore */ }
}
void QZBar::changeEvent(QEvent *event)
@@ -206,7 +206,7 @@
if(event->type() == QEvent::ParentChange)
thread->window.attach(QX11Info::display(), winId());
}
- catch(Exception) { /* ignore (FIXME do something w/error) */ }
+ catch(Exception *) { /* ignore (FIXME do something w/error) */ }
}
void QZBar::attach ()
@@ -222,7 +222,7 @@
if(_videoEnabled)
thread->pushEvent(new QZBarThread::VideoDeviceEvent(_videoDevice));
}
- catch(Exception) { /* ignore (FIXME do something w/error) */ }
+ catch(Exception *) { /* ignore (FIXME do something w/error) */ }
}
void QZBar::showEvent (QShowEvent *event)

View File

@ -1,15 +0,0 @@
diff -ur zbar-0.10_2012_08_06/configure.ac zbar-0.10_2012_08_06_fix/configure.ac
--- zbar-0.10_2012_08_06/configure.ac 2012-08-06 18:29:28.271138221 +0200
+++ zbar-0.10_2012_08_06_fix/configure.ac 2012-08-06 19:12:42.396126332 +0200
@@ -3,9 +3,10 @@
AC_INIT([zbar], [0.10], [spadix@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 foreign subdir-objects std-options dist-bzip2])
AC_CONFIG_HEADERS([include/config.h])
AC_CONFIG_SRCDIR(zbar/scanner.c)
+m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
LT_PREREQ([2.2])
LT_INIT([dlopen win32-dll])
LT_LANG([Windows Resource])

View File

@ -1,10 +0,0 @@
#! /bin/bash
hg clone http://zbar.hg.sourceforge.net:8000/hgroot/zbar
osc rm zbar-*.tar.bz2
pushd zbar
ARC=`date +"zbar-0.10_%Y_%m_%d.tar.bz2"`
hg archive "../$ARC"
popd
rm -rfv zbar
osc add $ARC

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:8c7ad832c603dcc5531a3816c092dc59f87df3782fe0111bb6becd2f65cbdc6a
size 648280

3
zbar-0.20.1.tar.bz2 Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:a0081a9b473d9e44e029d948a8d7f22deb1bf128980f3fc4e185298066e62a6c
size 459018

View File

@ -1,109 +0,0 @@
Index: zbar-0.10_2013_02_28/configure.ac
===================================================================
--- zbar-0.10_2013_02_28.orig/configure.ac
+++ zbar-0.10_2013_02_28/configure.ac
@@ -468,17 +468,17 @@ AM_CONDITIONAL([HAVE_PYTHON], [test "x$w
dnl Qt
AC_ARG_WITH([qt],
[AS_HELP_STRING([--without-qt],
- [disable support for Qt4 widget])],
+ [disable support for Qt5 widget])],
[],
[with_qt="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`
+ [PKG_CHECK_MODULES([QT], [Qt5Core Qt5Gui Qt5Widgets Qt5X11Extras])
+ MOC=`$PKG_CONFIG Qt5Core --variable=host_bins`/moc
AC_MSG_NOTICE([using moc from $MOC])
- QT_VERSION=`$PKG_CONFIG QtGui --modversion`
+ QT_VERSION=`$PKG_CONFIG Qt5Core --modversion`
AC_MSG_NOTICE([using Qt version $QT_VERSION])])
AM_CONDITIONAL([HAVE_QT], [test "x$with_qt" = "xyes"])
@@ -586,9 +586,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 "Qt5 --with-qt=$with_qt"
AS_IF([test "x$with_qt" != "xyes"],
- [echo " => the Qt4 widget will *NOT* be built"])
+ [echo " => the Qt5 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"])
Index: zbar-0.10_2013_02_28/include/zbar/QZBarImage.h
===================================================================
--- zbar-0.10_2013_02_28.orig/include/zbar/QZBarImage.h
+++ zbar-0.10_2013_02_28/include/zbar/QZBarImage.h
@@ -54,7 +54,7 @@ public:
unsigned height = qimg.height();
set_size(width, height);
set_format(zbar_fourcc('B','G','R','4'));
- unsigned long datalen = qimg.numBytes();
+ unsigned long datalen = qimg.byteCount();
set_data(qimg.bits(), datalen);
if((width * 4 != bpl) ||
Index: zbar-0.10_2013_02_28/qt/QZBar.cpp
===================================================================
--- zbar-0.10_2013_02_28.orig/qt/QZBar.cpp
+++ zbar-0.10_2013_02_28/qt/QZBar.cpp
@@ -21,8 +21,8 @@
// http://sourceforge.net/projects/zbar
//------------------------------------------------------------------------
-#include <qevent.h>
-#include <qurl.h>
+#include <QtCore>
+#include <QtGui>
#include <qx11info_x11.h>
#include <zbar/QZBar.h>
#include "QZBarThread.h"
@@ -49,7 +49,7 @@ QZBar::QZBar (QWidget *parent)
thread = new QZBarThread;
if(testAttribute(Qt::WA_WState_Created)) {
- thread->window.attach(x11Info().display(), winId());
+ thread->window.attach(QX11Info::display(), winId());
_attached = 1;
}
connect(thread, SIGNAL(videoOpened(bool)),
@@ -204,7 +204,7 @@ void QZBar::changeEvent(QEvent *event)
try {
QMutexLocker locker(&thread->mutex);
if(event->type() == QEvent::ParentChange)
- thread->window.attach(x11Info().display(), winId());
+ thread->window.attach(QX11Info::display(), winId());
}
catch(Exception) { /* ignore (FIXME do something w/error) */ }
}
@@ -215,7 +215,7 @@ void QZBar::attach ()
return;
try {
- thread->window.attach(x11Info().display(), winId());
+ thread->window.attach(QX11Info::display(), winId());
_attached = 1;
_videoEnabled = !_videoDevice.isEmpty();
Index: zbar-0.10_2013_02_28/zbar-qt.pc.in
===================================================================
--- zbar-0.10_2013_02_28.orig/zbar-qt.pc.in
+++ zbar-0.10_2013_02_28/zbar-qt.pc.in
@@ -4,9 +4,9 @@ libdir=@libdir@
includedir=@includedir@
Name: zbar-qt
-Description: bar code scanning and decoding Qt4 widget
+Description: bar code scanning and decoding Qt5 widget
URL: http://zbar.sourceforge.net
Version: @VERSION@
-Requires: zbar, QtCore >= 4, QtGui >= 4
+Requires: zbar, Qt5Widgets, Qt5X11Extras, Qt5Gui, Qt5Core
Libs: -L${libdir} -lzbarqt
Cflags: -I${includedir}

View File

@ -1,3 +1,17 @@
-------------------------------------------------------------------
Wed Jan 23 16:13:22 UTC 2019 - info@paolostivanin.com
- Update Zbar to v0.20.1
* switch from the old abandoned codebase to the new codebase
maintained by linuxtv.org
* improved v4l2 support
* compatible with Qt5
* various fixes
- Removed fix_build.patch
- Removed fix-gcc5.patch
- Removed zbar-Qt5.patch
- Removed fix-gcc8.patch
------------------------------------------------------------------- -------------------------------------------------------------------
Tue Apr 10 14:25:15 UTC 2018 - mliska@suse.cz Tue Apr 10 14:25:15 UTC 2018 - mliska@suse.cz

View File

@ -1,7 +1,7 @@
# #
# spec file for package zbar # spec file for package zbar
# #
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. # Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2010 Carlos Goncalves <cgoncalves@opensuse.org>. # Copyright (c) 2010 Carlos Goncalves <cgoncalves@opensuse.org>.
# #
# All modifications and additions to the file contributed by third parties # All modifications and additions to the file contributed by third parties
@ -19,29 +19,26 @@
%define libname libzbar0 %define libname libzbar0
Name: zbar Name: zbar
Version: 0.10_2013_02_28 Version: 0.20.1
Release: 0 Release: 0
Summary: Bar code reader Summary: Bar code reader
License: LGPL-2.1-or-later License: LGPL-2.0-or-later
Group: Productivity/Other Group: Productivity/Other
Url: http://zbar.sourceforge.net
Source: %{name}-%{version}.tar.bz2 URL: http://zbar.sourceforge.net/
Source0: https://linuxtv.org/downloads/%{name}/%{name}-%{version}.tar.bz2
Source98: baselibs.conf Source98: baselibs.conf
# update.sh is used to create a new tarball based on the hg repository
Source99: update.sh
Patch1: fix_build.patch
Patch2: fix-gcc5.patch
# PATCH-FEATURE-OPENSUSE zbar-Qt5.patch -- build against Qt5 libraries <aloisio@gmx.com>
Patch3: zbar-Qt5.patch
Patch4: fix-gcc8.patch
BuildRequires: ImageMagick-devel BuildRequires: ImageMagick-devel
# required by mercurial archive only
BuildRequires: autoconf BuildRequires: autoconf
BuildRequires: automake BuildRequires: automake
BuildRequires: libjpeg-devel
BuildRequires: libtool BuildRequires: libtool
BuildRequires: pkgconfig BuildRequires: pkgconfig
BuildRequires: libjpeg-devel
BuildRequires: libv4l-devel
BuildRequires: libXv-devel
BuildRequires: xmlto BuildRequires: xmlto
BuildRequires: python2-devel
BuildRequires: pkgconfig(Qt5Core) BuildRequires: pkgconfig(Qt5Core)
BuildRequires: pkgconfig(Qt5Gui) BuildRequires: pkgconfig(Qt5Gui)
BuildRequires: pkgconfig(Qt5Widgets) BuildRequires: pkgconfig(Qt5Widgets)
@ -78,46 +75,49 @@ This package contains all necessary include files, libraries,
configuration files and development tools needed to compile and link configuration files and development tools needed to compile and link
applications using the zbar library. applications using the zbar library.
%package -n libzbarqt0 %package -n lib%{name}qt0
Summary: ZBar Qt bindings Summary: ZBar Qt bindings
Group: System/Libraries Group: System/Libraries
%description -n libzbarqt0 %description -n lib%{name}qt0
This package provides ZBar Qt bindings. This package provides ZBar Qt bindings.
%package -n libzbarqt-devel %package -n lib%{name}qt-devel
Summary: Development environment for the ZBar Qt bindings library Summary: Development environment for the ZBar Qt bindings library
Group: Development/Libraries/C and C++ Group: Development/Libraries/C and C++
Requires: libzbarqt0 = %{version} Requires: lib%{name}qt0 = %{version}, lib%{name}-devel = %{version}
%description -n libzbarqt-devel %description -n lib%{name}qt-devel
This package contains all necessary include files, libraries, This package contains all necessary include files, libraries,
configuration files and development tools needed to compile and link configuration files and development tools needed to compile and link
applications using the zbar-qt library. applications using the zbar-qt library.
%prep %prep
%setup -q %setup -q
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%build %build
# for the Mercurial-based archive we need to get proper autoconf files # for the Mercurial-based archive we need to get proper autoconf files
autoreconf -fiv autoreconf -fiv
# Mercurial only? - This should not be required in a final release version!
export CFLAGS="%{optflags} -Wno-error=parentheses -Wno-error=deprecated-declarations"
%configure \ %configure \
--docdir=%{_docdir}/%{name} \ --docdir=%{_docdir}/%{name} \
--disable-static \ --disable-static \
--without-java \
--without-python \ --without-python \
--without-gtk --without-gtk
# rpath
sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
make %{?_smp_mflags} make %{?_smp_mflags}
%install %install
rm -rf %{buildroot}
%make_install %make_install
rm %{buildroot}%{_docdir}/zbar/INSTALL find %{buildroot} -name "*.la" -or -name "*.a" | xargs rm -f
find %{buildroot} -type f -name "*.la" -delete -print rm -rf %{buildroot}/usr/share/doc/zbar-%{version}/
rm -f %{buildroot}/usr/share/doc/packages/zbar/{COPYING,LICENSE,INSTALL}
%post -n %{libname} -p /sbin/ldconfig %post -n %{libname} -p /sbin/ldconfig
%postun -n %{libname} -p /sbin/ldconfig %postun -n %{libname} -p /sbin/ldconfig
@ -125,27 +125,39 @@ find %{buildroot} -type f -name "*.la" -delete -print
%postun -n libzbarqt0 -p /sbin/ldconfig %postun -n libzbarqt0 -p /sbin/ldconfig
%files %files
%doc ChangeLog README COPYING LICENSE NEWS %doc NEWS
%license COPYING LICENSE
%{_defaultdocdir}/%{name}/ %{_defaultdocdir}/%{name}/
%{_bindir}/zbar* %{_bindir}/zbarimg
%{_bindir}/zbarcam
%{_bindir}/zbarcam-qt
%{_mandir}/man1/* %{_mandir}/man1/*
%files -n %{libname} %files -n %{libname}
%{_libdir}/libzbar.so.* %{_libdir}/libzbar.so.*
%exclude %{python2_sitearch}/zbar.so
%exclude %{_includedir}/zbar/zbargtk.h
%files -n lib%{name}-devel %files -n lib%{name}-devel
%doc HACKING TODO
%dir %{_includedir}/%{name} %dir %{_includedir}/%{name}
%{_includedir}/zbar.h %{_includedir}/zbar.h
%{_includedir}/%{name}/*.h %{_includedir}/zbar/Exception.h
%exclude %{_includedir}/%{name}/zbargtk.h %{_includedir}/zbar/Symbol.h
%exclude %{_includedir}/%{name}/QZBar*.h %{_includedir}/zbar/Image.h
%{_includedir}/zbar/Scanner.h
%{_includedir}/zbar/Decoder.h
%{_includedir}/zbar/ImageScanner.h
%{_includedir}/zbar/Video.h
%{_includedir}/zbar/Window.h
%{_includedir}/zbar/Processor.h
%{_libdir}/libzbar.so %{_libdir}/libzbar.so
%{_libdir}/pkgconfig/zbar.pc %{_libdir}/pkgconfig/zbar.pc
%files -n libzbarqt0 %files -n lib%{name}qt0
%{_libdir}/libzbarqt.so.* %{_libdir}/libzbarqt.so.*
%files -n libzbarqt-devel %files -n lib%{name}qt-devel
%{_includedir}/%{name}/QZBar*.h %{_includedir}/%{name}/QZBar*.h
%{_libdir}/libzbarqt.so %{_libdir}/libzbarqt.so
%{_libdir}/pkgconfig/zbar-qt.pc %{_libdir}/pkgconfig/zbar-qt.pc