Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1 | inherit qmake_base |
| 2 | |
| 3 | DEPENDS += "qt4-tools-native freetype jpeg libpng zlib dbus openssl glib-2.0 sqlite3 tiff icu" |
| 4 | DEPENDS += "${@bb.utils.contains('DISTRO_FEATURES', 'pulseaudio', 'pulseaudio', '', d)}" |
| 5 | |
| 6 | require qt4_arch.inc |
| 7 | |
| 8 | QT_DISTRO_FLAGS ?= "-no-accessibility -no-sm" |
| 9 | QT_DISTRO_FLAGS_linuxstdbase = "-sm" |
| 10 | |
| 11 | QT_SQL_DRIVER_FLAGS ?= "-no-sql-ibase -no-sql-mysql -no-sql-psql -no-sql-odbc -no-sql-sqlite2 -plugin-sql-sqlite -system-sqlite" |
| 12 | |
| 13 | QT_GLFLAGS ?= "" |
| 14 | |
| 15 | |
| 16 | QT_QT3SUPPORT ?= "-qt3support" |
| 17 | QT_XML ?= "-xmlpatterns" |
| 18 | QT_WEBKIT ?= "-webkit" |
| 19 | QT_PHONON ?= "-no-phonon" |
| 20 | QT_DBUS ?= "-qdbus" |
| 21 | QT_MULTIMEDIA ?= "${@bb.utils.contains('DISTRO_FEATURES', 'pulseaudio', '-pulseaudio', '-no-pulseaudio', d)}" |
| 22 | |
| 23 | QT_CONFIG_FLAGS += "-release -no-cups -reduce-relocations \ |
| 24 | -shared -no-nas-sound -no-nis \ |
| 25 | -system-libjpeg -system-libpng -system-libtiff -system-zlib \ |
| 26 | -no-pch -stl -glib -icu \ |
| 27 | -no-rpath -silent \ |
| 28 | -D USE_QTMULTIMEDIA=1 \ |
| 29 | ${QT_DBUS} \ |
| 30 | ${QT_QT3SUPPORT} \ |
| 31 | ${QT_WEBKIT} \ |
| 32 | ${QT_PHONON} \ |
| 33 | ${QT_XML} \ |
| 34 | ${QT_MULTIMEDIA} \ |
| 35 | ${QT_SQL_DRIVER_FLAGS} \ |
| 36 | ${QT_DISTRO_FLAGS} \ |
| 37 | ${QT_GLFLAGS}" |
| 38 | |
| 39 | EXTRA_OEMAKE = "-e" |
| 40 | |
| 41 | EXTRA_ENV = 'QMAKE="${STAGING_BINDIR_NATIVE}/qmake2 -after \ |
| 42 | INCPATH+=${STAGING_INCDIR}/freetype2 LIBS+=-L${STAGING_LIBDIR}" \ |
| 43 | QMAKESPEC="${QMAKESPEC}" LINK="${CXX} -Wl,-rpath-link,${STAGING_LIBDIR}" \ |
| 44 | AR="${TARGET_PREFIX}ar cqs" \ |
| 45 | MOC="${STAGING_BINDIR_NATIVE}/moc4" UIC="${STAGING_BINDIR_NATIVE}/uic4" MAKE="make -e"' |
| 46 | |
| 47 | export QT_CONF_PATH="${WORKDIR}/qt.conf" |
| 48 | |
| 49 | # Library packages |
| 50 | QT_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" |
| 51 | |
| 52 | QT_EXTRA_LIBS = "pvrQWSWSEGL" |
| 53 | |
| 54 | python __anonymous () { |
| 55 | lib_packages = [] |
| 56 | dev_packages = [] |
| 57 | dbg_packages = [] |
| 58 | staticdev_packages = [] |
| 59 | for name in d.getVar("QT_LIB_NAMES", True).split(): |
| 60 | pkg = d.getVar("QT_BASE_LIB", True) + name.lower().replace("qt", "").replace("_", "-") + "4" |
| 61 | # NOTE: the headers for QtAssistantClient are different |
| 62 | incname = name.replace("QtAssistantClient", "QtAssistant") |
| 63 | d.setVar("FILES_%s" % pkg, "${libdir}/lib%(name)s${QT_LIBINFIX}.so.*" % locals()) |
| 64 | d.setVar("FILES_%s-dev" % pkg, """${libdir}/lib%(name)s${QT_LIBINFIX}.prl |
| 65 | ${libdir}/lib%(name)s${QT_LIBINFIX}.la |
| 66 | ${libdir}/lib%(name)s${QT_LIBINFIX}.so |
| 67 | ${includedir}/${QT_DIR_NAME}/%(incname)s |
| 68 | ${libdir}/pkgconfig/%(name)s${QT_LIBINFIX}.pc""" % locals()) |
| 69 | d.setVar("FILES_%s-staticdev" % pkg, "${libdir}/lib%(name)s${QT_LIBINFIX}.a" % locals()) |
| 70 | d.setVar("FILES_%s-dbg" % pkg, "${libdir}/.debug/lib%(name)s${QT_LIBINFIX}.so*" % locals()) |
| 71 | d.setVar("RRECOMMENDS_%s-dbg" % pkg, "${PN}-dbg") |
| 72 | lib_packages.append(pkg) |
| 73 | dev_packages.append("%s-dev" % pkg) |
| 74 | dbg_packages.append("%s-dbg" % pkg) |
| 75 | staticdev_packages.append("%s-staticdev" % pkg) |
| 76 | for name in d.getVar("OTHER_PACKAGES", True).split(): |
| 77 | dbg_packages.append("%s-dbg" % name) |
| 78 | staticdev_packages.append("%s-staticdev" % name) |
| 79 | |
| 80 | for name in d.getVar("QT_EXTRA_LIBS", True).split(): |
| 81 | pkg = d.getVar("QT_BASE_LIB", True) + name.lower().replace("qt", "").replace("_", "-") + "4" |
| 82 | d.setVar("FILES_%s" % pkg, "${libdir}/lib%(name)s.so.*" % locals()) |
| 83 | d.setVar("FILES_%s-staticdev" % pkg, "${libdir}/lib%(name)s.a" % locals()) |
| 84 | d.setVar("FILES_%s-dev" % pkg, """${libdir}/lib%(name)s.prl |
| 85 | ${libdir}/lib%(name)s.la |
| 86 | ${libdir}/lib%(name)s.so |
| 87 | ${includedir}/${QT_DIR_NAME}/%(incname)s |
| 88 | ${libdir}/pkgconfig/%(name)s.pc""" % locals()) |
| 89 | d.setVar("FILES_%s-dbg" % pkg, "${libdir}/.debug/lib%(name)s.so*" % locals()) |
| 90 | d.setVar("RRECOMMENDS_%s-dbg" % pkg, "${PN}-dbg") |
| 91 | lib_packages.append(pkg) |
| 92 | dev_packages.append("%s-dev" % pkg) |
| 93 | dbg_packages.append("%s-dbg" % pkg) |
| 94 | staticdev_packages.append("%s-staticdev" % pkg) |
| 95 | |
| 96 | d.setVar("LIB_PACKAGES", " ".join(lib_packages)) |
| 97 | d.setVar("DEV_PACKAGES", " ".join(dev_packages)) |
| 98 | d.setVar("DBG_PACKAGES", " ".join(dbg_packages)) |
| 99 | d.setVar("STATICDEV_PACKAGES", " ".join(staticdev_packages)) |
| 100 | } |
| 101 | |
| 102 | OTHER_PACKAGES = "\ |
| 103 | ${QT_BASE_NAME}-tools \ |
| 104 | ${QT_BASE_NAME}-assistant \ |
| 105 | ${QT_BASE_NAME}-common \ |
| 106 | ${QT_BASE_NAME}-dbus \ |
| 107 | ${QT_BASE_NAME}-demos \ |
| 108 | ${QT_BASE_NAME}-designer \ |
| 109 | ${QT_BASE_NAME}-examples \ |
| 110 | ${QT_BASE_NAME}-linguist \ |
| 111 | ${QT_BASE_NAME}-makeqpf \ |
| 112 | ${QT_BASE_NAME}-mkspecs \ |
| 113 | ${QT_BASE_NAME}-pixeltool \ |
| 114 | ${QT_BASE_NAME}-qmlviewer \ |
| 115 | ${QT_BASE_NAME}-xmlpatterns \ |
| 116 | ${QT_BASE_NAME}-qt3to4 \ |
| 117 | ${QT_BASE_NAME}-qml-plugins" |
| 118 | |
| 119 | #We prepend so ${QT_BASE_NAME}-demos-doc comes before ${PN}-doc,so the packaging of FILES_ get done before. |
| 120 | PACKAGES =+ "${QT_BASE_NAME}-demos-doc" |
| 121 | PACKAGES += " \ |
| 122 | ${LIB_PACKAGES} \ |
| 123 | ${DEV_PACKAGES} \ |
| 124 | ${DBG_PACKAGES} \ |
| 125 | ${STATICDEV_PACKAGES} \ |
| 126 | ${OTHER_PACKAGES}" |
| 127 | |
| 128 | PACKAGES_DYNAMIC += "^${QT_BASE_NAME}-plugin-.* ^${QT_BASE_NAME}-translation-.* ^${QT_BASE_NAME}-phrasebook-.*" |
| 129 | |
| 130 | ALLOW_EMPTY_${PN} = "1" |
| 131 | FILES_${PN} = "" |
| 132 | FILES_${PN}-dev = "${includedir}/${QT_DIR_NAME}/Qt/*" |
| 133 | FILES_${PN}-dbg = "/usr/src/debug/" |
| 134 | FILES_${QT_BASE_NAME}-demos-doc = "${docdir}/${QT_DIR_NAME}/qch/qt.qch" |
| 135 | RRECOMMENDS_${PN} = "${LIB_PACKAGES} ${OTHER_PACKAGES}" |
| 136 | RRECOMMENDS_${PN}-dev = "${DEV_PACKAGES}" |
| 137 | RRECOMMENDS_${PN}-dbg = "${DBG_PACKAGES}" |
| 138 | RRECOMMENDS_${QT_BASE_LIB}core4_append_libc-glibc = " glibc-gconv-utf-16" |
| 139 | RRECOMMENDS_${QT_BASE_NAME}-demos += " \ |
| 140 | ${QT_BASE_NAME}-examples \ |
| 141 | ${QT_BASE_NAME}-plugin-sqldriver-sqlite \ |
| 142 | ${QT_BASE_NAME}-plugin-imageformat-jpeg \ |
| 143 | ${QT_BASE_NAME}-qml-plugins \ |
| 144 | ${QT_BASE_NAME}-assistant \ |
| 145 | ${QT_BASE_NAME}-demos-doc" |
| 146 | RRECOMMENDS_${QT_BASE_NAME}-examples += " \ |
| 147 | ${QT_BASE_NAME}-plugin-sqldriver-sqlite \ |
| 148 | ${QT_BASE_NAME}-plugin-imageformat-jpeg \ |
| 149 | ${QT_BASE_NAME}-qml-plugins" |
| 150 | RRECOMMENDS_${QT_BASE_NAME}-qmlviewer += " \ |
| 151 | ${QT_BASE_NAME}-qml-plugins" |
| 152 | RRECOMMENDS_${QT_BASE_NAME}-doc += " \ |
| 153 | ${QT_BASE_NAME}-demos-doc" |
| 154 | |
| 155 | RPROVIDES_${QT_BASE_NAME}-tools += "qmake2" |
| 156 | RREPLACES_${QT_BASE_NAME}-tools += "qmake2" |
| 157 | |
| 158 | FILES_${QT_BASE_NAME}-tools = "${bindir}/qttracereplay ${bindir}/qdoc* ${bindir}/qmake ${bindir}/moc ${bindir}/uic* ${bindir}/rcc" |
| 159 | FILES_${QT_BASE_NAME}-tools-dbg = "${bindir}/.debug/qttracereplay ${bindir}/.debug/qdoc* ${bindir}/.debug/qmake ${bindir}/.debug/uic* ${bindir}/.debug/moc ${bindir}/.debug/rcc" |
| 160 | FILES_${QT_BASE_NAME}-assistant = "${bindir}/*assistant* ${bindir}/qcollectiongenerator ${bindir}/qhelpconverter ${bindir}/qhelpgenerator" |
| 161 | FILES_${QT_BASE_NAME}-assistant-dbg = "${bindir}/.debug/*assistant* ${bindir}/.debug/qcollectiongenerator ${bindir}/.debug/qhelpconverter ${bindir}/.debug/qhelpgenerator" |
| 162 | FILES_${QT_BASE_NAME}-common = "${bindir}/qtconfig" |
| 163 | FILES_${QT_BASE_NAME}-common-dbg = "${bindir}/.debug/qtconfig" |
| 164 | FILES_${QT_BASE_NAME}-dbus = "${bindir}/qdbus ${bindir}/qdbusxml2cpp ${bindir}/qdbuscpp2xml ${bindir}/qdbusviewer" |
| 165 | FILES_${QT_BASE_NAME}-dbus-dbg = "${bindir}/.debug/qdbus ${bindir}/.debug/qdbusxml2cpp ${bindir}/.debug/qdbuscpp2xml ${bindir}/.debug/qdbusviewer" |
| 166 | FILES_${QT_BASE_NAME}-demos = "${bindir}/qtdemo* ${bindir}/${QT_DIR_NAME}/demos/*" |
| 167 | FILES_${QT_BASE_NAME}-demos-staticdev = "${bindir}/${QT_DIR_NAME}/demos/shared/libdemo_shared.a" |
| 168 | FILES_${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" |
| 169 | FILES_${QT_BASE_NAME}-designer = "${bindir}/*designer*" |
| 170 | FILES_${QT_BASE_NAME}-designer-dbg = "${bindir}/.debug/*designer*" |
| 171 | FILES_${QT_BASE_NAME}-examples = "${bindir}/${QT_DIR_NAME}/examples/*" |
| 172 | FILES_${QT_BASE_NAME}-examples-staticdev = "${bindir}/${QT_DIR_NAME}/examples/tools/plugandpaint/plugins/libpnp_basictools.a" |
| 173 | FILES_${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/*" |
| 174 | FILES_${QT_BASE_NAME}-linguist = "${bindir}/*linguist* ${bindir}/lrelease ${bindir}/lupdate ${bindir}/lconvert ${bindir}/qm2ts" |
| 175 | FILES_${QT_BASE_NAME}-linguist-dbg = "${bindir}/.debug/*linguist* ${bindir}/.debug/lrelease ${bindir}/.debug/lupdate ${bindir}/.debug/lconvert ${bindir}/.debug/qm2ts" |
| 176 | FILES_${QT_BASE_NAME}-pixeltool = "${bindir}/pixeltool" |
| 177 | FILES_${QT_BASE_NAME}-pixeltool-dbg = "${bindir}/.debug/pixeltool" |
| 178 | FILES_${QT_BASE_NAME}-qt3to4 = "${bindir}/qt3to4 ${datadir}/${QT_DIR_NAME}/q3porting.xml" |
| 179 | FILES_${QT_BASE_NAME}-qt3to4-dbg = "${bindir}/.debug/qt3to4" |
| 180 | FILES_${QT_BASE_NAME}-qmlviewer = "${bindir}/qmlviewer" |
| 181 | FILES_${QT_BASE_NAME}-qmlviewer-dbg = "${bindir}/.debug/qmlviewer" |
| 182 | FILES_${QT_BASE_NAME}-makeqpf = "${bindir}/makeqpf" |
| 183 | FILES_${QT_BASE_NAME}-makeqpf-dbg = "${bindir}/.debug/makeqpf" |
| 184 | FILES_${QT_BASE_NAME}-mkspecs = "${datadir}/${QT_DIR_NAME}/mkspecs/* ${datadir}/${QT_DIR_NAME}/environment-setup" |
| 185 | FILES_${QT_BASE_NAME}-xmlpatterns = "${bindir}/xmlpatterns*" |
| 186 | FILES_${QT_BASE_NAME}-xmlpatterns-dbg = "${bindir}/.debug/xmlpatterns*" |
| 187 | FILES_${QT_BASE_NAME}-qml-plugins = "${libdir}/${QT_DIR_NAME}/imports/* ${libdir}/${QT_DIR_NAME}/plugins/qmltooling/*" |
| 188 | FILES_${QT_BASE_NAME}-qml-plugins-dbg = "${libdir}/${QT_DIR_NAME}/imports/*/*/*/.debug/* ${libdir}/${QT_DIR_NAME}/imports/*/.debug ${libdir}/${QT_DIR_NAME}/plugins/qmltooling/.debug" |
| 189 | INSANE_SKIP_${MLPREFIX}${QT_BASE_NAME}-examples += "libdir" |
| 190 | INSANE_SKIP_${MLPREFIX}${QT_BASE_NAME}-examples-dbg += "libdir" |
| 191 | |
| 192 | # License options, to be set by the recipe if different values are needed |
| 193 | QT_LICENSE_FILE ?= "" |
| 194 | QT_LICENSE_FLAGS ?= "-opensource" |
| 195 | |
| 196 | do_configure() { |
| 197 | unset QMAKESPEC |
| 198 | unset QTDIR |
| 199 | |
| 200 | set_arch |
| 201 | set_endian |
| 202 | |
| 203 | if [ ! -e bin/qmake ]; then |
| 204 | ln -sf ${STAGING_BINDIR_NATIVE}/qmake2 bin/qmake |
| 205 | fi |
| 206 | |
| 207 | if [ ! -e mkspecs/${TARGET_OS}-oe-g++ ]; then |
| 208 | ln -sf linux-g++ mkspecs/${TARGET_OS}-oe-g++ |
| 209 | fi |
| 210 | |
| 211 | if [ -f mkspecs/common/g++-unix.conf ] ; then |
| 212 | # mkspecs were refactored for 4.8.0 |
| 213 | cp -f ${WORKDIR}/g++.conf mkspecs/common/g++-unix.conf |
| 214 | else |
| 215 | cp -f ${WORKDIR}/g++.conf mkspecs/common/g++.conf |
| 216 | fi |
| 217 | cp -f ${WORKDIR}/linux.conf mkspecs/common/ |
| 218 | |
| 219 | echo "[Paths]" > $QT_CONF_PATH |
| 220 | echo "Prefix=${prefix}" >> $QT_CONF_PATH |
| 221 | echo "Documentation=${docdir}/${QT_DIR_NAME}" >> $QT_CONF_PATH |
| 222 | echo "Headers=${includedir}/${QT_DIR_NAME}" >> $QT_CONF_PATH |
| 223 | echo "Libraries=${libdir}" >> $QT_CONF_PATH |
| 224 | echo "Binaries=${bindir}" >> $QT_CONF_PATH |
| 225 | echo "Plugins=${libdir}/${QT_DIR_NAME}/plugins" >> $QT_CONF_PATH |
| 226 | echo "Imports=${libdir}/${QT_DIR_NAME}/imports" >> $QT_CONF_PATH |
| 227 | echo "Data=${datadir}/${QT_DIR_NAME}" >> $QT_CONF_PATH |
| 228 | echo "Translations=${datadir}/${QT_DIR_NAME}/translations" >> $QT_CONF_PATH |
| 229 | echo "Settings=${sysconfdir}/${QT_DIR_NAME}" >> $QT_CONF_PATH |
| 230 | echo "Examples=${bindir}/${QT_DIR_NAME}/examples" >> $QT_CONF_PATH |
| 231 | echo "Demos=${bindir}/${QT_DIR_NAME}/demos" >> $QT_CONF_PATH |
| 232 | |
| 233 | ${EXTRA_QMAKE_MUNGE}|| true |
| 234 | |
| 235 | echo yes | QT_LICENSE_FILE="${QT_LICENSE_FILE}" ./configure -v \ |
| 236 | -prefix ${prefix} \ |
| 237 | -bindir ${bindir} \ |
| 238 | -libdir ${libdir} \ |
| 239 | -datadir ${datadir}/${QT_DIR_NAME} \ |
| 240 | -sysconfdir ${sysconfdir}/${QT_DIR_NAME} \ |
| 241 | -docdir ${docdir}/${QT_DIR_NAME} \ |
| 242 | -headerdir ${includedir}/${QT_DIR_NAME} \ |
| 243 | -plugindir ${libdir}/${QT_DIR_NAME}/plugins \ |
| 244 | -importdir ${libdir}/${QT_DIR_NAME}/imports \ |
| 245 | -translationdir ${datadir}/${QT_DIR_NAME}/translations \ |
| 246 | -examplesdir ${bindir}/${QT_DIR_NAME}/examples \ |
| 247 | -demosdir ${bindir}/${QT_DIR_NAME}/demos \ |
| 248 | -platform ${TARGET_OS}-oe-g++ \ |
| 249 | -xplatform ${TARGET_OS}-oe-g++ \ |
| 250 | ${QT_ENDIAN} \ |
| 251 | -crossarch ${QT_ARCH} \ |
| 252 | ${QT_LICENSE_FLAGS} \ |
| 253 | ${QT_CONFIG_FLAGS} -no-fast \ |
| 254 | -L${STAGING_LIBDIR} -I${STAGING_INCDIR} \ |
| 255 | -I${STAGING_INCDIR}/freetype2 |
| 256 | } |
| 257 | |
| 258 | do_compile() { |
| 259 | # Fixup missing wsegl header in some SGX SDKs |
| 260 | if ! [ -e ${STAGING_INCDIR}/wsegl.h ] ; then |
| 261 | cp src/3rdparty/powervr/wsegl.h src/plugins/gfxdrivers/powervr/QWSWSEGL/ |
| 262 | fi |
| 263 | |
| 264 | unset CFLAGS CXXFLAGS |
| 265 | |
| 266 | oe_runmake ${EXTRA_ENV} |
| 267 | |
| 268 | # Build target qmake |
| 269 | export QMAKESPEC="${S}/mkspecs/${TARGET_OS}-oe-g++" |
| 270 | cd ${S}/qmake |
| 271 | ${OE_QMAKE_QMAKE} |
| 272 | oe_runmake CC="${CC}" CXX="${CXX}" |
| 273 | cd ${S} |
| 274 | } |
| 275 | |
| 276 | python populate_packages_prepend() { |
| 277 | translation_dir = d.expand('${datadir}/${QT_DIR_NAME}/translations/') |
| 278 | translation_name = d.expand('${QT_BASE_NAME}-translation-%s') |
| 279 | do_split_packages(d, translation_dir, '^(assistant|designer|linguist|qt|qtconfig|qvfb|qtscript)_(.*)\.qm$', translation_name, '${PN} translation for %s', extra_depends='' ) |
| 280 | |
| 281 | phrasebook_dir = d.expand('${datadir}/${QT_DIR_NAME}/phrasebooks/') |
| 282 | phrasebook_name = d.expand('${QT_BASE_NAME}-phrasebook-%s') |
| 283 | |
| 284 | if os.path.exists("%s%s" % (d.expand('${D}'), phrasebook_dir)): |
| 285 | do_split_packages(d, phrasebook_dir, '^(.*)\.qph$', phrasebook_name, '${PN} phrasebook for %s', extra_depends='' ) |
| 286 | else: |
| 287 | bb.note("The path does not exist:", d.expand('${D}'), phrasebook_dir) |
| 288 | |
| 289 | # Package all the plugins and their -dbg version and create a meta package |
| 290 | def qtopia_split(path, name, glob): |
| 291 | """ |
| 292 | Split the package into a normal and -dbg package and then add the |
| 293 | new packages to the meta package. |
| 294 | """ |
| 295 | plugin_dir = d.expand('${libdir}/${QT_DIR_NAME}/plugins/%s/' % path) |
| 296 | if not os.path.exists("%s%s" % (d.expand('${D}'), plugin_dir)): |
| 297 | bb.note("The path does not exist:", d.expand('${D}'), plugin_dir) |
| 298 | return |
| 299 | |
| 300 | plugin_name = d.expand('${QT_BASE_NAME}-plugin-%s-%%s' % name) |
| 301 | dev_packages = [] |
| 302 | dev_hook = lambda file,pkg,b,c,d:dev_packages.append((file,pkg)) |
| 303 | do_split_packages(d, plugin_dir, glob, plugin_name, '${PN} %s for %%s' % name, extra_depends='', hook=dev_hook) |
| 304 | # Create a -dbg package as well |
| 305 | plugin_dir_dbg = d.expand('${libdir}/${QT_DIR_NAME}/plugins/%s/.debug' % path) |
| 306 | packages = d.getVar('PACKAGES', False) |
| 307 | for (file,package) in dev_packages: |
| 308 | packages = "%s %s-dbg" % (packages, package) |
| 309 | file_name = os.path.join(plugin_dir_dbg, os.path.basename(file)) |
| 310 | d.setVar("FILES_%s-dbg" % package, file_name) |
| 311 | d.setVar("DESCRIPTION_%s-dbg" % package, "${PN} %s for %s" % (name, package)) |
| 312 | |
| 313 | d.setVar('PACKAGES', packages) |
| 314 | |
| 315 | qtopia_split('accessible', 'accessible', '^libq(.*)\.so$') |
| 316 | qtopia_split('codecs', 'codec', '^libq(.*)\.so$') |
| 317 | qtopia_split('decorations', 'decoration', '^libqdecoration(.*)\.so$') |
| 318 | qtopia_split('designer', 'designer', '^lib(.*)\.so$') |
| 319 | qtopia_split('gfxdrivers', 'gfxdriver', '^libq(.*)\.so$') |
| 320 | qtopia_split('graphicssystems','graphicssystems', '^libq(.*)\.so$') |
| 321 | qtopia_split('kbddrivers', 'kbddriver', '^libq(.*)kbddriver\.so$') |
| 322 | qtopia_split('mousedrivers', 'mousedriver', '^libq(.*)mousedriver\.so$') |
| 323 | qtopia_split('iconengines', 'iconengine', '^libq(.*)\.so$') |
| 324 | qtopia_split('imageformats', 'imageformat', '^libq(.*)\.so$') |
| 325 | qtopia_split('inputmethods', 'inputmethod', '^libq(.*)\.so$') |
| 326 | qtopia_split('sqldrivers', 'sqldriver', '^libq(.*)\.so$') |
| 327 | qtopia_split('script', 'script', '^libqtscript(.*)\.so$') |
| 328 | qtopia_split('styles', 'style', '^libq(.*)\.so$') |
| 329 | qtopia_split('phonon_backend','phonon-backend','^libphonon_(.*)\.so$') |
| 330 | qtopia_split('bearer', 'bearer', '^libq(.*)bearer\.so$') |
| 331 | } |
| 332 | |
| 333 | do_install() { |
| 334 | oe_runmake install INSTALL_ROOT=${D} |
| 335 | |
| 336 | # Install a proper target version of qmake |
| 337 | rm ${D}/${bindir}/qmake |
| 338 | install -m 0755 bin/qmake2 ${D}${bindir}/qmake |
| 339 | |
| 340 | # fix pkgconfig, libtool and prl files |
| 341 | sed -i -e 's#-L${S}/lib/\?##g' \ |
| 342 | -e 's#-L${STAGING_LIBDIR}/\?##g' \ |
| 343 | -e 's#STAGING_LIBDIR}#libdir}'#g \ |
| 344 | -e 's#-L${libdir}/\?##g' \ |
| 345 | -e s#'$(OE_QMAKE_LIBS_X11)'#"${OE_QMAKE_LIBS_X11}"#g \ |
| 346 | -e 's#" -Wl,-rpath-link,${S}/lib/\?"##g' \ |
| 347 | -e 's#" -Wl,-rpath-link,${libdir}/\?"##g' \ |
| 348 | -e 's#Iin#I${in#g' \ |
| 349 | -e 's#-L\.\./\.\./WebCore/release\s\+-L\.\./\.\./JavaScriptCore/release\s\+-lwebcore##g' \ |
| 350 | -e 's#-ljscore##g' \ |
| 351 | ${D}${libdir}/*.la ${D}${libdir}/*.prl ${D}${libdir}/pkgconfig/*.pc |
| 352 | |
| 353 | # fix pkgconfig files |
| 354 | sed -i -e s#"moc_location=.*$"#"moc_location=${bindir}/moc4"# \ |
| 355 | -e s#"uic_location=.*$"#"uic_location=${bindir}/uic4"# \ |
| 356 | ${D}${libdir}/pkgconfig/*.pc |
| 357 | for name in ${QT_LIB_NAMES}; do |
| 358 | sed -i -e /Requires/s#"${name}"#"${name}${QT_LIBINFIX}"#g ${D}${libdir}/pkgconfig/*.pc |
| 359 | done |
| 360 | |
| 361 | # QT abuses $includedir to point to its headers, which breaks pkgconfig sysroot, so manually fix it up here: |
| 362 | for pc in ${D}${libdir}/pkgconfig/*.pc ; do |
| 363 | sed -i -e "s:prefix}/include/${QT_DIR_NAME}/$(basename $pc .pc):prefix}/include:" \ |
| 364 | -e 's:IP{:I${:g' $pc |
| 365 | done |
| 366 | |
| 367 | #Append an E to the qtdemo file |
| 368 | if [ -n "${QT_LIBINFIX}" ] ; then |
| 369 | [ -f ${D}${bindir}/qtdemo ] && mv ${D}${bindir}/qtdemo ${D}${bindir}/qtdemo${QT_LIBINFIX} |
| 370 | fi |
| 371 | |
| 372 | script="${D}/${datadir}/${QT_DIR_NAME}/environment-setup" |
| 373 | touch $script |
| 374 | echo 'export QT_DIR_NAME=${QT_DIR_NAME}' >> $script |
| 375 | echo 'export QT_LIBINFIX=${QT_LIBINFIX}' >> $script |
| 376 | echo 'export OE_QMAKE_AR=ar' >> $script |
| 377 | echo 'export OE_QMAKE_CC=gcc' >> $script |
| 378 | echo 'export OE_QMAKE_CXX=g++' >> $script |
| 379 | echo 'export OE_QMAKE_LINK=g++' >> $script |
| 380 | echo 'export OE_QMAKE_LIBDIR_QT=${libdir}' >> $script |
| 381 | echo 'export OE_QMAKE_INCDIR_QT=${includedir}/${QT_DIR_NAME}' >> $script |
| 382 | echo 'export OE_QMAKE_MOC=${bindir}/moc' >> $script |
| 383 | echo 'export OE_QMAKE_UIC=${bindir}/uic' >> $script |
| 384 | echo 'export OE_QMAKE_UIC3=${bindir}/uic3' >> $script |
| 385 | echo 'export OE_QMAKE_RCC=${bindir}/rcc' >> $script |
| 386 | echo 'export OE_QMAKE_QDBUSCPP2XML=${bindir}/qdbuscpp2xml' >> $script |
| 387 | echo 'export OE_QMAKE_QDBUSXML2CPP=${bindir}/qdbusxml2cpp' >> $script |
| 388 | echo 'export OE_QMAKE_QT_CONFIG=${datadir}/${QT_DIR_NAME}/mkspecs/qconfig.pri' >> $script |
| 389 | echo 'export QMAKESPEC=${datadir}/${QT_DIR_NAME}/mkspecs/linux-g++' >> $script |
| 390 | chmod 0755 $script |
| 391 | } |