summaryrefslogtreecommitdiff
path: root/app-crypt/xca/files/xca-1.3.2-build.patch
blob: 9ca8a670da3346d4c60ff4b4c347a60281262d9a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
From 476aa73644e6b3d353a1ed1cf3982e7114875088 Mon Sep 17 00:00:00 2001
From: Alon Bar-Lev <alon.barlev@gmail.com>
Date: Fri, 3 Jun 2016 23:15:29 +0300
Subject: [PATCH 1/2] build: add --with-qt-version to force specific qt linkage

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
---
 configure.ac | 43 ++++++++++++++++++++++++++++---------------
 1 file changed, 28 insertions(+), 15 deletions(-)

diff --git a/configure.ac b/configure.ac
index 32ba42b..8490a88 100644
--- a/configure.ac
+++ b/configure.ac
@@ -90,18 +90,28 @@ if test -n "${_QTDIR}" && test -d "${_QTDIR}"; then
   DYLD_LIBRARY_PATH="${_QTDIR}/lib:${DYLD_LIBRARY_PATH}"
 fi
 
-PKG_CHECK_MODULES(Qt5, [Qt5Core >= 5.0, Qt5Widgets >= 5.0], [
-  _QT_HOST_BINS="`pkg-config --variable=host_bins Qt5Core`"
-  QT_MOC="${_QT_HOST_BINS}/moc"
-  QT_UIC="${_QT_HOST_BINS}/uic"
-  if test -n "$DARWIN"; then
-    FRAMEDIR=`pkg-config --variable=libdir Qt5Core`
-    Qt5_CFLAGS="$Qt5_CFLAGS -F${FRAMEDIR} -I${FRAMEDIR}/QtCore.framework/Headers -I${FRAMEDIR}/QtGui.framework/Headers -I${FRAMEDIR}/QtWdgets.framework/Headers"
-  fi
-  QT_VERSION=5
-  QT_CFLAGS="${Qt5_CFLAGS} -fPIC"
-  QT_LIBS="${Qt5_LIBS}"
-], [
+AC_ARG_WITH([qt-version],
+  AS_HELP_STRING([--with-qt-version], [Select the Qt version]),
+  [WANT_QT_VERSION="$withval"],
+  [WANT_QT_VERSION=detect])
+
+if test "${WANT_QT_VERSION}" = detect -o "${WANT_QT_VERSION}" = 5; then
+  PKG_CHECK_MODULES(Qt5, [Qt5Core >= 5.0, Qt5Widgets >= 5.0], [
+    _QT_HOST_BINS="`pkg-config --variable=host_bins Qt5Core`"
+    QT_MOC="${_QT_HOST_BINS}/moc"
+    QT_UIC="${_QT_HOST_BINS}/uic"
+    if test -n "$DARWIN"; then
+      FRAMEDIR=`pkg-config --variable=libdir Qt5Core`
+      Qt5_CFLAGS="$Qt5_CFLAGS -F${FRAMEDIR} -I${FRAMEDIR}/QtCore.framework/Headers -I${FRAMEDIR}/QtGui.framework/Headers -I${FRAMEDIR}/QtWdgets.framework/Headers"
+    fi
+    WANT_QT_VERSION=5
+    QT_VERSION=5
+    QT_CFLAGS="${Qt5_CFLAGS} -fPIC"
+    QT_LIBS="${Qt5_LIBS}"
+])
+fi
+
+if test "${WANT_QT_VERSION}" = detect -o "${WANT_QT_VERSION}" = 4; then
   PKG_CHECK_MODULES(Qt4, [QtCore >= 4.6, QtCore < 5.0, QtGui >= 4.6, QtGui < 5.0], [
     QT_MOC="`pkg-config --variable=moc_location QtCore`"
     QT_UIC="`pkg-config --variable=uic_location QtCore`"
@@ -112,18 +122,21 @@ PKG_CHECK_MODULES(Qt5, [Qt5Core >= 5.0, Qt5Widgets >= 5.0], [
       FRAMEDIR=`pkg-config --variable=libdir QtCore`
       Qt4_CFLAGS="$Qt4_CFLAGS -F${FRAMEDIR} -I${FRAMEDIR}/QtCore.framework/Headers -I${FRAMEDIR}/QtGui.framework/Headers"
     fi
+    WANT_QT_VERSION=4
     QT_VERSION=4
     QT_CFLAGS="${Qt4_CFLAGS}"
     QT_LIBS="${Qt4_LIBS}"
-  ], [
+  ])
+fi
+
+if test -z "${QT_VERSION}"; then
     if test -z "$DARWIN"; then
       QT_LIBS=" -lQtCore -lQtGui "
     else
       QT_LIBS=" -framework QtGui -framework QtCore "
     fi
     AC_MSG_WARN([Qt pkg-config failed, using fallback defaults (${QT_LIBS})]);
-  ])
-])
+fi
 
 AC_SUBST([QT_CFLAGS])
 AC_SUBST([QT_LIBS])
