Skip to content

Commit

Permalink
Upgrade to Qt 5.8
Browse files Browse the repository at this point in the history
The linux-oe-g++ mkspec is changed to use $$(...) operator to obtain
the contents of an environment value when qmake is run instead of when
Makefile is processed. All OE_QMAKE_xxx variables need to be exported
for qmake to find them. configure's setBootstrapVariable function needs
to change $$(..) to normal $(...) operator to work with qmake's Makefile.

qt.conf generation for qtbase recipes is not needed, as configure will
generate its own version based on configure arguments. Skip running
qmake, since configure is now automatically invoked when it's run in
qtbase's root folder.

Update PACKAGECONFIGs for qtbase to match current configure options.

The new Qt configuration system [1] can be used with a new variable
EXTRA_QMAKEVARS_CONFIGURE, which takes both command line and feature
arguments.

Merge the two qtwayland recipes to one that supports all three targets
(target, native, nativesdk) without need for additional patch.

Recipes for new Qt modules: QtSCXML, QtNetworkAuth, QtGamepad.
Removes qtdeclarative-render2d

[1] https://www.mail-archive.com/development@qt-project.org/msg25257.html

Change-Id: Ib37c4d7323e8b45aa2b171e8427b6ec15aaee213
Signed-off-by: Samuli Piippo <samuli.piippo@qt.io>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
  • Loading branch information
