2 # Copyright (C) 2020 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
:=bc9a21e9f6fff9629019fdf9f989f064751d5073c3a28dc596def92f4d4275c6
19 PKG_SYS_NAME
:=qtbase-everywhere-src-
$(PKG_VERSION
)
20 PKG_SOURCE
:=$(PKG_SYS_NAME
).
tar.xz
21 PKG_SOURCE_URL
:=https
://download.qt.io
/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
28 PKG_BUILD_FLAGS
:=no-mips16
29 # Yes, the host build depends on the target build. This is not a mistake!
30 # The target build provides the (target specific) qmake.mk file which
31 # is also used for host builds.
32 # Host projects depend on qt5base/host which however don't build
33 # if qt5base didn't install the qmake.mk file before.
34 # Benefit of the target build providing qmake.mk instead of the host build
35 # is that the host build really only needs to be built, if there're targets
36 # which actually depend on it. At the time of this writing, only qt5tools
37 # makes use of the host build.
38 HOST_BUILD_DEPENDS
:=qt5base
40 include $(INCLUDE_DIR
)/package.mk
41 include $(INCLUDE_DIR
)/host-build.mk
42 include $(INCLUDE_DIR
)/nls.mk
43 include .
/files
/qmake.mk
45 PKG_CONFIG_DEPENDS
:= \
46 CONFIG_PACKAGE_qt5base-plugin-imageformats-jpeg \
47 CONFIG_PACKAGE_qt5base-network \
48 CONFIG_PACKAGE_qt5base-gui \
49 CONFIG_PACKAGE_qt5base-gl \
50 CONFIG_PACKAGE_qt5base-widgets \
51 CONFIG_PACKAGE_qt5base-examples \
52 CONFIG_PACKAGE_qt5base-plugin-platforms-minimal \
53 CONFIG_PACKAGE_qt5base-plugin-platforms-linuxfb \
54 CONFIG_PACKAGE_qt5base-plugin-input-libinput \
55 # CONFIG_PACKAGE_qt5base-plugin-imageformats-png \
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@nanl.de
>
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 @BROKEN
102 define Package
/qt5base-core
103 $(call Package
/qt5base
/Default
)
105 DEPENDS
+=+libpthread
+zlib
+libzstd
+libpcre2-16
+libstdcpp
+librt
+libdouble-conversion
$(ICONV_DEPENDS
) +PACKAGE_icu
:icu
#FIXME: do not include ICONV_DEPENDS if ICU is selected (though, that's only an issue when using GNU iconv)
108 define Package
/qt5base-gui
109 $(call Package
/qt5base
/Default
)
111 DEPENDS
+=+qt5base-core
+libpng
+fontconfig
+libfreetype
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-libinput
169 $(call Package
/qt5base
/Default
)
170 TITLE
+=libinput
(plugin
)
171 DEPENDS
+=+qt5base-core
+qt5base-gui
+libinput
174 define Package
/qt5base-plugin-input-evdevkeyboard
175 $(call Package
/qt5base
/Default
)
176 TITLE
+=evdev keyboard
(plugin
)
177 DEPENDS
+=+qt5base-core
+qt5base-gui
+libudev
+PACKAGE_qt5base-plugin-input-libinput
:libinput
180 define Package
/qt5base-plugin-input-evdevmouse
181 $(call Package
/qt5base
/Default
)
182 TITLE
+=evdev mouse
(plugin
)
183 DEPENDS
+=+qt5base-core
+qt5base-gui
+libudev
+PACKAGE_qt5base-plugin-input-libinput
:libinput
186 define Package
/qt5base-plugin-input-evdevtablet
187 $(call Package
/qt5base
/Default
)
188 TITLE
+=evdev tablet
(plugin
)
189 DEPENDS
+=+qt5base-core
+qt5base-gui
+libudev
+PACKAGE_qt5base-plugin-input-libinput
:libinput
192 define Package
/qt5base-plugin-input-evdevtouch
193 $(call Package
/qt5base
/Default
)
194 TITLE
+=evdev touch
(plugin
)
195 DEPENDS
+=+qt5base-core
+qt5base-gui
+libudev
+PACKAGE_qt5base-plugin-input-libinput
:libinput
200 #define Package/qt5base-plugin-imageformats-gif
201 # $(call Package/qt5base/Default)
202 #TITLE+=imageformat gif (plugin)
203 # DEPENDS+=+qt5base-core +qt5base-gui
206 define Package
/qt5base-plugin-imageformats-ico
207 $(call Package
/qt5base
/Default
)
208 TITLE
+=imageformat ico
(plugin
)
209 DEPENDS
+=+qt5base-core
+qt5base-gui
212 define Package
/qt5base-plugin-imageformats-jpeg
213 $(call Package
/qt5base
/Default
)
214 TITLE
+=imageformat jpeg
(plugin
)
215 DEPENDS
+=+qt5base-core
+qt5base-gui
+libjpeg
218 #define Package/qt5base-plugin-imageformats-png
219 # $(call Package/qt5base/Default)
220 # TITLE+=imageformat png (plugin)
221 # DEPENDS+=+qt5base-core +qt5base-gui +libpng
226 #define Package/qt5base-plugin-platforms-eglfs
227 # $(call Package/qt5base/Default)
228 # TITLE+=platform eglfs (plugin)
229 # DEPENDS+=+qt5base-core +qt5base-gui +libfreetype +fontconfig
232 #define Package/qt5base-plugin-platforms-minimalegl
233 # $(call Package/qt5base/Default)
234 # TITLE+=platform minimalegl (plugin)
235 # DEPENDS+=+qt5base-core +qt5base-gui +libfreetype +fontconfig
238 define Package
/qt5base-plugin-platforms-linuxfb
239 $(call Package
/qt5base
/Default
)
240 TITLE
+=platform linuxfb
(plugin
)
241 DEPENDS
+=+qt5base-core
+qt5base-gui
+libfreetype
+fontconfig
+libudev
+PACKAGE_qt5base-plugin-input-libinput
:libinput
244 define Package
/qt5base-plugin-platforms-minimal
245 $(call Package
/qt5base
/Default
)
246 TITLE
+=platform minimal
(plugin
)
247 DEPENDS
+=+qt5base-core
+qt5base-gui
+libfreetype
+fontconfig
250 define Package
/qt5base-plugin-platforms-offscreen
251 $(call Package
/qt5base
/Default
)
252 TITLE
+=platform offscreen
(plugin
)
253 DEPENDS
+=+qt5base-core
+qt5base-gui
+libfreetype
+fontconfig
256 define Package
/qt5base-plugin-platforms-vnc
257 $(call Package
/qt5base
/Default
)
258 TITLE
+=platform vnc
(plugin
)
259 DEPENDS
+=+qt5base-core
+qt5base-gui
+qt5base-network
+libfreetype
+fontconfig
+libudev
+PACKAGE_qt5base-plugin-input-libinput
:libinput
266 #define Package/qt5base-plugin-sqldrivers-sqlite
267 # $(call Package/qt5base/Default)
268 # TITLE+=sqldriver sqlite (plugin)
269 # DEPENDS+=+qt5base-core +qt5base-sql +libsqlite3
272 define Package
/qt5base-examples
273 $(call Package
/qt5base
/Default
)
282 +qt5base-printSupport \
283 +qt5base-concurrent \
288 $(call Build
/Prepare
/Default
)
290 .
/files
/mkspecs
/linux-openwrt-g
++ \
291 $(PKG_BUILD_DIR
)/mkspecs
/
295 # -I$(STAGING_DIR)/usr/include/freetype2 \
296 # -I$(STAGING_DIR)/usr/include/libdrm
298 define Build
/Configure
299 # CROSS/TARGET_* need to be passed to configure, in order to use cross-compiling tools to check for requirements.
300 # Usually used variables such as CC/CXX/CFLAGS/CXXFLAGS/LDFLAGS would be used for compilation of host tools (qmake, moc, etc.),
301 # hence we use the TARGET_* nomenclature.
304 # - icu support currently depends on selection of icu package which is not ideal, since unpredictable.
305 # - icu support overrides iconv support
306 ( cd
$(PKG_BUILD_DIR
) ; \
307 TARGET_CROSS
="$(TARGET_CROSS)" \
308 TARGET_CFLAGS
="$(TARGET_CFLAGS)" \
309 TARGET_CXXFLAGS
="$(TARGET_CFLAGS) $(TARGET_CXXFLAGS)" \
310 TARGET_LDFLAGS
="$(TARGET_LDFLAGS)" \
311 PKG_CONFIG_SYSROOT_DIR
="$(STAGING_DIR)" \
313 --prefix=$(QT_INSTALL_PREFIX
) \
314 --extprefix
=$(QT_EXTPREFIX
) \
315 --hostprefix
=$(QT_HOST_PREFIX
) \
317 --bindir=$(QT_INSTALL_BINS
) \
318 --headerdir
=$(QT_INSTALL_HEADERS
) \
319 --libdir=$(QT_INSTALL_LIBS
) \
320 --archdatadir
=$(QT_INSTALL_ARCHDATA
) \
321 --plugindir
=$(QT_INSTALL_PLUGINS
) \
322 --libexecdir
=$(QT_INSTALL_LIBEXECS
) \
323 --importdir
=$(QT_INSTALL_IMPORTS
) \
324 --qmldir
=$(QT_INSTALL_QML
) \
325 --datadir=$(QT_INSTALL_DATA
) \
326 --docdir
=$(QT_INSTALL_DOCS
) \
327 --translationdir
=$(QT_INSTALL_TRANSLATIONS
) \
328 --sysconfdir
=$(QT_INSTALL_CONFIGURATION
) \
329 --examplesdir
=$(QT_INSTALL_EXAMPLES
) \
330 --testsdir
=$(QT_INSTALL_TESTS
) \
331 --hostbindir
=$(QT_HOST_BINS
) \
332 --hostlibdir
=$(QT_HOST_LIBS
) \
333 --hostdatadir
=$(QT_HOST_DATA
) \
338 --optimized-tools
=no \
343 --xplatform
=linux-openwrt-g
++ \
344 --reduce-exports
=no \
345 --reduce-relocations
=no \
348 --use-gold-linker
=no \
349 --warnings-are-errors
=no \
351 --compile-examples
=$(if
$(CONFIG_PACKAGE_qt5base-examples
),yes
,no
) \
352 $(if
$(CONFIG_PACKAGE_qt5base-examples
),,--nomake
=examples
) \
353 --gui
=$(if
$(CONFIG_PACKAGE_qt5base-gui
),yes
,no
) \
354 --widgets
=$(if
$(CONFIG_PACKAGE_qt5base-widgets
),yes
,no
) \
356 --accessibility
=yes \
357 --doubleconversion
=system \
361 --iconv
=$(if
$(CONFIG_BUILD_NLS
),$(if
$(CONFIG_LIBC_USE_GLIBC
)$(CONFIG_LIBC_USE_MUSL
),posix
)$(if
$(CONFIG_LIBC_USE_UCLIBC
),gnu
),no
) \
362 --icu
=$(if
$(CONFIG_PACKAGE_icu
),yes
,no
) \
367 --ssl
=$(if
$(CONFIG_PACKAGE_qt5base-network
),yes
,no
) \
368 --openssl-linked
$(if
$(CONFIG_PACKAGE_qt5base-network
),,=no
) \
370 --system-proxies
=yes \
380 --qpa
=$(if
$(CONFIG_PACKAGE_qt5base-plugin-platforms-linuxfb
),linuxfb
,) \
384 --linuxfb
=$(if
$(CONFIG_PACKAGE_qt5base-plugin-platforms-linuxfb
),yes
,no
) \
389 --libinput
=$(if
$(CONFIG_PACKAGE_qt5base-plugin-input-libinput
),yes
,no
) \
392 --bundled-xcb-xinput
=no \
394 --gif
=$(if
$(CONFIG_PACKAGE_qt5base-gui
),yes
,no
) \
395 --ico
=$(if
$(CONFIG_PACKAGE_qt5base-plugin-imageformats-ico
),yes
,no
) \
396 --libjpeg
=$(if
$(CONFIG_PACKAGE_qt5base-plugin-imageformats-jpeg
),system
,no
) \
412 define Host
/Configure
413 # CROSS/TARGET_* need to be passed to configure, in order to use cross-compiling tools to check for requirements.
414 # Usually used variables such as CC/CXX/CFLAGS/CXXFLAGS/LDFLAGS would be used for compilation of host tools (qmake, moc, etc.),
415 # hence we use the TARGET_* nomenclature.
416 ( cd
$(HOST_BUILD_DIR
) ; \
417 TARGET_CFLAGS
="$(HOST_CFLAGS)" \
418 TARGET_CXXFLAGS
="$(HOST_CFLAGS) $(HOST_CXXFLAGS)" \
419 TARGET_LDFLAGS
="$(HOST_LDFLAGS)" \
421 --prefix=$(STAGING_DIR_HOST
) \
422 --hostprefix
=$(STAGING_DIR_HOST
) \
423 --hostdatadir
=$(STAGING_DIR_HOST
)/share \
424 --datadir=$(STAGING_DIR_HOST
)/share \
425 --archdatadir
=$(STAGING_DIR_HOST
)/lib \
431 --optimized-tools
=no \
436 --reduce-exports
=no \
437 --reduce-relocations
=no \
440 --use-gold-linker
=no \
441 --warnings-are-errors
=no \
443 --compile-examples
=no \
451 --doubleconversion
=qt \
463 --system-proxies
=no \
484 --bundled-xcb-xinput
=no \
503 define Build
/InstallDev
505 $(STAGING_DIR
)/host
/mk
509 $(STAGING_DIR
)/host
/mk
/
511 $(call Build
/Install
/HostFiles
,$(1))
512 $(call Build
/Install
/Headers
,$(1))
513 $(call Build
/Install
/Libs
,$(1),*)
517 $(call Host
/Install
/Default
)
520 $(STAGING_DIR_HOST
)/bin \
521 $(STAGING_DIR_HOST
)/lib \
522 $(STAGING_DIR_HOST
)/include \
523 $(STAGING_DIR_HOST
)/share
526 $(HOST_INSTALL_DIR
)/lib
/* \
527 $(STAGING_DIR_HOST
)/lib
/
530 $(HOST_INSTALL_DIR
)/include/* \
531 $(STAGING_DIR_HOST
)/include/
534 $(HOST_INSTALL_DIR
)/share
/* \
535 $(STAGING_DIR_HOST
)/share
/
538 $(HOST_INSTALL_DIR
)/bin
/* \
539 $(STAGING_DIR_HOST
)/bin
/
542 define Package
/qt5base-concurrent
/install
543 $(call Build
/Install
/Libs
,$(1),libQt5Concurrent
)
546 define Package
/qt5base-core
/install
547 $(call Build
/Install
/Libs
,$(1),libQt5Core
)
550 define Package
/qt5base-gl
/install
551 $(call Build
/Install
/Libs
,$(1),libQt5OpenGL
)
554 define Package
/qt5base-gui
/install
555 $(call Build
/Install
/Libs
,$(1),libQt5Gui
)
558 define Package
/qt5base-network
/install
559 $(call Build
/Install
/Libs
,$(1),libQt5Network
)
562 define Package
/qt5base-printSupport
/install
563 $(call Build
/Install
/Libs
,$(1),libQt5PrintSupport
)
566 define Package
/qt5base-sql
/install
567 $(call Build
/Install
/Libs
,$(1),libQt5Sql
)
570 define Package
/qt5base-test
/install
571 $(call Build
/Install
/Libs
,$(1),libQt5Test
)
574 define Package
/qt5base-widgets
/install
575 $(call Build
/Install
/Libs
,$(1),libQt5Widgets
)
578 define Package
/qt5base-xml
/install
579 $(call Build
/Install
/Libs
,$(1),libQt5Xml
)
582 define Package
/qt5base-plugin-bearer-generic
/install
583 $(call Build
/Install
/Plugins
,$(1),bearer
,libqgenericbearer
)
586 define Package
/qt5base-plugin-input-libinput
/install
587 $(call Build
/Install
/Plugins
,$(1),generic
,libqlibinputplugin
)
590 define Package
/qt5base-plugin-input-evdevkeyboard
/install
591 $(call Build
/Install
/Plugins
,$(1),generic
,libqevdevkeyboardplugin
)
594 define Package
/qt5base-plugin-input-evdevmouse
/install
595 $(call Build
/Install
/Plugins
,$(1),generic
,libqevdevmouseplugin
)
598 define Package
/qt5base-plugin-input-evdevtablet
/install
599 $(call Build
/Install
/Plugins
,$(1),generic
,libqevdevtabletplugin
)
602 define Package
/qt5base-plugin-input-evdevtouch
/install
603 $(call Build
/Install
/Plugins
,$(1),generic
,libqevdevtouchplugin
)
606 #define Package/qt5base-plugin-imageformats-gif/install
607 # $(call Build/Install/Plugins,$(1),imageformats,libqgif)
610 define Package
/qt5base-plugin-imageformats-ico
/install
611 $(call Build
/Install
/Plugins
,$(1),imageformats
,libqico
)
614 define Package
/qt5base-plugin-imageformats-jpeg
/install
615 $(call Build
/Install
/Plugins
,$(1),imageformats
,libqjpeg
)
618 #define Package/qt5base-plugin-imageformats-png/install
619 # $(call Build/Install/Plugins,$(1),imageformats,libqpng)
622 define Package
/qt5base-plugin-platforms-linuxfb
/install
623 $(call Build
/Install
/Plugins
,$(1),platforms
,libqlinuxfb
)
626 define Package
/qt5base-plugin-platforms-vnc
/install
627 $(call Build
/Install
/Plugins
,$(1),platforms
,libqvnc
)
630 #define Package/qt5base-plugin-platforms-eglfs/install
631 # $(call Build/Install/Plugins,$(1),platforms,libqeglfs)
634 #define Package/qt5base-plugin-platforms-minimalegl/install
635 # $(call Build/Install/Plugins,$(1),platforms,libqminimalegl)
638 define Package
/qt5base-plugin-platforms-minimal
/install
639 $(call Build
/Install
/Plugins
,$(1),platforms
,libqminimal
)
642 define Package
/qt5base-plugin-platforms-offscreen
/install
643 $(call Build
/Install
/Plugins
,$(1),platforms
,libqoffscreen
)
646 #define Package/qt5base-plugin-sqldrivers-sqlite/install
647 # $(call Build/Install/Plugins,$(1),sqldrivers,libqsqlite)
650 define Package
/qt5base-examples
/install
651 $(call Build
/Install
/Examples
,$(1))
654 # $(eval $(call BuildPackage,qt5base))
655 $(eval
$(call BuildPackage
,qt5base-concurrent
))
656 $(eval
$(call BuildPackage
,qt5base-core
))
657 $(eval
$(call BuildPackage
,qt5base-gui
))
658 $(eval
$(call BuildPackage
,qt5base-gl
))
659 $(eval
$(call BuildPackage
,qt5base-network
))
660 $(eval
$(call BuildPackage
,qt5base-printSupport
))
661 $(eval
$(call BuildPackage
,qt5base-sql
))
662 $(eval
$(call BuildPackage
,qt5base-test
))
663 $(eval
$(call BuildPackage
,qt5base-widgets
))
664 $(eval
$(call BuildPackage
,qt5base-xml
))
665 $(eval
$(call BuildPackage
,qt5base-plugin-bearer-generic
))
666 $(eval
$(call BuildPackage
,qt5base-plugin-input-libinput
))
667 $(eval
$(call BuildPackage
,qt5base-plugin-input-evdevkeyboard
))
668 $(eval
$(call BuildPackage
,qt5base-plugin-input-evdevmouse
))
669 $(eval
$(call BuildPackage
,qt5base-plugin-input-evdevtablet
))
670 $(eval
$(call BuildPackage
,qt5base-plugin-input-evdevtouch
))
671 #$(eval $(call BuildPackage,qt5base-plugin-imageformats-gif))
672 $(eval
$(call BuildPackage
,qt5base-plugin-imageformats-ico
))
673 $(eval
$(call BuildPackage
,qt5base-plugin-imageformats-jpeg
))
674 #$(eval $(call BuildPackage,qt5base-plugin-imageformats-png))
675 $(eval
$(call BuildPackage
,qt5base-plugin-platforms-linuxfb
))
676 #$(eval $(call BuildPackage,qt5base-plugin-platforms-eglfs))
677 #$(eval $(call BuildPackage,qt5base-plugin-platforms-minimalegl))
678 $(eval
$(call BuildPackage
,qt5base-plugin-platforms-minimal
))
679 $(eval
$(call BuildPackage
,qt5base-plugin-platforms-offscreen
))
680 $(eval
$(call BuildPackage
,qt5base-plugin-platforms-vnc
))
681 #$(eval $(call BuildPackage,qt5base-plugin-sqldrivers-sqlite))
682 $(eval
$(call BuildPackage
,qt5base-examples
))
683 $(eval
$(call HostBuild
))