blob: 077008bb8bdc91a8f59c213520912137303d9163 [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001SUMMARY = "SDK tools for Qt version 4.x"
2DEPENDS = "nativesdk-zlib nativesdk-dbus qt4-native ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'virtual/nativesdk-libx11', '', d)}"
3SECTION = "libs"
4HOMEPAGE = "http://qt-project.org/"
5LICENSE = "LGPLv2.1 | GPLv3"
6
7FILESEXTRAPATHS =. "${FILE_DIRNAME}/qt4-${PV}:"
8
9inherit nativesdk qmake2
10
11SRC_URI = "http://download.qt-project.org/official_releases/qt/4.8/${PV}/qt-everywhere-opensource-src-${PV}.tar.gz \
12 file://0001-qlibraryinfo-allow-to-set-qt.conf-from-the-outside-u.patch \
13 file://0004-configure-qmake-is-already-built-in-qt4-tools-native.patch \
14 file://0005-configure-set-LFLAGS-to-pick-up-zlib-from-staging.patch \
15 file://0006-configure-Use-OE_QMAKE_-values-to-specify-Qt-utility.patch \
16 file://0007-dbus-Remove-const-usage-that-causes-compile-failure-.patch \
17 file://0008-qmake.pro-Allow-building-a-separate-qmake-for-the-ta.patch \
18 file://g++.conf \
19 file://linux.conf"
20
21S = "${WORKDIR}/qt-everywhere-opensource-src-${PV}"
22
23LIC_FILES_CHKSUM = "file://LICENSE.LGPL;md5=fbc093901857fcd118f065f900982c24 \
24 file://LICENSE.GPL3;md5=6e1694ee338db410417517884918d4d2 \
25 file://LGPL_EXCEPTION.txt;md5=0145c4d1b6f96a661c2c139dfb268fb6"
26
27require qt4_arch.inc
28
29# FIXME: make it work with "${STAGING_BINDIR_NATIVE}/pkg-config --cflags dbus-1"
30EXTRA_OECONF = "-prefix ${prefix} \
31 -qt-libjpeg -system-zlib \
32 -no-libjpeg -no-libpng -no-libmng -no-libtiff \
33 -no-accessibility \
34 -no-cups \
35 -no-exceptions \
36 -no-nas-sound \
37 -no-nis -no-openssl \
38 -verbose -release -fast -static \
39 -platform ${TARGET_OS}-oe-g++ \
40 -xplatform ${TARGET_OS}-oe-g++ \
41 -arch ${QT_ARCH} \
42 -embedded -no-freetype -no-glib -no-iconv \
43 -qt3support \
44 -I${STAGING_DIR_HOST}${SDKPATHNATIVE}/usr/include/dbus-1.0 \
45 -I${STAGING_DIR_HOST}${SDKPATHNATIVE}/usr/lib/dbus-1.0/include"
46
47# yank default -e, otherwise we get the following error:
48# moc_qbuffer.cpp: No such file or directory
49EXTRA_OEMAKE = " "
50
51do_configure() {
52 # Avoid problems with Qt 4.8.0 configure setting QMAKE_LINK from LD (since we want the linker to be g++)
53 unset LD
54
55 if [ ! -e mkspecs/${TARGET_OS}-oe-g++ ]; then
56 ln -sf linux-g++ mkspecs/${TARGET_OS}-oe-g++
57 fi
58
59 cp ../g++.conf mkspecs/common
60 cp ../linux.conf mkspecs/common
61
62 if [ -f mkspecs/common/g++-base.conf ] ; then
63 # don't use host g++ even during configure (4.8.0+)
64 sed -i -e "s#= g++#= ${CXX}#" mkspecs/common/g++-base.conf
65 sed -i -e "s#= gcc#= ${CC}#" mkspecs/common/g++-base.conf
66 fi
67
68 # Use qmake from qt4-native for building
69 if [ ! -e bin/qmake ]; then
70 ln -sf ${STAGING_BINDIR_NATIVE}/qmake2 bin/qmake
71 fi
72 set_arch
73 (echo o; echo yes) | CC="${CC}" CXX="${CXX}" ./configure ${EXTRA_OECONF} || die "Configuring qt failed. EXTRA_OECONF was ${EXTRA_OECONF}"
74}
75
76TOBUILD = "\
77 src/tools/bootstrap \
78 src/tools/moc \
79 src/corelib \
80 src/sql \
81 src/dbus \
82 src/qt3support \
83 src/xml \
84 src/tools/uic \
85 src/tools/rcc \
86 src/network \
87 src/gui \
88 src/tools/uic3 \
89 tools/linguist/lrelease \
90 tools/linguist/lupdate \
91 tools/qdbus \
92"
93
94do_compile() {
95 for i in ${TOBUILD}; do
96 cd ${S}/$i && oe_runmake CC="${CC}" CXX="${CXX}"
97 done
98
99 # Build nativesdk qmake
100 export QMAKESPEC="${S}/mkspecs/${TARGET_OS}-oe-g++"
101 cd ${S}/qmake
102 ${OE_QMAKE_QMAKE}
103 oe_runmake CC="${CC}" CXX="${CXX}"
104 cd ${S}
105}
106
107do_install() {
108 install -d ${D}${bindir}
109 install -m 0755 bin/qmake2 ${D}${bindir}/qmake2
110 for i in moc uic uic3 rcc lrelease lupdate qdbuscpp2xml qdbusxml2cpp; do
111 install -m 0755 bin/${i} ${D}${bindir}/${i}4
112 done
113
114 (cd ${D}${bindir}; \
115 ln -s qmake2 qmake; \
116 for i in moc uic uic3 rcc lrelease lupdate qdbuscpp2xml qdbusxml2cpp; do \
117 ln -s ${i}4 ${i}; \
118 done)
119
120 install -d ${D}${sysconfdir}
121 cat >${D}${sysconfdir}/qt.conf <<EOF
122[Paths]
123Prefix = ${prefix}
124EOF
125}