3 # common for qtbase-native, qtbase-nativesdk and qtbase
5 file://0001-Add-linux-oe-g-platform.patch \
6 file://0002-qlibraryinfo-allow-to-set-qt.conf-from-the-outside-u.patch \
7 file://0003-Add-external-hostbindir-option.patch \
8 file://0004-configureapp-Prefix-default-LIBDIRS-and-INCDIRS-with.patch \
9 file://0005-qt_module-Fix-pkgconfig-and-libtool-replacements.patch \
10 file://0006-Revert-eglfs-Print-the-chosen-config-in-debug-mode.patch \
11 file://0007-qeglplatformintegration-Undefine-CursorShape-from-X..patch \
12 file://0008-configure-bump-path-length-from-256-to-512-character.patch \
13 file://0009-eglfs-fix-egl-error-for-platforms-only-supporting-on.patch \
14 file://0010-Revert-Use-the-gcc-feature-in-simd.prf.patch \
15 file://0011-QOpenGLPaintDevice-sub-area-support.patch \
20 file://0012-qmake-don-t-build-it-in-configure-but-allow-to-build.patch \
23 DEPENDS += "qtbase-native"
26 RDEPENDS_${PN}-tools += "perl"
28 # separate some parts of PACKAGECONFIG which are often changed
29 # be aware that you need to add icu to build qtwebkit, default
30 # PACKAGECONFIG is kept rather minimal for people who don't need
31 # stuff like webkit (and it's easier to add options than remove)
33 # gl or gles needs to be enabled in order to build qtdeclarative
34 # http://qt.gitorious.org/qt/qtdeclarative/commit/e988998a08b1420ed10bd02d9d4b3b8ed2289df9
35 PACKAGECONFIG_GL ?= "${@base_contains('DISTRO_FEATURES', 'opengl', 'gl', '', d)}"
36 PACKAGECONFIG_FB ?= "${@base_contains('DISTRO_FEATURES', 'directfb', 'directfb', '', d)}"
37 PACKAGECONFIG_X11 ?= "${@base_contains('DISTRO_FEATURES', 'x11', 'xcb xvideo xsync xshape xrender xrandr xfixes xinput2 xinput xinerama xcursor gtkstyle xkb', '', d)}"
38 PACKAGECONFIG_FONTS ?= ""
39 PACKAGECONFIG_SYSTEM ?= "jpeg libpng zlib"
40 PACKAGECONFIG_MULTIMEDIA ?= "${@base_contains('DISTRO_FEATURES', 'pulseaudio', 'pulseaudio', '', d)}"
41 PACKAGECONFIG_DISTRO ?= ""
42 # Either release or debug, can be overridden in bbappends
43 PACKAGECONFIG_RELEASE ?= "release"
44 # This is in qt5.inc, because qtwebkit-examples are using it to enable ca-certificates dependency
45 # PACKAGECONFIG_OPENSSL ?= "openssl"
46 PACKAGECONFIG_DEFAULT ?= "dbus udev evdev widgets tools libs"
49 ${PACKAGECONFIG_RELEASE} \
50 ${PACKAGECONFIG_DEFAULT} \
51 ${PACKAGECONFIG_OPENSSL} \
54 ${PACKAGECONFIG_X11} \
55 ${PACKAGECONFIG_FONTS} \
56 ${PACKAGECONFIG_SYSTEM} \
57 ${PACKAGECONFIG_MULTIMEDIA} \
58 ${PACKAGECONFIG_DISTRO} \
61 PACKAGECONFIG[release] = "-release,-debug"
62 PACKAGECONFIG[developer] = "-developer-build"
63 PACKAGECONFIG[sm] = "-sm,-no-sm"
64 PACKAGECONFIG[tests] = "-make tests,-nomake tests"
65 PACKAGECONFIG[examples] = "-make examples -compile-examples,-nomake examples"
66 PACKAGECONFIG[tools] = "-make tools,-nomake tools"
67 # only for completeness, configure will add libs even if you try to explicitly remove it
68 PACKAGECONFIG[libs] = "-make libs,-nomake libs"
69 # accessibility is required to compile qtquickcontrols
70 PACKAGECONFIG[accessibility] = "-accessibility,-no-accessibility"
71 PACKAGECONFIG[glib] = "-glib,-no-glib,glib-2.0"
72 # use either system freetype or bundled freetype, if you disable freetype completely
73 # fontdatabases/basic/qbasicfontdatabase.cpp will fail to build and system freetype
74 # works only together with fontconfig
75 PACKAGECONFIG[freetype] = "-system-freetype,-freetype,freetype"
76 PACKAGECONFIG[jpeg] = "-system-libjpeg,-no-libjpeg,jpeg"
77 PACKAGECONFIG[libpng] = "-system-libpng,-no-libpng,libpng"
78 PACKAGECONFIG[zlib] = "-system-zlib,-qt-zlib,zlib"
79 PACKAGECONFIG[pcre] = "-system-pcre,-qt-pcre,pcre"
80 # gl or gles2 is needed in order to build qtdeclarative (qtdeclarative.do_configure fails to find quick module without)
81 PACKAGECONFIG[gl] = "-opengl desktop -no-eglfs,,virtual/libgl"
82 PACKAGECONFIG[gles2] = "-opengl es2 -eglfs,,virtual/libgles2 virtual/egl"
83 PACKAGECONFIG[tslib] = "-tslib,-no-tslib,tslib"
84 PACKAGECONFIG[dbus] = "-dbus,-no-dbus,dbus"
85 PACKAGECONFIG[xcb] = "-xcb -xcb-xlib -system-xcb,-no-xcb,libxcb xcb-util-wm xcb-util-image xcb-util-keysyms xcb-util-renderutil"
86 PACKAGECONFIG[sql-ibase] = "-sql-ibase,-no-sql-ibase"
87 PACKAGECONFIG[sql-mysql] = "-sql-mysql,-no-sql-mysql,mysql"
88 PACKAGECONFIG[sql-psql] = "-sql-psql,-no-sql-psql,postgresql"
89 PACKAGECONFIG[sql-odbc] = "-sql-odbc,-no-sql-odbc"
90 PACKAGECONFIG[sql-oci] = "-sql-oci,-no-sql-oci"
91 PACKAGECONFIG[sql-tds] = "-sql-tds,-no-sql-tds"
92 PACKAGECONFIG[sql-db2] = "-sql-db2,-no-sql-db2"
93 PACKAGECONFIG[sql-sqlite2] = "-sql-sqlite2,-no-sql-sqlite2,sqlite"
94 PACKAGECONFIG[sql-sqlite] = "-sql-sqlite,-no-sql-sqlite,sqlite3"
95 PACKAGECONFIG[xcursor] = "-xcursor,-no-xcursor,libxcursor"
96 PACKAGECONFIG[xinerama] = "-xinerama,-no-xinerama,libxinerama"
97 PACKAGECONFIG[xinput] = "-xinput,-no-xinput"
98 PACKAGECONFIG[xinput2] = "-xinput2,-no-xinput2,libxi"
99 PACKAGECONFIG[xfixes] = "-xfixes,-no-xfixes,libxfixes"
100 PACKAGECONFIG[xrandr] = "-xrandr,-no-xrandr,libxrandr"
101 PACKAGECONFIG[xrender] = "-xrender,-no-xrender,libxrender"
102 PACKAGECONFIG[xshape] = "-xshape,-no-xshape"
103 PACKAGECONFIG[xsync] = "-xsync,-no-xsync"
104 PACKAGECONFIG[xvideo] = "-xvideo,-no-xvideo"
105 PACKAGECONFIG[openvg] = "-openvg,-no-openvg"
106 PACKAGECONFIG[iconv] = "-iconv,-no-iconv,virtual/libiconv"
107 PACKAGECONFIG[xkb] = "-xkb,-no-xkb -no-xkbcommon,libxkbcommon"
108 PACKAGECONFIG[evdev] = "-evdev,-no-evdev"
109 PACKAGECONFIG[mtdev] = "-mtdev,-no-mtdev,mtdev"
111 PACKAGECONFIG[fontconfig] = "-fontconfig,-no-fontconfig,fontconfig"
112 PACKAGECONFIG[gtkstyle] = "-gtkstyle,-no-gtkstyle,gtk+"
113 PACKAGECONFIG[directfb] = "-directfb,-no-directfb,directfb"
114 PACKAGECONFIG[linuxfb] = "-linuxfb,-no-linuxfb"
115 PACKAGECONFIG[mitshm] = "-mitshm,-no-mitshm,mitshm"
116 PACKAGECONFIG[kms] = "-kms,-no-kms,virtual/mesa virtual/egl"
117 # needed for qtdeclarative (qtdeclarative.do_configure fails to find quick module without)
118 PACKAGECONFIG[icu] = "-icu,-no-icu,icu"
119 PACKAGECONFIG[udev] = "-libudev,-no-libudev,udev"
120 # use -openssl-linked here to ensure that RDEPENDS for libcrypto and libssl are detected
121 PACKAGECONFIG[openssl] = "-openssl-linked,-no-openssl,openssl"
122 PACKAGECONFIG[alsa] = "-alsa,-no-alsa,alsa-lib"
123 PACKAGECONFIG[pulseaudio] = "-pulseaudio,-no-pulseaudio,pulseaudio"
124 PACKAGECONFIG[nis] = "-nis,-no-nis"
125 PACKAGECONFIG[widgets] = "-widgets,-no-widgets"
127 QT_CONFIG_FLAGS += " \
136 do_generate_qt_config_file_append() {
137 cat >> ${QT_CONF_PATH} <<EOF
144 # qtbase is exception, we need to use mkspecs from ${S}
145 QMAKE_MKSPEC_PATH = "${B}"
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"
151 # qtbase is exception, configure script is using our get(X)QEvalMakeConf and setBootstrapEvalVariable functions to read it from shell
152 export OE_QMAKE_COMPILER
154 export OE_QMAKE_CFLAGS
156 export OE_QMAKE_CXXFLAGS
158 export OE_QMAKE_LDFLAGS
160 export OE_QMAKE_STRIP
163 # we need symlink in path relative to source, because
164 # EffectivePaths:Prefix is relative to qmake location
165 if [ ! -e ${B}/bin/qmake ]; then
167 ln -sf ${OE_QMAKE_QMAKE_ORIG} ${B}/bin/qmake
171 -opensource -confirm-license \
172 -sysroot ${STAGING_DIR_TARGET} \
174 -prefix ${OE_QMAKE_PATH_PREFIX} \
175 -bindir ${OE_QMAKE_PATH_BINS} \
176 -libdir ${OE_QMAKE_PATH_LIBS} \
177 -datadir ${OE_QMAKE_PATH_DATA} \
178 -sysconfdir ${OE_QMAKE_PATH_SETTINGS} \
179 -docdir ${OE_QMAKE_PATH_DOCS} \
180 -headerdir ${OE_QMAKE_PATH_HEADERS} \
181 -archdatadir ${OE_QMAKE_PATH_ARCHDATA} \
182 -libexecdir ${OE_QMAKE_PATH_LIBEXECS} \
183 -plugindir ${OE_QMAKE_PATH_PLUGINS} \
184 -importdir ${OE_QMAKE_PATH_IMPORTS} \
185 -qmldir ${OE_QMAKE_PATH_QML} \
186 -translationdir ${OE_QMAKE_PATH_TRANSLATIONS} \
187 -testsdir ${OE_QMAKE_PATH_TESTS} \
188 -examplesdir ${OE_QMAKE_PATH_EXAMPLES} \
189 -hostbindir ${OE_QMAKE_PATH_HOST_BINS} \
190 -hostdatadir ${OE_QMAKE_PATH_HOST_DATA} \
191 -external-hostbindir ${OE_QMAKE_PATH_EXTERNAL_HOST_BINS} \
192 -platform ${OE_QMAKESPEC} \
193 -xplatform linux-oe-g++ \
196 qmake5_base_do_configure
199 do_compile_append() {
200 # Build qmake for the target arch
201 # Disable for now, because doesn't work well with separate ${B}
202 # cp -ra ${S}/qmake ${B}
205 # Fix to use headers in ${B}
206 # sed '/INCPATH/s#${S}#${B}#g' -i Makefile
207 # oe_runmake CC="${CC}" CXX="${CXX}"
211 do_install_append() {
212 ### Fix up the binaries to the right location
214 # qemu built on host breaks do_package, remove it here (will be replaces with right qemu when do_compile is fixed
215 # ERROR: objcopy failed with exit code 1 (cmd was 'arm-oe-linux-gnueabi-objcopy' --only-keep-debug '/OE/oe-core/tmp-eglibc/work/armv5te-oe-linux-gnueabi/qtbase/5.0.1-r0.0/package/usr/bin/qmake' '/OE/oe-core/tmp-eglibc/work/armv5te-oe-linux-gnueabi/qtbase/5.0.1-r0.0/package/usr/bin/.debug/qmake')
216 rm -f ${D}/${bindir}/${QT_DIR_NAME}/qmake
217 # install fonts manually if they are missing
218 if [ ! -d ${D}/${OE_QMAKE_PATH_LIBS}/fonts ]; then
219 cp -a ${S}/lib/fonts ${D}/${OE_QMAKE_PATH_LIBS}
222 # Remove example.pro file as it is useless
223 rm -f ${D}${OE_QMAKE_PATH_EXAMPLES}/examples.pro
225 # Remove macx-ios-clang directory because /usr/lib/qt5/mkspecs/macx-ios-clang/rename_main.sh:#!/bin/bash
226 # triggers QA Issue: qtbase-mkspecs requires /bin/bash, but no providers in its RDEPENDS [file-rdeps]
227 rm -rf ${D}/${OE_QMAKE_PATH_QT_ARCHDATA}/mkspecs/macx-ios-clang
232 ${PN}-fonts-ttf-vera \
233 ${PN}-fonts-ttf-dejavu \
239 RRECOMMENDS_${PN}-fonts = " \
240 ${PN}-fonts-ttf-vera \
241 ${PN}-fonts-ttf-dejavu \
247 ALLOW_EMPTY_${PN}-fonts = "1"
249 FILES_${PN}-fonts-ttf-vera = "${OE_QMAKE_PATH_LIBS}/fonts/Vera*.ttf"
250 FILES_${PN}-fonts-ttf-dejavu = "${OE_QMAKE_PATH_LIBS}/fonts/DejaVu*.ttf"
251 FILES_${PN}-fonts-pfa = "${OE_QMAKE_PATH_LIBS}/fonts/*.pfa"
252 FILES_${PN}-fonts-pfb = "${OE_QMAKE_PATH_LIBS}/fonts/*.pfb"
253 FILES_${PN}-fonts-qpf = "${OE_QMAKE_PATH_LIBS}/fonts/*.qpf*"
254 FILES_${PN}-fonts = "${OE_QMAKE_PATH_LIBS}/fonts/README \
255 ${OE_QMAKE_PATH_LIBS}/fonts/fontdir"
257 sysroot_stage_dirs_append() {
258 # $to is 2nd parameter passed to sysroot_stage_dir, e.g. ${SYSROOT_DESTDIR} passed from sysroot_stage_all
259 rm -rf $to${OE_QMAKE_PATH_LIBS}/fonts