void-packages/srcpkgs/zbar/patches/check-qt5-first.patch

71 lines
2.6 KiB
Diff

From aab155cde51e44334022bcaddb694c014f800ae8 Mon Sep 17 00:00:00 2001
From: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Date: Sun, 26 Mar 2017 08:35:16 -0300
Subject: [PATCH] configure.ac: check for Qt5 version first
Despite zbar can be compiled with either Qt4 or Qt5, the
current logic seeks only Qt4. Change it to try first Qt5.
Yet, as people may have both but want to build it with
Qt4, add a --without-qt5 configuration option that will
make it to check only for Qt4, just like before.
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
---
configure.ac | 24 ++++++++++++++++--------
1 file changed, 16 insertions(+), 8 deletions(-)
diff --git a/configure.ac b/configure.ac
index d49094c..70b759d 100644
--- configure.ac
+++ configure.ac
@@ -364,18 +364,26 @@ 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"])
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"])
@@ -453,9 +461,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 "NPAPI Plugin --with-npapi=$with_npapi"
#AS_IF([test "x$with_mozilla" != "xyes"],
# [echo " => the Mozilla/Firefox/OpenOffice plugin will *NOT* be built"])
--
2.19.0