From 9b9abeebc11c54db6a667ef3d9eb79e558ee9ce4009e64152affb80266a33654 Mon Sep 17 00:00:00 2001 From: Bruno Friedmann Date: Fri, 11 Aug 2017 17:27:36 +0000 Subject: [PATCH] Accepting request 516083 from home:alois:branches:Application:Geo OBS-URL: https://build.opensuse.org/request/show/516083 OBS-URL: https://build.opensuse.org/package/show/Application:Geo/zbar?expand=0&rev=24 --- zbar-Qt5.patch | 109 +++++++++++++++++++++++++++++++++++++++++++++++++ zbar.changes | 5 +++ zbar.spec | 8 +++- 3 files changed, 121 insertions(+), 1 deletion(-) create mode 100644 zbar-Qt5.patch diff --git a/zbar-Qt5.patch b/zbar-Qt5.patch new file mode 100644 index 0000000..1c9b3da --- /dev/null +++ b/zbar-Qt5.patch @@ -0,0 +1,109 @@ +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 +-#include ++#include ++#include + #include + #include + #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} diff --git a/zbar.changes b/zbar.changes index 35dd27b..ec58a35 100644 --- a/zbar.changes +++ b/zbar.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Sat Aug 5 19:22:42 UTC 2017 - aloisio@gmx.com + +- Added zbar-Qt5.patch to build against Qt5 + ------------------------------------------------------------------- Fri Feb 3 17:10:25 UTC 2017 - jengelh@inai.de diff --git a/zbar.spec b/zbar.spec index 2d5539a..8c01d0d 100644 --- a/zbar.spec +++ b/zbar.spec @@ -31,15 +31,20 @@ Source98: baselibs.conf Source99: update.sh Patch1: fix_build.patch Patch2: fix-gcc5.patch +# PATCH-FEATURE-OPENSUSE zbar-Qt5.patch -- build against Qt5 libraries +Patch3: zbar-Qt5.patch BuildRequires: ImageMagick-devel # required by mercurial archive only BuildRequires: autoconf BuildRequires: automake BuildRequires: gtk2-devel -BuildRequires: libqt4-devel BuildRequires: libtool BuildRequires: python-gtk-devel BuildRequires: xmlto +BuildRequires: pkgconfig(Qt5Core) +BuildRequires: pkgconfig(Qt5Gui) +BuildRequires: pkgconfig(Qt5Widgets) +BuildRequires: pkgconfig(Qt5X11Extras) BuildRoot: %{_tmppath}/%{name}-%{version}-build %description @@ -128,6 +133,7 @@ This package provides ZBar Python-Gtk bindings. %setup -q %patch1 -p1 %patch2 -p1 +%patch3 -p1 %build # for the Mercurial-based archive we need to get proper autoconf files