diff options
Diffstat (limited to 'recipes-qt/qt5/nativesdk-qtbase_git.bb')
-rw-r--r-- | recipes-qt/qt5/nativesdk-qtbase_git.bb | 258 |
1 files changed, 249 insertions, 9 deletions
diff --git a/recipes-qt/qt5/nativesdk-qtbase_git.bb b/recipes-qt/qt5/nativesdk-qtbase_git.bb index 1b566c21..65069280 100644 --- a/recipes-qt/qt5/nativesdk-qtbase_git.bb +++ b/recipes-qt/qt5/nativesdk-qtbase_git.bb | |||
@@ -1,10 +1,24 @@ | |||
1 | require qt5-git.inc | 1 | DESCRIPTION = "SDK version of Qt/[X11|Mac|Embedded]" |
2 | require ${PN}.inc | 2 | DEPENDS = "nativesdk-zlib nativesdk-dbus qtbase-native" |
3 | SECTION = "libs" | ||
4 | HOMEPAGE = "http://qt-project.org" | ||
3 | 5 | ||
4 | SRC_URI = "\ | 6 | LICENSE = "GFDL-1.3 & BSD & (LGPL-2.1 & Digia-Qt-LGPL-Exception-1.1 | LGPL-3.0)" |
5 | ${QT_GIT}/qt/${QT_MODULE}.git;branch=${QT_MODULE_BRANCH} \ | 7 | LIC_FILES_CHKSUM = " \ |
8 | file://LICENSE.LGPLv21;md5=d87ae0d200af76dca730d911474cbe5b \ | ||
9 | file://LICENSE.LGPLv3;md5=ffcfac38a32c9ebdb8ff768fa1702478 \ | ||
10 | file://LGPL_EXCEPTION.txt;md5=0145c4d1b6f96a661c2c139dfb268fb6 \ | ||
11 | file://LICENSE.FDL;md5=6d9f2a9af4c8b8c3c769f6cc1b6aaf7e \ | ||
6 | " | 12 | " |
7 | 13 | ||
14 | QT_MODULE = "qtbase" | ||
15 | |||
16 | require nativesdk-qt5.inc | ||
17 | require qt5-git.inc | ||
18 | |||
19 | # it's already included with newer oe-core, but include it here for dylan | ||
20 | FILESEXTRAPATHS =. "${FILE_DIRNAME}/qtbase:" | ||
21 | |||
8 | # common for qtbase-native, qtbase-nativesdk and qtbase | 22 | # common for qtbase-native, qtbase-nativesdk and qtbase |
9 | SRC_URI += "\ | 23 | SRC_URI += "\ |
10 | file://0001-Add-linux-oe-g-platform.patch \ | 24 | file://0001-Add-linux-oe-g-platform.patch \ |
@@ -35,9 +49,235 @@ SRC_URI += " \ | |||
35 | file://OEQt5Toolchain.cmake \ | 49 | file://OEQt5Toolchain.cmake \ |
36 | " | 50 | " |
37 | 51 | ||
38 | SRCREV = "f58e882b7594c59b6050d3c87562fcf836d10f60" | 52 | PACKAGES = "${PN}-tools-dbg ${PN}-tools-dev ${PN}-tools-staticdev ${PN}-tools" |
53 | |||
54 | PACKAGE_DEBUG_SPLIT_STYLE = "debug-without-src" | ||
55 | |||
56 | FILES_${PN}-tools-dev = " \ | ||
57 | ${includedir} \ | ||
58 | ${FILES_SOLIBSDEV} ${libdir}/*.la \ | ||
59 | ${OE_QMAKE_PATH_ARCHDATA}/mkspecs \ | ||
60 | " | ||
61 | |||
62 | FILES_${PN}-tools-staticdev = " \ | ||
63 | ${libdir}/libQt5Bootstrap.a \ | ||
64 | " | ||
65 | |||
66 | FILES_${PN}-tools-dbg = " \ | ||
67 | ${libdir}/.debug \ | ||
68 | ${OE_QMAKE_PATH_BINS}/.debug \ | ||
69 | " | ||
70 | |||
71 | FILES_${PN}-tools = " \ | ||
72 | ${libdir}/lib*${SOLIBS} \ | ||
73 | ${OE_QMAKE_PATH_BINS}/* \ | ||
74 | ${SDKPATHNATIVE}/environment-setup.d \ | ||
75 | ${datadir}/cmake \ | ||
76 | " | ||
77 | |||
78 | # qttools binaries are placed in a subdir of bin in order to avoid | ||
79 | # collisions with qt4. This would trigger debian.bbclass to rename the | ||
80 | # package, since it doesn't detect binaries in subdirs. Explicitly | ||
81 | # disable package auto-renaming for the tools-package. | ||
82 | DEBIAN_NOAUTONAME_${PN}-tools = "1" | ||
83 | |||
84 | QT_CONFIG_FLAGS += " \ | ||
85 | -shared \ | ||
86 | -silent \ | ||
87 | -no-pch \ | ||
88 | -no-rpath \ | ||
89 | -pkg-config \ | ||
90 | ${EXTRA_OECONF} \ | ||
91 | " | ||
92 | |||
93 | # qtbase is exception, as these are used as install path for sysroots | ||
94 | OE_QMAKE_PATH_HOST_DATA = "${libdir}/${QT_DIR_NAME}" | ||
95 | OE_QMAKE_PATH_HOST_LIBS = "${libdir}" | ||
96 | |||
97 | do_generate_qt_config_file() { | ||
98 | cat > ${QT_CONF_PATH} <<EOF | ||
99 | [Paths] | ||
100 | Prefix = ${OE_QMAKE_PATH_PREFIX} | ||
101 | Headers = ${OE_QMAKE_PATH_HEADERS} | ||
102 | Libraries = ${OE_QMAKE_PATH_LIBS} | ||
103 | ArchData = ${OE_QMAKE_PATH_ARCHDATA} | ||
104 | Data = ${OE_QMAKE_PATH_DATA} | ||
105 | Binaries = ${OE_QMAKE_PATH_BINS} | ||
106 | LibraryExecutables = ${OE_QMAKE_PATH_LIBEXECS} | ||
107 | Plugins = ${OE_QMAKE_PATH_PLUGINS} | ||
108 | Imports = ${OE_QMAKE_PATH_IMPORTS} | ||
109 | Qml2Imports = ${OE_QMAKE_PATH_QML} | ||
110 | Translations = ${OE_QMAKE_PATH_TRANSLATIONS} | ||
111 | Documentation = ${OE_QMAKE_PATH_DOCS} | ||
112 | Settings = ${OE_QMAKE_PATH_SETTINGS} | ||
113 | Examples = ${OE_QMAKE_PATH_EXAMPLES} | ||
114 | Tests = ${OE_QMAKE_PATH_TESTS} | ||
115 | HostBinaries = ${OE_QMAKE_PATH_HOST_BINS} | ||
116 | HostData = ${OE_QMAKE_PATH_HOST_DATA} | ||
117 | HostLibraries = ${OE_QMAKE_PATH_HOST_LIBS} | ||
118 | HostSpec = ${OE_QMAKESPEC} | ||
119 | TartgetSpec = ${OE_XQMAKESPEC} | ||
120 | ExternalHostBinaries = ${OE_QMAKE_PATH_EXTERNAL_HOST_BINS} | ||
121 | Sysroot = | ||
122 | EOF | ||
123 | } | ||
124 | |||
125 | do_generate_qt_config_file_append() { | ||
126 | cat >> ${QT_CONF_PATH} <<EOF | ||
39 | 127 | ||
40 | LIC_FILES_CHKSUM = "file://LICENSE.LGPLv21;md5=d87ae0d200af76dca730d911474cbe5b \ | 128 | [EffectivePaths] |
41 | file://LICENSE.LGPLv3;md5=ffcfac38a32c9ebdb8ff768fa1702478 \ | 129 | Prefix=.. |
42 | file://LGPL_EXCEPTION.txt;md5=0145c4d1b6f96a661c2c139dfb268fb6 \ | 130 | EOF |
43 | file://LICENSE.FDL;md5=6d9f2a9af4c8b8c3c769f6cc1b6aaf7e" | 131 | } |
132 | |||
133 | # qtbase is exception, we need to use mkspecs from ${S} | ||
134 | QMAKE_MKSPEC_PATH = "${B}" | ||
135 | |||
136 | # qtbase is exception, configure script is using our get(X)QEvalMakeConf and setBootstrapEvalVariable functions to read it from shell | ||
137 | export OE_QMAKE_COMPILER | ||
138 | export OE_QMAKE_CC | ||
139 | export OE_QMAKE_CFLAGS | ||
140 | export OE_QMAKE_CXX | ||
141 | export OE_QMAKE_CXXFLAGS | ||
142 | export OE_QMAKE_LINK | ||
143 | export OE_QMAKE_LDFLAGS | ||
144 | export OE_QMAKE_AR | ||
145 | export OE_QMAKE_STRIP | ||
146 | |||
147 | # another exception is that we need to run bin/qmake, because EffectivePaths are relative to qmake location | ||
148 | OE_QMAKE_QMAKE_ORIG = "${STAGING_BINDIR_NATIVE}/${QT_DIR_NAME}/qmake" | ||
149 | OE_QMAKE_QMAKE = "bin/qmake" | ||
150 | |||
151 | do_configure() { | ||
152 | # we need symlink in path relative to source, because | ||
153 | # EffectivePaths:Prefix is relative to qmake location | ||
154 | # Also, configure expects qmake-native to swap with real one | ||
155 | if [ ! -e ${B}/bin/qmake-native ]; then | ||
156 | mkdir ${B}/bin | ||
157 | ln -sf ${OE_QMAKE_QMAKE_ORIG} ${B}/bin/qmake-native | ||
158 | fi | ||
159 | |||
160 | ${S}/configure -v \ | ||
161 | -opensource -confirm-license \ | ||
162 | -sysroot ${STAGING_DIR_NATIVE} \ | ||
163 | -no-gcc-sysroot \ | ||
164 | -system-zlib \ | ||
165 | -no-libjpeg \ | ||
166 | -no-libpng \ | ||
167 | -no-gif \ | ||
168 | -no-accessibility \ | ||
169 | -no-cups \ | ||
170 | -no-nis \ | ||
171 | -no-gui \ | ||
172 | -no-qml-debug \ | ||
173 | -no-sql-mysql \ | ||
174 | -no-sql-sqlite \ | ||
175 | -no-opengl \ | ||
176 | -no-openssl \ | ||
177 | -no-xcb \ | ||
178 | -verbose \ | ||
179 | -release \ | ||
180 | -prefix ${OE_QMAKE_PATH_PREFIX} \ | ||
181 | -bindir ${OE_QMAKE_PATH_BINS} \ | ||
182 | -libdir ${OE_QMAKE_PATH_LIBS} \ | ||
183 | -datadir ${OE_QMAKE_PATH_DATA} \ | ||
184 | -sysconfdir ${OE_QMAKE_PATH_SETTINGS} \ | ||
185 | -docdir ${OE_QMAKE_PATH_DOCS} \ | ||
186 | -headerdir ${OE_QMAKE_PATH_HEADERS} \ | ||
187 | -archdatadir ${OE_QMAKE_PATH_ARCHDATA} \ | ||
188 | -libexecdir ${OE_QMAKE_PATH_LIBEXECS} \ | ||
189 | -plugindir ${OE_QMAKE_PATH_PLUGINS} \ | ||
190 | -importdir ${OE_QMAKE_PATH_IMPORTS} \ | ||
191 | -qmldir ${OE_QMAKE_PATH_QML} \ | ||
192 | -translationdir ${OE_QMAKE_PATH_TRANSLATIONS} \ | ||
193 | -testsdir ${OE_QMAKE_PATH_TESTS} \ | ||
194 | -hostbindir ${OE_QMAKE_PATH_HOST_BINS} \ | ||
195 | -hostdatadir ${OE_QMAKE_PATH_HOST_DATA} \ | ||
196 | -external-hostbindir ${OE_QMAKE_PATH_EXTERNAL_HOST_BINS} \ | ||
197 | -no-glib \ | ||
198 | -no-iconv \ | ||
199 | -silent \ | ||
200 | -nomake examples \ | ||
201 | -nomake tests \ | ||
202 | -nomake libs \ | ||
203 | -no-compile-examples \ | ||
204 | -no-rpath \ | ||
205 | -platform ${OE_QMAKESPEC} \ | ||
206 | -xplatform linux-oe-g++ \ | ||
207 | ${QT_CONFIG_FLAGS} | ||
208 | |||
209 | bin/qmake ${OE_QMAKE_DEBUG_OUTPUT} ${S} -o Makefile || die "Configuring qt with qmake failed. EXTRA_OECONF was ${EXTRA_OECONF}" | ||
210 | } | ||
211 | |||
212 | # Set the EXTRA_QTLIB variable to e.g. Xml, in order to not remove libQt5Xml.so.* | ||
213 | EXTRA_QTLIB ?= "" | ||
214 | |||
215 | python __anonymous () { | ||
216 | templibs = "" | ||
217 | for e in d.getVar("EXTRA_QTLIB", True).split(): | ||
218 | templibs = "%s -not -name 'libQt5%s.so*' -and" % (templibs, e) | ||
219 | d.setVar("QTLIBSPRESERVE", templibs) | ||
220 | } | ||
221 | |||
222 | do_install() { | ||
223 | # Fix install paths for all | ||
224 | find -name "Makefile*" | xargs sed -i "s,(INSTALL_ROOT)${STAGING_DIR_NATIVE}${STAGING_DIR_NATIVE},(INSTALL_ROOT)${STAGING_DIR_NATIVE},g" | ||
225 | |||
226 | oe_runmake install INSTALL_ROOT=${D} | ||
227 | |||
228 | # replace the native qmake installed above with nativesdk version | ||
229 | rm -rf ${D}${OE_QMAKE_PATH_HOST_BINS}/qmake | ||
230 | install -m 755 ${B}/bin/qmake-real ${D}${OE_QMAKE_PATH_HOST_BINS}/qmake | ||
231 | |||
232 | # for modules which are still using syncqt and call qtPrepareTool(QMAKE_SYNCQT, syncqt) | ||
233 | # e.g. qt3d, qtwayland | ||
234 | ln -sf syncqt.pl ${D}${OE_QMAKE_PATH_QT_BINS}/syncqt | ||
235 | |||
236 | # remove things unused in nativesdk, we need the headers, Qt5Core | ||
237 | # and Qt5Bootstrap. | ||
238 | rm -rf ${D}${datadir} \ | ||
239 | ${D}/${OE_QMAKE_PATH_PLUGINS} \ | ||
240 | ${D}${libdir}/cmake \ | ||
241 | ${D}${libdir}/pkgconfig | ||
242 | find ${D}${libdir} -maxdepth 1 -name 'lib*' -and -not -type d -and \ | ||
243 | -not -name 'libQt5Core.so*' -and \ | ||
244 | ${QTLIBSPRESERVE} \ | ||
245 | -not -name 'libQt5Bootstrap.a' \ | ||
246 | -exec rm '{}' ';' | ||
247 | |||
248 | # Install CMake's toolchain configuration | ||
249 | mkdir -p ${D}${datadir}/cmake/OEToolchainConfig.cmake.d/ | ||
250 | install -m 644 ${WORKDIR}/OEQt5Toolchain.cmake ${D}${datadir}/cmake/OEToolchainConfig.cmake.d/ | ||
251 | } | ||
252 | |||
253 | do_generate_qt_environment_file() { | ||
254 | mkdir -p ${D}${SDKPATHNATIVE}/environment-setup.d/ | ||
255 | script=${D}${SDKPATHNATIVE}/environment-setup.d/qt5.sh | ||
256 | |||
257 | echo 'export PATH=${OE_QMAKE_PATH_HOST_BINS}:$PATH' > $script | ||
258 | echo 'export OE_QMAKE_CFLAGS="$CFLAGS"' >> $script | ||
259 | echo 'export OE_QMAKE_CXXFLAGS="$CXXFLAGS"' >> $script | ||
260 | echo 'export OE_QMAKE_LDFLAGS="$LDFLAGS"' >> $script | ||
261 | echo 'export OE_QMAKE_CC=$CC' >> $script | ||
262 | echo 'export OE_QMAKE_CXX=$CXX' >> $script | ||
263 | echo 'export OE_QMAKE_LINK=$CXX' >> $script | ||
264 | echo 'export OE_QMAKE_AR=$AR' >> $script | ||
265 | echo 'export QT_CONF_PATH=${OE_QMAKE_PATH_HOST_BINS}/qt.conf' >> $script | ||
266 | echo 'export OE_QMAKE_LIBDIR_QT=`qmake -query QT_INSTALL_LIBS`' >> $script | ||
267 | echo 'export OE_QMAKE_INCDIR_QT=`qmake -query QT_INSTALL_HEADERS`' >> $script | ||
268 | echo 'export OE_QMAKE_MOC=${OE_QMAKE_PATH_HOST_BINS}/moc' >> $script | ||
269 | echo 'export OE_QMAKE_UIC=${OE_QMAKE_PATH_HOST_BINS}/uic' >> $script | ||
270 | echo 'export OE_QMAKE_RCC=${OE_QMAKE_PATH_HOST_BINS}/rcc' >> $script | ||
271 | echo 'export OE_QMAKE_QDBUSCPP2XML=${OE_QMAKE_PATH_HOST_BINS}/qdbuscpp2xml' >> $script | ||
272 | echo 'export OE_QMAKE_QDBUSXML2CPP=${OE_QMAKE_PATH_HOST_BINS}/qdbusxml2cpp' >> $script | ||
273 | echo 'export OE_QMAKE_QT_CONFIG=`qmake -query QT_INSTALL_LIBS`/${QT_DIR_NAME}/mkspecs/qconfig.pri' >> $script | ||
274 | echo 'export OE_QMAKE_PATH_HOST_BINS=${OE_QMAKE_PATH_HOST_BINS}' >> $script | ||
275 | echo 'export QMAKESPEC=`qmake -query QT_INSTALL_LIBS`/${QT_DIR_NAME}/mkspecs/linux-oe-g++' >> $script | ||
276 | |||
277 | # Use relocable sysroot | ||
278 | sed -i -e 's:${SDKPATHNATIVE}:$OECORE_NATIVE_SYSROOT:g' $script | ||
279 | } | ||
280 | |||
281 | addtask generate_qt_environment_file after do_install before do_package | ||
282 | |||
283 | SRCREV = "f58e882b7594c59b6050d3c87562fcf836d10f60" | ||