summaryrefslogtreecommitdiffstats
path: root/recipes-qt
diff options
context:
space:
mode:
authorSamuli Piippo <samuli.piippo@qt.io>2018-06-18 10:52:40 +0300
committerOtavio Salvador <otavio@ossystems.com.br>2018-07-04 17:12:38 -0300
commit0263af75c053d1d7ea4882a75cf59b230fbb88ad (patch)
tree6cd09dd0835f539aac0a2aa404f4e5a3c13926d6 /recipes-qt
parenta4f88b6b5f0703d15c4b50589d36fd6df22cd330 (diff)
downloadmeta-qt5-0263af75c053d1d7ea4882a75cf59b230fbb88ad.tar.gz
qt5: add option to build Qt5 statically
Add PACKAGECONFIG that enables static build for qtbase and consequently to all Qt recipes. This can be enabled with DISTRO_FEATURE 'qt5-static', which also adds qtdeclarative-native dependency to all recipes that depend on qtdeclarative as it's required for qmlimportscannertool. Building examples and tests with static build can take excessive amounts of time and disk space, so disabling DISTRO_FEATURE 'ptest' and PACKAGECONFIGs 'examples' from qtbase is advised. Not all recipes support static builds and those are not fixed here. Change-Id: Ia0e2a2467cd42d4395ed5292a645fd1d89ad521a Signed-off-by: Samuli Piippo <samuli.piippo@qt.io>
Diffstat (limited to 'recipes-qt')
-rw-r--r--recipes-qt/qt5/qt5.inc22
-rw-r--r--recipes-qt/qt5/qtbase_git.bb2
-rw-r--r--recipes-qt/qt5/qtdeclarative_git.bb3
-rw-r--r--recipes-qt/qt5/qtwebengine_git.bb4
4 files changed, 30 insertions, 1 deletions
diff --git a/recipes-qt/qt5/qt5.inc b/recipes-qt/qt5/qt5.inc
index b4915138..99105bd9 100644
--- a/recipes-qt/qt5/qt5.inc
+++ b/recipes-qt/qt5/qt5.inc
@@ -37,6 +37,14 @@ python __anonymous() {
37 d.setVar("PACKAGE_ARCH", tarch) 37 d.setVar("PACKAGE_ARCH", tarch)
38} 38}
39 39
40# if building static Qt5, add qtdeclarative-native dependency to all recipes
41# that depend on qtdeclarative as it's required for qmlimportscannertool
42python __anonymous() {
43 if bb.utils.contains('DISTRO_FEATURES', "qt5-static", True, False, d):
44 if bb.utils.contains('DEPENDS', "qtdeclarative", True, False, d):
45 d.appendVar("DEPENDS", " qtdeclarative-native")
46}
47
40# Many examples come with libraries installed outside of standard libdir, 48# Many examples come with libraries installed outside of standard libdir,
41# suppress QA check complaining 49# suppress QA check complaining
42INSANE_SKIP_${PN}-dbg += "libdir" 50INSANE_SKIP_${PN}-dbg += "libdir"
@@ -48,6 +56,8 @@ PACKAGES =. "${PN}-qmlplugins-dbg ${PN}-tools-dbg ${PN}-plugins-dbg ${PN}-qmldes
48 56
49ALLOW_EMPTY_${PN} = "1" 57ALLOW_EMPTY_${PN} = "1"
50ALLOW_EMPTY_${PN}-dbg = "1" 58ALLOW_EMPTY_${PN}-dbg = "1"
59ALLOW_EMPTY_${PN}-plugins = "1"
60ALLOW_EMPTY_${PN}-qmlplugins = "1"
51 61
52RRECOMMENDS_${PN} = " \ 62RRECOMMENDS_${PN} = " \
53 ${PN}-plugins \ 63 ${PN}-plugins \
@@ -159,6 +169,18 @@ FILES_${PN}-dbg += " \
159" 169"
160FILES_${PN}-staticdev += " \ 170FILES_${PN}-staticdev += " \
161 ${OE_QMAKE_PATH_LIBS}/*.a \ 171 ${OE_QMAKE_PATH_LIBS}/*.a \
172 ${OE_QMAKE_PATH_PLUGINS}/*/*.a \
173 ${OE_QMAKE_PATH_PLUGINS}/*/*.prl \
174 ${OE_QMAKE_PATH_PLUGINS}/*/*/*.a \
175 ${OE_QMAKE_PATH_PLUGINS}/*/*/*.prl \
176 ${OE_QMAKE_PATH_QML}/*/*.a \
177 ${OE_QMAKE_PATH_QML}/*/*.prl \
178 ${OE_QMAKE_PATH_QML}/*/*/*.a \
179 ${OE_QMAKE_PATH_QML}/*/*/*.prl \
180 ${OE_QMAKE_PATH_QML}/*/*/*/*.a \
181 ${OE_QMAKE_PATH_QML}/*/*/*/*.prl \
182 ${OE_QMAKE_PATH_QML}/*/*/*/*/*.a \
183 ${OE_QMAKE_PATH_QML}/*/*/*/*/*.prl \
162" 184"
163FILES_${PN}-examples = " \ 185FILES_${PN}-examples = " \
164 ${OE_QMAKE_PATH_EXAMPLES}/* \ 186 ${OE_QMAKE_PATH_EXAMPLES}/* \
diff --git a/recipes-qt/qt5/qtbase_git.bb b/recipes-qt/qt5/qtbase_git.bb
index bf05cf81..fdaf031f 100644
--- a/recipes-qt/qt5/qtbase_git.bb
+++ b/recipes-qt/qt5/qtbase_git.bb
@@ -70,6 +70,7 @@ PACKAGECONFIG_RELEASE ?= "release"
70# PACKAGECONFIG_OPENSSL ?= "openssl" 70# PACKAGECONFIG_OPENSSL ?= "openssl"
71PACKAGECONFIG_DEFAULT ?= "dbus udev evdev widgets tools libs freetype tests \ 71PACKAGECONFIG_DEFAULT ?= "dbus udev evdev widgets tools libs freetype tests \
72 ${@bb.utils.contains('SELECTED_OPTIMIZATION', '-Os', 'optimize-size ltcg', '', d)} \ 72 ${@bb.utils.contains('SELECTED_OPTIMIZATION', '-Os', 'optimize-size ltcg', '', d)} \
73 ${@bb.utils.contains('DISTRO_FEATURES', 'qt5-static', 'static', '', d)} \
73" 74"
74 75
75PACKAGECONFIG ?= " \ 76PACKAGECONFIG ?= " \
@@ -84,6 +85,7 @@ PACKAGECONFIG ?= " \
84 ${PACKAGECONFIG_DISTRO} \ 85 ${PACKAGECONFIG_DISTRO} \
85" 86"
86 87
88PACKAGECONFIG[static] = "-static,-shared"
87PACKAGECONFIG[release] = "-release,-debug" 89PACKAGECONFIG[release] = "-release,-debug"
88PACKAGECONFIG[debug] = "" 90PACKAGECONFIG[debug] = ""
89PACKAGECONFIG[developer] = "-developer-build" 91PACKAGECONFIG[developer] = "-developer-build"
diff --git a/recipes-qt/qt5/qtdeclarative_git.bb b/recipes-qt/qt5/qtdeclarative_git.bb
index 69e90570..e6173b4e 100644
--- a/recipes-qt/qt5/qtdeclarative_git.bb
+++ b/recipes-qt/qt5/qtdeclarative_git.bb
@@ -14,10 +14,11 @@ LIC_FILES_CHKSUM = " \
14 14
15DEPENDS += "qtbase" 15DEPENDS += "qtbase"
16 16
17PACKAGECONFIG ??= "qtxmlpatterns qml-debug qml-network" 17PACKAGECONFIG ??= "qtxmlpatterns qml-debug qml-network ${@bb.utils.contains('DISTRO_FEATURES', 'qt5-static', 'static', '', d)}"
18PACKAGECONFIG[qtxmlpatterns] = ",,qtxmlpatterns" 18PACKAGECONFIG[qtxmlpatterns] = ",,qtxmlpatterns"
19PACKAGECONFIG[qml-debug] = "-qml-debug,-no-qml-debug" 19PACKAGECONFIG[qml-debug] = "-qml-debug,-no-qml-debug"
20PACKAGECONFIG[qml-network] = "-qml-network, -no-qml-network" 20PACKAGECONFIG[qml-network] = "-qml-network, -no-qml-network"
21PACKAGECONFIG[static] = ",,qtdeclarative-native"
21 22
22do_configure_prepend() { 23do_configure_prepend() {
23 # disable qtxmlpatterns test if it isn't enabled by PACKAGECONFIG 24 # disable qtxmlpatterns test if it isn't enabled by PACKAGECONFIG
diff --git a/recipes-qt/qt5/qtwebengine_git.bb b/recipes-qt/qt5/qtwebengine_git.bb
index 11ee347e..32ad875c 100644
--- a/recipes-qt/qt5/qtwebengine_git.bb
+++ b/recipes-qt/qt5/qtwebengine_git.bb
@@ -73,6 +73,10 @@ inherit qmake5
73inherit gettext 73inherit gettext
74inherit pythonnative 74inherit pythonnative
75inherit perlnative 75inherit perlnative
76inherit distro_features_check
77
78# Static builds of QtWebEngine aren't supported.
79CONFLICT_DISTRO_FEATURES = "qt5-static"
76 80
77# we don't want gettext.bbclass to append --enable-nls 81# we don't want gettext.bbclass to append --enable-nls
78def gettext_oeconf(d): 82def gettext_oeconf(d):