summaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-qt/qt4/qt4.inc
diff options
context:
space:
mode:
Diffstat (limited to 'meta-oe/recipes-qt/qt4/qt4.inc')
-rw-r--r--meta-oe/recipes-qt/qt4/qt4.inc314
1 files changed, 314 insertions, 0 deletions
diff --git a/meta-oe/recipes-qt/qt4/qt4.inc b/meta-oe/recipes-qt/qt4/qt4.inc
new file mode 100644
index 000000000..98d55b1be
--- /dev/null
+++ b/meta-oe/recipes-qt/qt4/qt4.inc
@@ -0,0 +1,314 @@
1inherit qmake_base
2
3DEPENDS += "qt4-tools-native freetype jpeg libpng zlib dbus openssl glib-2.0 gstreamer gst-plugins-base mysql5 postgresql sqlite sqlite3"
4
5require qt4_arch.inc
6QT_ARCH := "${@qt_arch(d)}"
7QT_ENDIAN = "${@qt_endian(d)}"
8
9QT_DISTRO_FLAGS ?= "-no-accessibility -no-sm"
10QT_DISTRO_FLAGS_poky-lsb = "-sm"
11
12QT_CONFIG_FLAGS += "-release -no-cups -reduce-relocations \
13 -shared -no-nas-sound -no-nis \
14 -qt-gif -system-libjpeg -system-libpng -system-zlib \
15 -no-sql-ibase -plugin-sql-mysql -no-sql-odbc -plugin-sql-psql -plugin-sql-sqlite -plugin-sql-sqlite3 \
16 -no-pch -qdbus -stl -glib -phonon -webkit \
17 ${QT_DISTRO_FLAGS} "
18
19EXTRA_OEMAKE = "-e"
20
21EXTRA_ENV = 'QMAKE="${STAGING_BINDIR_NATIVE}/qmake2 -after \
22 INCPATH+=${STAGING_INCDIR}/freetype2 LIBS+=-L${STAGING_LIBDIR}" \
23 QMAKESPEC="${QMAKESPEC}" LINK="${CXX} -Wl,-rpath-link,${STAGING_LIBDIR}" \
24 AR="${TARGET_PREFIX}ar cqs" \
25 MOC="${STAGING_BINDIR_NATIVE}/moc4" UIC="${STAGING_BINDIR_NATIVE}/uic4" MAKE="make -e"'
26
27export QT_CONF_PATH="${WORKDIR}/qt.conf"
28
29# Library packages
30QT_LIB_NAMES = "Qt3Support QtAssistantClient QtCLucene QtCore QtDBus QtDesigner QtDesignerComponents QtGui QtHelp QtNetwork QtOpenGL QtScript QtScriptTools QtSql QtSvg QtTest QtUiTools QtWebKit QtXml QtXmlPatterns phonon QtMultimedia QtOpenVG QtMediaServices QtDeclarative"
31
32QT_EXTRA_LIBS = "pvrQWSWSEGL"
33
34python __anonymous () {
35 import bb
36
37 lib_packages = []
38 dev_packages = []
39 dbg_packages = []
40 for name in bb.data.getVar("QT_LIB_NAMES", d, 1).split():
41 pkg = "${QT_BASE_LIB}" + name.lower().replace("qt", "").replace("_", "-") + "4"
42 # NOTE: the headers for QtAssistantClient are different
43 incname = name.replace("QtAssistantClient", "QtAssistant")
44 bb.data.setVar("FILES_%s" % pkg, "${libdir}/lib%(name)s${QT_LIBINFIX}.so.*" % locals(), d)
45 bb.data.setVar("FILES_%s-dev" % pkg, """${libdir}/lib%(name)s${QT_LIBINFIX}.prl
46 ${libdir}/lib%(name)s${QT_LIBINFIX}.a
47 ${libdir}/lib%(name)s${QT_LIBINFIX}.la
48 ${libdir}/lib%(name)s${QT_LIBINFIX}.so
49 ${includedir}/${QT_DIR_NAME}/%(incname)s
50 ${libdir}/pkgconfig/%(name)s${QT_LIBINFIX}.pc""" % locals(), d)
51 bb.data.setVar("FILES_%s-dbg" % pkg, "${libdir}/.debug/lib%(name)s${QT_LIBINFIX}.so.*" % locals(), d)
52 lib_packages.append(pkg)
53 dev_packages.append("%s-dev" % pkg)
54 dbg_packages.append("%s-dbg" % pkg)
55 for name in bb.data.getVar("OTHER_PACKAGES", d, 1).split():
56 dbg_packages.append("%s-dbg" % name)
57
58 for name in bb.data.getVar("QT_EXTRA_LIBS", d, 1).split():
59 pkg = "${QT_BASE_LIB}" + name.lower().replace("qt", "").replace("_", "-") + "4"
60 bb.data.setVar("FILES_%s" % pkg, "${libdir}/lib%(name)s.so.*" % locals(), d)
61 bb.data.setVar("FILES_%s-dev" % pkg, """${libdir}/lib%(name)s.prl
62 ${libdir}/lib%(name)s.a
63 ${libdir}/lib%(name)s.la
64 ${libdir}/lib%(name)s.so
65 ${includedir}/${QT_DIR_NAME}/%(incname)s
66 ${libdir}/pkgconfig/%(name)s.pc""" % locals(), d)
67 bb.data.setVar("FILES_%s-dbg" % pkg, "${libdir}/.debug/lib%(name)s.so.*" % locals(), d)
68 lib_packages.append(pkg)
69 dev_packages.append("%s-dev" % pkg)
70 dbg_packages.append("%s-dbg" % pkg)
71
72 bb.data.setVar("LIB_PACKAGES", " ".join(lib_packages), d)
73 bb.data.setVar("DEV_PACKAGES", " ".join(dev_packages), d)
74 bb.data.setVar("DBG_PACKAGES", " ".join(dbg_packages), d)
75}
76
77OTHER_PACKAGES = "\
78 ${QT_BASE_NAME}-tools \
79 ${QT_BASE_NAME}-assistant \
80 ${QT_BASE_NAME}-common \
81 ${QT_BASE_NAME}-dbus \
82 ${QT_BASE_NAME}-demos \
83 ${QT_BASE_NAME}-designer \
84 ${QT_BASE_NAME}-examples \
85 ${QT_BASE_NAME}-fonts \
86 ${QT_BASE_NAME}-fonts-ttf-vera \
87 ${QT_BASE_NAME}-fonts-ttf-dejavu \
88 ${QT_BASE_NAME}-fonts-pfa \
89 ${QT_BASE_NAME}-fonts-pfb \
90 ${QT_BASE_NAME}-fonts-qpf \
91 ${QT_BASE_NAME}-linguist \
92 ${QT_BASE_NAME}-makeqpf \
93 ${QT_BASE_NAME}-mkspecs \
94 ${QT_BASE_NAME}-pixeltool \
95 ${QT_BASE_NAME}-qmlviewer \
96 ${QT_BASE_NAME}-xmlpatterns \
97 ${QT_BASE_NAME}-qt3to4"
98
99PACKAGES += "${LIB_PACKAGES} ${DEV_PACKAGES} ${DBG_PACKAGES} ${OTHER_PACKAGES}"
100PACKAGES_DYNAMIC = "${QT_BASE_NAME}-plugin-* ${QT_BASE_NAME}-translation-* ${QT_BASE_NAME}-fonts-*"
101
102ALLOW_EMPTY_${PN} = "1"
103ALLOW_EMPTY_${QT_BASE_NAME}-fonts = "1"
104FILES_${PN} = ""
105FILES_${PN}-dev = "${includedir}/${QT_DIR_NAME}/Qt/*"
106FILES_${PN}-dbg = ""
107RRECOMMENDS_${PN} = "${LIB_PACKAGES} ${OTHER_PACKAGES}"
108RRECOMMENDS_${PN}-dev = "${DEV_PACKAGES}"
109RRECOMMENDS_${PN}-dbg = "${DBG_PACKAGES}"
110RRECOMMENDS_${QT_BASE_NAME}-fonts = " \
111 ${QT_BASE_NAME}-fonts-ttf-vera \
112 ${QT_BASE_NAME}-fonts-ttf-dejavu \
113 ${QT_BASE_NAME}-fonts-pfa \
114 ${QT_BASE_NAME}-fonts-pfb \
115 ${QT_BASE_NAME}-fonts-qpf"
116RRECOMMENDS_${QT_BASE_NAME}-demos += " \
117 ${QT_BASE_NAME}-fonts \
118 ${QT_BASE_NAME}-examples \
119 ${QT_BASE_NAME}-plugin-sqldriver-sqlite \
120 ${QT_BASE_NAME}-plugin-imageformat-jpeg \
121 ${QT_BASE_NAME}-assistant \
122 ${PN}-doc"
123RRECOMMENDS_${QT_BASE_NAME}-examples += " \
124 ${QT_BASE_NAME}-plugin-sqldriver-sqlite \
125 ${QT_BASE_NAME}-plugin-imageformat-jpeg"
126
127FILES_${QT_BASE_NAME}-tools = "${bindir}/uic* ${bindir}/moc ${bindir}/rcc ${bindir}/qttracereplay ${bindir}/qdoc*"
128FILES_${QT_BASE_NAME}-tools-dbg = "${bindir}/.debug/uic* ${bindir}/.debug/moc ${bindir}/.debug/rcc ${bindir}/.debug/qttracereplay ${bindir}/.debug/qdoc*"
129FILES_${QT_BASE_NAME}-assistant = "${bindir}/*assistant* ${bindir}/qcollectiongenerator ${bindir}/qhelpconverter ${bindir}/qhelpgenerator"
130FILES_${QT_BASE_NAME}-assistant-dbg = "${bindir}/.debug/*assistant* ${bindir}/.debug/qcollectiongenerator ${bindir}/.debug/qhelpconverter ${bindir}/.debug/qhelpgenerator"
131FILES_${QT_BASE_NAME}-common = "${bindir}/qtconfig"
132FILES_${QT_BASE_NAME}-common-dbg = "${bindir}/.debug/qtconfig"
133FILES_${QT_BASE_NAME}-dbus = "${bindir}/qdbus ${bindir}/qdbusxml2cpp ${bindir}/qdbuscpp2xml ${bindir}/qdbusviewer"
134FILES_${QT_BASE_NAME}-dbus-dbg = "${bindir}/.debug/qdbus ${bindir}/.debug/qdbusxml2cpp ${bindir}/.debug/qdbuscpp2xml ${bindir}/.debug/qdbusviewer"
135FILES_${QT_BASE_NAME}-demos = "${bindir}/qtdemo* ${bindir}/${QT_DIR_NAME}/demos/*"
136FILES_${QT_BASE_NAME}-demos-dbg = "${bindir}/.debug/qtdemo* ${bindir}/${QT_DIR_NAME}/demos/.debug/* ${bindir}/${QT_DIR_NAME}/demos/*/.debug ${bindir}/${QT_DIR_NAME}/demos/*/*/.debug ${bindir}/${QT_DIR_NAME}/demos/*/*/*/.debug"
137FILES_${QT_BASE_NAME}-designer = "${bindir}/*designer*"
138FILES_${QT_BASE_NAME}-designer-dbg = "${bindir}/.debug/*designer*"
139FILES_${QT_BASE_NAME}-examples = "${bindir}/${QT_DIR_NAME}/examples/*"
140FILES_${QT_BASE_NAME}-examples-dbg = "${bindir}/${QT_DIR_NAME}/examples/.debug ${bindir}/${QT_DIR_NAME}/examples/*/.debug ${bindir}/${QT_DIR_NAME}/examples/*/*/.debug ${bindir}/${QT_DIR_NAME}/examples/*/*/*/.debug ${bindir}/${QT_DIR_NAME}/examples/*/*/*/*/.debug ${bindir}/${QT_DIR_NAME}/examples/declarative/*/*/*/*/*/.debug/* ${bindir}/${QT_DIR_NAME}/examples/declarative/*/*/*/*/.debug/*"
141FILES_${QT_BASE_NAME}-fonts-ttf-vera = "${libdir}/fonts/Vera*.ttf"
142FILES_${QT_BASE_NAME}-fonts-ttf-dejavu = "${libdir}/fonts/DejaVu*.ttf"
143FILES_${QT_BASE_NAME}-fonts-pfa = "${libdir}/fonts/*.pfa"
144FILES_${QT_BASE_NAME}-fonts-pfb = "${libdir}/fonts/*.pfb"
145FILES_${QT_BASE_NAME}-fonts-qpf = "${libdir}/fonts/*.qpf"
146FILES_${QT_BASE_NAME}-linguist = "${bindir}/*linguist* ${bindir}/lrelease ${bindir}/lupdate ${bindir}/lconvert ${bindir}/qm2ts"
147FILES_${QT_BASE_NAME}-linguist-dbg = "${bindir}/.debug/*linguist* ${bindir}/.debug/lrelease ${bindir}/.debug/lupdate ${bindir}/.debug/lconvert ${bindir}/.debug/qm2ts"
148FILES_${QT_BASE_NAME}-pixeltool = "${bindir}/pixeltool"
149FILES_${QT_BASE_NAME}-pixeltool-dbg = "${bindir}/.debug/pixeltool"
150FILES_${QT_BASE_NAME}-qt3to4 = "${bindir}/qt3to4 ${datadir}/${QT_DIR_NAME}/q3porting.xml"
151FILES_${QT_BASE_NAME}-qt3to4-dbg = "${bindir}/.debug/qt3to4"
152FILES_${QT_BASE_NAME}-qmlviewer = "${bindir}/qmlviewer"
153FILES_${QT_BASE_NAME}-qmlviewer-dbg = "${bindir}/.debug/qmlviewer"
154FILES_${QT_BASE_NAME}-makeqpf = "${bindir}/makeqpf"
155FILES_${QT_BASE_NAME}-makeqpf-dbg = "${bindir}/.debug/makeqpf"
156FILES_${QT_BASE_NAME}-mkspecs = "${datadir}/${QT_DIR_NAME}/mkspecs/*"
157FILES_${QT_BASE_NAME}-xmlpatterns = "${bindir}/xmlpatterns*"
158FILES_${QT_BASE_NAME}-xmlpatterns-dbg = "${bindir}/.debug/xmlpatterns*"
159
160
161do_configure() {
162 unset QMAKESPEC
163 unset QTDIR
164
165 if [ ! -e bin/qmake ]; then
166 ln -sf ${STAGING_BINDIR_NATIVE}/qmake2 bin/qmake
167 fi
168
169 if [ ! -e mkspecs/${TARGET_OS}-oe-g++ ]; then
170 ln -sf linux-g++ mkspecs/${TARGET_OS}-oe-g++
171 fi
172
173 cp -f ${WORKDIR}/g++.conf ${WORKDIR}/linux.conf mkspecs/common/
174
175 echo "[Paths]" > $QT_CONF_PATH
176 echo "Prefix=${prefix}/" >> $QT_CONF_PATH
177 echo "Documentation=${docdir}/${QT_DIR_NAME}" >> $QT_CONF_PATH
178 echo "Headers=${includedir}/${QT_DIR_NAME}" >> $QT_CONF_PATH
179 echo "Libraries=${libdir}" >> $QT_CONF_PATH
180 echo "Binaries=${bindir}" >> $QT_CONF_PATH
181 echo "Plugins=${libdir}/${QT_DIR_NAME}/plugins" >> $QT_CONF_PATH
182 echo "Data=${datadir}/${QT_DIR_NAME}" >> $QT_CONF_PATH
183 echo "Translations=${datadir}/${QT_DIR_NAME}/translations" >> $QT_CONF_PATH
184 echo "Settings=${sysconfdir}/${QT_DIR_NAME}" >> $QT_CONF_PATH
185 echo "Examples=${bindir}/${QT_DIR_NAME}/examples" >> $QT_CONF_PATH
186 echo "Demos=${bindir}/${QT_DIR_NAME}/demos" >> $QT_CONF_PATH
187
188 ${EXTRA_QMAKE_MUNGE}|| true
189
190 (echo o; echo yes) | ./configure -v \
191 -prefix ${prefix}/ \
192 -bindir ${bindir} \
193 -libdir ${libdir} \
194 -datadir ${datadir}/${QT_DIR_NAME} \
195 -sysconfdir ${sysconfdir}/${QT_DIR_NAME} \
196 -docdir ${docdir}/${QT_DIR_NAME} \
197 -headerdir ${includedir}/${QT_DIR_NAME} \
198 -plugindir ${libdir}/${QT_DIR_NAME}/plugins \
199 -translationdir ${datadir}/${QT_DIR_NAME}/translations \
200 -examplesdir ${bindir}/${QT_DIR_NAME}/examples \
201 -demosdir ${bindir}/${QT_DIR_NAME}/demos \
202 -platform ${TARGET_OS}-oe-g++ \
203 -xplatform ${TARGET_OS}-oe-g++ \
204 ${QT_ENDIAN} \
205 -crossarch ${QT_ARCH} \
206 ${QT_CONFIG_FLAGS} -no-fast \
207 -L${STAGING_LIBDIR} -I${STAGING_INCDIR} \
208 -I${STAGING_INCDIR}/freetype2 \
209 -I${STAGING_INCDIR}/mysql \
210 -I${STAGING_INCDIR}/postgresql
211}
212
213python populate_packages_prepend() {
214 translation_dir = bb.data.expand('${datadir}/${QT_DIR_NAME}/translations/', d)
215 translation_name = bb.data.expand('${QT_BASE_NAME}-translation-%s', d)
216 do_split_packages(d, translation_dir, '^(assistant|designer|linguist|qt|qtconfig|qvfb)_(.*)\.qm$', translation_name, '${PN} translation for %s', extra_depends='' )
217
218 phrasebook_dir = bb.data.expand('${datadir}/${QT_DIR_NAME}/phrasebooks/', d)
219 phrasebook_name = bb.data.expand('${QT_BASE_NAME}-phrasebook-%s', d)
220 do_split_packages(d, phrasebook_dir, '^(.*)\.qph$', phrasebook_name, '${PN} phrasebook for %s', extra_depends='' )
221
222 # Package all the plugins and their -dbg version and create a meta package
223 import os
224 def qtopia_split(path, name, glob):
225 """
226 Split the package into a normal and -dbg package and then add the
227 new packages to the meta package.
228 """
229 plugin_dir = bb.data.expand('${libdir}/${QT_DIR_NAME}/plugins/%s/' % path, d)
230 if not os.path.exists("%s%s" % (bb.data.expand('${D}',d), plugin_dir)):
231 bb.note("The path does not exist:", bb.data.expand('${D}', d), plugin_dir)
232 return
233
234 plugin_name = bb.data.expand('${QT_BASE_NAME}-plugin-%s-%%s' % name, d)
235 dev_packages = []
236 dev_hook = lambda file,pkg,b,c,d:dev_packages.append((file,pkg))
237 do_split_packages(d, plugin_dir, glob, plugin_name, '${PN} %s for %%s' % name, extra_depends='', hook=dev_hook)
238 # Create a -dbg package as well
239 plugin_dir_dbg = bb.data.expand('${libdir}/${QT_DIR_NAME}/plugins/%s/.debug' % path, d)
240 packages = bb.data.getVar('PACKAGES',d)
241 for (file,package) in dev_packages:
242 packages = "%s %s-dbg" % (packages, package)
243 file_name = os.path.join(plugin_dir_dbg, os.path.basename(file))
244 bb.data.setVar("FILES_%s-dbg" % package, file_name, d)
245 bb.data.setVar("DESCRIPTION_%s-dbg" % package, "${PN} %s for %s" % (name, package), d)
246
247 bb.data.setVar('PACKAGES', packages, d)
248
249 qtopia_split('accessible', 'accessible', '^libq(.*)\.so$')
250 qtopia_split('codecs', 'codec', '^libq(.*)\.so$')
251 qtopia_split('decorations', 'decoration', '^libqdecoration(.*)\.so$')
252 qtopia_split('designer', 'designer', '^lib(.*)\.so$')
253 qtopia_split('gfxdrivers', 'gfxdriver', '^libq(.*)\.so$')
254 qtopia_split('graphicssystems','graphicssystems', '^libq(.*)\.so$')
255 qtopia_split('mousedrivers', 'mousedriver', '^libq(.*)mousedriver\.so$')
256 qtopia_split('iconengines', 'iconengine', '^libq(.*)\.so$')
257 qtopia_split('imageformats', 'imageformat', '^libq(.*)\.so$')
258 qtopia_split('inputmethods', 'inputmethod', '^libq(.*)\.so$')
259 qtopia_split('sqldrivers', 'sqldriver', '^libq(.*)\.so$')
260 qtopia_split('script', 'script', '^libqtscript(.*)\.so$')
261 qtopia_split('styles', 'style', '^libq(.*)\.so$')
262 qtopia_split('phonon_backend','phonon-backend','^libphonon_(.*)\.so$')
263 qtopia_split('bearer', 'bearer', '^libq(.*)bearer\.so$')
264}
265
266do_install() {
267 oe_runmake install INSTALL_ROOT=${D}
268
269 # These are host binaries, we should only use them in staging
270 rm -rf ${D}/${bindir}/qmake
271
272 # fix pkgconfig, libtool and prl files
273 sed -i -e s#-L${S}/lib##g \
274 -e s#-L${STAGING_LIBDIR}##g \
275 -e 's#STAGING_LIBDIR}#libdir}'#g \
276 -e s#-L${libdir}##g \
277 -e s#'$(OE_QMAKE_LIBS_X11)'#"${OE_QMAKE_LIBS_X11}"#g \
278 -e s#" -Wl,-rpath-link,${S}/lib"##g \
279 -e s#" -Wl,-rpath-link,${libdir}"##g \
280 -e 's#I/usr/include#Iincludedir}#g' \
281 -e 's#Iin#I${in#g' \
282 ${D}${libdir}/*.la ${D}${libdir}/*.prl ${D}${libdir}/pkgconfig/*.pc
283
284 sed -i -e s#" -Wl,-rpath-link,${S}/lib"##g \
285 ${D}${datadir}/${QT_DIR_NAME}/mkspecs/common/linux.conf
286
287 # fix pkgconfig files
288 sed -i -e s#"moc_location=.*$"#"moc_location=${bindir}/moc4"# \
289 -e s#"uic_location=.*$"#"uic_location=${bindir}/uic4"# \
290 ${D}${libdir}/pkgconfig/*.pc
291 for name in ${QT_LIB_NAMES}; do
292 sed -i -e /Requires/s#"${name}"#"${name}${QT_LIBINFIX}"#g ${D}${libdir}/pkgconfig/*.pc
293 done
294
295 # QT abuses $includedir to point to its headers, which breaks pkgconfig sysroot, so manually fix it up here:
296 for pc in ${D}${libdir}/pkgconfig/*.pc ; do
297 sed -i -e "s:prefix}include/${QT_BASE_NAME}/$(basename $pc .pc):prefix}/include:" \
298 -e "s,Cflags: ,Cflags: -IP{includedir}/${QT_BASE_NAME}/$(basename $pc .pc) ," \
299 -e 's:IP{:I${:g' $pc
300 done
301
302 install -d ${D}/${libdir}/fonts
303 touch ${D}/${libdir}/fonts/fontdir
304
305 install -d ${D}${bindir}
306 for i in rcc uic moc ; do
307 install -m 0755 ${S}/bin/$i ${D}${bindir}/
308 done
309
310 #Append an E to the qtdemo file
311 if [ -n "${QT_LIBINFIX}" ] ; then
312 mv ${D}${bindir}/qtdemo ${D}${bindir}/qtdemo${QT_LIBINFIX}
313 fi
314}