From 13ed17b2baeb253961885c469ba3c97b9ed420e5 Mon Sep 17 00:00:00 2001 From: Mikko Levonmaa Date: Thu, 15 Nov 2012 20:38:27 +0100 Subject: [PATCH] qtbase: add recipe for git version Signed-off-by: Mikko Levonmaa Signed-off-by: Martin Jansa --- classes/qmake5.bbclass | 22 +++++ classes/qmake5_base.bbclass | 35 ++++++++ recipes-qt/qt5/files/qmake-build.conf.sh | 31 +++++++ recipes-qt/qt5/files/qmake.conf.sh | 39 +++++++++ recipes-qt/qt5/files/qplatformdefs.h | 1 + recipes-qt/qt5/qt5.inc | 86 ++++++++++++++++++- recipes-qt/qt5/qt5_arch.inc | 19 ++++ recipes-qt/qt5/qtbase.inc | 23 +++++ ...owing-the-customization-of-the-paths.patch | 37 ++++++++ ...ow-to-set-qt.conf-from-the-outside-u.patch | 44 ++++++++++ ...is-already-built-in-qt5-tools-native.patch | 29 +++++++ ...ding-a-separate-qmake-for-the-target.patch | 28 ++++++ recipes-qt/qt5/qtbase_4.999+git.bb | 6 ++ 13 files changed, 397 insertions(+), 3 deletions(-) create mode 100644 classes/qmake5.bbclass create mode 100644 classes/qmake5_base.bbclass create mode 100644 recipes-qt/qt5/files/qmake-build.conf.sh create mode 100644 recipes-qt/qt5/files/qmake.conf.sh create mode 100644 recipes-qt/qt5/files/qplatformdefs.h create mode 100644 recipes-qt/qt5/qt5_arch.inc create mode 100644 recipes-qt/qt5/qtbase.inc create mode 100644 recipes-qt/qt5/qtbase/0001-Allowing-the-customization-of-the-paths.patch create mode 100644 recipes-qt/qt5/qtbase/0001-qlibraryinfo-allow-to-set-qt.conf-from-the-outside-u.patch create mode 100644 recipes-qt/qt5/qtbase/0002-qmake-is-already-built-in-qt5-tools-native.patch create mode 100644 recipes-qt/qt5/qtbase/0003-Allow-building-a-separate-qmake-for-the-target.patch create mode 100644 recipes-qt/qt5/qtbase_4.999+git.bb diff --git a/classes/qmake5.bbclass b/classes/qmake5.bbclass new file mode 100644 index 0000000000..b30b150720 --- /dev/null +++ b/classes/qmake5.bbclass @@ -0,0 +1,22 @@ +# +# QMake variables for Qt +# +inherit qmake5_base + +QT5TOOLSDEPENDS ?= "qt5-native " +DEPENDS_prepend = "${QT5TOOLSDEPENDS}" + +export QMAKESPEC = "${STAGING_DATADIR_NATIVE}/qt5/mkspecs/${TARGET_OS}-oe-g++" +export OE_QMAKE_UIC = "${STAGING_BINDIR_NATIVE}/uic" +export OE_QMAKE_MOC = "${STAGING_BINDIR_NATIVE}/moc" +export OE_QMAKE_RCC = "${STAGING_BINDIR_NATIVE}/rcc" +export OE_QMAKE_QMAKE = "${STAGING_BINDIR_NATIVE}/qmake" +export OE_QMAKE_LINK = "${CXX}" +export OE_QMAKE_CXXFLAGS = "${CXXFLAGS}" +export OE_QMAKE_INCDIR_QT = "${STAGING_INCDIR}/qt5" +export OE_QMAKE_LIBDIR_QT = "${STAGING_LIBDIR}" +export OE_QMAKE_LIBS_QT = "qt" +export OE_QMAKE_LIBS_X11 = "-lXext -lX11 -lm" +export OE_QMAKE_LIBS_X11SM = "-lSM -lICE" +export OE_QMAKE_LRELEASE = "${STAGING_BINDIR_NATIVE}/lrelease5" +export OE_QMAKE_LUPDATE = "${STAGING_BINDIR_NATIVE}/lupdate5" diff --git a/classes/qmake5_base.bbclass b/classes/qmake5_base.bbclass new file mode 100644 index 0000000000..fc90429fd5 --- /dev/null +++ b/classes/qmake5_base.bbclass @@ -0,0 +1,35 @@ + +# We override this completely to eliminate the -e normally passed in +EXTRA_OEMAKE = ' MAKEFLAGS= ' + +export OE_QMAKE_CC="${CC}" +export OE_QMAKE_CFLAGS="${CFLAGS}" +export OE_QMAKE_CXX="${CXX}" +export OE_QMAKE_LDFLAGS="${LDFLAGS}" +export OE_QMAKE_AR="${AR} cqs" +export OE_QMAKE_STRIP="echo" +export OE_QMAKE_RPATH="-Wl,-rpath-link," + +# do not export STRIP to the environment +STRIP[unexport] = "1" + +do_generate_qt_config_file() { + export QT_CONF_PATH=${WORKDIR}/qt.conf + cat > ${WORKDIR}/qt.conf < mkspecs/${TARGET_OS}-oe-g++/qmake.conf + + mkdir -p mkspecs/build-oe-g++ + cp -f ${WORKDIR}/qplatformdefs.h mkspecs/build-oe-g++ + + ## FIXME, the file nameing is dumb... + cp ${WORKDIR}/qmake-build.conf.sh mkspecs/build-oe-g++/qmake.conf + + ./configure -v \ + -opensource -confirm-license \ + -prefix ${prefix} \ + -bindir ${bindir} \ + -libdir ${libdir} \ + -datadir ${datadir}/${QT_DIR_NAME} \ + -sysconfdir ${sysconfdir}/${QT_DIR_NAME} \ + -docdir ${docdir}/${QT_DIR_NAME} \ + -headerdir ${includedir}/${QT_DIR_NAME} \ + -plugindir ${libdir}/${QT_DIR_NAME}/plugins \ + -importdir ${libdir}/${QT_DIR_NAME}/imports \ + -translationdir ${datadir}/${QT_DIR_NAME}/translations \ + -examplesdir ${bindir}/${QT_DIR_NAME}/examples \ + -shared \ + -no-rpath \ + -platform build-oe-g++ \ + -xplatform ${TARGET_OS}-oe-g++ \ + ${QT_TESTS} \ + ${QT_EXAMPLES} \ + ${QT_DEMOS} \ + ${QT_CONFIG_FLAGS} -no-fast +} + +do_compile() { + unset CFLAGS CXXFLAGS AR + + export QMAKESPEC="${S}/mkspecs/${TARGET_OS}-oe-g++" + + oe_runmake +} + +do_install() { + oe_runmake install INSTALL_ROOT=${D} +} + +FILES_${PN} = "${libdir}/*.so.*" +FILES_${PN}-dbg = "${libdir}/.debug/*.so.*" +FILES_${PN}-dev = "${libdir}/cmake/* ${libdir}/pkgconfig/*.pc ${libdir}/*.la ${libdir}/*.prl ${includedir}/qt5/*" +FILES_${PN}-staticdev = "${libdir}/libQt*.a" diff --git a/recipes-qt/qt5/qt5_arch.inc b/recipes-qt/qt5/qt5_arch.inc new file mode 100644 index 0000000000..7048d7a368 --- /dev/null +++ b/recipes-qt/qt5/qt5_arch.inc @@ -0,0 +1,19 @@ +inherit siteinfo + +set_arch() { + case ${TARGET_ARCH} in + arm*) QT_ARCH=arm ;; + i*86*) QT_ARCH=i386 ;; + mips*) QT_ARCH=mips ;; + powerpc*) QT_ARCH=powerpc ;; + x86_64*) QT_ARCH=x86_64 ;; + esac +} + +set_endian() { + if [ ${SITEINFO_ENDIANNESS} = "le" ] ; then + QT_ENDIAN="-little-endian" + elif [ ${SITEINFO_ENDIANNESS} = "be" ] ; then + QT_ENDIAN="-big-endian" + fi +} diff --git a/recipes-qt/qt5/qtbase.inc b/recipes-qt/qt5/qtbase.inc new file mode 100644 index 0000000000..235029b0aa --- /dev/null +++ b/recipes-qt/qt5/qtbase.inc @@ -0,0 +1,23 @@ +require qt5.inc + +SRC_URI += " \ + file://0001-Allowing-the-customization-of-the-paths.patch \ + file://0002-qmake-is-already-built-in-qt5-tools-native.patch \ + file://0003-Allow-building-a-separate-qmake-for-the-target.patch \ +" +#file://0001-qlibraryinfo-allow-to-set-qt.conf-from-the-outside-u.patch + +# to provide xcb/xcb_icccm.h, xcb/xcb_image.h, xcb/xcb_keysyms.h +DEPENDS += "xcb-util-wm xcb-util-image xcb-util-keysyms" + +INC_PR = "r0" + +QT_BASE_NAME = "qt5" +QT_DIR_NAME = "qt5" + +export QMAKESPEC = "${STAGING_DATADIR}/${QT_DIR_NAME}/mkspecs/${TARGET_OS}-oe-g++" + +# Qt uses atomic instructions not supported in thumb mode +ARM_INSTRUCTION_SET = "arm" + +inherit qmake5 diff --git a/recipes-qt/qt5/qtbase/0001-Allowing-the-customization-of-the-paths.patch b/recipes-qt/qt5/qtbase/0001-Allowing-the-customization-of-the-paths.patch new file mode 100644 index 0000000000..073df37872 --- /dev/null +++ b/recipes-qt/qt5/qtbase/0001-Allowing-the-customization-of-the-paths.patch @@ -0,0 +1,37 @@ +From 183cf66e2770f7fbc420cf7aa94a9a8564785044 Mon Sep 17 00:00:00 2001 +From: Mikko Levonmaa +Date: Wed, 7 Nov 2012 14:48:46 -0800 +Subject: [PATCH] Allowing the customization of the paths + +Signed-off-by: Mikko Levonmaa +--- + src/corelib/global/qlibraryinfo.cpp | 6 ++++++ + 1 files changed, 6 insertions(+), 0 deletions(-) + +diff --git a/src/corelib/global/qlibraryinfo.cpp b/src/corelib/global/qlibraryinfo.cpp +index ccf0718..487b8eb 100644 +--- a/src/corelib/global/qlibraryinfo.cpp ++++ b/src/corelib/global/qlibraryinfo.cpp +@@ -49,6 +49,7 @@ + QT_BEGIN_NAMESPACE + extern QString qt_libraryInfoFile(); + QT_END_NAMESPACE ++#include + #elif defined(QT_BOOTSTRAPPED) + QString qt_libraryInfoFile() + { +@@ -164,6 +165,11 @@ QSettings *QLibraryInfoPrivate::findConfiguration() + } + } + #endif ++ if (!QFile::exists(qtconfig)) { ++ QByteArray config = getenv("QT_CONF_PATH"); ++ qtconfig = QFile::decodeName(config); ++ printf("Using qt.conf from: %s\n", qtconfig.toLatin1().data()); ++ } + if (QFile::exists(qtconfig)) + return new QSettings(qtconfig, QSettings::IniFormat); + return 0; //no luck +-- +1.7.4.1 + diff --git a/recipes-qt/qt5/qtbase/0001-qlibraryinfo-allow-to-set-qt.conf-from-the-outside-u.patch b/recipes-qt/qt5/qtbase/0001-qlibraryinfo-allow-to-set-qt.conf-from-the-outside-u.patch new file mode 100644 index 0000000000..6b5bed9a2c --- /dev/null +++ b/recipes-qt/qt5/qtbase/0001-qlibraryinfo-allow-to-set-qt.conf-from-the-outside-u.patch @@ -0,0 +1,44 @@ +From d5a0cf45ebbd6a5911f8bd208fe355eb990b5388 Mon Sep 17 00:00:00 2001 +From: Holger Freyther +Date: Wed, 26 Sep 2012 17:22:30 +0200 +Subject: [PATCH] qlibraryinfo: allow to set qt.conf from the outside using the environment + +Allow to set a qt.conf from the outside using the environment. This allows +to inject new prefixes and other paths into qmake. This is needed when using +the same qmake binary to build qt/x11 and qt/embedded + +Upstream-Status: Pending + +Signed-off-by: Martin Jansa +--- + src/corelib/global/qlibraryinfo.cpp | 5 +++++ + 1 files changed, 5 insertions(+), 0 deletions(-) + +diff --git a/src/corelib/global/qlibraryinfo.cpp b/src/corelib/global/qlibraryinfo.cpp +index ccf0718..497e72e 100644 +--- a/src/corelib/global/qlibraryinfo.cpp ++++ b/src/corelib/global/qlibraryinfo.cpp +@@ -49,6 +49,8 @@ + QT_BEGIN_NAMESPACE + extern QString qt_libraryInfoFile(); + QT_END_NAMESPACE ++#include ++#include + #elif defined(QT_BOOTSTRAPPED) + QString qt_libraryInfoFile() + { +@@ -142,6 +143,11 @@ QSettings *QLibraryInfoPrivate::findConfiguration() + #ifdef QT_BOOTSTRAPPED + if(!QFile::exists(qtconfig)) + qtconfig = qt_libraryInfoFile(); ++ if (!QFile::exists(qtconfig)) { ++ QByteArray config = getenv("QT_CONF_PATH"); ++ qtconfig = QFile::decodeName(config); ++ printf("using qt.conf %s", qtconfig.toLatin1().data()); ++ } + #else + if (!QFile::exists(qtconfig) && QCoreApplication::instance()) { + #ifdef Q_OS_MAC +-- +1.7.4.1 + diff --git a/recipes-qt/qt5/qtbase/0002-qmake-is-already-built-in-qt5-tools-native.patch b/recipes-qt/qt5/qtbase/0002-qmake-is-already-built-in-qt5-tools-native.patch new file mode 100644 index 0000000000..0c1f63c69e --- /dev/null +++ b/recipes-qt/qt5/qtbase/0002-qmake-is-already-built-in-qt5-tools-native.patch @@ -0,0 +1,29 @@ +From aab01049543f4508f1dc92fb62b980d1d0c3bcc0 Mon Sep 17 00:00:00 2001 +From: Michael Krelin +Date: Mon, 29 Oct 2012 20:07:49 -0700 +Subject: [PATCH] qmake is already built in qt5-tools-native + +Ported from OE by: Yu Ke +Upstream-Status: Inappropriate [configuration] + +Signed-off-by: Mikko Levonmaa +--- + configure | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/configure b/configure +index c3e61d6..5e43a19 100755 +--- a/configure ++++ b/configure +@@ -3594,7 +3594,7 @@ setBootstrapVariable() + } + + # build qmake +-if true; then ###[ '!' -f "$outpath/bin/qmake" ]; ++if false; then ###[ '!' -f "$outpath/bin/qmake" ]; + echo "Creating qmake. Please wait..." + + #mkspecs/default is used as a (gasp!) default mkspec so QMAKESPEC needn't be set once configured +-- +1.7.4.1 + diff --git a/recipes-qt/qt5/qtbase/0003-Allow-building-a-separate-qmake-for-the-target.patch b/recipes-qt/qt5/qtbase/0003-Allow-building-a-separate-qmake-for-the-target.patch new file mode 100644 index 0000000000..781d6e549b --- /dev/null +++ b/recipes-qt/qt5/qtbase/0003-Allow-building-a-separate-qmake-for-the-target.patch @@ -0,0 +1,28 @@ +From a2a01e1fd975e8e616b580423c3bf30db9c11b6d Mon Sep 17 00:00:00 2001 +From: Paul Eggleton +Date: Mon, 29 Oct 2012 20:26:36 -0700 +Subject: [PATCH] Allow building a separate qmake for the target + +Upstream-Status: Inappropriate [config] + +Signed-off-by: Paul Eggleton +Signed-off-by: Mikko Levonmaa +--- + qmake/qmake.pro | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +diff --git a/qmake/qmake.pro b/qmake/qmake.pro +index 0d92ac2..07fa80e 100644 +--- a/qmake/qmake.pro ++++ b/qmake/qmake.pro +@@ -9,6 +9,7 @@ CONFIG -= qt shared app_bundle uic + DEFINES += QT_BUILD_QMAKE QT_BOOTSTRAPPED \ + PROEVALUATOR_FULL PROEVALUATOR_DEBUG + DESTDIR = ../bin/ ++TARGET = qmake2 + + OBJECTS_DIR = . + MOC_DIR = . +-- +1.7.4.1 + diff --git a/recipes-qt/qt5/qtbase_4.999+git.bb b/recipes-qt/qt5/qtbase_4.999+git.bb new file mode 100644 index 0000000000..fe8fd1e571 --- /dev/null +++ b/recipes-qt/qt5/qtbase_4.999+git.bb @@ -0,0 +1,6 @@ +require qtbase.inc +require qt5-4.999+git.inc + +PR = "${INC_PR}.0" + +SRCREV = "f7d99ad50f11ee7c263d4c2bdbe024355a1ab3e9"