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