qt*: refresh the patches
[scm/bb/tizen-distro.git] / meta-qt5 / recipes-qt / qt5 / nativesdk-qtbase.inc
1 DESCRIPTION = "SDK version of Qt/[X11|Mac|Embedded]"
2 DEPENDS = "nativesdk-zlib nativesdk-dbus qtbase-native"
3 SECTION = "libs"
4 HOMEPAGE = "http://qt-project.org"
5
6 QT_MODULE = "qtbase"
7
8 require nativesdk-qt5.inc
9
10 # it's already included with newer oe-core, but include it here for dylan
11 FILESEXTRAPATHS =. "${FILE_DIRNAME}/qtbase:"
12
13 # common for qtbase-native, qtbase-nativesdk and qtbase
14 SRC_URI += "\
15     file://0001-Add-linux-oe-g-platform.patch \
16     file://0002-qlibraryinfo-allow-to-set-qt.conf-from-the-outside-u.patch \
17     file://0003-Add-external-hostbindir-option.patch \
18     file://0004-configureapp-Prefix-default-LIBDIRS-and-INCDIRS-with.patch \
19     file://0005-qt_module-Fix-pkgconfig-and-libtool-replacements.patch \
20     file://0006-Revert-eglfs-Print-the-chosen-config-in-debug-mode.patch \
21     file://0007-qeglplatformintegration-Undefine-CursorShape-from-X..patch \
22     file://0008-configure-bump-path-length-from-256-to-512-character.patch \
23     file://0009-eglfs-fix-egl-error-for-platforms-only-supporting-on.patch \
24     file://0010-Revert-Use-the-gcc-feature-in-simd.prf.patch \
25     file://0011-QOpenGLPaintDevice-sub-area-support.patch \
26 "
27
28 # common for qtbase-native and nativesdk-qtbase
29 SRC_URI += " \
30     file://0012-Always-build-uic.patch \
31 "
32
33 # specific for nativesdk-qtbase
34 SRC_URI += " \
35     file://0013-configure-preserve-built-qmake-and-swap-with-native-.patch \
36 "
37
38 PACKAGES = "${PN}-tools-dbg ${PN}-tools-dev ${PN}-tools-staticdev ${PN}-tools"
39
40 PACKAGE_DEBUG_SPLIT_STYLE = "debug-without-src"
41
42 FILES_${PN}-tools-dev = " \
43     ${includedir} \
44     ${FILES_SOLIBSDEV} ${libdir}/*.la \
45     ${OE_QMAKE_PATH_ARCHDATA}/mkspecs \
46 "
47
48 FILES_${PN}-tools-staticdev = " \
49     ${libdir}/libQt5Bootstrap.a \
50 "
51
52 FILES_${PN}-tools-dbg = " \
53     ${libdir}/.debug \
54     ${OE_QMAKE_PATH_BINS}/.debug \
55 "
56
57 FILES_${PN}-tools = " \
58     ${libdir}/lib*${SOLIBS} \
59     ${OE_QMAKE_PATH_BINS}/* \
60 "
61
62 # qttools binaries are placed in a subdir of bin in order to avoid
63 # collisions with qt4. This would trigger debian.bbclass to rename the
64 # package, since it doesn't detect binaries in subdirs. Explicitly
65 # disable package auto-renaming for the tools-package.
66 DEBIAN_NOAUTONAME_${PN}-tools = "1"
67
68 QT_CONFIG_FLAGS += " \
69     -shared \
70     -silent \
71     -no-pch \
72     -no-rpath \
73     -pkg-config \
74     ${EXTRA_OECONF} \
75 "
76
77 # qtbase is exception, as these are used as install path for sysroots
78 OE_QMAKE_PATH_HOST_DATA = "${libdir}/${QT_DIR_NAME}"
79 OE_QMAKE_PATH_HOST_LIBS = "${libdir}"
80
81 do_generate_qt_config_file() {
82     cat > ${QT_CONF_PATH} <<EOF
83 [Paths]
84 Prefix = ${OE_QMAKE_PATH_PREFIX}
85 Headers = ${OE_QMAKE_PATH_HEADERS}
86 Libraries = ${OE_QMAKE_PATH_LIBS}
87 ArchData = ${OE_QMAKE_PATH_ARCHDATA}
88 Data = ${OE_QMAKE_PATH_DATA}
89 Binaries = ${OE_QMAKE_PATH_BINS}
90 LibraryExecutables = ${OE_QMAKE_PATH_LIBEXECS}
91 Plugins = ${OE_QMAKE_PATH_PLUGINS}
92 Imports = ${OE_QMAKE_PATH_IMPORTS}
93 Qml2Imports = ${OE_QMAKE_PATH_QML}
94 Translations = ${OE_QMAKE_PATH_TRANSLATIONS}
95 Documentation = ${OE_QMAKE_PATH_DOCS}
96 Settings = ${OE_QMAKE_PATH_SETTINGS}
97 Examples = ${OE_QMAKE_PATH_EXAMPLES}
98 Tests = ${OE_QMAKE_PATH_TESTS}
99 HostBinaries = ${OE_QMAKE_PATH_HOST_BINS}
100 HostData = ${OE_QMAKE_PATH_HOST_DATA}
101 HostLibraries = ${OE_QMAKE_PATH_HOST_LIBS}
102 HostSpec = ${OE_QMAKESPEC}
103 TartgetSpec = ${OE_XQMAKESPEC}
104 ExternalHostBinaries = ${OE_QMAKE_PATH_EXTERNAL_HOST_BINS}
105 Sysroot =
106 EOF
107 }
108
109 do_generate_qt_config_file_append() {
110     cat >> ${QT_CONF_PATH} <<EOF
111
112 [EffectivePaths]
113 Prefix=..
114 EOF
115 }
116
117 # qtbase is exception, we need to use mkspecs from ${S}
118 QMAKE_MKSPEC_PATH = "${B}"
119
120 # qtbase is exception, configure script is using our get(X)QEvalMakeConf and setBootstrapEvalVariable functions to read it from shell
121 export OE_QMAKE_COMPILER
122 export OE_QMAKE_CC
123 export OE_QMAKE_CFLAGS
124 export OE_QMAKE_CXX
125 export OE_QMAKE_CXXFLAGS
126 export OE_QMAKE_LINK
127 export OE_QMAKE_LDFLAGS
128 export OE_QMAKE_AR
129 export OE_QMAKE_STRIP
130
131 # another exception is that we need to run bin/qmake, because EffectivePaths are relative to qmake location
132 OE_QMAKE_QMAKE_ORIG = "${STAGING_BINDIR_NATIVE}/${QT_DIR_NAME}/qmake"
133 OE_QMAKE_QMAKE = "bin/qmake"
134
135 do_configure() {
136     # we need symlink in path relative to source, because
137     # EffectivePaths:Prefix is relative to qmake location
138     # Also, configure expects qmake-native to swap with real one
139     if [ ! -e ${B}/bin/qmake-native ]; then
140         mkdir ${B}/bin
141         ln -sf ${OE_QMAKE_QMAKE_ORIG} ${B}/bin/qmake-native
142     fi
143
144     ${S}/configure -v \
145         -dont-process \
146         -opensource -confirm-license \
147         -sysroot ${STAGING_DIR_NATIVE} \
148         -no-gcc-sysroot \
149         -system-zlib \
150         -no-libjpeg \
151         -no-libpng \
152         -no-gif \
153         -no-accessibility \
154         -no-cups \
155         -no-nis \
156         -no-gui \
157         -no-qml-debug \
158         -no-sql-mysql \
159         -no-sql-sqlite \
160         -no-opengl \
161         -no-openssl \
162         -no-xcb \
163         -verbose \
164         -release \
165         -prefix ${OE_QMAKE_PATH_PREFIX} \
166         -bindir ${OE_QMAKE_PATH_BINS} \
167         -libdir ${OE_QMAKE_PATH_LIBS} \
168         -datadir ${OE_QMAKE_PATH_DATA} \
169         -sysconfdir ${OE_QMAKE_PATH_SETTINGS} \
170         -docdir ${OE_QMAKE_PATH_DOCS} \
171         -headerdir ${OE_QMAKE_PATH_HEADERS} \
172         -archdatadir ${OE_QMAKE_PATH_ARCHDATA} \
173         -libexecdir ${OE_QMAKE_PATH_LIBEXECS} \
174         -plugindir ${OE_QMAKE_PATH_PLUGINS} \
175         -importdir ${OE_QMAKE_PATH_IMPORTS} \
176         -qmldir ${OE_QMAKE_PATH_QML} \
177         -translationdir ${OE_QMAKE_PATH_TRANSLATIONS} \
178         -testsdir ${OE_QMAKE_PATH_TESTS} \
179         -hostbindir ${OE_QMAKE_PATH_HOST_BINS} \
180         -hostdatadir ${OE_QMAKE_PATH_HOST_DATA} \
181         -external-hostbindir ${OE_QMAKE_PATH_EXTERNAL_HOST_BINS} \
182         -no-glib \
183         -no-iconv \
184         -silent \
185         -nomake examples \
186         -nomake tests \
187         -nomake libs \
188         -no-compile-examples \
189         -no-rpath \
190         -platform ${OE_QMAKESPEC} \
191         -xplatform linux-oe-g++ \
192         ${QT_CONFIG_FLAGS}
193
194     bin/qmake ${OE_QMAKE_DEBUG_OUTPUT} ${S} -o Makefile || die "Configuring qt with qmake failed. EXTRA_OECONF was ${EXTRA_OECONF}"
195 }
196
197 do_install() {
198     # Fix install paths for all
199     find -name "Makefile*" | xargs sed -i "s,(INSTALL_ROOT)${STAGING_DIR_NATIVE}${STAGING_DIR_NATIVE},(INSTALL_ROOT)${STAGING_DIR_NATIVE},g"
200
201     oe_runmake install INSTALL_ROOT=${D}
202
203     # replace the native qmake installed above with nativesdk version
204     rm -rf ${D}${OE_QMAKE_PATH_HOST_BINS}/qmake
205     install -m 755 ${B}/bin/qmake-real ${D}${OE_QMAKE_PATH_HOST_BINS}/qmake
206
207     # for modules which are still using syncqt and call qtPrepareTool(QMAKE_SYNCQT, syncqt)
208     # e.g. qt3d, qtwayland
209     ln -sf syncqt.pl ${D}${OE_QMAKE_PATH_QT_BINS}/syncqt
210
211     # remove things unused in nativesdk, we need the headers, Qt5Core
212     # and Qt5Bootstrap.
213     rm -rf ${D}${datadir} \
214            ${D}/${OE_QMAKE_PATH_PLUGINS} \
215            ${D}${libdir}/cmake \
216            ${D}${libdir}/pkgconfig
217     find ${D}${libdir} -maxdepth 1 -name 'lib*' -and \
218                                    -not -name 'libQt5Core.so*' -and \
219                                    -not -name 'libQt5Bootstrap.a' \
220                                    -exec rm '{}' ';'
221 }