level Qt up to version 5.7.0 + several bug fixes
[feed/video.git] / frameworks / qt5base / Makefile
1 #
2 # Copyright (C) 2016 OpenWrt.org
3 # Author: Mirko Vogt <mirko-openwrt@nanl.de>
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 # TODO / known bugs:
9 # - plugins don't work when sstrip is used for stripping
10 # - no X11/wayland/xcb/kms support so far - primary target is linuxfb
11
12 include $(TOPDIR)/rules.mk
13
14 PKG_NAME:=qt5base
15 PKG_VERSION:=5.7.0
16 PKG_RELEASE:=1
17 PKG_MD5SUM:=184f9460b40752d71b15b827260580c2
18
19 PKG_SYS_NAME:=qtbase-opensource-src-$(PKG_VERSION)
20 PKG_SOURCE:=$(PKG_SYS_NAME).tar.xz
21 PKG_SOURCE_URL:=http://download.qt-project.org/official_releases/qt/$(basename $(PKG_VERSION))/$(PKG_VERSION)/submodules
22
23 PKG_BUILD_DIR=$(BUILD_DIR)/$(PKG_SYS_NAME)
24 PKG_BUILD_PARALLEL:=1
25 PKG_BUILD_DEPENDS:=librpc
26 PKG_INSTALL:=1
27 PKG_USE_MIPS16:=0
28
29 include $(INCLUDE_DIR)/package.mk
30 include $(INCLUDE_DIR)/nls.mk
31 include ./files/qmake.mk
32
33 PKG_CONFIG_DEPENDS:= \
34 CONFIG_PACKAGE_qt5base-plugin-imageformats-jpeg \
35 CONFIG_PACKAGE_qt5base-plugin-imageformats-png \
36 CONFIG_PACKAGE_qt5base-network \
37 CONFIG_PACKAGE_qt5base-gui \
38 CONFIG_PACKAGE_qt5base-gl \
39 CONFIG_PACKAGE_qt5base-widgets \
40 CONFIG_PACKAGE_qt5base-examples \
41 CONFIG_PACKAGE_qt5base-plugin-platforms-minimal \
42 CONFIG_PACKAGE_qt5base-plugin-platforms-linuxfb \
43 # CONFIG_PACKAGE_qt5base-plugin-platforms-eglfs \
44 # CONFIG_PACKAGE_qt5base-plugin-platforms-minimalegl \
45
46 # Do not use sstrip for QT5. When sstrip is used the QT5 plugin loading does
47 # not work, because of QT''s internal elf parser, see
48 # https://bugreports.qt.io/browse/QTBUG-52567
49 # Use the code from the gcc package to use strip instaed.
50 ifneq ($(CONFIG_USE_SSTRIP),)
51 STRIP:=$(TARGET_CROSS)strip $(call qstrip,$(CONFIG_STRIP_ARGS))
52 RSTRIP:= \
53 export CROSS="$(TARGET_CROSS)" \
54 $(if $(CONFIG_KERNEL_KALLSYMS),NO_RENAME=1) \
55 $(if $(CONFIG_KERNEL_PROFILING),KEEP_SYMBOLS=1); \
56 NM="$(TARGET_CROSS)nm" \
57 STRIP="$(STRIP)" \
58 STRIP_KMOD="$(SCRIPT_DIR)/strip-kmod.sh" \
59 $(SCRIPT_DIR)/rstrip.sh
60 endif
61
62 define Package/qt5base/Default
63 SECTION:=video-frameworks
64 CATEGORY:=Video
65 SUBMENU:=Frameworks and Toolkits
66 TITLE:=Qt5base
67 DEPENDS+=qt5base
68 URL:=http://qt.io
69 MAINTAINER:=Mirko Vogt <mirko@openwrt.org>
70 endef
71
72 define Package/qt5base
73 $(call Package/qt5base/Default)
74 DEPENDS:=
75 MENU:=1
76 endef
77
78 define Package/qt5base-concurrent
79 $(call Package/qt5base/Default)
80 TITLE+=concurrent
81 DEPENDS+=+qt5base-core
82 endef
83
84 define Package/qt5base-gl
85 $(call Package/qt5base/Default)
86 TITLE+=gl
87 DEPENDS+=+qt5base-core +qt5base-gui +qt5base-widgets
88 endef
89
90 define Package/qt5base-core
91 $(call Package/qt5base/Default)
92 TITLE+=core
93 DEPENDS+=+libpthread +zlib +libpcre16 +libstdcpp +librt +libdouble-conversion $(ICONV_DEPENDS) #+icu
94 endef
95
96 define Package/qt5base-gui
97 $(call Package/qt5base/Default)
98 TITLE+=gui
99 DEPENDS+=+qt5base-core +qt5quick2-2d-sw-renderer-GLstubs +libpng +fontconfig +libfreetype +libudev
100 endef
101
102 define Package/qt5base-network
103 $(call Package/qt5base/Default)
104 TITLE+=network
105 DEPENDS+=+qt5base-core +libopenssl
106 endef
107
108 # seems to be only present as static lib
109 # define Package/qt5base-paltformSupport
110 # $(call Package/qt5base/Default)
111 # DEPENDS+=
112 # endef
113
114 define Package/qt5base-printSupport
115 $(call Package/qt5base/Default)
116 TITLE+=print support
117 DEPENDS+=+qt5base-core +qt5base-gui +qt5base-widgets
118 endef
119
120 define Package/qt5base-sql
121 $(call Package/qt5base/Default)
122 TITLE+=sql
123 DEPENDS+=+qt5base-core
124 endef
125
126 define Package/qt5base-test
127 $(call Package/qt5base/Default)
128 TITLE+=test
129 DEPENDS+=+qt5base-core
130 endef
131
132 define Package/qt5base-widgets
133 $(call Package/qt5base/Default)
134 TITLE+=widgets
135 DEPENDS+=+qt5base-core +qt5base-gui
136 endef
137
138 define Package/qt5base-xml
139 $(call Package/qt5base/Default)
140 TITLE+=xml
141 DEPENDS+=+qt5base-core
142 endef
143
144 #### plugins
145
146 ####### bearer
147
148 define Package/qt5base-plugin-bearer-generic
149 $(call Package/qt5base/Default)
150 TITLE+=bearer (plugin)
151 DEPENDS+=+qt5base-core +qt5base-network
152 endef
153
154 ####### generic / input
155
156 define Package/qt5base-plugin-input-evdevkeyboard
157 $(call Package/qt5base/Default)
158 TITLE+=evdev keyboard (plugin)
159 DEPENDS+=+qt5base-core +qt5base-gui +libfreetype +fontconfig
160 endef
161
162 define Package/qt5base-plugin-input-evdevmouse
163 $(call Package/qt5base/Default)
164 TITLE+=evdev mouse (plugin)
165 DEPENDS+=+qt5base-core +qt5base-gui +libfreetype +fontconfig
166 endef
167
168 define Package/qt5base-plugin-input-evdevtablet
169 $(call Package/qt5base/Default)
170 TITLE+=evdev tablet (plugin)
171 DEPENDS+=+qt5base-core +qt5base-gui +libfreetype +fontconfig
172 endef
173
174 define Package/qt5base-plugin-input-evdevtouch
175 $(call Package/qt5base/Default)
176 TITLE+=evdev touch (plugin)
177 DEPENDS+=+qt5base-core +qt5base-gui +libfreetype +fontconfig
178 endef
179
180 ####### imageformats
181
182 #define Package/qt5base-plugin-imageformats-gif
183 # $(call Package/qt5base/Default)
184 #TITLE+=imageformat gif (plugin)
185 # DEPENDS+=+qt5base-core +qt5base-gui
186 #endef
187
188 define Package/qt5base-plugin-imageformats-ico
189 $(call Package/qt5base/Default)
190 TITLE+=imageformat ico (plugin)
191 DEPENDS+=+qt5base-core +qt5base-gui
192 endef
193
194 define Package/qt5base-plugin-imageformats-jpeg
195 $(call Package/qt5base/Default)
196 TITLE+=imageformat jpeg (plugin)
197 DEPENDS+=+qt5base-core +qt5base-gui +libjpeg
198 endef
199
200 ####### platforms
201
202 #define Package/qt5base-plugin-platforms-eglfs
203 # $(call Package/qt5base/Default)
204 # TITLE+=platform eglfs (plugin)
205 # DEPENDS+=+qt5base-core +qt5base-gui +libfreetype +fontconfig
206 #endef
207
208 #define Package/qt5base-plugin-platforms-minimalegl
209 # $(call Package/qt5base/Default)
210 # TITLE+=platform minimalegl (plugin)
211 # DEPENDS+=+qt5base-core +qt5base-gui +libfreetype +fontconfig
212 #endef
213
214 define Package/qt5base-plugin-platforms-linuxfb
215 $(call Package/qt5base/Default)
216 TITLE+=platform linuxfb (plugin)
217 DEPENDS+=+qt5base-core +qt5base-gui +libfreetype +fontconfig
218 endef
219
220 define Package/qt5base-plugin-platforms-minimal
221 $(call Package/qt5base/Default)
222 TITLE+=platform minimal (plugin)
223 DEPENDS+=+qt5base-core +qt5base-gui +libfreetype +fontconfig
224 endef
225
226 define Package/qt5base-plugin-platforms-offscreen
227 $(call Package/qt5base/Default)
228 TITLE+=platform offscreen (plugin)
229 DEPENDS+=+qt5base-core +qt5base-gui +libfreetype +fontconfig
230 endef
231
232 ###### sql
233
234 #define Package/qt5base-plugin-sqldrivers-sqlite
235 # $(call Package/qt5base/Default)
236 # TITLE+=sqldriver sqlite (plugin)
237 # DEPENDS+=+qt5base-core +qt5base-sql +libsqlite3
238 #endef
239
240 define Package/qt5base-examples
241 $(call Package/qt5base/Default)
242 TITLE+=examples
243 DEPENDS+=\
244 +qt5base-core \
245 +qt5base-gui \
246 +qt5base-widgets \
247 +qt5base-network \
248 +qt5base-sql \
249 +qt5base-xml \
250 +qt5base-printSupport \
251 +qt5base-concurrent \
252 +qt5base-gl
253 endef
254
255 define Build/Prepare
256 $(call Build/Prepare/Default)
257 $(CP) \
258 ./files/mkspecs/linux-openwrt-g++ \
259 $(PKG_BUILD_DIR)/mkspecs/
260 endef
261
262 TARGET_CFLAGS += \
263 -I$(STAGING_DIR)/usr/include/freetype2 \
264 -I$(STAGING_DIR)/usr/include/libdrm
265
266 define Build/Configure
267 # CROSS/TARGET_* need to be passed to configure, in order to use cross-compiling tools to check for requirements.
268 # Usually used variables such as CC/CXX/CFLAGS/CXXFLAGS/LDFLAGS would be used for compilation of host tools (qmake, moc, etc.),
269 # hence we use the TARGET_* nomenclature.
270 ( cd $(PKG_BUILD_DIR) ; \
271 TARGET_CROSS="$(TARGET_CROSS)" \
272 TARGET_CFLAGS="$(TARGET_CFLAGS)" \
273 TARGET_CXXFLAGS="$(TARGET_CFLAGS) $(TARGET_CXXFLAGS)" \
274 TARGET_LDFLAGS="$(TARGET_LDFLAGS)" \
275 ./configure \
276 -prefix $(QT_INSTALL_PREFIX) \
277 -extprefix $(QT_EXTPREFIX) \
278 -hostprefix $(QT_HOST_PREFIX) \
279 -no-gcc-sysroot \
280 -bindir $(QT_INSTALL_BINS) \
281 -headerdir $(QT_INSTALL_HEADERS) \
282 -libdir $(QT_INSTALL_LIBS) \
283 -archdatadir $(QT_INSTALL_ARCHDATA) \
284 -plugindir $(QT_INSTALL_PLUGINS) \
285 -libexecdir $(QT_INSTALL_LIBEXECS) \
286 -importdir $(QT_INSTALL_IMPORTS) \
287 -qmldir $(QT_INSTALL_QML) \
288 -datadir $(QT_INSTALL_DATA) \
289 -docdir $(QT_INSTALL_DOCS) \
290 -translationdir $(QT_INSTALL_TRANSLATIONS) \
291 -sysconfdir $(QT_INSTALL_CONFIGURATION) \
292 -examplesdir $(QT_INSTALL_EXAMPLES) \
293 -testsdir $(QT_INSTALL_TESTS) \
294 -hostbindir $(QT_HOST_BINS) \
295 -hostlibdir $(QT_HOST_LIBS) \
296 -hostdatadir $(QT_HOST_DATA) \
297 -v \
298 -release \
299 -no-optimized-tools \
300 -opensource \
301 -confirm-license \
302 -shared \
303 -largefile \
304 -accessibility \
305 -no-sql-db2 \
306 -no-sql-ibase \
307 -no-sql-mysql \
308 -no-sql-oci \
309 -no-sql-odbc \
310 -no-sql-psql \
311 -no-sql-sqlite \
312 -no-sql-sqlite2 \
313 -no-sql-tds \
314 -system-sqlite \
315 -no-qml-debug \
316 -no-sse3 \
317 -no-ssse3 \
318 -no-sse4.1 \
319 -no-sse4.2 \
320 -no-avx \
321 -no-avx2 \
322 -no-avx512 \
323 $(if $(findstring -mdsp,$(TARGET_CFLAGS)),,-no-mips_dsp) \
324 $(if $(findstring -mdspr2,$(TARGET_CFLAGS)),,-no-mips_dspr2) \
325 -no-mips_dspr2 \
326 -force-pkg-config \
327 -system-zlib \
328 -no-mtdev \
329 -no-journald \
330 -syslog \
331 -no-gif \
332 $(if $(CONFIG_PACKAGE_qt5base-gui),-system-libpng,-no-libpng) \
333 $(if $(CONFIG_PACKAGE_qt5base-plugin-imageformats-jpeg),-system-libjpeg,-no-libjpeg) \
334 -system-doubleconversion \
335 -system-freetype \
336 -no-harfbuzz \
337 $(if $(CONFIG_PACKAGE_qt5base-network),-openssl-linked,-no-openssl) \
338 -no-libproxy \
339 -system-pcre \
340 -system-xcb \
341 -system-xkbcommon \
342 -no-xinput2 \
343 -no-xcb-xlib \
344 -no-glib \
345 -no-pulseaudio \
346 -no-alsa \
347 -no-gtk \
348 -no-optimized-qmake \
349 -nomake tools \
350 -make examples \
351 $(if $(CONFIG_PACKAGE_qt5base-examples),-make examples,-nomake examples) \
352 $(if $(CONFIG_PACKAGE_qt5base-gui),-gui,-no-gui) \
353 $(if $(CONFIG_PACKAGE_qt5base-widgets),-widgets,-no-widgets) \
354 -no-nis \
355 -no-cups \
356 $(if $(CONFIG_BUILD_NLS),-iconv,-no-iconv) \
357 -evdev \
358 -no-tslib \
359 -no-icu \
360 -fontconfig \
361 -no-strip \
362 -no-pch \
363 -no-dbus \
364 -no-reduce-relocations \
365 -no-use-gold-linker \
366 -no-xcb \
367 -no-eglfs \
368 -no-kms \
369 -no-gbm \
370 -no-directfb \
371 $(if $(CONFIG_PACKAGE_qt5base-plugin-platforms-linuxfb),-linuxfb,-no-linuxfb) \
372 -no-mirclient \
373 -opengl \
374 $(if $(CONFIG_PACKAGE_qt5base-plugin-platforms-minimal),,-qpa minimal) \
375 -no-libinput \
376 -no-gstreamer \
377 -system-proxies \
378 -no-warnings-are-errors \
379 -xplatform linux-openwrt-g++ \
380 )
381 endef
382
383 define Build/InstallDev
384 $(INSTALL_DIR) \
385 $(STAGING_DIR)/host/mk
386
387 $(CP) \
388 ./files/qmake.mk \
389 $(STAGING_DIR)/host/mk/
390
391 $(call Build/Install/HostFiles,$(1))
392 $(call Build/Install/Headers,$(1))
393 $(call Build/Install/Libs,$(1),*)
394 endef
395
396 define Package/qt5base-concurrent/install
397 $(call Build/Install/Libs,$(1),libQt5Concurrent)
398 endef
399
400 define Package/qt5base-core/install
401 $(call Build/Install/Libs,$(1),libQt5Core)
402 endef
403
404 define Package/qt5base-gl/install
405 $(call Build/Install/Libs,$(1),libQt5OpenGL)
406 endef
407
408 define Package/qt5base-gui/install
409 $(call Build/Install/Libs,$(1),libQt5Gui)
410 endef
411
412 define Package/qt5base-network/install
413 $(call Build/Install/Libs,$(1),libQt5Network)
414 endef
415
416 define Package/qt5base-printSupport/install
417 $(call Build/Install/Libs,$(1),libQt5PrintSupport)
418 endef
419
420 define Package/qt5base-sql/install
421 $(call Build/Install/Libs,$(1),libQt5Sql)
422 endef
423
424 define Package/qt5base-test/install
425 $(call Build/Install/Libs,$(1),libQt5Test)
426 endef
427
428 define Package/qt5base-widgets/install
429 $(call Build/Install/Libs,$(1),libQt5Widgets)
430 endef
431
432 define Package/qt5base-xml/install
433 $(call Build/Install/Libs,$(1),libQt5Xml)
434 endef
435
436 define Package/qt5base-plugin-bearer-generic/install
437 $(call Build/Install/Plugins,$(1),bearer,libqgenericbearer)
438 endef
439
440 define Package/qt5base-plugin-input-evdevkeyboard/install
441 $(call Build/Install/Plugins,$(1),generic,libqevdevkeyboardplugin)
442 endef
443
444 define Package/qt5base-plugin-input-evdevmouse/install
445 $(call Build/Install/Plugins,$(1),generic,libqevdevmouseplugin)
446 endef
447
448 define Package/qt5base-plugin-input-evdevtablet/install
449 $(call Build/Install/Plugins,$(1),generic,libqevdevtabletplugin)
450 endef
451
452 define Package/qt5base-plugin-input-evdevtouch/install
453 $(call Build/Install/Plugins,$(1),generic,libqevdevtouchplugin)
454 endef
455
456 #define Package/qt5base-plugin-imageformats-gif/install
457 # $(call Build/Install/Plugins,$(1),imageformats,libqgif)
458 #endef
459
460 define Package/qt5base-plugin-imageformats-ico/install
461 $(call Build/Install/Plugins,$(1),imageformats,libqico)
462 endef
463
464 define Package/qt5base-plugin-imageformats-jpeg/install
465 $(call Build/Install/Plugins,$(1),imageformats,libqjpeg)
466 endef
467
468 define Package/qt5base-plugin-platforms-linuxfb/install
469 $(call Build/Install/Plugins,$(1),platforms,libqlinuxfb)
470 endef
471
472 #define Package/qt5base-plugin-platforms-eglfs/install
473 # $(call Build/Install/Plugins,$(1),platforms,libqeglfs)
474 #endef
475
476 #define Package/qt5base-plugin-platforms-minimalegl/install
477 # $(call Build/Install/Plugins,$(1),platforms,libqminimalegl)
478 #endef
479
480 define Package/qt5base-plugin-platforms-minimal/install
481 $(call Build/Install/Plugins,$(1),platforms,libqminimal)
482 endef
483
484 define Package/qt5base-plugin-platforms-offscreen/install
485 $(call Build/Install/Plugins,$(1),platforms,libqoffscreen)
486 endef
487
488 #define Package/qt5base-plugin-sqldrivers-sqlite/install
489 # $(call Build/Install/Plugins,$(1),sqldrivers,libqsqlite)
490 #endef
491
492 define Package/qt5base-examples/install
493 $(call Build/Install/Examples,$(1))
494 endef
495
496 $(eval $(call BuildPackage,qt5base))
497 $(eval $(call BuildPackage,qt5base-concurrent))
498 $(eval $(call BuildPackage,qt5base-core))
499 $(eval $(call BuildPackage,qt5base-gui))
500 $(eval $(call BuildPackage,qt5base-gl))
501 $(eval $(call BuildPackage,qt5base-network))
502 $(eval $(call BuildPackage,qt5base-printSupport))
503 $(eval $(call BuildPackage,qt5base-sql))
504 $(eval $(call BuildPackage,qt5base-test))
505 $(eval $(call BuildPackage,qt5base-widgets))
506 $(eval $(call BuildPackage,qt5base-xml))
507 $(eval $(call BuildPackage,qt5base-plugin-bearer-generic))
508 $(eval $(call BuildPackage,qt5base-plugin-input-evdevkeyboard))
509 $(eval $(call BuildPackage,qt5base-plugin-input-evdevmouse))
510 $(eval $(call BuildPackage,qt5base-plugin-input-evdevtablet))
511 $(eval $(call BuildPackage,qt5base-plugin-input-evdevtouch))
512 #$(eval $(call BuildPackage,qt5base-plugin-imageformats-gif))
513 $(eval $(call BuildPackage,qt5base-plugin-imageformats-ico))
514 $(eval $(call BuildPackage,qt5base-plugin-imageformats-jpeg))
515 $(eval $(call BuildPackage,qt5base-plugin-platforms-linuxfb))
516 #$(eval $(call BuildPackage,qt5base-plugin-platforms-eglfs))
517 #$(eval $(call BuildPackage,qt5base-plugin-platforms-minimalegl))
518 $(eval $(call BuildPackage,qt5base-plugin-platforms-minimal))
519 $(eval $(call BuildPackage,qt5base-plugin-platforms-offscreen))
520 #$(eval $(call BuildPackage,qt5base-plugin-sqldrivers-sqlite))
521 $(eval $(call BuildPackage,qt5base-examples))