comparison qt/qtbase/qtbase.sh @ 675:c05fa46c5b62

qt/qtbase: initial import, closes #1544
author David Demelier <markand@malikania.fr>
date Wed, 31 Jul 2019 20:10:00 +0200
parents
children e91fbcb3d1ef
comparison
equal deleted inserted replaced
674:cff7770ad21a 675:c05fa46c5b62
1 #!/bin/sh
2 #
3 # Copyright (c) 2019 David Demelier <markand@malikania.fr>
4 #
5 # Permission to use, copy, modify, and/or distribute this software for any
6 # purpose with or without fee is hereby granted, provided that the above
7 # copyright notice and this permission notice appear in all copies.
8 #
9 # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16 #
17
18 # TODO: add option for PostgreSQL and mariadb.
19 # TODO: add optional dependencies for Qt modules (e.g. qt/qtwayland)
20
21 PKGNAME=qtbase
22 PKGVERSION=5.13.0
23 PKGREVISION=1
24 PKGLICENSE="GPLv3 LGPLv21"
25 PKGSUMMARY="cross platform SDK for developing applications"
26 PKGDOWNLOAD="http://download.qt-project.org/official_releases/qt/${PKGVERSION%.*}/$PKGVERSION/submodules/$PKGNAME-everywhere-src-$PKGVERSION.tar.xz"
27 PKGDEPENDS="lib/pcre2"
28 PKGOPTIONS="CUPS
29 DATABASES
30 DBUS
31 EVDEV
32 FONTCONFIG
33 FREETYPE
34 GLIB
35 GTK
36 GUI
37 HARFBUZZ
38 ICU
39 JPEG
40 KMS
41 LIBINPUT
42 MTDEV
43 OPENGL
44 PNG
45 SSL
46 SYSLOG
47 UDEV
48 X
49 ZLIB"
50
51 : ${CC:=clang}
52 : ${CXX:=clang++}
53 : ${CUPS:=yes}
54 : ${DATABASES:=sqlite} # (list) none, sqlite
55 : ${DBUS:=yes}
56 : ${EVDEV:=yes}
57 : ${FONTCONFIG:=yes}
58 : ${FREETYPE:=yes}
59 : ${GLIB:=yes}
60 : ${GTK:=yes}
61 : ${GUI:=yes} # requires FREETYPE
62 : ${HARFBUZZ:=yes}
63 : ${ICU:=yes}
64 : ${JPEG:=yes}
65 : ${KMS:=yes}
66 : ${LIBINPUT:=yes}
67 : ${MTDEV:=yes}
68 : ${OPENGL:=yes}
69 : ${PNG:=yes}
70 : ${SSL:=yes}
71 : ${SYSLOG:=no}
72 : ${UDEV:=yes}
73 : ${X:=yes}
74 : ${ZLIB:=yes}
75
76 if [ "$CXX" = "clang++" ]; then
77 platform="linux-clang"
78 else
79 platform="linux-g++"
80 fi
81
82 if [ "$CUPS" = "yes" ]; then
83 PKGDEPENDS="print/cups $PKGDEPENDS"
84 with_cups="-cups"
85 else
86 with_cups="-no-cups"
87 fi
88
89 #
90 # It looks like there is no option to disable all SQL drivers to create a
91 # "white" list of desired drivers so disable all by default unless it is listed
92 # in DATABASES option.
93 #
94 # First, create a list with unsupported databases in vanilla.
95 #
96 with_databases="-no-sql-db2
97 -no-sql-ibase
98 -no-sql-oci
99 -no-sql-odbc
100 -no-sql-sqlite2
101 -no-sql-tds"
102
103 if echo $DATABASES | grep -q "sqlite"; then
104 PKGDEPENDS="databases/sqlite $PKGDEPENDS"
105 with_databases="-sql-sqlite -system-sqlite $with_databases"
106 else
107 with_databases="-no-sql-sqlite $with_databases"
108 fi
109
110 if [ "$DBUS" = "yes" ]; then
111 PKGDEPENDS="network/dbus $PKGDEPENDS"
112 with_dbus="-dbus-linked"
113 else
114 with_dbus="-no-dbus"
115 fi
116
117 if [ "$EVDEV" = "yes" ]; then
118 with_evdev="-evdev"
119 else
120 with_evdev="-no-evdev"
121 fi
122
123 if [ "$FONTCONFIG" = "yes" ]; then
124 PKGDEPENDS="fonts/fontconfig $PKGDEPENDS"
125 with_fontconfig="-fontconfig"
126 else
127 with_fontconfig="-no-fontconfig"
128 fi
129
130 if [ "$FREETYPE" = "yes" ]; then
131 PKGDEPENDS="fonts/freetype $PKGDEPENDS"
132 with_freetype="-system-freetype"
133 else
134 with_freetype="-no-freetype"
135 fi
136
137 if [ "$GLIB" = "yes" ]; then
138 PKGDEPENDS="lib/glib $PKGDEPENDS"
139 with_glib="-glib"
140 else
141 with_glib="-no-glib"
142 fi
143
144 if [ "$GTK" = "yes" ]; then
145 PKGDEPENDS="graphics/gtk $PKGDEPENDS"
146 with_gtk="-gtk"
147 else
148 with_gtk="-no-gtk"
149 fi
150
151 if [ "$GUI" = "yes" ]; then
152 if [ "$FREETYPE" != "yes" ]; then
153 echo "warning: GUI requires FREETYPE" 1>&2
154 fi
155
156 with_gui="-gui"
157 else
158 with_gui="-no-gui"
159 fi
160
161 if [ "$HARFBUZZ" = "yes" ]; then
162 PKGDEPENDS="fonts/harfbuzz $PKGDEPENDS"
163 with_harfbuzz="-system-harfbuzz"
164 else
165 with_harfbuzz="-no-harfbuzz"
166 fi
167
168 if [ "$ICU" = "yes" ]; then
169 PKGDEPENDS="lib/icu $PKGDEPENDS"
170 with_icu="-icu"
171 else
172 with_icu="-no-icu"
173 fi
174
175 if [ "$KMS" = "yes" ]; then
176 PKGDEPENDS="graphics/libdrm $PKGDEPENDS"
177 with_kms="-kms"
178 else
179 with_kms="-no-kms"
180 fi
181
182 if [ "$LIBINPUT" = "yes" ]; then
183 PKGDEPENDS="lib/libinput $PKGDEPENDS"
184 with_libinput="-libinput"
185 else
186 with_libinput="-no-libinput"
187 fi
188
189 if [ "$MTDEV" = "yes" ]; then
190 PKGDEPENDS="lib/mtdev $PKGDEPENDS"
191 with_mtdev="-mtdev"
192 else
193 with_mtdev="-no-mtdev"
194 fi
195
196 if [ "$JPEG" = "yes" ]; then
197 PKGDEPENDS="lib/libjpeg-turbo $PKGDEPENDS"
198 with_jpeg="-system-libjpeg"
199 else
200 with_jpeb="-no-libjpeg"
201 fi
202
203 if [ "$OPENGL" = "yes" ]; then
204 with_opengl="-opengl"
205 else
206 with_opengl="-no-opengl"
207 fi
208
209 if [ "$PNG" = "yes" ]; then
210 PKGDEPENDS="lib/libpng $PKGDEPENDS"
211 with_png="-system-libpng"
212 else
213 with_png="-no-libpng"
214 fi
215
216 if [ "$SSL" = "yes" ]; then
217 PKGDEPENDS="crypto/libressl $PKGDEPENDS"
218 with_ssl="-ssl -openssl-linked"
219 else
220 with_ssl="-no-openssl"
221 fi
222
223 if [ "$SYSLOG" = "yes" ]; then
224 with_syslog="-syslog"
225 else
226 with_syslog="-no-syslog"
227 fi
228
229 if [ "$UDEV" = "yes" ]; then
230 PKGDEPENDS="core/eudev $PKGDEPENDS"
231 with_udev="-libudev"
232 else
233 with_udev="-no-libudev"
234 fi
235
236 if [ "$X" = "yes" ]; then
237 with_x="-xcb -xcb-xlib -xcb-xinput"
238 else
239 with_x="-no-xcb -no-xcb-xlib -no-xcb-xinput"
240 fi
241
242 if [ "$ZLIB" = "yes" ]; then
243 PKGDEPENDS="compression/zlib $PKGDEPENDS"
244 with_zlib="-system-zlib"
245 else
246 with_zlib="-no-zlib"
247 fi
248
249 build()
250 {
251 rm -rf $PKGNAME-everywhere-src-$PKGVERSION
252 tar xvf $PKGNAME-everywhere-src-$PKGVERSION.tar.xz
253 cd $PKGNAME-everywhere-src-$PKGVERSION
254
255 # https://github.com/void-linux/void-packages/tree/master/srcpkgs/qt5/patches
256 patch -p0 < ../patch-libressl.patch
257 patch -p0 < ../patch-musl.patch
258 PKG_CONFIG_PATH=/lib/pkgconfig \
259 ./configure \
260 -opensource \
261 -prefix / \
262 -archdatadir /lib/qt \
263 -datadir /share/qt \
264 -docdir /share/doc/qt \
265 -libexecdir /libexec \
266 -confirm-license \
267 -release \
268 -platform $platform \
269 -nomake examples \
270 -nomake tests \
271 -system-pcre \
272 $with_cups \
273 $with_databases \
274 $with_dbus \
275 $with_evdev \
276 $with_fontconfig \
277 $with_freetype \
278 $with_glib \
279 $with_gtk \
280 $with_gui \
281 $with_harfbuzz \
282 $with_icu \
283 $with_kms \
284 $with_libinput \
285 $with_opengl \
286 $with_png \
287 $with_ssl \
288 $with_syslog \
289 $with_udev \
290 $with_x \
291 $with_zlib
292 make
293 make install INSTALL_ROOT=$DESTDIR
294 rm -f $DESTDIR/lib/libQt*.la
295
296 cd ..
297 rm -rf $PKGNAME-everywhere-src-$PKGVERSION
298 }