sapiippo authored and shr-project committed Jan 26, 2017
1 parent c0ba8ab commit 333949a
Show file tree
Hide file tree
Showing 65 changed files with 437 additions and 1,965 deletions.
4 changes: 0 additions & 4 deletions classes/qmake5.bbclass
Expand Up @@ -17,7 +17,3 @@ do_install() {
do_install_class-native() {
qmake5_base_native_do_install
}

do_install_class-nativesdk() {
qmake5_base_nativesdk_do_install
}
96 changes: 56 additions & 40 deletions classes/qmake5_base.bbclass
Expand Up @@ -30,27 +30,29 @@ EXTRA_OEMAKE = " \
OE_QMAKE_INCDIR_QT='${STAGING_DIR_TARGET}/${OE_QMAKE_PATH_HEADERS}' \
"

OE_QMAKESPEC = "${QMAKE_MKSPEC_PATH_NATIVE}/mkspecs/${OE_QMAKE_PLATFORM_NATIVE}"
OE_XQMAKESPEC = "${QMAKE_MKSPEC_PATH}/mkspecs/${OE_QMAKE_PLATFORM}"
OE_QMAKE_QMAKE = "${OE_QMAKE_PATH_EXTERNAL_HOST_BINS}/qmake"
OE_QMAKE_COMPILER = "${CC}"
OE_QMAKE_CC = "${CC}"
OE_QMAKE_CFLAGS = "${CFLAGS}"
OE_QMAKE_CXX = "${CXX}"
OE_QMAKE_CXXFLAGS = "${CXXFLAGS}"
OE_QMAKE_LINK = "${CXX}"
OE_QMAKE_LDFLAGS = "${LDFLAGS}"
OE_QMAKE_AR = "${AR}"
OE_QMAKE_STRIP = "echo"
OE_QMAKE_WAYLAND_SCANNER = "${STAGING_BINDIR_NATIVE}/wayland-scanner"

# this one needs to be exported, because qmake reads it from shell env
export QT_CONF_PATH = "${WORKDIR}/qt.conf"
export OE_QMAKE_COMPILER = "${CC}"
export OE_QMAKE_CC = "${CC}"
export OE_QMAKE_CFLAGS = "${CFLAGS}"
export OE_QMAKE_CXX = "${CXX}"
export OE_QMAKE_CXXFLAGS = "${CXXFLAGS}"
export OE_QMAKE_LINK = "${CXX}"
export OE_QMAKE_LDFLAGS = "${LDFLAGS}"
export OE_QMAKE_AR = "${AR}"
export OE_QMAKE_STRIP = "echo"
export OE_QMAKE_WAYLAND_SCANNER = "${STAGING_BINDIR_NATIVE}/wayland-scanner"
OE_QMAKE_QTCONF_PATH = "${WORKDIR}/qt.conf"
export OE_QMAKE_QTCONF = "-qtconf ${OE_QMAKE_QTCONF_PATH}"

inherit qmake5_paths remove-libtool

do_generate_qt_config_file() {
cat > ${QT_CONF_PATH} <<EOF
generate_qt_config_file_paths
generate_qt_config_file_effective_paths
}

generate_qt_config_file_paths() {
cat > ${OE_QMAKE_QTCONF_PATH} <<EOF
[Paths]
Prefix = ${OE_QMAKE_PATH_PREFIX}
Headers = ${OE_QMAKE_PATH_HEADERS}
Expand All @@ -70,12 +72,21 @@ Tests = ${OE_QMAKE_PATH_TESTS}
HostBinaries = ${OE_QMAKE_PATH_HOST_BINS}
HostData = ${OE_QMAKE_PATH_HOST_DATA}
HostLibraries = ${OE_QMAKE_PATH_HOST_LIBS}
HostSpec = ${OE_QMAKESPEC}
TartgetSpec = ${OE_XQMAKESPEC}
HostSpec = ${OE_QMAKE_PLATFORM_NATIVE}
TargetSpec = ${OE_QMAKE_PLATFORM}
ExternalHostBinaries = ${OE_QMAKE_PATH_EXTERNAL_HOST_BINS}
Sysroot = ${STAGING_DIR_TARGET}
EOF
}

generate_qt_config_file_effective_paths() {
cat >> ${OE_QMAKE_QTCONF_PATH} <<EOF
[EffectivePaths]
HostBinaries = ${OE_QMAKE_PATH_EXTERNAL_HOST_BINS}
HostData = ${OE_QMAKE_PATH_HOST_DATA}
HostPrefix = ${STAGING_DIR_NATIVE}${prefix_native}
EOF
}
#
# Allows to override following values (as in version 5.0.1)
# Prefix The default prefix for all paths.
Expand Down Expand Up @@ -151,11 +162,16 @@ qmake5_base_do_configure () {
bbnote "qmake prevar substitution: '${EXTRA_QMAKEVARS_PRE}'"
fi

if [ ! -z "${EXTRA_QMAKEVARS_CONFIGURE}" ]; then
QMAKE_VARSUBST_CONFIGURE="${EXTRA_QMAKEVARS_CONFIGURE}"
bbnote "qmake configure substitution: '${EXTRA_QMAKEVARS_CONFIGURE}'"
fi

# for config.tests to read this
export QMAKE_MAKE_ARGS="${EXTRA_OEMAKE}"

CMD="${OE_QMAKE_QMAKE} -makefile -o Makefile ${OE_QMAKE_DEBUG_OUTPUT} ${OE_QMAKE_RECURSIVE} $QMAKE_VARSUBST_PRE $AFTER $PROFILES $QMAKE_VARSUBST_POST"
${OE_QMAKE_QMAKE} -makefile -o Makefile ${OE_QMAKE_DEBUG_OUTPUT} ${OE_QMAKE_RECURSIVE} $QMAKE_VARSUBST_PRE $AFTER $PROFILES $QMAKE_VARSUBST_POST || die "Error calling $CMD"
CMD="${OE_QMAKE_QMAKE} -makefile -o Makefile ${OE_QMAKE_QTCONF} ${OE_QMAKE_DEBUG_OUTPUT} ${OE_QMAKE_RECURSIVE} $QMAKE_VARSUBST_PRE $AFTER $PROFILES $QMAKE_VARSUBST_POST -- $QMAKE_VARSUBST_CONFIGURE"
${OE_QMAKE_QMAKE} -makefile -o Makefile ${OE_QMAKE_QTCONF} ${OE_QMAKE_DEBUG_OUTPUT} ${OE_QMAKE_RECURSIVE} $QMAKE_VARSUBST_PRE $AFTER $PROFILES $QMAKE_VARSUBST_POST -- $QMAKE_VARSUBST_CONFIGURE || die "Error calling $CMD"
}

qmake5_base_native_do_install() {
Expand All @@ -166,37 +182,37 @@ qmake5_base_native_do_install() {
fi
}

qmake5_base_nativesdk_do_install() {
# Fix install paths for all
find . -name "Makefile*" | xargs -r sed -i "s,(INSTALL_ROOT)${STAGING_DIR_HOST},(INSTALL_ROOT),g"

oe_runmake install INSTALL_ROOT=${D}
if ls ${D}${libdir}/pkgconfig/Qt5*.pc >/dev/null 2>/dev/null; then
sed -i "s@-L${STAGING_LIBDIR}@-L\${libdir}@g" ${D}${libdir}/pkgconfig/Qt5*.pc
qmake5_base_fix_install() {
STAGING_PATH=$1
if [ -d ${D}${STAGING_PATH} ] ; then
echo "Some files are installed in wrong directory ${D}${STAGING_PATH}"
cp -ra ${D}${STAGING_PATH}/* ${D}
rm -rf ${D}${STAGING_PATH}
# remove empty dirs
TMP=`dirname ${D}${STAGING_PATH}`
while test ${TMP} != ${D}; do
rmdir ${TMP}
TMP=`dirname ${TMP}`;
done
fi
}

qmake5_base_do_install() {
# Fix install paths for all
find . -name "Makefile*" | xargs -r sed -i "s,(INSTALL_ROOT)${STAGING_DIR_TARGET},(INSTALL_ROOT),g"
find . -name "Makefile*" | xargs -r sed -i "s,(INSTALL_ROOT)${STAGING_DIR_HOST},(INSTALL_ROOT),g"
find . -name "Makefile*" | xargs -r sed -i "s,(INSTALL_ROOT)${STAGING_DIR_NATIVE},(INSTALL_ROOT),g"

oe_runmake install INSTALL_ROOT=${D}

# everything except HostData and HostBinaries is prefixed with sysroot value,
# but we cannot remove sysroot override, because that's useful for pkg-config etc
# In some cases like QtQmlDevTools in qtdeclarative, the sed above does not work,
# fix them manually
if [ -d ${D}${STAGING_DIR_TARGET} ] ; then
echo "Some files are installed in wrong directory ${D}${STAGING_DIR_TARGET}"
cp -ra ${D}${STAGING_DIR_TARGET}/* ${D}
rm -rf ${D}${STAGING_DIR_TARGET}
# remove empty dirs
TMP=`dirname ${D}/${STAGING_DIR_TARGET}`
while test ${TMP} != ${D}; do
rmdir ${TMP}
TMP=`dirname ${TMP}`;
done
fi
# concurrent builds may cause qmake to regenerate Makefiles and override the above
# sed changes. If that happens, move files manually to correct location.
qmake5_base_fix_install ${STAGING_DIR_TARGET}
qmake5_base_fix_install ${STAGING_DIR_HOST}
qmake5_base_fix_install ${STAGING_DIR_NATIVE}

if ls ${D}${libdir}/pkgconfig/Qt5*.pc >/dev/null 2>/dev/null; then
sed -i "s@-L${STAGING_LIBDIR}@-L\${libdir}@g" ${D}${libdir}/pkgconfig/Qt5*.pc
fi
Expand Down
Expand Up @@ -53,7 +53,6 @@ RDEPENDS_${PN} += " \
qttranslations-qtconnectivity \
qtdeclarative-dev \
qtdeclarative-mkspecs \
qtdeclarative-plugins \
${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'qtdeclarative-qmlplugins', '', d)} \
qtdeclarative-tools \
qtdeclarative-staticdev \
Expand Down
93 changes: 9 additions & 84 deletions recipes-qt/qt5/nativesdk-qtbase_git.bb
Expand Up @@ -27,21 +27,17 @@ FILESEXTRAPATHS =. "${FILE_DIRNAME}/qtbase:"
# common for qtbase-native, qtbase-nativesdk and qtbase
SRC_URI += "\
file://0001-Add-linux-oe-g-platform.patch \
file://0002-qlibraryinfo-allow-to-set-qt.conf-from-the-outside-u.patch \
file://0003-Add-external-hostbindir-option.patch \
file://0004-qt_module-Fix-pkgconfig-and-libtool-replacements.patch \
file://0005-configure-bump-path-length-from-256-to-512-character.patch \
file://0006-QOpenGLPaintDevice-sub-area-support.patch \
file://0007-linux-oe-g-Invert-conditional-for-defining-QT_SOCKLE.patch \
file://0008-configure-paths-for-target-qmake-properly.patch \
file://0009-Reorder-EGL-libraries-from-pkgconfig-and-defaults.patch \
file://0009-Disable-all-unknown-features-instead-of-erroring-out.patch \
file://0010-Pretend-Qt5-wasn-t-found-if-OE_QMAKE_PATH_EXTERNAL_H.patch \
"

# common for qtbase-native and nativesdk-qtbase
SRC_URI += " \
file://0011-Always-build-uic.patch \
file://0012-Add-external-hostbindir-option-for-native-sdk.patch \
"

# CMake's toolchain configuration of nativesdk-qtbase
Expand All @@ -58,10 +54,11 @@ FILES_${PN}-tools-dev = " \
${FILES_SOLIBSDEV} ${libdir}/*.la \
${libdir}/*.prl \
${OE_QMAKE_PATH_ARCHDATA}/mkspecs \
${OE_QMAKE_PATH_LIBS}/*.prl \
"

FILES_${PN}-tools-staticdev = " \
${libdir}/libQt5Bootstrap.a \
${OE_QMAKE_PATH_LIBS}/*.a \
"

FILES_${PN}-tools-dbg = " \
Expand Down Expand Up @@ -95,71 +92,10 @@ QT_CONFIG_FLAGS += " \
OE_QMAKE_PATH_HOST_DATA = "${libdir}${QT_DIR_NAME}"
OE_QMAKE_PATH_HOST_LIBS = "${libdir}"

do_generate_qt_config_file() {
cat > ${QT_CONF_PATH} <<EOF
[Paths]
Prefix = ${OE_QMAKE_PATH_PREFIX}
Headers = ${OE_QMAKE_PATH_HEADERS}
Libraries = ${OE_QMAKE_PATH_LIBS}
ArchData = ${OE_QMAKE_PATH_ARCHDATA}
Data = ${OE_QMAKE_PATH_DATA}
Binaries = ${OE_QMAKE_PATH_BINS}
LibraryExecutables = ${OE_QMAKE_PATH_LIBEXECS}
Plugins = ${OE_QMAKE_PATH_PLUGINS}
Imports = ${OE_QMAKE_PATH_IMPORTS}
Qml2Imports = ${OE_QMAKE_PATH_QML}
Translations = ${OE_QMAKE_PATH_TRANSLATIONS}
Documentation = ${OE_QMAKE_PATH_DOCS}
Settings = ${OE_QMAKE_PATH_SETTINGS}
Examples = ${OE_QMAKE_PATH_EXAMPLES}
Tests = ${OE_QMAKE_PATH_TESTS}
HostBinaries = ${OE_QMAKE_PATH_HOST_BINS}
HostData = ${OE_QMAKE_PATH_HOST_DATA}
HostLibraries = ${OE_QMAKE_PATH_HOST_LIBS}
HostSpec = ${OE_QMAKESPEC}
TartgetSpec = ${OE_XQMAKESPEC}
ExternalHostBinaries = ${OE_QMAKE_PATH_EXTERNAL_HOST_BINS}
Sysroot =
EOF
}

do_generate_qt_config_file_append() {
cat >> ${QT_CONF_PATH} <<EOF

[EffectivePaths]
Prefix=..
EOF
}

# qtbase is exception, we need to use mkspecs from ${S}
QMAKE_MKSPEC_PATH = "${B}"

# qtbase is exception, configure script is using our get(X)QEvalMakeConf and setBootstrapEvalVariable functions to read it from shell
export OE_QMAKE_COMPILER
export OE_QMAKE_CC
export OE_QMAKE_CFLAGS
export OE_QMAKE_CXX
export OE_QMAKE_CXXFLAGS
export OE_QMAKE_LINK
export OE_QMAKE_LDFLAGS
export OE_QMAKE_AR
export OE_QMAKE_STRIP

# another exception is that we need to run bin/qmake, because EffectivePaths are relative to qmake location
OE_QMAKE_QMAKE_ORIG := "${OE_QMAKE_QMAKE}"
OE_QMAKE_QMAKE = "bin/qmake"

do_configure() {
# we need symlink in path relative to source, because
# EffectivePaths:Prefix is relative to qmake location
if [ ! -e ${B}/bin/qmake ]; then
mkdir -p ${B}/bin
ln -sf ${OE_QMAKE_QMAKE_ORIG} ${B}/bin/qmake
fi

${S}/configure -v \
-opensource -confirm-license \
-sysroot ${STAGING_DIR_NATIVE} \
-sysroot ${STAGING_DIR_TARGET} \
-no-gcc-sysroot \
-system-zlib \
-dbus-runtime \
Expand Down Expand Up @@ -193,33 +129,22 @@ do_configure() {
-testsdir ${OE_QMAKE_PATH_TESTS} \
-hostbindir ${OE_QMAKE_PATH_HOST_BINS} \
-hostdatadir ${OE_QMAKE_PATH_HOST_DATA} \
-host-option CROSS_COMPILE=${HOST_PREFIX} \
-external-hostbindir ${OE_QMAKE_PATH_EXTERNAL_HOST_BINS} \
-no-glib \
-no-iconv \
-silent \
-nomake examples \
-nomake tests \
-nomake libs \
-no-compile-examples \
-no-rpath \
-platform ${OE_QMAKESPEC} \
-xplatform linux-oe-g++ \
-platform ${OE_QMAKE_PLATFORM_NATIVE} \
-xplatform ${OE_QMAKE_PLATFORM} \
${QT_CONFIG_FLAGS}

bin/qmake ${OE_QMAKE_DEBUG_OUTPUT} ${S} -o Makefile || die "Configuring qt with qmake failed. PACKAGECONFIG_CONFARGS was ${PACKAGECONFIG_CONFARGS}"
}

do_install() {
# Fix install paths for all
find . -name "Makefile*" | xargs sed -i "s,(INSTALL_ROOT)${STAGING_DIR_NATIVE}${STAGING_DIR_NATIVE},(INSTALL_ROOT)${STAGING_DIR_NATIVE},g"

oe_runmake install INSTALL_ROOT=${D}

install -m 755 ${B}/bin/qmake-target ${D}${OE_QMAKE_PATH_HOST_BINS}/qmake

# for modules which are still using syncqt and call qtPrepareTool(QMAKE_SYNCQT, syncqt)
# e.g. qt3d, qtwayland
ln -sf syncqt.pl ${D}${OE_QMAKE_PATH_QT_BINS}/syncqt
qmake5_base_do_install

# remove things unused in nativesdk, we need the headers and libs
rm -rf ${D}${datadir} \
Expand Down Expand Up @@ -262,4 +187,4 @@ fakeroot do_generate_qt_environment_file() {

addtask generate_qt_environment_file after do_install before do_package

SRCREV = "69b43e74d78e050cf5e40197acafa4bc9f90c0bd"
SRCREV = "49dc9aa409d727824f26b246054a22b5a7dd5980"
30 changes: 21 additions & 9 deletions recipes-qt/qt5/qt3d/0001-Allow-a-tools-only-build.patch
@@ -1,23 +1,24 @@
From befe1fd63c485b8d10d1b9f1eca3368f3ee0042b Mon Sep 17 00:00:00 2001
From 64f46f5399627430f9ce1a888fb9212b33977231 Mon Sep 17 00:00:00 2001
From: Samuli Piippo <samuli.piippo@theqtcompany.com>
Date: Wed, 10 Feb 2016 09:02:09 +0200
Subject: [PATCH] Allow a tools-only build

---
qt3d.pro | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
qt3d.pro | 7 ++++++-
src/3rdparty/assimp/assimp_dependency.pri | 2 +-
2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/qt3d.pro b/qt3d.pro
index a26e76d..016fb30 100644
index 2cc347a..81cdeef 100644
--- a/qt3d.pro
+++ b/qt3d.pro
@@ -1,4 +1,4 @@
-requires(contains(QT_CONFIG, opengl))
+!tools-only:requires(contains(QT_CONFIG, opengl))
-requires(qtConfig(opengl))
+!tools-only:requires(qtConfig(opengl))

load(configure)
qtCompileTest(assimp)
@@ -17,3 +17,8 @@ load(qt_parts)
CONFIG += examples_need_tools
load(qt_parts)
@@ -14,3 +14,8 @@ load(qt_parts)

OTHER_FILES += \
sync.profile
Expand All @@ -26,3 +27,14 @@ index a26e76d..016fb30 100644
+ sub_tools.depends -= sub_src
+ SUBDIRS = sub_tools
+}
diff --git a/src/3rdparty/assimp/assimp_dependency.pri b/src/3rdparty/assimp/assimp_dependency.pri
index 8ba2d9a..e973d93 100644
--- a/src/3rdparty/assimp/assimp_dependency.pri
+++ b/src/3rdparty/assimp/assimp_dependency.pri
@@ -1,5 +1,5 @@
QT_FOR_CONFIG += 3dcore-private
-qtConfig(system-assimp):!if(cross_compile:host_build) {
+!tools-only:qtConfig(system-assimp):!if(cross_compile:host_build) {
QMAKE_USE_PRIVATE += assimp
} else {
include(assimp.pri)

0 comments on commit 333949a

Please sign in to comment.