-- 
2.7.3

From 7112df9532f71cb3a150fef61b2d7e5d9899634c Mon Sep 17 00:00:00 2001
From: Alon Bar-Lev <alon.barlev@gmail.com>
Date: Fri, 3 Jun 2016 23:58:01 +0300
Subject: [PATCH 2/2] build: add --disable-doc to disable doc installation

---
 Local.mak.in |  1 +
 configure.ac | 37 +++++++++++++++++++++++--------------
 doc/Makefile | 10 +++++-----
 3 files changed, 29 insertions(+), 19 deletions(-)

diff --git a/Local.mak.in b/Local.mak.in
index cd5ebfc..d993b8b 100644
--- a/Local.mak.in
+++ b/Local.mak.in
@@ -19,6 +19,7 @@ STRIP=@STRIP@
 DOCTOOL=@DOCTOOL@
 MACDEPLOYQT=@MACDEPLOYQT@
 DARWIN=@DARWIN@
+ENABLE_DOC=@ENABLE_DOC@
 
 PACKAGE_TARNAME=@PACKAGE_TARNAME@
 HOST=linux
diff --git a/configure.ac b/configure.ac
index 8490a88..03d729e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -202,20 +202,29 @@ AX_CHECK_GNU_MAKE()
 
 # linuxdoc application detection
 ##################################
-AC_CHECK_PROGS([DOCTOOL], [linuxdoc sgml2html], [":"])
-AC_SUBST([DOCTOOL])
-
-case "$DOCTOOL" in
- linuxdoc) DOCTOOL="linuxdoc -B html";;
- sgml2html) DOCTOOL="sgml2html -s 1";;
- :)
-  if test "${srcdir}" != "."; then
-    mkdir -p doc
-    cp ${srcdir}/doc/xca-doc.tgz doc/
-  fi
-  AC_MSG_WARN(['linuxdoc' or 'sgml2html' not found, using pre-compiled documentation])
-  ;;
-esac
+AC_ARG_ENABLE([doc],
+  AS_HELP_STRING([--disable-doc], [Disable documentation installation]),
+  ,
+  [enable_doc=yes])
+test "${enable_doc}" = "yes" && ENABLE_DOC= || ENABLE_DOC='\#'
+AC_SUBST([ENABLE_DOC])
+
+if test "${enable_doc}"; then
+  AC_CHECK_PROGS([DOCTOOL], [linuxdoc sgml2html], [":"])
+  AC_SUBST([DOCTOOL])
+
+  case "$DOCTOOL" in
+   linuxdoc) DOCTOOL="linuxdoc -B html";;
+   sgml2html) DOCTOOL="sgml2html -s 1";;
+   :)
+    if test "${srcdir}" != "."; then
+      mkdir -p doc
+      cp ${srcdir}/doc/xca-doc.tgz doc/
+    fi
+    AC_MSG_WARN(['linuxdoc' or 'sgml2html' not found, using pre-compiled documentation])
+    ;;
+  esac
+fi
 
 # Setup done. Write local.h and Local.mak
 ############################################
diff --git a/doc/Makefile b/doc/Makefile
index fce4acf..7bf802f 100644
--- a/doc/Makefile
+++ b/doc/Makefile
@@ -17,13 +17,13 @@ xca.html: xca.sgml
 	echo 'The documentation for XCA can be viewed online at: <a href="http://xca.sourceforge.net/">http://xca.sourceforge.net/</a>.' > $@
 	test ! -f xca-doc.tgz || tar zxf xca-doc.tgz
 	@$(PRINT) "  DOC    [$(BASENAME)] $@"
-	$(DOCTOOL) $< >/dev/null
+	$(ENABLE_DOC)$(DOCTOOL) $< >/dev/null
 
 install: $(doc)
-	install -m 755 -d $(destdir)$(htmldir) \
-		$(destdir)$(mandir)/man1
-	install -m 644 xca*.html $(destdir)$(htmldir)
-	install *.1.gz $(destdir)/$(mandir)/man1
+	$(ENABLE_DOC)install -m 755 -d $(destdir)$(htmldir)
+	$(ENABLE_DOC)install -m 644 xca*.html $(destdir)$(htmldir)
+	install -m 755 -d $(destdir)$(mandir)/man1
+	install -m 644 *.1.gz $(destdir)/$(mandir)/man1
 
 app: xca.html
 	mkdir -p $(APPDIR)/Resources
-- 
2.7.3