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.
9 # - plugins don't work when sstrip is used for stripping
10 # - no X11/wayland/xcb/kms support so far - primary target is linuxfb
12 include $(TOPDIR
)/rules.mk
17 PKG_HASH
:=c17111ae02a44dc7be1ec2cf979a47ee9e58edf4904041a525c21f4fa53fc005
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
23 PKG_BUILD_DIR
=$(BUILD_DIR
)/$(PKG_SYS_NAME
)
24 HOST_BUILD_DIR
=$(BUILD_DIR
)/host
/$(PKG_SYS_NAME
)
26 HOST_BUILD_PARALLEL
:=1
27 PKG_BUILD_DEPENDS
:=librpc
30 # Yes, the host build depends on the target build. This is not a mistake!
31 # The target build provides the (target specific) qmake.mk file which
32 # is also used for host builds.
33 # Host projects depend on qt5base/host which however don't build
34 # if qt5base didn't install the qmake.mk file before.
35 # Benefit of the target build providing qmake.mk instead of the host build
36 # is that the host build really only needs to be built, if there're targets
37 # which actually depend on it. At the time of this writing, only qt5tools
38 # makes use of the host build.
39 HOST_BUILD_DEPENDS
:=qt5base
41 include $(INCLUDE_DIR
)/package.mk
42 include $(INCLUDE_DIR
)/host-build.mk
43 include $(INCLUDE_DIR
)/nls.mk
44 include .
/files
/qmake.mk
46 PKG_CONFIG_DEPENDS
:= \
47 CONFIG_PACKAGE_qt5base-plugin-imageformats-jpeg \
48 CONFIG_PACKAGE_qt5base-plugin-imageformats-png \
49 CONFIG_PACKAGE_qt5base-network \
50 CONFIG_PACKAGE_qt5base-gui \
51 CONFIG_PACKAGE_qt5base-gl \
52 CONFIG_PACKAGE_qt5base-widgets \
53 CONFIG_PACKAGE_qt5base-examples \
54 CONFIG_PACKAGE_qt5base-plugin-platforms-minimal \
55 CONFIG_PACKAGE_qt5base-plugin-platforms-linuxfb \
56 # CONFIG_PACKAGE_qt5base-plugin-platforms-eglfs \
57 # CONFIG_PACKAGE_qt5base-plugin-platforms-minimalegl \
59 # Do not use sstrip for QT5. When sstrip is used the QT5 plugin loading does
60 # not work, because of QT''s internal elf parser, see
61 # https://bugreports.qt.io/browse/QTBUG-52567
62 # Use the code from the gcc package to use strip instaed.
63 ifneq ($(CONFIG_USE_SSTRIP
),)
64 STRIP
:=$(TARGET_CROSS
)strip $(call qstrip
,$(CONFIG_STRIP_ARGS
))
66 export CROSS
="$(TARGET_CROSS)" \
67 $(if
$(CONFIG_KERNEL_KALLSYMS
),NO_RENAME
=1) \
68 $(if
$(CONFIG_KERNEL_PROFILING
),KEEP_SYMBOLS
=1); \
69 NM
="$(TARGET_CROSS)nm" \
71 STRIP_KMOD
="$(SCRIPT_DIR)/strip-kmod.sh" \
72 $(SCRIPT_DIR
)/rstrip.sh
75 define Package
/qt5base
/Default
76 SECTION
:=video-frameworks
78 SUBMENU
:=Frameworks and Toolkits
81 MAINTAINER
:=Mirko Vogt
<mirko@openwrt.org
>
84 # define Package/qt5base
85 # $(call Package/qt5base/Default)
90 define Package
/qt5base-concurrent
91 $(call Package
/qt5base
/Default
)
93 DEPENDS
+=+qt5base-core
96 define Package
/qt5base-gl
97 $(call Package
/qt5base
/Default
)
99 DEPENDS
+=+qt5base-core
+qt5base-gui
+qt5base-widgets
102 define Package
/qt5base-core
103 $(call Package
/qt5base
/Default
)
105 DEPENDS
+=+libpthread
+zlib
+libpcre16
+libstdcpp
+librt
+libdouble-conversion
$(ICONV_DEPENDS
) #+icu
108 define Package
/qt5base-gui
109 $(call Package
/qt5base
/Default
)
111 DEPENDS
+=+qt5base-core
+qt5quick2-2d-sw-renderer-GLstubs
+libpng
+fontconfig
+libfreetype
+libudev
114 define Package
/qt5base-network
115 $(call Package
/qt5base
/Default
)
117 DEPENDS
+=+qt5base-core
+libopenssl
120 # seems to be only present as static lib
121 # define Package/qt5base-paltformSupport
122 # $(call Package/qt5base/Default)
126 define Package
/qt5base-printSupport
127 $(call Package
/qt5base
/Default
)
129 DEPENDS
+=+qt5base-core
+qt5base-gui
+qt5base-widgets
132 define Package
/qt5base-sql
133 $(call Package
/qt5base
/Default
)
135 DEPENDS
+=+qt5base-core
138 define Package
/qt5base-test
139 $(call Package
/qt5base
/Default
)
141 DEPENDS
+=+qt5base-core
144 define Package
/qt5base-widgets
145 $(call Package
/qt5base
/Default
)
147 DEPENDS
+=+qt5base-core
+qt5base-gui
150 define Package
/qt5base-xml
151 $(call Package
/qt5base
/Default
)
153 DEPENDS
+=+qt5base-core
160 define Package
/qt5base-plugin-bearer-generic
161 $(call Package
/qt5base
/Default
)
162 TITLE
+=bearer
(plugin
)
163 DEPENDS
+=+qt5base-core
+qt5base-network
166 ####### generic / input
168 define Package
/qt5base-plugin-input-evdevkeyboard
169 $(call Package
/qt5base
/Default
)
170 TITLE
+=evdev keyboard
(plugin
)
171 DEPENDS
+=+qt5base-core
+qt5base-gui
+libfreetype
+fontconfig
174 define Package
/qt5base-plugin-input-evdevmouse
175 $(call Package
/qt5base
/Default
)
176 TITLE
+=evdev mouse
(plugin
)
177 DEPENDS
+=+qt5base-core
+qt5base-gui
+libfreetype
+fontconfig
180 define Package
/qt5base-plugin-input-evdevtablet
181 $(call Package
/qt5base
/Default
)
182 TITLE
+=evdev tablet
(plugin
)
183 DEPENDS
+=+qt5base-core
+qt5base-gui
+libfreetype
+fontconfig
186 define Package
/qt5base-plugin-input-evdevtouch
187 $(call Package
/qt5base
/Default
)
188 TITLE
+=evdev touch
(plugin
)
189 DEPENDS
+=+qt5base-core
+qt5base-gui
+libfreetype
+fontconfig
194 #define Package/qt5base-plugin-imageformats-gif
195 # $(call Package/qt5base/Default)
196 #TITLE+=imageformat gif (plugin)
197 # DEPENDS+=+qt5base-core +qt5base-gui
200 define Package
/qt5base-plugin-imageformats-ico
201 $(call Package
/qt5base
/Default
)
202 TITLE
+=imageformat ico
(plugin
)
203 DEPENDS
+=+qt5base-core
+qt5base-gui
206 define Package
/qt5base-plugin-imageformats-jpeg
207 $(call Package
/qt5base
/Default
)
208 TITLE
+=imageformat jpeg
(plugin
)
209 DEPENDS
+=+qt5base-core
+qt5base-gui
+libjpeg
214 #define Package/qt5base-plugin-platforms-eglfs
215 # $(call Package/qt5base/Default)
216 # TITLE+=platform eglfs (plugin)
217 # DEPENDS+=+qt5base-core +qt5base-gui +libfreetype +fontconfig
220 #define Package/qt5base-plugin-platforms-minimalegl
221 # $(call Package/qt5base/Default)
222 # TITLE+=platform minimalegl (plugin)
223 # DEPENDS+=+qt5base-core +qt5base-gui +libfreetype +fontconfig
226 define Package
/qt5base-plugin-platforms-linuxfb
227 $(call Package
/qt5base
/Default
)
228 TITLE
+=platform linuxfb
(plugin
)
229 DEPENDS
+=+qt5base-core
+qt5base-gui
+libfreetype
+fontconfig
232 define Package
/qt5base-plugin-platforms-minimal
233 $(call Package
/qt5base
/Default
)
234 TITLE
+=platform minimal
(plugin
)
235 DEPENDS
+=+qt5base-core
+qt5base-gui
+libfreetype
+fontconfig
238 define Package
/qt5base-plugin-platforms-offscreen
239 $(call Package
/qt5base
/Default
)
240 TITLE
+=platform offscreen
(plugin
)
241 DEPENDS
+=+qt5base-core
+qt5base-gui
+libfreetype
+fontconfig
244 define Package
/qt5base-plugin-platforms-vnc
245 $(call Package
/qt5base
/Default
)
246 TITLE
+=platform vnc
(plugin
)
247 DEPENDS
+=+qt5base-core
+qt5base-gui
+qt5base-network
+libfreetype
+fontconfig
254 #define Package/qt5base-plugin-sqldrivers-sqlite
255 # $(call Package/qt5base/Default)
256 # TITLE+=sqldriver sqlite (plugin)
257 # DEPENDS+=+qt5base-core +qt5base-sql +libsqlite3
260 define Package
/qt5base-examples
261 $(call Package
/qt5base
/Default
)
270 +qt5base-printSupport \
271 +qt5base-concurrent \
276 $(call Build
/Prepare
/Default
)
278 .
/files
/mkspecs
/linux-openwrt-g
++ \
279 $(PKG_BUILD_DIR
)/mkspecs
/
283 # -I$(STAGING_DIR)/usr/include/freetype2 \
284 # -I$(STAGING_DIR)/usr/include/libdrm
286 define Build
/Configure
287 # CROSS/TARGET_* need to be passed to configure, in order to use cross-compiling tools to check for requirements.
288 # Usually used variables such as CC/CXX/CFLAGS/CXXFLAGS/LDFLAGS would be used for compilation of host tools (qmake, moc, etc.),
289 # hence we use the TARGET_* nomenclature.
290 ( cd
$(PKG_BUILD_DIR
) ; \
291 TARGET_CROSS
="$(TARGET_CROSS)" \
292 TARGET_CFLAGS
="$(TARGET_CFLAGS)" \
293 TARGET_CXXFLAGS
="$(TARGET_CFLAGS) $(TARGET_CXXFLAGS)" \
294 TARGET_LDFLAGS
="$(TARGET_LDFLAGS)" \
296 -prefix $(QT_INSTALL_PREFIX
) \
297 -extprefix
$(QT_EXTPREFIX
) \
298 -hostprefix
$(QT_HOST_PREFIX
) \
299 -hostdatadir
$(QT_HOST_PREFIX
)/share \
301 -bindir $(QT_INSTALL_BINS
) \
302 -headerdir
$(QT_INSTALL_HEADERS
) \
303 -libdir $(QT_INSTALL_LIBS
) \
304 -archdatadir
$(QT_INSTALL_ARCHDATA
) \
305 -plugindir
$(QT_INSTALL_PLUGINS
) \
306 -libexecdir
$(QT_INSTALL_LIBEXECS
) \
307 -importdir
$(QT_INSTALL_IMPORTS
) \
308 -qmldir
$(QT_INSTALL_QML
) \
309 -datadir $(QT_INSTALL_DATA
) \
310 -docdir
$(QT_INSTALL_DOCS
) \
311 -translationdir
$(QT_INSTALL_TRANSLATIONS
) \
312 -sysconfdir
$(QT_INSTALL_CONFIGURATION
) \
313 -examplesdir
$(QT_INSTALL_EXAMPLES
) \
314 -testsdir
$(QT_INSTALL_TESTS
) \
315 -hostbindir
$(QT_HOST_BINS
) \
316 -hostlibdir
$(QT_HOST_LIBS
) \
317 -hostdatadir
$(QT_HOST_DATA
) \
322 -no-optimized-tools \
326 -xplatform linux-openwrt-g
++ \
334 $(if
$(findstring -mdsp
,$(TARGET_CFLAGS
)),,-no-mips_dsp
) \
335 $(if
$(findstring -mdspr2
,$(TARGET_CFLAGS
)),,-no-mips_dspr2
) \
337 -no-reduce-relocations \
339 -no-use-gold-linker \
340 -no-warnings-are-errors \
342 -no-optimized-qmake \
345 $(if
$(CONFIG_PACKAGE_qt5base-examples
),-compile-examples
,-no-compile-examples
) \
346 $(if
$(CONFIG_PACKAGE_qt5base-examples
),-make examples
,-nomake examples
) \
347 $(if
$(CONFIG_PACKAGE_qt5base-gui
),-gui
,-no-gui
) \
348 $(if
$(CONFIG_PACKAGE_qt5base-widgets
),-widgets
,-no-widgets
) \
352 -system-doubleconversion \
356 $(if
$(CONFIG_BUILD_NLS
),-no-iconv
,-no-iconv
) \
363 $(if
$(CONFIG_PACKAGE_qt5base-network
),-openssl-linked
,-no-openssl
) \
372 $(if
$(CONFIG_PACKAGE_qt5base-plugin-platforms-minimal
),,-qpa minimal
) \
373 $(if
$(CONFIG_PACKAGE_qt5base-plugin-platforms-linuxfb
),,-qpa linuxfb
) \
379 $(if
$(CONFIG_PACKAGE_qt5base-plugin-platforms-linuxfb
),-linuxfb
,-no-linuxfb
) \
388 -no-xkbcommon-evdev \
390 $(if
$(CONFIG_PACKAGE_qt5base-plugin-imageformats-ico
),-ico
,-no-ico
) \
391 $(if
$(CONFIG_PACKAGE_qt5base-gui
),-system-libpng
,-no-libpng
) \
392 $(if
$(CONFIG_PACKAGE_qt5base-plugin-imageformats-jpeg
),-system-libjpeg
,-no-libjpeg
) \
408 define Host
/Configure
409 # CROSS/TARGET_* need to be passed to configure, in order to use cross-compiling tools to check for requirements.
410 # Usually used variables such as CC/CXX/CFLAGS/CXXFLAGS/LDFLAGS would be used for compilation of host tools (qmake, moc, etc.),
411 # hence we use the TARGET_* nomenclature.
412 ( cd
$(HOST_BUILD_DIR
) ; \
413 TARGET_CFLAGS
="$(HOST_CFLAGS)" \
414 TARGET_CXXFLAGS
="$(HOST_CFLAGS) $(HOST_CXXFLAGS)" \
415 TARGET_LDFLAGS
="$(HOST_LDFLAGS)" \
417 -prefix $(STAGING_DIR_HOST
) \
418 -hostprefix
$(STAGING_DIR_HOST
) \
419 -hostdatadir
$(STAGING_DIR_HOST
)/share \
420 -datadir $(STAGING_DIR_HOST
)/share \
421 -archdatadir
$(STAGING_DIR_HOST
)/lib \
427 -no-optimized-tools \
433 -no-compile-examples \
439 -qt-doubleconversion \
471 -no-xkbcommon-evdev \
490 define Build
/InstallDev
492 $(STAGING_DIR
)/host
/mk
496 $(STAGING_DIR
)/host
/mk
/
498 $(call Build
/Install
/HostFiles
,$(1))
499 $(call Build
/Install
/Headers
,$(1))
500 $(call Build
/Install
/Libs
,$(1),*)
504 $(call Host
/Install
/Default
)
507 $(STAGING_DIR_HOST
)/bin \
508 $(STAGING_DIR_HOST
)/lib \
509 $(STAGING_DIR_HOST
)/include \
510 $(STAGING_DIR_HOST
)/share
513 $(HOST_INSTALL_DIR
)/lib
/* \
514 $(STAGING_DIR_HOST
)/lib
/
517 $(HOST_INSTALL_DIR
)/include/* \
518 $(STAGING_DIR_HOST
)/include/
521 $(HOST_INSTALL_DIR
)/share
/* \
522 $(STAGING_DIR_HOST
)/share
/
525 $(HOST_INSTALL_DIR
)/bin
/qmake \
526 $(STAGING_DIR_HOST
)/bin
/qmake_host
529 define Package
/qt5base-concurrent
/install
530 $(call Build
/Install
/Libs
,$(1),libQt5Concurrent
)
533 define Package
/qt5base-core
/install
534 $(call Build
/Install
/Libs
,$(1),libQt5Core
)
537 define Package
/qt5base-gl
/install
538 $(call Build
/Install
/Libs
,$(1),libQt5OpenGL
)
541 define Package
/qt5base-gui
/install
542 $(call Build
/Install
/Libs
,$(1),libQt5Gui
)
545 define Package
/qt5base-network
/install
546 $(call Build
/Install
/Libs
,$(1),libQt5Network
)
549 define Package
/qt5base-printSupport
/install
550 $(call Build
/Install
/Libs
,$(1),libQt5PrintSupport
)
553 define Package
/qt5base-sql
/install
554 $(call Build
/Install
/Libs
,$(1),libQt5Sql
)
557 define Package
/qt5base-test
/install
558 $(call Build
/Install
/Libs
,$(1),libQt5Test
)
561 define Package
/qt5base-widgets
/install
562 $(call Build
/Install
/Libs
,$(1),libQt5Widgets
)
565 define Package
/qt5base-xml
/install
566 $(call Build
/Install
/Libs
,$(1),libQt5Xml
)
569 define Package
/qt5base-plugin-bearer-generic
/install
570 $(call Build
/Install
/Plugins
,$(1),bearer
,libqgenericbearer
)
573 define Package
/qt5base-plugin-input-evdevkeyboard
/install
574 $(call Build
/Install
/Plugins
,$(1),generic
,libqevdevkeyboardplugin
)
577 define Package
/qt5base-plugin-input-evdevmouse
/install
578 $(call Build
/Install
/Plugins
,$(1),generic
,libqevdevmouseplugin
)
581 define Package
/qt5base-plugin-input-evdevtablet
/install
582 $(call Build
/Install
/Plugins
,$(1),generic
,libqevdevtabletplugin
)
585 define Package
/qt5base-plugin-input-evdevtouch
/install
586 $(call Build
/Install
/Plugins
,$(1),generic
,libqevdevtouchplugin
)
589 #define Package/qt5base-plugin-imageformats-gif/install
590 # $(call Build/Install/Plugins,$(1),imageformats,libqgif)
593 define Package
/qt5base-plugin-imageformats-ico
/install
594 $(call Build
/Install
/Plugins
,$(1),imageformats
,libqico
)
597 define Package
/qt5base-plugin-imageformats-jpeg
/install
598 $(call Build
/Install
/Plugins
,$(1),imageformats
,libqjpeg
)
601 define Package
/qt5base-plugin-platforms-linuxfb
/install
602 $(call Build
/Install
/Plugins
,$(1),platforms
,libqlinuxfb
)
605 define Package
/qt5base-plugin-platforms-vnc
/install
606 $(call Build
/Install
/Plugins
,$(1),platforms
,libqvnc
)
609 #define Package/qt5base-plugin-platforms-eglfs/install
610 # $(call Build/Install/Plugins,$(1),platforms,libqeglfs)
613 #define Package/qt5base-plugin-platforms-minimalegl/install
614 # $(call Build/Install/Plugins,$(1),platforms,libqminimalegl)
617 define Package
/qt5base-plugin-platforms-minimal
/install
618 $(call Build
/Install
/Plugins
,$(1),platforms
,libqminimal
)
621 define Package
/qt5base-plugin-platforms-offscreen
/install
622 $(call Build
/Install
/Plugins
,$(1),platforms
,libqoffscreen
)
625 #define Package/qt5base-plugin-sqldrivers-sqlite/install
626 # $(call Build/Install/Plugins,$(1),sqldrivers,libqsqlite)
629 define Package
/qt5base-examples
/install
630 $(call Build
/Install
/Examples
,$(1))
633 # $(eval $(call BuildPackage,qt5base))
634 $(eval
$(call BuildPackage
,qt5base-concurrent
))
635 $(eval
$(call BuildPackage
,qt5base-core
))
636 $(eval
$(call BuildPackage
,qt5base-gui
))
637 $(eval
$(call BuildPackage
,qt5base-gl
))
638 $(eval
$(call BuildPackage
,qt5base-network
))
639 $(eval
$(call BuildPackage
,qt5base-printSupport
))
640 $(eval
$(call BuildPackage
,qt5base-sql
))
641 $(eval
$(call BuildPackage
,qt5base-test
))
642 $(eval
$(call BuildPackage
,qt5base-widgets
))
643 $(eval
$(call BuildPackage
,qt5base-xml
))
644 $(eval
$(call BuildPackage
,qt5base-plugin-bearer-generic
))
645 $(eval
$(call BuildPackage
,qt5base-plugin-input-evdevkeyboard
))
646 $(eval
$(call BuildPackage
,qt5base-plugin-input-evdevmouse
))
647 $(eval
$(call BuildPackage
,qt5base-plugin-input-evdevtablet
))
648 $(eval
$(call BuildPackage
,qt5base-plugin-input-evdevtouch
))
649 #$(eval $(call BuildPackage,qt5base-plugin-imageformats-gif))
650 $(eval
$(call BuildPackage
,qt5base-plugin-imageformats-ico
))
651 $(eval
$(call BuildPackage
,qt5base-plugin-imageformats-jpeg
))
652 $(eval
$(call BuildPackage
,qt5base-plugin-platforms-linuxfb
))
653 #$(eval $(call BuildPackage,qt5base-plugin-platforms-eglfs))
654 #$(eval $(call BuildPackage,qt5base-plugin-platforms-minimalegl))
655 $(eval
$(call BuildPackage
,qt5base-plugin-platforms-minimal
))
656 $(eval
$(call BuildPackage
,qt5base-plugin-platforms-offscreen
))
657 $(eval
$(call BuildPackage
,qt5base-plugin-platforms-vnc
))
658 #$(eval $(call BuildPackage,qt5base-plugin-sqldrivers-sqlite))
659 $(eval
$(call BuildPackage
,qt5base-examples
))
660 $(eval
$(call HostBuild
))