9522c2f4bf7422cac40d45578607b81d25e3ccd6
[portage-overlay.git] / app-crypt / pinentry / files / pinentry-0.9.6-add-disable-pinentry-qt5-option.patch
1 From 08ec9556c8a384ea7bb5d42d3f6aab6c2f6a8786 Mon Sep 17 00:00:00 2001
2 From: Andre Heinecke <aheinecke@intevation.de>
3 Date: Fri, 25 Sep 2015 15:56:55 +0200
4 Subject: [PATCH] Add option to disable looking for qt5
5
6 * m4/qt.m4 (FIND_QT): Add --disable-pinentry-qt5 option to
7 disable qt5 support even if it is available.
8
9 --
10 As requested by Kristan F.
11
12 GnuPG-bug-id: 2105
13 ---
14  m4/qt.m4 | 23 ++++++++++++++++-------
15  1 file changed, 16 insertions(+), 7 deletions(-)
16
17 diff --git a/m4/qt.m4 b/m4/qt.m4
18 index 0a7ea99..0e47ec6 100644
19 --- a/m4/qt.m4
20 +++ b/m4/qt.m4
21 @@ -28,15 +28,24 @@ dnl The moc lookup code is based on libpoppler (rev. d821207)
22  
23  AC_DEFUN([FIND_QT],
24  [
25 -  PKG_CHECK_MODULES(PINENTRY_QT,
26 -                    Qt5Core >= 5.0.0 Qt5Gui >= 5.0.0 Qt5Widgets >= 5.0.0,
27 -                    [have_qt5_libs="yes"],
28 -                    [have_qt5_libs="no"])
29 +  AC_ARG_ENABLE(pinentry-qt5,
30 +                AC_HELP_STRING([--disable-pinentry-qt5],
31 +                           [Don't use qt5 even if it is available.]),
32 +                enable_pinentry_qt5=$enableval,
33 +                enable_pinentry_qt5="try")
34  
35 -  if "$PKG_CONFIG" --variable qt_config Qt5Core | grep -q "reduce_relocations"; then
36 -    PINENTRY_QT_CFLAGS="$PINENTRY_QT_CFLAGS -fpic"
37 -  fi
38 +  have_qt5_libs="no";
39 +
40 +  if test "$enable_pinentry_qt5" != "no"; then
41 +    PKG_CHECK_MODULES(PINENTRY_QT,
42 +                      Qt5Core >= 5.0.0 Qt5Gui >= 5.0.0 Qt5Widgets >= 5.0.0,
43 +                      [have_qt5_libs="yes"],
44 +                      [have_qt5_libs="no"])
45  
46 +    if "$PKG_CONFIG" --variable qt_config Qt5Core | grep -q "reduce_relocations"; then
47 +      PINENTRY_QT_CFLAGS="$PINENTRY_QT_CFLAGS -fpic"
48 +    fi
49 +  fi
50    if test "$have_qt5_libs" = "yes"; then
51      AC_CHECK_TOOL(MOC, moc)
52      AC_MSG_CHECKING([moc version])
53 -- 
54 2.1.4
55