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