]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
qt5: import qtbase-native from meta-qt5 which often reproduces Yocto #12434
authorMartin Jansa <Martin.Jansa@gmail.com>
Wed, 25 Apr 2018 21:03:54 +0000 (21:03 +0000)
committerMartin Jansa <Martin.Jansa@gmail.com>
Mon, 20 May 2019 15:56:01 +0000 (15:56 +0000)
* just temporary to make it easier to reproduce

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
28 files changed:
meta/classes/qmake5.bbclass [new file with mode: 0644]
meta/classes/qmake5_base.bbclass [new file with mode: 0644]
meta/classes/qmake5_paths.bbclass [new file with mode: 0644]
meta/conf/bitbake.conf
meta/recipes-qt/qt5/qt5-git.inc [new file with mode: 0644]
meta/recipes-qt/qt5/qt5-native.inc [new file with mode: 0644]
meta/recipes-qt/qt5/qt5.inc [new file with mode: 0644]
meta/recipes-qt/qt5/qtbase-native_git.bb [new file with mode: 0644]
meta/recipes-qt/qt5/qtbase/0001-Add-linux-oe-g-platform.patch [new file with mode: 0644]
meta/recipes-qt/qt5/qtbase/0002-cmake-Use-OE_QMAKE_PATH_EXTERNAL_HOST_BINS.patch [new file with mode: 0644]
meta/recipes-qt/qt5/qtbase/0003-qlibraryinfo-allow-to-set-qt.conf-from-the-outside-u.patch [new file with mode: 0644]
meta/recipes-qt/qt5/qtbase/0004-configure-bump-path-length-from-256-to-512-character.patch [new file with mode: 0644]
meta/recipes-qt/qt5/qtbase/0005-Disable-all-unknown-features-instead-of-erroring-out.patch [new file with mode: 0644]
meta/recipes-qt/qt5/qtbase/0006-Pretend-Qt5-wasn-t-found-if-OE_QMAKE_PATH_EXTERNAL_H.patch [new file with mode: 0644]
meta/recipes-qt/qt5/qtbase/0007-Delete-qlonglong-and-qulonglong.patch [new file with mode: 0644]
meta/recipes-qt/qt5/qtbase/0008-Replace-pthread_yield-with-sched_yield.patch [new file with mode: 0644]
meta/recipes-qt/qt5/qtbase/0009-Add-OE-specific-specs-for-clang-compiler.patch [new file with mode: 0644]
meta/recipes-qt/qt5/qtbase/0010-linux-clang-Invert-conditional-for-defining-QT_SOCKL.patch [new file with mode: 0644]
meta/recipes-qt/qt5/qtbase/0011-tst_qlocale-Enable-QT_USE_FENV-only-on-glibc.patch [new file with mode: 0644]
meta/recipes-qt/qt5/qtbase/0012-mkspecs-common-gcc-base.conf-Use-I-instead-of-isyste.patch [new file with mode: 0644]
meta/recipes-qt/qt5/qtbase/0013-Disable-ltcg-for-host_build.patch [new file with mode: 0644]
meta/recipes-qt/qt5/qtbase/0014-Qt5GuiConfigExtras.cmake.in-cope-with-variable-path-.patch [new file with mode: 0644]
meta/recipes-qt/qt5/qtbase/0015-corelib-Include-sys-types.h-for-uint32_t.patch [new file with mode: 0644]
meta/recipes-qt/qt5/qtbase/0016-Define-QMAKE_CXX.COMPILER_MACROS-for-clang-on-linux.patch [new file with mode: 0644]
meta/recipes-qt/qt5/qtbase/0017-Always-build-uic-and-qvkgen.patch [new file with mode: 0644]
meta/recipes-qt/qt5/qtbase/0018-Avoid-renameeat2-for-native-sdk-builds.patch [new file with mode: 0644]
meta/recipes-qt/qt5/qtbase/0019-Bootstrap-without-linkat-feature.patch [new file with mode: 0644]
meta/recipes-qt/qt5/qtbase/OEQt5Toolchain.cmake [new file with mode: 0644]

diff --git a/meta/classes/qmake5.bbclass b/meta/classes/qmake5.bbclass
new file mode 100644 (file)
index 0000000..1a960e8
--- /dev/null
@@ -0,0 +1,19 @@
+#
+# QMake variables for Qt
+#
+inherit qmake5_base
+
+QT5TOOLSDEPENDS ?= "qtbase-native"
+DEPENDS_prepend = "${QT5TOOLSDEPENDS} "
+
+do_configure() {
+    qmake5_base_do_configure
+}
+
+do_install() {
+    qmake5_base_do_install
+}
+
+do_install_class-native() {
+    qmake5_base_native_do_install
+}
diff --git a/meta/classes/qmake5_base.bbclass b/meta/classes/qmake5_base.bbclass
new file mode 100644 (file)
index 0000000..20ff33d
--- /dev/null
@@ -0,0 +1,257 @@
+# hardcode linux, because that's what 0001-Add-linux-oe-g-platform.patch adds
+XPLATFORM_toolchain-clang = "linux-oe-clang"
+XPLATFORM ?= "linux-oe-g++"
+
+OE_QMAKE_PLATFORM_NATIVE = "${XPLATFORM}"
+OE_QMAKE_PLATFORM = "${XPLATFORM}"
+
+# Add -d to show debug output from every qmake call, but it prints *a lot*, better to add it only to debugged recipe
+OE_QMAKE_DEBUG_OUTPUT ?= ""
+
+# Look through supplied directories recursively by default
+OE_QMAKE_RECURSIVE ?= "-r"
+
+# Paths in .prl files contain SYSROOT value
+SSTATE_SCAN_FILES += "*.pri *.prl *.prf"
+
+# drop default -e and add needed OE_QMAKE vars explicitly
+# the problem is that when generated Makefile has:
+# CFLAGS = -pipe $(OE_QMAKE_CFLAGS) -O2 -pthread -D_REENTRANT -Wall -W -fPIC $(DEFINES)
+# then OE_QMAKE_CFLAGS are exported and used correctly, but then whole CFLAGS is overwritten from env (and -fPIC lost and build fails)
+EXTRA_OEMAKE = " \
+    MAKEFLAGS='${PARALLEL_MAKE}' \
+    OE_QMAKE_CC='${OE_QMAKE_CC}' \
+    OE_QMAKE_CXX='${OE_QMAKE_CXX}' \
+    OE_QMAKE_CFLAGS='${OE_QMAKE_CFLAGS}' \
+    OE_QMAKE_CXXFLAGS='${OE_QMAKE_CXXFLAGS}' \
+    OE_QMAKE_LINK='${OE_QMAKE_LINK}' \
+    OE_QMAKE_LDFLAGS='${OE_QMAKE_LDFLAGS}' \
+    OE_QMAKE_AR='${OE_QMAKE_AR}' \
+    OE_QMAKE_STRIP='${OE_QMAKE_STRIP}' \
+    OE_QMAKE_INCDIR_QT='${STAGING_DIR_TARGET}/${OE_QMAKE_PATH_HEADERS}' \
+"
+
+OE_QMAKE_QMAKE = "${OE_QMAKE_PATH_EXTERNAL_HOST_BINS}/qmake"
+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"
+
+# qmake reads if from shell environment
+export OE_QMAKE_QTCONF_PATH = "${WORKDIR}/qt.conf"
+
+inherit qmake5_paths remove-libtool
+
+generate_target_qt_config_file() {
+    qtconf="$1"
+    cat > "${qtconf}" <<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}
+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_BINS}
+HostData = ${OE_QMAKE_PATH_ARCHDATA}
+HostLibraries = ${OE_QMAKE_PATH_LIBS}
+HostSpec = ${OE_QMAKE_PLATFORM}
+TargetSpec = ${OE_QMAKE_PLATFORM}
+ExternalHostBinaries = ${OE_QMAKE_PATH_BINS}
+Sysroot =
+EOF
+}
+
+do_generate_qt_config_file() {
+    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}
+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}
+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_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}
+EOF
+}
+#
+# Allows to override following values (as in version 5.0.1)
+# Prefix The default prefix for all paths.
+# Documentation The location for documentation upon install.
+# Headers The location for all headers.
+# Libraries The location of installed libraries.
+# LibraryExecutables The location of installed executables required by libraries at runtime.
+# Binaries The location of installed Qt binaries (tools and applications).
+# Plugins The location of installed Qt plugins.
+# Imports The location of installed QML extensions to import (QML 1.x).
+# Qml2Imports The location of installed QML extensions to import (QML 2.x).
+# ArchData The location of general architecture-dependent Qt data.
+# Data The location of general architecture-independent Qt data.
+# Translations The location of translation information for Qt strings.
+# Examples The location for examples upon install.
+# Tests The location of installed Qt testcases.
+# Settings The location for Qt settings. Not applicable on Windows.
+
+# For bootstrapped
+# Sysroot The location of target sysroot
+# HostPrefix The prefix for host tools when cross compiling (building tools for both systems)
+# HostBinaries The location where to install host tools
+# HostData The location where to install host data
+# ExternalHostBinaries The location where we already have host tools (when cross compiling, but reusing existing tools)
+# TargetSpec The location where to install target mkspec
+# HostSpec The location where to install host mkspec
+
+# qmake works fine with separate B, use it by default
+SEPB = "${WORKDIR}/build"
+B = "${SEPB}"
+
+CONFIGURESTAMPFILE = "${WORKDIR}/qmake5_base_configure.sstate"
+
+qmake5_base_preconfigure() {
+        if [ -n "${CONFIGURESTAMPFILE}" -a -e "${CONFIGURESTAMPFILE}" ]; then
+                if [ "`cat ${CONFIGURESTAMPFILE}`" != "${BB_TASKHASH}" -a "${S}" != "${B}" ]; then
+                        echo "Previously configured separate build directory detected, cleaning ${B}"
+                        rm -rf ${B}
+                        mkdir ${B}
+                fi
+        fi
+}
+
+qmake5_base_postconfigure(){
+        if [ -n "${CONFIGURESTAMPFILE}" ]; then
+                echo ${BB_TASKHASH} > ${CONFIGURESTAMPFILE}
+        fi
+}
+
+EXTRAQCONFFUNCS ??= ""
+
+do_configure[prefuncs] += "qmake5_base_preconfigure ${EXTRAQCONFFUNCS}"
+do_configure[postfuncs] += "qmake5_base_postconfigure"
+
+addtask generate_qt_config_file after do_patch before do_configure
+
+qmake5_base_do_configure () {
+    if [ -z "${QMAKE_PROFILES}" ]; then
+        PROFILES="`ls ${S}/*.pro`"
+    else
+        PROFILES="${QMAKE_PROFILES}"
+        bbnote "qmake using profiles: '${QMAKE_PROFILES}'"
+    fi
+
+    if [ ! -z "${EXTRA_QMAKEVARS_POST}" ]; then
+        AFTER="-after"
+        QMAKE_VARSUBST_POST="${EXTRA_QMAKEVARS_POST}"
+        bbnote "qmake postvar substitution: '${EXTRA_QMAKEVARS_POST}'"
+    fi
+
+    if [ ! -z "${EXTRA_QMAKEVARS_PRE}" ]; then
+        QMAKE_VARSUBST_PRE="${EXTRA_QMAKEVARS_PRE}"
+        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 -- $QMAKE_VARSUBST_CONFIGURE"
+    ${OE_QMAKE_QMAKE} -makefile -o Makefile ${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() {
+    oe_runmake install INSTALL_ROOT=${D}
+    find "${D}" -ignore_readdir_race -name "*.la" -delete
+    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
+}
+
+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
+    # 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}
+
+    # Replace host paths with qmake built-in properties
+    find ${D} \( -name *.pri -or -name *.prl \) -exec \
+        sed -i -e 's|${STAGING_DIR_NATIVE}|$$[QT_HOST_PREFIX/get]|g' \
+            -e 's|${STAGING_DIR_HOST}|$$[QT_SYSROOT]|g' {} \;
+
+    # Replace host paths with pkg-config built-in variable
+    find ${D} -name *.pc -exec \
+        sed -i -e 's|prefix=${STAGING_DIR_HOST}|prefix=|g' \
+            -e 's|${STAGING_DIR_HOST}|${pc_sysrootdir}|g' {} \;
+
+    # Replace resolved lib path with the lib name
+    find ${D} -name *.cmake -exec \
+        sed -i -e 's@/[^;]*/lib\([^;]*\)\.\(so\|a\)@\1@g' {} \;
+
+}
diff --git a/meta/classes/qmake5_paths.bbclass b/meta/classes/qmake5_paths.bbclass
new file mode 100644 (file)
index 0000000..ca7e4fc
--- /dev/null
@@ -0,0 +1,51 @@
+# If your distribution supports only qt5, or you don't care
+# about conflicts with qt4, then you can add qmake5_paths.bbclass
+# to your distro layer and flatten all QT_DIR_NAME directories
+
+QT_DIR_NAME ?= ""
+
+# This is useful for target recipes to reference native mkspecs
+QMAKE_MKSPEC_PATH_NATIVE = "${STAGING_LIBDIR_NATIVE}${QT_DIR_NAME}"
+QMAKE_MKSPEC_PATH_TARGET = "${STAGING_LIBDIR}${QT_DIR_NAME}"
+
+QMAKE_MKSPEC_PATH = "${QMAKE_MKSPEC_PATH_TARGET}"
+QMAKE_MKSPEC_PATH_class-native = "${QMAKE_MKSPEC_PATH_NATIVE}"
+QMAKE_MKSPEC_PATH_class-nativesdk = "${QMAKE_MKSPEC_PATH_NATIVE}"
+
+OE_QMAKE_PATH_PREFIX = "${prefix}"
+OE_QMAKE_PATH_HEADERS = "${includedir}${QT_DIR_NAME}"
+OE_QMAKE_PATH_LIBS = "${libdir}"
+OE_QMAKE_PATH_ARCHDATA = "${libdir}"
+OE_QMAKE_PATH_DATA = "${datadir}"
+OE_QMAKE_PATH_BINS = "${bindir}"
+OE_QMAKE_PATH_LIBEXECS = "${libdir}${QT_DIR_NAME}/libexec"
+OE_QMAKE_PATH_PLUGINS = "${libdir}${QT_DIR_NAME}/plugins"
+OE_QMAKE_PATH_QML = "${libdir}${QT_DIR_NAME}/qml"
+OE_QMAKE_PATH_TRANSLATIONS = "${datadir}/translations"
+OE_QMAKE_PATH_DOCS = "${docdir}"
+OE_QMAKE_PATH_SETTINGS = "${sysconfdir}"
+OE_QMAKE_PATH_EXAMPLES = "${datadir}/examples"
+OE_QMAKE_PATH_TESTS = "${datadir}/tests"
+OE_QMAKE_PATH_HOST_PREFIX = ""
+OE_QMAKE_PATH_HOST_PREFIX_class-target = "${STAGING_DIR_NATIVE}"
+OE_QMAKE_PATH_HOST_BINS = "${bindir}${QT_DIR_NAME}"
+OE_QMAKE_PATH_HOST_DATA = "${QMAKE_MKSPEC_PATH_TARGET}"
+OE_QMAKE_PATH_HOST_LIBS = "${STAGING_LIBDIR}"
+OE_QMAKE_PATH_EXTERNAL_HOST_BINS = "${STAGING_BINDIR_NATIVE}${QT_DIR_NAME}"
+
+# for qt5 components we're using QT_DIR_NAME subdirectory in more
+# variables, because we don't want conflicts with qt4
+# This block is usefull for components which install their
+# own files without QT_DIR_NAME but need to reference paths e.g. 
+# with QT headers
+OE_QMAKE_PATH_QT_HEADERS = "${includedir}${QT_DIR_NAME}"
+OE_QMAKE_PATH_QT_ARCHDATA = "${libdir}${QT_DIR_NAME}"
+OE_QMAKE_PATH_QT_DATA = "${datadir}${QT_DIR_NAME}"
+OE_QMAKE_PATH_QT_BINS = "${bindir}${QT_DIR_NAME}"
+OE_QMAKE_PATH_QT_TRANSLATIONS = "${datadir}${QT_DIR_NAME}/translations"
+OE_QMAKE_PATH_QT_DOCS = "${docdir}${QT_DIR_NAME}"
+OE_QMAKE_PATH_QT_SETTINGS = "${sysconfdir}${QT_DIR_NAME}"
+OE_QMAKE_PATH_QT_EXAMPLES = "${datadir}${QT_DIR_NAME}/examples"
+OE_QMAKE_PATH_QT_TESTS = "${datadir}${QT_DIR_NAME}/tests"
+
+OE_QMAKE_PATH_QT_FONTS = "${OE_QMAKE_PATH_LIBS}/fonts"
index c5313ccd19572277bbac0067f436be40e4e6a215..eb0bd1c415d3689615a0d07962220c6adf3e6f19 100644 (file)
@@ -907,3 +907,8 @@ MULTILIB_VARIANTS ??= ""
 # what it would be anyway if the signature generator (e.g. OEEquivHash) doesn't
 # support unihashes.
 BB_UNIHASH ?= "${BB_TASKHASH}"
+
+QT_GIT_PROJECT ?= "qt"
+QT_GIT ?= "git://code.qt.io/${QT_GIT_PROJECT}"
+QT_GIT_PROTOCOL ?= "git"
+QT_EDITION ?= "opensource"
diff --git a/meta/recipes-qt/qt5/qt5-git.inc b/meta/recipes-qt/qt5/qt5-git.inc
new file mode 100644 (file)
index 0000000..1866f3e
--- /dev/null
@@ -0,0 +1,17 @@
+# Copyright (C) 2012-2016 O.S. Systems Software LTDA.
+# Copyright (C) 2013-2019 Martin Jansa <martin.jansa@gmail.com>
+
+QT_MODULE ?= "${BPN}"
+QT_MODULE_BRANCH ?= "5.12"
+QT_MODULE_BRANCH_PARAM ?= "branch=${QT_MODULE_BRANCH}"
+
+# each module needs to define valid SRCREV
+SRC_URI = " \
+    ${QT_GIT}/${QT_MODULE}.git;name=${QT_MODULE};${QT_MODULE_BRANCH_PARAM};protocol=${QT_GIT_PROTOCOL} \
+"
+
+CVE_PRODUCT = "qt"
+
+S = "${WORKDIR}/git"
+
+PV = "5.12.3+git${SRCPV}"
diff --git a/meta/recipes-qt/qt5/qt5-native.inc b/meta/recipes-qt/qt5/qt5-native.inc
new file mode 100644 (file)
index 0000000..7681602
--- /dev/null
@@ -0,0 +1,12 @@
+inherit native qmake5_base
+
+# we don't want conflicts with qt4
+OE_QMAKE_PATH_HEADERS = "${OE_QMAKE_PATH_QT_HEADERS}"
+OE_QMAKE_PATH_ARCHDATA = "${OE_QMAKE_PATH_QT_ARCHDATA}"
+OE_QMAKE_PATH_DATA = "${OE_QMAKE_PATH_QT_DATA}"
+OE_QMAKE_PATH_BINS = "${OE_QMAKE_PATH_QT_BINS}"
+OE_QMAKE_PATH_TRANSLATIONS = "${OE_QMAKE_PATH_QT_TRANSLATIONS}"
+OE_QMAKE_PATH_DOCS = "${OE_QMAKE_PATH_QT_DOCS}"
+OE_QMAKE_PATH_SETTINGS = "${OE_QMAKE_PATH_QT_SETTINGS}"
+OE_QMAKE_PATH_EXAMPLES = "${OE_QMAKE_PATH_QT_EXAMPLES}"
+OE_QMAKE_PATH_TESTS = "${OE_QMAKE_PATH_QT_TESTS}"
diff --git a/meta/recipes-qt/qt5/qt5.inc b/meta/recipes-qt/qt5/qt5.inc
new file mode 100644 (file)
index 0000000..e0cd894
--- /dev/null
@@ -0,0 +1,161 @@
+# Copyright (C) 2012, 2014 O.S. Systems Software LTDA.
+# Copyright (C) 2013-2018 Martin Jansa <martin.jansa@gmail.com>
+
+inherit qmake5
+
+PACKAGECONFIG_OPENSSL ?= "openssl"
+
+PACKAGECONFIG[examples] = ""
+PACKAGECONFIG[tests] = ""
+PACKAGECONFIG[qtquickcompiler] = ",,qtdeclarative-native"
+EXTRA_QMAKEVARS_PRE += "${@bb.utils.contains('PACKAGECONFIG', 'examples', 'QT_BUILD_PARTS+=examples', '', d)}"
+EXTRA_QMAKEVARS_PRE += "${@bb.utils.contains('PACKAGECONFIG', 'tests', 'QT_BUILD_PARTS+=tests', '', d)}"
+EXTRA_QMAKEVARS_PRE += "${@bb.utils.contains('PACKAGECONFIG', 'qtquickcompiler', 'CONFIG+=qtquickcompiler', '', d)}"
+
+# we don't want conflicts with qt4
+OE_QMAKE_PATH_HEADERS = "${OE_QMAKE_PATH_QT_HEADERS}"
+OE_QMAKE_PATH_ARCHDATA = "${OE_QMAKE_PATH_QT_ARCHDATA}"
+OE_QMAKE_PATH_DATA = "${OE_QMAKE_PATH_QT_DATA}"
+OE_QMAKE_PATH_BINS = "${OE_QMAKE_PATH_QT_BINS}"
+OE_QMAKE_PATH_TRANSLATIONS = "${OE_QMAKE_PATH_QT_TRANSLATIONS}"
+OE_QMAKE_PATH_DOCS = "${OE_QMAKE_PATH_QT_DOCS}"
+OE_QMAKE_PATH_SETTINGS = "${OE_QMAKE_PATH_QT_SETTINGS}"
+OE_QMAKE_PATH_EXAMPLES = "${OE_QMAKE_PATH_QT_EXAMPLES}"
+OE_QMAKE_PATH_TESTS = "${OE_QMAKE_PATH_QT_TESTS}"
+
+OE_QMAKE_RECURSIVE = ""
+
+# If Qt5 (qtbase) is machine specific, then everything will be,
+# because the (initial) qtbase configuration becomes part of Qt5/qmake
+python __anonymous() {
+    barch = d.getVar("BUILD_ARCH", True) or ''
+    tarch = d.getVar("TARGET_ARCH", True) or ''
+    # do not do anything if we are building a native package
+    if barch != tarch:
+        tarch = d.getVar("QT_PACKAGES_ARCH", True) or ''
+        if tarch:
+            d.setVar("PACKAGE_ARCH", tarch)
+}
+
+# if building static Qt5, add qtdeclarative-native dependency to all recipes
+# that depend on qtdeclarative as it's required for qmlimportscannertool
+python __anonymous() {
+    if bb.utils.contains('DISTRO_FEATURES', "qt5-static", True, False, d):
+        if bb.utils.contains('DEPENDS', "qtdeclarative", True, False, d):
+            d.appendVar("DEPENDS", " qtdeclarative-native")
+}
+
+# Many examples come with libraries installed outside of standard libdir,
+# suppress QA check complaining
+INSANE_SKIP_${PN}-dbg += "libdir"
+INSANE_SKIP_${PN}-examples += "libdir staticdev dev-so"
+
+PACKAGES =. "${PN}-qmldesigner ${PN}-qmlplugins ${PN}-tools ${PN}-plugins ${PN}-mkspecs ${PN}-examples "
+
+ALLOW_EMPTY_${PN} = "1"
+ALLOW_EMPTY_${PN}-plugins = "1"
+ALLOW_EMPTY_${PN}-qmlplugins = "1"
+
+RRECOMMENDS_${PN} = " \
+    ${PN}-plugins \
+    ${PN}-qmlplugins \
+    "
+RRECOMMENDS_${PN}_class-native = ""
+
+RRECOMMENDS_${PN}-dev = " \
+    ${PN} \
+    ${PN}-mkspecs \
+    ${PN}-qmldesigner \
+    "
+
+# extra packages
+FILES_${PN}-qmldesigner += " \
+    ${OE_QMAKE_PATH_QML}/*/designer \
+    ${OE_QMAKE_PATH_QML}/*/*/designer \
+    ${OE_QMAKE_PATH_QML}/*/*/*/designer \
+"
+
+# qmlplugins 1-4 levels of subdirs qmldir + *{.so,*.qmltypes,*.qml,*.qmlc,*.js,*.jsc}
+FILES_${PN}-qmlplugins = " \
+    ${OE_QMAKE_PATH_QML}/*.qmltypes \
+    ${OE_QMAKE_PATH_QML}/*/*${SOLIBSDEV} \
+    ${OE_QMAKE_PATH_QML}/*/qmldir \
+    ${OE_QMAKE_PATH_QML}/*/*.qmltypes \
+    ${OE_QMAKE_PATH_QML}/*/*.qml \
+    ${OE_QMAKE_PATH_QML}/*/*.qmlc \
+    ${OE_QMAKE_PATH_QML}/*/*.js \
+    ${OE_QMAKE_PATH_QML}/*/*.jsc \
+    ${OE_QMAKE_PATH_QML}/*/*.png \
+    ${OE_QMAKE_PATH_QML}/*/*/*${SOLIBSDEV} \
+    ${OE_QMAKE_PATH_QML}/*/*/qmldir \
+    ${OE_QMAKE_PATH_QML}/*/*/*.qmltypes \
+    ${OE_QMAKE_PATH_QML}/*/*/*.qml \
+    ${OE_QMAKE_PATH_QML}/*/*/*.qmlc \
+    ${OE_QMAKE_PATH_QML}/*/*/*.js \
+    ${OE_QMAKE_PATH_QML}/*/*/*.jsc \
+    ${OE_QMAKE_PATH_QML}/*/*/*.png \
+    ${OE_QMAKE_PATH_QML}/*/*/*/*${SOLIBSDEV} \
+    ${OE_QMAKE_PATH_QML}/*/*/*/qmldir \
+    ${OE_QMAKE_PATH_QML}/*/*/*/images \
+    ${OE_QMAKE_PATH_QML}/*/*/*/*.qmltypes \
+    ${OE_QMAKE_PATH_QML}/*/*/*/*.qml \
+    ${OE_QMAKE_PATH_QML}/*/*/*/*.qmlc \
+    ${OE_QMAKE_PATH_QML}/*/*/*/*.js \
+    ${OE_QMAKE_PATH_QML}/*/*/*/*.jsc \
+    ${OE_QMAKE_PATH_QML}/*/*/*/*.png \
+    ${OE_QMAKE_PATH_QML}/*/*/*/*.metainfo \
+    ${OE_QMAKE_PATH_QML}/*/*/*/*/*${SOLIBSDEV} \
+    ${OE_QMAKE_PATH_QML}/*/*/*/*/qmldir \
+    ${OE_QMAKE_PATH_QML}/*/*/*/*/*.qmltypes \
+    ${OE_QMAKE_PATH_QML}/*/*/*/*/*.qml \
+    ${OE_QMAKE_PATH_QML}/*/*/*/*/*.qmlc \
+    ${OE_QMAKE_PATH_QML}/*/*/*/*/*.js \
+    ${OE_QMAKE_PATH_QML}/*/*/*/*/*.jsc \
+    ${OE_QMAKE_PATH_QML}/*/*/*/*/*/*.png \
+"
+
+FILES_${PN}-tools = " \
+    ${OE_QMAKE_PATH_BINS}/* \
+"
+FILES_${PN}-plugins = " \
+    ${OE_QMAKE_PATH_PLUGINS}/*/*${SOLIBSDEV} \
+    ${OE_QMAKE_PATH_PLUGINS}/*/*/*${SOLIBSDEV} \
+    ${OE_QMAKE_PATH_PLUGINS}/*/*/*/*${SOLIBSDEV} \
+"
+FILES_${PN}-mkspecs = "\
+    ${OE_QMAKE_PATH_ARCHDATA}/mkspecs \
+"
+
+# modifications to normal packages
+FILES_${PN} += " \
+    ${OE_QMAKE_PATH_LIBS}/lib*${SOLIBS} \
+    ${OE_QMAKE_PATH_LIBEXECS} \
+"
+FILES_${PN}-dev += " \
+    ${OE_QMAKE_PATH_LIBS}/lib*${SOLIBSDEV} \
+    ${OE_QMAKE_PATH_LIBS}/pkgconfig \
+    ${OE_QMAKE_PATH_LIBS}/cmake/* \
+    ${OE_QMAKE_PATH_LIBS}/*.prl \
+    ${OE_QMAKE_PATH_LIBS}/*.la \
+    ${OE_QMAKE_PATH_HEADERS}/* \
+"
+FILES_${PN}-staticdev += " \
+    ${OE_QMAKE_PATH_LIBS}/*.a \
+    ${OE_QMAKE_PATH_PLUGINS}/*/*.a \
+    ${OE_QMAKE_PATH_PLUGINS}/*/*.prl \
+    ${OE_QMAKE_PATH_PLUGINS}/*/*/*.a \
+    ${OE_QMAKE_PATH_PLUGINS}/*/*/*.prl \
+    ${OE_QMAKE_PATH_QML}/*/*.a \
+    ${OE_QMAKE_PATH_QML}/*/*.prl \
+    ${OE_QMAKE_PATH_QML}/*/*/*.a \
+    ${OE_QMAKE_PATH_QML}/*/*/*.prl \
+    ${OE_QMAKE_PATH_QML}/*/*/*/*.a \
+    ${OE_QMAKE_PATH_QML}/*/*/*/*.prl \
+    ${OE_QMAKE_PATH_QML}/*/*/*/*/*.a \
+    ${OE_QMAKE_PATH_QML}/*/*/*/*/*.prl \
+"
+FILES_${PN}-examples = " \
+    ${OE_QMAKE_PATH_EXAMPLES} \
+"
+
+PATH_prepend = "${STAGING_DIR_NATIVE}${OE_QMAKE_PATH_QT_BINS}:"
diff --git a/meta/recipes-qt/qt5/qtbase-native_git.bb b/meta/recipes-qt/qt5/qtbase-native_git.bb
new file mode 100644 (file)
index 0000000..91ed480
--- /dev/null
@@ -0,0 +1,144 @@
+DESCRIPTION = "Native version of Qt/[X11|Mac|Embedded]"
+DEPENDS = "zlib-native dbus-native"
+SECTION = "libs"
+HOMEPAGE = "http://qt-project.org"
+
+LICENSE = "GFDL-1.3 & BSD & ( GPL-3.0 & The-Qt-Company-GPL-Exception-1.0 | The-Qt-Company-Commercial ) & ( GPL-2.0+ | LGPL-3.0 | The-Qt-Company-Commercial )"
+LIC_FILES_CHKSUM = " \
+    file://LICENSE.LGPL3;md5=e6a600fd5e1d9cbde2d983680233ad02 \
+    file://LICENSE.GPL2;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
+    file://LICENSE.GPL3;md5=d32239bcb673463ab874e80d47fae504 \
+    file://LICENSE.GPL3-EXCEPT;md5=763d8c535a234d9a3fb682c7ecb6c073 \
+    file://LICENSE.FDL;md5=6d9f2a9af4c8b8c3c769f6cc1b6aaf7e \
+    file://LICENSE.QT-LICENSE-AGREEMENT-4.0;md5=948f8877345cd66106f11031977a4625 \
+"
+
+require qt5-native.inc
+require qt5-git.inc
+
+# common for qtbase-native, qtbase-nativesdk and qtbase
+# Patches from https://github.com/meta-qt5/qtbase/commits/b5.12-shared
+# 5.12.meta-qt5-shared.7
+SRC_URI += "\
+    file://0001-Add-linux-oe-g-platform.patch \
+    file://0002-cmake-Use-OE_QMAKE_PATH_EXTERNAL_HOST_BINS.patch \
+    file://0003-qlibraryinfo-allow-to-set-qt.conf-from-the-outside-u.patch \
+    file://0004-configure-bump-path-length-from-256-to-512-character.patch \
+    file://0005-Disable-all-unknown-features-instead-of-erroring-out.patch \
+    file://0006-Pretend-Qt5-wasn-t-found-if-OE_QMAKE_PATH_EXTERNAL_H.patch \
+    file://0007-Delete-qlonglong-and-qulonglong.patch \
+    file://0008-Replace-pthread_yield-with-sched_yield.patch \
+    file://0009-Add-OE-specific-specs-for-clang-compiler.patch \
+    file://0010-linux-clang-Invert-conditional-for-defining-QT_SOCKL.patch \
+    file://0011-tst_qlocale-Enable-QT_USE_FENV-only-on-glibc.patch \
+    file://0012-mkspecs-common-gcc-base.conf-Use-I-instead-of-isyste.patch \
+    file://0013-Disable-ltcg-for-host_build.patch \
+    file://0014-Qt5GuiConfigExtras.cmake.in-cope-with-variable-path-.patch \
+    file://0015-corelib-Include-sys-types.h-for-uint32_t.patch \
+    file://0016-Define-QMAKE_CXX.COMPILER_MACROS-for-clang-on-linux.patch \
+"
+
+# common for qtbase-native and nativesdk-qtbase
+# Patches from https://github.com/meta-qt5/qtbase/commits/b5.12-native
+# 5.12.meta-qt5-native.7
+SRC_URI += " \
+    file://0017-Always-build-uic-and-qvkgen.patch \
+    file://0018-Avoid-renameeat2-for-native-sdk-builds.patch \
+"
+
+# only for qtbase-native
+SRC_URI += " \
+    file://0019-Bootstrap-without-linkat-feature.patch \
+"
+
+CLEANBROKEN = "1"
+
+XPLATFORM_toolchain-clang = "linux-oe-clang"
+XPLATFORM ?= "linux-oe-g++"
+
+QT_CONFIG_FLAGS = " \
+    -sysroot ${STAGING_DIR_NATIVE} \
+    -L${STAGING_LIBDIR_NATIVE} \
+    -no-gcc-sysroot \
+    -system-zlib \
+    -qt-pcre \
+    -no-libjpeg \
+    -no-libpng \
+    -no-gif \
+    -no-accessibility \
+    -no-cups \
+    -no-gui \
+    -no-sql-mysql \
+    -no-sql-sqlite \
+    -no-sql-psql \
+    -no-opengl \
+    -no-openssl \
+    -no-xcb \
+    -no-icu \
+    -verbose \
+    -release \
+    -prefix ${OE_QMAKE_PATH_PREFIX} \
+    -hostprefix ${OE_QMAKE_PATH_PREFIX} \
+    -bindir ${OE_QMAKE_PATH_BINS} \
+    -hostbindir ${OE_QMAKE_PATH_BINS} \
+    -libdir ${OE_QMAKE_PATH_LIBS} \
+    -hostlibdir ${OE_QMAKE_PATH_LIBS} \
+    -headerdir ${OE_QMAKE_PATH_HEADERS} \
+    -archdatadir ${OE_QMAKE_PATH_ARCHDATA} \
+    -datadir ${OE_QMAKE_PATH_DATA} \
+    -hostdatadir ${QMAKE_MKSPEC_PATH_NATIVE} \
+    -docdir ${OE_QMAKE_PATH_DOCS} \
+    -sysconfdir ${OE_QMAKE_PATH_SETTINGS} \
+    -no-glib \
+    -no-iconv \
+    -silent \
+    -nomake examples \
+    -nomake tests \
+    -no-rpath \
+    -no-feature-linkat \
+    -platform ${XPLATFORM} \
+    ${PACKAGECONFIG_CONFARGS} \
+"
+
+# for qtbase configuration we need default settings
+# since we cannot set empty set filename to a not existent file
+deltask generate_qt_config_file
+
+do_configure_prepend() {
+    # Regenerate header files when they are included in source tarball
+    # Otherwise cmake files don't set PRIVATE_HEADERS correctly
+    rm -rf ${S}/include
+    mkdir -p ${S}/.git || true
+
+    # Avoid qmake error "Cannot read [...]/usr/lib/qt5/mkspecs/oe-device-extra.pri: No such file or directory"
+    touch ${S}/mkspecs/oe-device-extra.pri
+
+    MAKEFLAGS="${PARALLEL_MAKE}" ${S}/configure -${QT_EDITION} -confirm-license ${QT_CONFIG_FLAGS} || die "Configuring qt failed. QT_CONFIG_FLAGS was ${QT_CONFIG_FLAGS}"
+}
+
+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}
+
+    if [ -d ${D}${STAGING_DIR_NATIVE}${STAGING_DIR_NATIVE} ] ; then
+        echo "Some files are installed in wrong directory ${D}${STAGING_DIR_NATIVE}"
+        cp -ra ${D}${STAGING_DIR_NATIVE}${STAGING_DIR_NATIVE}/* ${D}${STAGING_DIR_NATIVE}
+        rm -rf ${D}${STAGING_DIR_NATIVE}${STAGING_DIR_NATIVE}
+        # remove empty dirs
+        TMP=`dirname ${D}/${STAGING_DIR_NATIVE}${STAGING_DIR_NATIVE}`
+        while test ${TMP} != ${D}${STAGING_DIR_NATIVE}; do
+            rmdir ${TMP}
+            TMP=`dirname ${TMP}`;
+        done
+    fi
+
+    install -m 755 ${B}/bin/qfloat16-tables ${D}${OE_QMAKE_PATH_BINS}
+
+    # since 5.9.2 something sets a very strange path to mkspec ("${_qt5Core_install_prefix}/../../../../../../../../../../usr/lib/qt5//mkspecs/linux-oe-g++")
+    # override this until somebody finds a better way
+    echo 'set(_qt5_corelib_extra_includes "${_qt5Core_install_prefix}/lib${QT_DIR_NAME}/mkspecs/linux-oe-g++")' > ${D}${libdir}/cmake/Qt5Core/Qt5CoreConfigExtrasMkspecDir.cmake
+}
+
+SRCREV = "b527725766df850fcad6b9078fea5e8da8085560"
diff --git a/meta/recipes-qt/qt5/qtbase/0001-Add-linux-oe-g-platform.patch b/meta/recipes-qt/qt5/qtbase/0001-Add-linux-oe-g-platform.patch
new file mode 100644 (file)
index 0000000..4d90c77
--- /dev/null
@@ -0,0 +1,155 @@
+From 406ea336ac2a1bc7dac055c378303f27b8a20c2d Mon Sep 17 00:00:00 2001
+From: Martin Jansa <Martin.Jansa@gmail.com>
+Date: Mon, 15 Apr 2013 04:29:32 +0200
+Subject: [PATCH] Add linux-oe-g++ platform
+
+* This qmake.conf unlike other platforms reads most variables from
+  shell environment, because it's easier for qt recipes to export
+  *FLAGS or CC specific for given recipe
+
+* configure: extend setBootstrapVariable to convert $$(...) operator
+  to $(...) operator to work in qmake's Makefiles
+
+* configure.prf: Allow to add extra arguments to make
+  sometimes we would like to add -e or define some variable and respect it from both
+  Makefiles used in configure tests and also Makefiles to build the application
+
+Upstream-Status: Inappropriate [embedded specific]
+                 too OE specific, probably cannot be upstreamed
+
+Change-Id: I0591ed5da0d61d7cf1509d420e6b293582f1863c
+Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
+---
+ configure                            |  2 +-
+ mkspecs/features/configure.prf       |  4 +--
+ mkspecs/features/qt.prf              |  6 ++---
+ mkspecs/features/qt_functions.prf    |  2 +-
+ mkspecs/linux-oe-g++/qmake.conf      | 39 ++++++++++++++++++++++++++++
+ mkspecs/linux-oe-g++/qplatformdefs.h |  1 +
+ 6 files changed, 47 insertions(+), 7 deletions(-)
+ create mode 100644 mkspecs/linux-oe-g++/qmake.conf
+ create mode 100644 mkspecs/linux-oe-g++/qplatformdefs.h
+
+diff --git a/configure b/configure
+index ef7bad1bfc..dcca0f9135 100755
+--- a/configure
++++ b/configure
+@@ -712,7 +712,7 @@ fi
+ # is where the resulting variable is written to
+ setBootstrapVariable()
+ {
+-    getQMakeConf "$1" | echo ${2-$1} = `if [ -n "$3" ]; then sed "$3"; else cat; fi` >> "$mkfile"
++    getQMakeConf "$1" | sed 's:\$\$(:\$(:' | echo ${2-$1} = `if [ -n "$3" ]; then sed "$3"; else cat; fi` >> "$mkfile"
+ }
+ # build qmake
+diff --git a/mkspecs/features/configure.prf b/mkspecs/features/configure.prf
+index 934a18a924..0f5b1b6333 100644
+--- a/mkspecs/features/configure.prf
++++ b/mkspecs/features/configure.prf
+@@ -46,14 +46,14 @@ defineTest(qtCompileTest) {
+     }
+     # Clean up after previous run
+-    exists($$test_out_dir/Makefile):qtRunLoggedCommand("$$test_cmd_base $$QMAKE_MAKE distclean")
++    exists($$test_out_dir/Makefile):qtRunLoggedCommand("$$test_cmd_base $$QMAKE_MAKE $$(QMAKE_MAKE_ARGS) distclean")
+     mkpath($$test_out_dir)|error()
+     !isEmpty (QMAKE_QTCONF): qtconfarg = -qtconf $$QMAKE_QTCONF
+     qtRunLoggedCommand("$$test_cmd_base $$system_quote($$system_path($$QMAKE_QMAKE)) $$qtconfarg -spec $$QMAKESPEC $$qmake_configs $$shell_quote($$test_dir)") {
+-        qtRunLoggedCommand("$$test_cmd_base $$QMAKE_MAKE") {
++        qtRunLoggedCommand("$$test_cmd_base $$QMAKE_MAKE $$(QMAKE_MAKE_ARGS)") {
+             log("yes$$escape_expand(\\n)")
+             msg = "test $$1 succeeded"
+             write_file($$QMAKE_CONFIG_LOG, msg, append)
+diff --git a/mkspecs/features/qt.prf b/mkspecs/features/qt.prf
+index d8d5acaafd..57d11420c2 100644
+--- a/mkspecs/features/qt.prf
++++ b/mkspecs/features/qt.prf
+@@ -147,7 +147,7 @@ import_plugins:qtConfig(static) {
+         !isEmpty(plug_type) {
+             plug_path = $$eval(QT_PLUGIN.$${plug}.PATH)
+             isEmpty(plug_path): \
+-                plug_path = $$[QT_INSTALL_PLUGINS/get]
++                plug_path = $$[QT_INSTALL_PLUGINS]
+             LIBS += -L$$plug_path/$$plug_type
+         }
+         LIBS += -l$${plug}$$qtPlatformTargetSuffix()
+@@ -277,8 +277,8 @@ for(ever) {
+ # static builds: link qml import plugins into the target.
+ contains(all_qt_module_deps, qml): \
+         qtConfig(static):import_plugins:!host_build:!no_import_scan {
+-    exists($$[QT_INSTALL_QML/get]): \
+-        QMLPATHS *= $$[QT_INSTALL_QML/get]
++    exists($$[QT_INSTALL_QML]): \
++        QMLPATHS *= $$[QT_INSTALL_QML]
+     # run qmlimportscanner
+     qtPrepareTool(QMLIMPORTSCANNER, qmlimportscanner, , system)
+diff --git a/mkspecs/features/qt_functions.prf b/mkspecs/features/qt_functions.prf
+index 1903e509c8..c093dd4592 100644
+--- a/mkspecs/features/qt_functions.prf
++++ b/mkspecs/features/qt_functions.prf
+@@ -69,7 +69,7 @@ defineTest(qtHaveModule) {
+ defineTest(qtPrepareTool) {
+     cmd = $$eval(QT_TOOL.$${2}.binary)
+     isEmpty(cmd) {
+-        cmd = $$[QT_HOST_BINS]/$$2
++        cmd = $$[QT_HOST_BINS/get]/$$2
+         exists($${cmd}.pl) {
+             $${1}_EXE = $${cmd}.pl
+             cmd = perl -w $$system_path($${cmd}.pl)
+diff --git a/mkspecs/linux-oe-g++/qmake.conf b/mkspecs/linux-oe-g++/qmake.conf
+new file mode 100644
+index 0000000000..c202c47fa1
+--- /dev/null
++++ b/mkspecs/linux-oe-g++/qmake.conf
+@@ -0,0 +1,39 @@
++#
++# qmake configuration for linux-g++ with modifications for building with OpenEmbedded
++#
++
++MAKEFILE_GENERATOR = UNIX
++CONFIG += incremental
++QMAKE_INCREMENTAL_STYLE = sublib
++
++include(../common/linux.conf)
++
++# QMAKE_<TOOL> (moc, uic, rcc) are gone, overwrite only ar and strip
++QMAKE_AR              = $$(OE_QMAKE_AR) cqs
++QMAKE_STRIP           = $$(OE_QMAKE_STRIP)
++
++include(../common/gcc-base-unix.conf)
++
++# *FLAGS from gcc-base.conf
++QMAKE_CFLAGS                += $$(OE_QMAKE_CFLAGS)
++QMAKE_CXXFLAGS              += $$(OE_QMAKE_CXXFLAGS)
++QMAKE_LFLAGS                += $$(OE_QMAKE_LDFLAGS)
++
++include(../common/g++-unix.conf)
++
++# tc settings from g++-base.conf
++QMAKE_CC       = $$(OE_QMAKE_CC)
++QMAKE_CXX      = $$(OE_QMAKE_CXX)
++
++QMAKE_LINK         = $$(OE_QMAKE_LINK)
++QMAKE_LINK_SHLIB   = $$(OE_QMAKE_LINK)
++QMAKE_LINK_C       = $$(OE_QMAKE_LINK)
++QMAKE_LINK_C_SHLIB = $$(OE_QMAKE_LINK)
++QMAKE_CFLAGS_ISYSTEM =
++# for the SDK
++isEmpty(QMAKE_QT_CONFIG):QMAKE_QT_CONFIG = $$(OE_QMAKE_QT_CONFIG)
++
++include(../oe-device-extra.pri)
++
++load(device_config)
++load(qt_config)
+diff --git a/mkspecs/linux-oe-g++/qplatformdefs.h b/mkspecs/linux-oe-g++/qplatformdefs.h
+new file mode 100644
+index 0000000000..5d22fb4101
+--- /dev/null
++++ b/mkspecs/linux-oe-g++/qplatformdefs.h
+@@ -0,0 +1 @@
++#include "../linux-g++/qplatformdefs.h"
diff --git a/meta/recipes-qt/qt5/qtbase/0002-cmake-Use-OE_QMAKE_PATH_EXTERNAL_HOST_BINS.patch b/meta/recipes-qt/qt5/qtbase/0002-cmake-Use-OE_QMAKE_PATH_EXTERNAL_HOST_BINS.patch
new file mode 100644 (file)
index 0000000..c46d296
--- /dev/null
@@ -0,0 +1,86 @@
+From 643818dd46f6c0bfabdf09608dd12844c65a06c7 Mon Sep 17 00:00:00 2001
+From: Martin Jansa <Martin.Jansa@gmail.com>
+Date: Sat, 6 Apr 2013 13:15:07 +0200
+Subject: [PATCH] cmake: Use OE_QMAKE_PATH_EXTERNAL_HOST_BINS
+
+... to determine path to host binaries
+
+Upstream-Status: Inappropriate [OE specific]
+
+Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
+Signed-off-by: Simon Busch <morphis@gravedo.de>
+Signed-off-by: Jonathan Liu <net147@gmail.com>
+
+Change-Id: Iacaa1c5531cd6dcc094891610c351673db55d7b2
+---
+ src/corelib/Qt5CoreConfigExtras.cmake.in    | 6 +++---
+ src/dbus/Qt5DBusConfigExtras.cmake.in       | 4 ++--
+ src/widgets/Qt5WidgetsConfigExtras.cmake.in | 2 +-
+ 3 files changed, 6 insertions(+), 6 deletions(-)
+
+diff --git a/src/corelib/Qt5CoreConfigExtras.cmake.in b/src/corelib/Qt5CoreConfigExtras.cmake.in
+index e0652fdcf9..7b8fed8931 100644
+--- a/src/corelib/Qt5CoreConfigExtras.cmake.in
++++ b/src/corelib/Qt5CoreConfigExtras.cmake.in
+@@ -5,7 +5,7 @@ if (NOT TARGET Qt5::qmake)
+ !!IF isEmpty(CMAKE_BIN_DIR_IS_ABSOLUTE)
+     set(imported_location \"${_qt5Core_install_prefix}/$${CMAKE_BIN_DIR}qmake$$CMAKE_BIN_SUFFIX\")
+ !!ELSE
+-    set(imported_location \"$${CMAKE_BIN_DIR}qmake$$CMAKE_BIN_SUFFIX\")
++    set(imported_location \"${OE_QMAKE_PATH_EXTERNAL_HOST_BINS}/qmake${OE_QMAKE_BIN_SUFFIX}\")
+ !!ENDIF
+     _qt5_Core_check_file_exists(${imported_location})
+@@ -20,7 +20,7 @@ if (NOT TARGET Qt5::moc)
+ !!IF isEmpty(CMAKE_BIN_DIR_IS_ABSOLUTE)
+     set(imported_location \"${_qt5Core_install_prefix}/$${CMAKE_BIN_DIR}moc$$CMAKE_BIN_SUFFIX\")
+ !!ELSE
+-    set(imported_location \"$${CMAKE_BIN_DIR}moc$$CMAKE_BIN_SUFFIX\")
++    set(imported_location \"${OE_QMAKE_PATH_EXTERNAL_HOST_BINS}/moc${OE_QMAKE_BIN_SUFFIX}\")
+ !!ENDIF
+     _qt5_Core_check_file_exists(${imported_location})
+@@ -37,7 +37,7 @@ if (NOT TARGET Qt5::rcc)
+ !!IF isEmpty(CMAKE_BIN_DIR_IS_ABSOLUTE)
+     set(imported_location \"${_qt5Core_install_prefix}/$${CMAKE_BIN_DIR}rcc$$CMAKE_BIN_SUFFIX\")
+ !!ELSE
+-    set(imported_location \"$${CMAKE_BIN_DIR}rcc$$CMAKE_BIN_SUFFIX\")
++    set(imported_location \"${OE_QMAKE_PATH_EXTERNAL_HOST_BINS}/rcc${OE_QMAKE_BIN_SUFFIX}\")
+ !!ENDIF
+     _qt5_Core_check_file_exists(${imported_location})
+diff --git a/src/dbus/Qt5DBusConfigExtras.cmake.in b/src/dbus/Qt5DBusConfigExtras.cmake.in
+index 1d947159e2..582c52169e 100644
+--- a/src/dbus/Qt5DBusConfigExtras.cmake.in
++++ b/src/dbus/Qt5DBusConfigExtras.cmake.in
+@@ -5,7 +5,7 @@ if (NOT TARGET Qt5::qdbuscpp2xml)
+ !!IF isEmpty(CMAKE_BIN_DIR_IS_ABSOLUTE)
+     set(imported_location \"${_qt5DBus_install_prefix}/$${CMAKE_BIN_DIR}qdbuscpp2xml$$CMAKE_BIN_SUFFIX\")
+ !!ELSE
+-    set(imported_location \"$${CMAKE_BIN_DIR}qdbuscpp2xml$$CMAKE_BIN_SUFFIX\")
++    set(imported_location \"${OE_QMAKE_PATH_EXTERNAL_HOST_BINS}/qdbuscpp2xml${OE_QMAKE_BIN_SUFFIX}\")
+ !!ENDIF
+     _qt5_DBus_check_file_exists(${imported_location})
+@@ -20,7 +20,7 @@ if (NOT TARGET Qt5::qdbusxml2cpp)
+ !!IF isEmpty(CMAKE_BIN_DIR_IS_ABSOLUTE)
+     set(imported_location \"${_qt5DBus_install_prefix}/$${CMAKE_BIN_DIR}qdbusxml2cpp$$CMAKE_BIN_SUFFIX\")
+ !!ELSE
+-    set(imported_location \"$${CMAKE_BIN_DIR}qdbusxml2cpp$$CMAKE_BIN_SUFFIX\")
++    set(imported_location \"${OE_QMAKE_PATH_EXTERNAL_HOST_BINS}/qdbusxml2cpp${OE_QMAKE_BIN_SUFFIX}\")
+ !!ENDIF
+     _qt5_DBus_check_file_exists(${imported_location})
+diff --git a/src/widgets/Qt5WidgetsConfigExtras.cmake.in b/src/widgets/Qt5WidgetsConfigExtras.cmake.in
+index 99d87e2e46..8fe9b3c0b5 100644
+--- a/src/widgets/Qt5WidgetsConfigExtras.cmake.in
++++ b/src/widgets/Qt5WidgetsConfigExtras.cmake.in
+@@ -5,7 +5,7 @@ if (NOT TARGET Qt5::uic)
+ !!IF isEmpty(CMAKE_BIN_DIR_IS_ABSOLUTE)
+     set(imported_location \"${_qt5Widgets_install_prefix}/$${CMAKE_BIN_DIR}uic$$CMAKE_BIN_SUFFIX\")
+ !!ELSE
+-    set(imported_location \"$${CMAKE_BIN_DIR}uic$$CMAKE_BIN_SUFFIX\")
++    set(imported_location \"${OE_QMAKE_PATH_EXTERNAL_HOST_BINS}/uic${OE_QMAKE_BIN_SUFFIX}\")
+ !!ENDIF
+     _qt5_Widgets_check_file_exists(${imported_location})
diff --git a/meta/recipes-qt/qt5/qtbase/0003-qlibraryinfo-allow-to-set-qt.conf-from-the-outside-u.patch b/meta/recipes-qt/qt5/qtbase/0003-qlibraryinfo-allow-to-set-qt.conf-from-the-outside-u.patch
new file mode 100644 (file)
index 0000000..d7db54d
--- /dev/null
@@ -0,0 +1,37 @@
+From df4410ccc0977b089efddd7d0d405e4abee2aab8 Mon Sep 17 00:00:00 2001
+From: Holger Freyther <zecke@selfish.org>
+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: Inappropriate [embedded specific]
+  again very OE specific to read everything from environment (reusing the same
+  qmake from sstate and replacing all configured paths in it with qt.conf from
+  environment).
+
+Change-Id: I41595c6ce7514e8f197d0a19a1308c9460037d1b
+Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
+---
+ src/corelib/global/qlibraryinfo.cpp | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/src/corelib/global/qlibraryinfo.cpp b/src/corelib/global/qlibraryinfo.cpp
+index 4119012d85..6395d10561 100644
+--- a/src/corelib/global/qlibraryinfo.cpp
++++ b/src/corelib/global/qlibraryinfo.cpp
+@@ -174,7 +174,10 @@ void QLibrarySettings::load()
+ QSettings *QLibraryInfoPrivate::findConfiguration()
+ {
+ #ifdef QT_BUILD_QMAKE
+-    QString qtconfig = qmake_libraryInfoFile();
++    QByteArray config = getenv("OE_QMAKE_QTCONF_PATH");
++    QString qtconfig = QFile::decodeName(config);
++    if(qtconfig.isEmpty() || !QFile::exists(qtconfig))
++        qtconfig = qmake_libraryInfoFile();
+     if (QFile::exists(qtconfig))
+         return new QSettings(qtconfig, QSettings::IniFormat);
+ #else
diff --git a/meta/recipes-qt/qt5/qtbase/0004-configure-bump-path-length-from-256-to-512-character.patch b/meta/recipes-qt/qt5/qtbase/0004-configure-bump-path-length-from-256-to-512-character.patch
new file mode 100644 (file)
index 0000000..420a1e3
--- /dev/null
@@ -0,0 +1,34 @@
+From 7f912753d733d218eb87fd3b3d1d3d39e336f566 Mon Sep 17 00:00:00 2001
+From: Denys Dmytriyenko <denys@ti.com>
+Date: Tue, 25 Aug 2015 10:05:15 -0400
+Subject: [PATCH] configure: bump path length from 256 to 512 characters
+
+Increase the path length that gets hardcoded into generated config.cpp file
+from 256 to 512 characters, as nativesdk path can be quite long.
+
+Also update length of EXT_PREFIX and HOST_PREFIX now.
+
+Change-Id: If98dd57160efe9c98c36148cdf872f50b3d38118
+Signed-off-by: Denys Dmytriyenko <denys@ti.com>
+---
+ configure.pri | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/configure.pri b/configure.pri
+index 131aa868c2..294dfd6fd2 100644
+--- a/configure.pri
++++ b/configure.pri
+@@ -843,10 +843,10 @@ defineTest(qtConfOutput_preparePaths) {
+         "static const char qt_configure_installation     [12+11]  = \"qt_instdate=2012-12-20\";" \
+         "" \
+         "/* Installation Info */" \
+-        "static const char qt_configure_prefix_path_str  [12+256] = \"qt_prfxpath=$$config.input.prefix\";" \
++        "static const char qt_configure_prefix_path_str  [12+512] = \"qt_prfxpath=$$config.input.prefix\";" \
+         "$${LITERAL_HASH}ifdef QT_BUILD_QMAKE" \
+-        "static const char qt_configure_ext_prefix_path_str   [12+256] = \"qt_epfxpath=$$config.input.extprefix\";" \
+-        "static const char qt_configure_host_prefix_path_str  [12+256] = \"qt_hpfxpath=$$config.input.hostprefix\";" \
++        "static const char qt_configure_ext_prefix_path_str   [12+512] = \"qt_epfxpath=$$config.input.extprefix\";" \
++        "static const char qt_configure_host_prefix_path_str  [12+512] = \"qt_hpfxpath=$$config.input.hostprefix\";" \
+         "$${LITERAL_HASH}endif" \
+         "" \
+         "static const short qt_configure_str_offsets[] = {" \
diff --git a/meta/recipes-qt/qt5/qtbase/0005-Disable-all-unknown-features-instead-of-erroring-out.patch b/meta/recipes-qt/qt5/qtbase/0005-Disable-all-unknown-features-instead-of-erroring-out.patch
new file mode 100644 (file)
index 0000000..b54bcf6
--- /dev/null
@@ -0,0 +1,25 @@
+From 5556bc54942214e84dc5f81b2dcdc05f7713ff6e Mon Sep 17 00:00:00 2001
+From: Samuli Piippo <samuli.piippo@qt.io>
+Date: Mon, 24 Oct 2016 09:45:18 +0300
+Subject: [PATCH] Disable all unknown features instead of erroring out
+
+Task-number: QTBUG-56656
+Change-Id: Ib884fe33cac74439f9592b145937f6b75ced8447
+---
+ mkspecs/features/qt_configure.prf | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/mkspecs/features/qt_configure.prf b/mkspecs/features/qt_configure.prf
+index 62ad972796..04690068bc 100644
+--- a/mkspecs/features/qt_configure.prf
++++ b/mkspecs/features/qt_configure.prf
+@@ -1576,7 +1576,8 @@ defineReplace(qtConfEvaluateSingleExpression) {
+                     error("Expression '$$1' is accessing field '$$var' of non-local feature $${feature}.")
+                 return($$result)
+             }
+-            error("Unknown feature object $${feature} in expression '$${1}'.")
++            warning("Unknown feature object $${feature} in expression '$${1}'.")
++            result = false
+         }
+         !qtConfCheckFeature($$feature): \
+             error("Expression '$$1' is accessing non-emitted feature $${feature}.")
diff --git a/meta/recipes-qt/qt5/qtbase/0006-Pretend-Qt5-wasn-t-found-if-OE_QMAKE_PATH_EXTERNAL_H.patch b/meta/recipes-qt/qt5/qtbase/0006-Pretend-Qt5-wasn-t-found-if-OE_QMAKE_PATH_EXTERNAL_H.patch
new file mode 100644 (file)
index 0000000..849ee0c
--- /dev/null
@@ -0,0 +1,63 @@
+From 265c509a62cc52d9b3a6c9e9995ac26ca278bc1b Mon Sep 17 00:00:00 2001
+From: Pascal Bach <pascal.bach@siemens.com>
+Date: Wed, 11 May 2016 15:20:41 +0200
+Subject: [PATCH] Pretend Qt5 wasn't found if OE_QMAKE_PATH_EXTERNAL_HOST_BINS
+ isn't set
+
+This prevents errors like:
+
+|   The imported target "Qt5::Core" references the file
+|
+|      "/qmake"
+|
+|   but this file does not exist.  Possible reasons include:
+
+Which happen if CMake is used without setting OE_QMAKE_PATH_EXTERNAL_HOST_BINS.
+To achieve this a check for OE_QMAKE_PATH_EXTERNAL_HOST_BINS is added to each Qt5*Config.cmake
+file. And in the case where the variable is not set we just return which is basically
+equal to telling CMake that Qt5 wasn't found.
+
+Upstream-Status: Pending
+  The patch only makes sense in connection with other patches included here.
+  Specifically this are:
+    - 0003-Add-external-hostbindir-option.patch
+    - 0010-Add-external-hostbindir-option-for-native-sdk.patch
+
+Signed-off-by: Pascal Bach <pascal.bach@siemens.com>
+---
+ mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in | 5 +++++
+ src/corelib/Qt5Config.cmake.in                      | 5 +++++
+ 2 files changed, 10 insertions(+)
+
+diff --git a/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in b/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in
+index 3ed6dd5889..52b69b26f6 100644
+--- a/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in
++++ b/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in
+@@ -3,6 +3,11 @@ if (CMAKE_VERSION VERSION_LESS 3.1.0)
+     message(FATAL_ERROR \"Qt 5 $${CMAKE_MODULE_NAME} module requires at least CMake version 3.1.0\")
+ endif()
++if(NOT DEFINED OE_QMAKE_PATH_EXTERNAL_HOST_BINS)
++    message(WARNING "Skipping because OE_QMAKE_PATH_EXTERNAL_HOST_BINS is not defined")
++    return()
++endif()
++
+ !!IF !isEmpty(CMAKE_USR_MOVE_WORKAROUND)
+ !!IF !isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE)
+ set(_qt5$${CMAKE_MODULE_NAME}_install_prefix \"$$[QT_INSTALL_PREFIX]\")
+diff --git a/src/corelib/Qt5Config.cmake.in b/src/corelib/Qt5Config.cmake.in
+index 6b6544f932..d317912632 100644
+--- a/src/corelib/Qt5Config.cmake.in
++++ b/src/corelib/Qt5Config.cmake.in
+@@ -3,6 +3,11 @@ if (CMAKE_VERSION VERSION_LESS 3.1.0)
+     message(FATAL_ERROR \"Qt5 requires at least CMake version 3.1.0\")
+ endif()
++if(NOT DEFINED OE_QMAKE_PATH_EXTERNAL_HOST_BINS)
++    message(WARNING "Skipping because OE_QMAKE_PATH_EXTERNAL_HOST_BINS is not defined")
++    return()
++endif()
++
+ if (NOT Qt5_FIND_COMPONENTS)
+     set(Qt5_NOT_FOUND_MESSAGE \"The Qt5 package requires at least one component\")
+     set(Qt5_FOUND False)
diff --git a/meta/recipes-qt/qt5/qtbase/0007-Delete-qlonglong-and-qulonglong.patch b/meta/recipes-qt/qt5/qtbase/0007-Delete-qlonglong-and-qulonglong.patch
new file mode 100644 (file)
index 0000000..8719d1e
--- /dev/null
@@ -0,0 +1,25 @@
+From a7b47f38399ef145160e201052e5d0871fa6750c Mon Sep 17 00:00:00 2001
+From: Huang Qiyu <huangqy.fnst@cn.fujitsu.com>
+Date: Wed, 7 Jun 2017 21:00:49 +0900
+Subject: [PATCH] Delete qlonglong and qulonglong
+
+Signed-off-by: Huang Qiyu <huangqy.fnst@cn.fujitsu.com>
+---
+ tests/auto/corelib/thread/qatomicinteger/qatomicinteger.pro | 2 --
+ 1 file changed, 2 deletions(-)
+
+diff --git a/tests/auto/corelib/thread/qatomicinteger/qatomicinteger.pro b/tests/auto/corelib/thread/qatomicinteger/qatomicinteger.pro
+index 09458bd9c3..59a120eb26 100644
+--- a/tests/auto/corelib/thread/qatomicinteger/qatomicinteger.pro
++++ b/tests/auto/corelib/thread/qatomicinteger/qatomicinteger.pro
+@@ -5,10 +5,8 @@ SUBDIRS=\
+     char32_t \
+     int \
+     long \
+-    qlonglong \
+     qptrdiff \
+     quintptr \
+-    qulonglong \
+     schar \
+     short \
+     uchar \
diff --git a/meta/recipes-qt/qt5/qtbase/0008-Replace-pthread_yield-with-sched_yield.patch b/meta/recipes-qt/qt5/qtbase/0008-Replace-pthread_yield-with-sched_yield.patch
new file mode 100644 (file)
index 0000000..84e59e7
--- /dev/null
@@ -0,0 +1,60 @@
+From aebff1455c764e9ecc73e6b52a4bac8233c93966 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 27 Jul 2017 08:02:51 -0700
+Subject: [PATCH] Replace pthread_yield with sched_yield
+
+On Linux pthead_yield is same as sched_yield implementation wise
+and sched_yield is available on all libc
+implementations on Linux
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp   | 4 ++--
+ tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp | 5 +++--
+ 2 files changed, 5 insertions(+), 4 deletions(-)
+
+diff --git a/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp b/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp
+index e6fac74ccc..28c7e9cfb3 100644
+--- a/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp
++++ b/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp
+@@ -35,7 +35,7 @@
+ #include "tst_qvariant_common.h"
+ #ifdef Q_OS_LINUX
+-# include <pthread.h>
++# include <sched.h>
+ #endif
+ #include <algorithm>
+@@ -366,7 +366,7 @@ protected:
+             const char *nm = name.constData();
+             int tp = qRegisterMetaType<Bar>(nm);
+ #if defined(Q_OS_LINUX) && !defined(Q_OS_ANDROID)
+-            pthread_yield();
++            sched_yield();
+ #endif
+             QMetaType info(tp);
+             if (!info.isValid()) {
+diff --git a/tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp b/tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp
+index c473230246..1db8d6f225 100644
+--- a/tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp
++++ b/tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp
+@@ -78,6 +78,7 @@
+ #include <stdlib.h>
+ #include <sys/stat.h>
+ #include <unistd.h>
++#include <sched.h>
+ #endif
+ #include "private/qhostinfo_p.h"
+@@ -2132,8 +2133,8 @@ public slots:
+ #if defined(Q_OS_MAC)
+         pthread_yield_np();
+-#elif defined Q_OS_LINUX && !defined Q_OS_ANDROID
+-        pthread_yield();
++#elif defined Q_OS_LINUX
++        sched_yield();
+ #endif
+         if (!sock->waitForConnected()) {
+             networkTimeout = true;
diff --git a/meta/recipes-qt/qt5/qtbase/0009-Add-OE-specific-specs-for-clang-compiler.patch b/meta/recipes-qt/qt5/qtbase/0009-Add-OE-specific-specs-for-clang-compiler.patch
new file mode 100644 (file)
index 0000000..8498fd6
--- /dev/null
@@ -0,0 +1,65 @@
+From d1198f3f6f3293c46db913d63518f625162b3ce5 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sun, 3 Sep 2017 09:11:44 -0700
+Subject: [PATCH] Add OE specific specs for clang compiler
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ mkspecs/linux-oe-clang/qmake.conf      | 39 ++++++++++++++++++++++++++
+ mkspecs/linux-oe-clang/qplatformdefs.h |  1 +
+ 2 files changed, 40 insertions(+)
+ create mode 100644 mkspecs/linux-oe-clang/qmake.conf
+ create mode 100644 mkspecs/linux-oe-clang/qplatformdefs.h
+
+diff --git a/mkspecs/linux-oe-clang/qmake.conf b/mkspecs/linux-oe-clang/qmake.conf
+new file mode 100644
+index 0000000000..db02ab5215
+--- /dev/null
++++ b/mkspecs/linux-oe-clang/qmake.conf
+@@ -0,0 +1,39 @@
++#
++# qmake configuration for linux-g++ with modifications for building with OpenEmbedded
++#
++
++MAKEFILE_GENERATOR = UNIX
++CONFIG += incremental
++QMAKE_INCREMENTAL_STYLE = sublib
++
++include(../common/linux.conf)
++
++# QMAKE_<TOOL> (moc, uic, rcc) are gone, overwrite only ar and strip
++QMAKE_AR              = $$(OE_QMAKE_AR) cqs
++QMAKE_STRIP           = $$(OE_QMAKE_STRIP)
++
++include(../common/gcc-base-unix.conf)
++
++# *FLAGS from gcc-base.conf
++QMAKE_CFLAGS                += $$(OE_QMAKE_CFLAGS)
++QMAKE_CXXFLAGS              += $$(OE_QMAKE_CXXFLAGS)
++QMAKE_LFLAGS                += $$(OE_QMAKE_LDFLAGS)
++
++include(../common/clang.conf)
++
++# tc settings from g++-base.conf
++QMAKE_CC       = $$(OE_QMAKE_CC)
++QMAKE_CXX      = $$(OE_QMAKE_CXX)
++
++QMAKE_LINK         = $$(OE_QMAKE_LINK)
++QMAKE_LINK_SHLIB   = $$(OE_QMAKE_LINK)
++QMAKE_LINK_C       = $$(OE_QMAKE_LINK)
++QMAKE_LINK_C_SHLIB = $$(OE_QMAKE_LINK)
++QMAKE_CFLAGS_ISYSTEM =
++# for the SDK
++isEmpty(QMAKE_QT_CONFIG):QMAKE_QT_CONFIG = $$(OE_QMAKE_QT_CONFIG)
++
++include(../oe-device-extra.pri)
++
++load(device_config)
++load(qt_config)
+diff --git a/mkspecs/linux-oe-clang/qplatformdefs.h b/mkspecs/linux-oe-clang/qplatformdefs.h
+new file mode 100644
+index 0000000000..880c927b21
+--- /dev/null
++++ b/mkspecs/linux-oe-clang/qplatformdefs.h
+@@ -0,0 +1 @@
++#include "../linux-clang/qplatformdefs.h"
diff --git a/meta/recipes-qt/qt5/qtbase/0010-linux-clang-Invert-conditional-for-defining-QT_SOCKL.patch b/meta/recipes-qt/qt5/qtbase/0010-linux-clang-Invert-conditional-for-defining-QT_SOCKL.patch
new file mode 100644 (file)
index 0000000..e13858f
--- /dev/null
@@ -0,0 +1,32 @@
+From e6ce6eaa98985b706151c63ca7b705110927d71b Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sun, 3 Sep 2017 09:44:48 -0700
+Subject: [PATCH] linux-clang: Invert conditional for defining QT_SOCKLEN_T
+
+This helps to make sure that QT_SOCKLEN_T is defined to be 'int'
+only when its glibc < 2 and not for other libcswhich may define
+it as per standards but are not glibc, e.g. musl
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ mkspecs/linux-clang/qplatformdefs.h | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/mkspecs/linux-clang/qplatformdefs.h b/mkspecs/linux-clang/qplatformdefs.h
+index a818d973f0..959a508d3a 100644
+--- a/mkspecs/linux-clang/qplatformdefs.h
++++ b/mkspecs/linux-clang/qplatformdefs.h
+@@ -81,10 +81,10 @@
+ #undef QT_SOCKLEN_T
+-#if defined(__GLIBC__) && (__GLIBC__ >= 2)
+-#define QT_SOCKLEN_T            socklen_t
+-#else
++#if defined(__GLIBC__) && (__GLIBC__ < 2)
+ #define QT_SOCKLEN_T            int
++#else
++#define QT_SOCKLEN_T            socklen_t
+ #endif
+ #if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 500)
diff --git a/meta/recipes-qt/qt5/qtbase/0011-tst_qlocale-Enable-QT_USE_FENV-only-on-glibc.patch b/meta/recipes-qt/qt5/qtbase/0011-tst_qlocale-Enable-QT_USE_FENV-only-on-glibc.patch
new file mode 100644 (file)
index 0000000..b9cc9d4
--- /dev/null
@@ -0,0 +1,25 @@
+From d8eb5531c444bcae2c2067a7f67e5229acc75fac Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sun, 3 Sep 2017 10:11:50 -0700
+Subject: [PATCH] tst_qlocale: Enable QT_USE_FENV only on glibc
+
+musl does not have feenableexcept function
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ tests/auto/corelib/tools/qlocale/tst_qlocale.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp b/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp
+index 5d344834e6..1afc70d255 100644
+--- a/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp
++++ b/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp
+@@ -46,7 +46,7 @@
+ #include <private/qlocale_tools_p.h>
+ #include <qnumeric.h>
+-#if defined(Q_OS_LINUX) && !defined(__UCLIBC__)
++#if defined(Q_OS_LINUX) && defined(__GLIBC__)
+ #    define QT_USE_FENV
+ #endif
diff --git a/meta/recipes-qt/qt5/qtbase/0012-mkspecs-common-gcc-base.conf-Use-I-instead-of-isyste.patch b/meta/recipes-qt/qt5/qtbase/0012-mkspecs-common-gcc-base.conf-Use-I-instead-of-isyste.patch
new file mode 100644 (file)
index 0000000..61a5b80
--- /dev/null
@@ -0,0 +1,49 @@
+From 6a97088ee9d0d8b2a4fbd5b13ea44501d9e58995 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 14 Feb 2018 17:08:43 -0800
+Subject: [PATCH] mkspecs/common/gcc-base.conf: Use -I instead of -isystem
+
+-isystem fails to build when code uses include_next on certain files e.g.
+
+qtbase/5.10.0+gitAUTOINC+50117d738a-r0/recipe-sysroot/usr/include/c++/7.3.0/cstdlib:75:15: fatal error: stdlib.h: No such file or directory
+ #include_next <stdlib.h>
+               ^~~~~~~~~~
+compilation terminated.
+make[2]: *** [Makefile:11592: .obj/qgenericpluginfactory.o] Error 1
+
+Upstream-Status: Pending
+
+Change-Id: Ia47832a6339a6ee59c0a6301fc5e552cd28b1029
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
+---
+ mkspecs/common/clang.conf    | 2 +-
+ mkspecs/common/gcc-base.conf | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/mkspecs/common/clang.conf b/mkspecs/common/clang.conf
+index 5800aaa5b4..7b4901ce46 100644
+--- a/mkspecs/common/clang.conf
++++ b/mkspecs/common/clang.conf
+@@ -16,7 +16,7 @@ QMAKE_LINK_SHLIB        = $$QMAKE_CXX
+ CONFIG                 += clang_pch_style
+ QMAKE_PCH_OUTPUT_EXT    = .pch
+-QMAKE_CFLAGS_ISYSTEM             = -isystem
++QMAKE_CFLAGS_ISYSTEM             =
+ QMAKE_CFLAGS_PRECOMPILE          = -x c-header -c ${QMAKE_PCH_INPUT} -o ${QMAKE_PCH_OUTPUT}
+ QMAKE_CFLAGS_USE_PRECOMPILE      = -Xclang -include-pch -Xclang ${QMAKE_PCH_OUTPUT}
+ QMAKE_CFLAGS_LTCG                = -flto
+diff --git a/mkspecs/common/gcc-base.conf b/mkspecs/common/gcc-base.conf
+index c2669e4833..3fde8dc85f 100644
+--- a/mkspecs/common/gcc-base.conf
++++ b/mkspecs/common/gcc-base.conf
+@@ -46,7 +46,7 @@ QMAKE_CFLAGS_DEBUG         += -g
+ QMAKE_CFLAGS_SHLIB         += $$QMAKE_CFLAGS_PIC
+ QMAKE_CFLAGS_STATIC_LIB    += $$QMAKE_CFLAGS_PIC
+ QMAKE_CFLAGS_APP           += $$QMAKE_CFLAGS_PIC
+-QMAKE_CFLAGS_ISYSTEM        = -isystem
++QMAKE_CFLAGS_ISYSTEM        =
+ QMAKE_CFLAGS_YACC          += -Wno-unused -Wno-parentheses
+ QMAKE_CFLAGS_HIDESYMS      += -fvisibility=hidden
+ QMAKE_CFLAGS_EXCEPTIONS_OFF += -fno-exceptions
diff --git a/meta/recipes-qt/qt5/qtbase/0013-Disable-ltcg-for-host_build.patch b/meta/recipes-qt/qt5/qtbase/0013-Disable-ltcg-for-host_build.patch
new file mode 100644 (file)
index 0000000..e275a80
--- /dev/null
@@ -0,0 +1,26 @@
+From ffd62d10df5607897ef366330e368069fed1a9b9 Mon Sep 17 00:00:00 2001
+From: Samuli Piippo <samuli.piippo@qt.io>
+Date: Tue, 23 Oct 2018 09:54:57 +0300
+Subject: [PATCH] Disable ltcg for host_build
+
+debug-prefix-map does not work correctly for static libraries
+when using ltcg, and since host_build compilations link agaist
+the libQt5Bootstrap.a library, it breaks source file packaging
+into debug packages.
+
+Task-number: QTBUG-71230
+Upstream-Status: Inappropriate [embedded specific]
+---
+ mkspecs/features/ltcg.prf | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/mkspecs/features/ltcg.prf b/mkspecs/features/ltcg.prf
+index ccf0226272..482e5b573d 100644
+--- a/mkspecs/features/ltcg.prf
++++ b/mkspecs/features/ltcg.prf
+@@ -1,4 +1,4 @@
+-CONFIG(release, debug|release) {
++CONFIG(release, debug|release):!host_build {
+     # We need fat object files when creating static libraries on some platforms
+     # so the linker will know to load a particular object from the library
+     # in the first place. On others, we have special ar and nm to create the symbol
diff --git a/meta/recipes-qt/qt5/qtbase/0014-Qt5GuiConfigExtras.cmake.in-cope-with-variable-path-.patch b/meta/recipes-qt/qt5/qtbase/0014-Qt5GuiConfigExtras.cmake.in-cope-with-variable-path-.patch
new file mode 100644 (file)
index 0000000..0a641bb
--- /dev/null
@@ -0,0 +1,66 @@
+From f5c88622ac10601e48a14f31d9299692a9ac62e2 Mon Sep 17 00:00:00 2001
+From: Max Krummenacher <max.krummenacher@toradex.com>
+Date: Sat, 27 Oct 2018 12:29:31 +0000
+Subject: [PATCH] Qt5GuiConfigExtras.cmake.in: cope with variable path to
+ sysroot
+
+EGL is configured to need an include path into the recipe-specific sysroot.
+However users of the cmake file will have a different absolute path than that
+used when creating the cmake file from cmake.in in qtbase.
+
+Change to store the relative path within the sysroot and then prepend the
+currently used sysroot in the _qt5gui_find_extra_libs macro.
+
+Upstream-Status: Inappropriate [OE specific]
+
+Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
+---
+ src/gui/Qt5GuiConfigExtras.cmake.in | 22 ++++++++--------------
+ 1 file changed, 8 insertions(+), 14 deletions(-)
+
+diff --git a/src/gui/Qt5GuiConfigExtras.cmake.in b/src/gui/Qt5GuiConfigExtras.cmake.in
+index 84dbbfebd4..ad6956d814 100644
+--- a/src/gui/Qt5GuiConfigExtras.cmake.in
++++ b/src/gui/Qt5GuiConfigExtras.cmake.in
+@@ -75,21 +75,15 @@ unset(_qt5gui_OPENGL_INCLUDE_DIR CACHE)
+ macro(_qt5gui_find_extra_libs Name Libs LibDir IncDirs)
+     set(Qt5Gui_${Name}_LIBRARIES)
+-!!IF !mac
+-    set(Qt5Gui_${Name}_INCLUDE_DIRS ${IncDirs})
+-!!ELSE
++
+     foreach(_dir ${IncDirs})
+-      if (EXISTS ${_dir})
+-        list(APPEND Qt5Gui_${Name}_INCLUDE_DIRS ${_dir})
+-      else()
+-        find_path(_actual_dir ${_dir}) # Look in sdk directories
+-        if (_actual_dir)
+-          list(APPEND Qt5Gui_${Name}_INCLUDE_DIRS ${_actual_dir})
+-        endif()
+-        unset(_actual_dir CACHE)
++      find_path(_actual_dir ${_dir})
++      if (_actual_dir)
++        list(APPEND Qt5Gui_${Name}_INCLUDE_DIRS ${_actual_dir})
+       endif()
++      unset(_actual_dir CACHE)
+     endforeach()
+-!!ENDIF
++
+     foreach(_lib ${Libs})
+         if (IS_ABSOLUTE ${_lib})
+             get_filename_component(_libFile ${_lib} NAME_WE)
+@@ -171,11 +165,11 @@ endmacro()
+ !!IF !isEmpty(CMAKE_EGL_LIBS)
+-_qt5gui_find_extra_libs(EGL \"$$CMAKE_EGL_LIBS\" \"$$CMAKE_EGL_LIBDIR\" \"$$CMAKE_EGL_INCDIRS\")
++_qt5gui_find_extra_libs(EGL \"$$CMAKE_EGL_LIBS\" \"$$CMAKE_EGL_LIBDIR\" \"$$replace(CMAKE_EGL_INCDIRS,$$re_escape($$PKG_CONFIG_SYSROOT_DIR),)\")
+ !!ENDIF
+ !!IF !isEmpty(CMAKE_OPENGL_LIBS)
+-_qt5gui_find_extra_libs(OPENGL \"$$CMAKE_OPENGL_LIBS\" \"$$CMAKE_OPENGL_LIBDIR\" \"$$CMAKE_OPENGL_INCDIRS\")
++_qt5gui_find_extra_libs(OPENGL \"$$CMAKE_OPENGL_LIBS\" \"$$CMAKE_OPENGL_LIBDIR\" \"$$replace(CMAKE_OPENGL_INCDIRS,$$re_escape($$PKG_CONFIG_SYSROOT_DIR),)\")
+ !!ENDIF
diff --git a/meta/recipes-qt/qt5/qtbase/0015-corelib-Include-sys-types.h-for-uint32_t.patch b/meta/recipes-qt/qt5/qtbase/0015-corelib-Include-sys-types.h-for-uint32_t.patch
new file mode 100644 (file)
index 0000000..749594b
--- /dev/null
@@ -0,0 +1,27 @@
+From a7755c994aa8031e7f4eaa2df1a442a812d7f5bf Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 6 Dec 2018 11:47:52 -0800
+Subject: [PATCH] corelib: Include sys/types.h for uint32_t
+
+This has been includes indirectly on glibc/linux systems
+via inttypes.h -> stdint.h -> sys/types.h but it breaks on
+musl where this indirect include chain does not exist.
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/corelib/global/qnumeric_p.h | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/corelib/global/qnumeric_p.h b/src/corelib/global/qnumeric_p.h
+index 4a225b2599..4414865c71 100644
+--- a/src/corelib/global/qnumeric_p.h
++++ b/src/corelib/global/qnumeric_p.h
+@@ -55,6 +55,7 @@
+ #include "QtCore/private/qglobal_p.h"
+ #include <cmath>
+ #include <limits>
++#include <sys/types.h>
+ #if defined(Q_CC_MSVC)
+ #  include <intrin.h>
diff --git a/meta/recipes-qt/qt5/qtbase/0016-Define-QMAKE_CXX.COMPILER_MACROS-for-clang-on-linux.patch b/meta/recipes-qt/qt5/qtbase/0016-Define-QMAKE_CXX.COMPILER_MACROS-for-clang-on-linux.patch
new file mode 100644 (file)
index 0000000..e3a9216
--- /dev/null
@@ -0,0 +1,41 @@
+From 59c5c149ad1fa3015f1fee34e87e9f8ab89f5de1 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 6 Dec 2018 15:06:20 -0800
+Subject: [PATCH] Define QMAKE_CXX.COMPILER_MACROS for clang on linux
+
+This is required when using clang for compiler, fixes
+mkspecs/features/toolchain.prf:215: Variable QMAKE_CXX.COMPILER_MACROS is not defined.
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ mkspecs/features/toolchain.prf | 9 +++++++++
+ 1 file changed, 9 insertions(+)
+
+diff --git a/mkspecs/features/toolchain.prf b/mkspecs/features/toolchain.prf
+index 9c3a64aa8b..d0758ab778 100644
+--- a/mkspecs/features/toolchain.prf
++++ b/mkspecs/features/toolchain.prf
+@@ -41,6 +41,13 @@ defineReplace(qtVariablesFromGCC) {
+     return($$ret)
+ }
++defineReplace(qtVariablesFromCLANG) {
++    ret = $$system("$$1 $$2 -E $$system_quote($$PWD/data/macros.cpp) \
++        <$$QMAKE_SYSTEM_NULL_DEVICE 2>$$QMAKE_SYSTEM_NULL_DEVICE", lines, ec)
++    !equals(ec, 0): qtCompilerErrror($$1, $$ret)
++    return($$ret)
++}
++
+ isEmpty($${target_prefix}.COMPILER_MACROS) {
+     msvc {
+         clang_cl {
+@@ -60,6 +67,8 @@ isEmpty($${target_prefix}.COMPILER_MACROS) {
+         } else {
+             vars = $$qtVariablesFromMSVC($$QMAKE_CXX)
+         }
++    } else: clang {
++        vars = $$qtVariablesFromCLANG($$QMAKE_CXX, $$QMAKE_CXXFLAGS)
+     } else: gcc|ghs {
+         vars = $$qtVariablesFromGCC($$QMAKE_CXX)
+     }
diff --git a/meta/recipes-qt/qt5/qtbase/0017-Always-build-uic-and-qvkgen.patch b/meta/recipes-qt/qt5/qtbase/0017-Always-build-uic-and-qvkgen.patch
new file mode 100644 (file)
index 0000000..6941092
--- /dev/null
@@ -0,0 +1,28 @@
+From 4b0ca5d85afd944d1e5a3df545ba99566207c184 Mon Sep 17 00:00:00 2001
+From: Martin Jansa <Martin.Jansa@gmail.com>
+Date: Sat, 16 Nov 2013 00:32:30 +0100
+Subject: [PATCH] Always build uic and qvkgen
+
+Even if we are not building gui or widgets. This tool is needed later
+as a native tool when compiling the target.
+
+Change-Id: I257668ac28c22b192e7ec7736e6c23fa3be6bab6
+Signed-off-by: Mikko Levonmaa <mikko.levonmaa@palm.com>
+Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
+---
+ src/src.pro | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/src.pro b/src/src.pro
+index 1c76a2e46f..fbd4014fb3 100644
+--- a/src/src.pro
++++ b/src/src.pro
+@@ -232,7 +232,7 @@ qtConfig(gui) {
+         }
+     }
+ }
+-SUBDIRS += src_plugins
++SUBDIRS += src_plugins src_tools_uic src_tools_qvkgen
+ nacl: SUBDIRS -= src_network src_testlib
diff --git a/meta/recipes-qt/qt5/qtbase/0018-Avoid-renameeat2-for-native-sdk-builds.patch b/meta/recipes-qt/qt5/qtbase/0018-Avoid-renameeat2-for-native-sdk-builds.patch
new file mode 100644 (file)
index 0000000..0ca038f
--- /dev/null
@@ -0,0 +1,67 @@
+From 69aeac9c7233e0d76a8a00b1a45c53c1670c9b49 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@gmail.com>
+Date: Sun, 14 Apr 2019 13:27:58 +0200
+Subject: [PATCH] Avoid renameeat2 for native(sdk) builds
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Recently pseudo changed to not support reanameeat2 as glibc wrapper [1]. This
+causes massive failures at do_install [2] on qtbase.
+
+To work around tell Qt build configuration not to use ranameet2 independent
+of glibc version.
+
+[1] https://git.openembedded.org/openembedded-core/commit/?id=0fb257121b68f38b40c078150db8f7d0979b7ea5
+[2] https://github.com/meta-qt5/meta-qt5/issues/187
+
+Upstream-Status: Inappropriate [OE-specific]
+
+Signed-off-by: Andreas Müller <schnitzeltony@gmail.com>
+---
+ src/corelib/global/qconfig-bootstrapped.h |  4 ++--
+ src/corelib/io/qfilesystemengine_unix.cpp | 10 ----------
+ 2 files changed, 2 insertions(+), 12 deletions(-)
+
+diff --git a/src/corelib/global/qconfig-bootstrapped.h b/src/corelib/global/qconfig-bootstrapped.h
+index dfcc3c9c7f..30166fe41c 100644
+--- a/src/corelib/global/qconfig-bootstrapped.h
++++ b/src/corelib/global/qconfig-bootstrapped.h
+@@ -100,14 +100,14 @@
+ #define QT_FEATURE_process -1
+ #define QT_FEATURE_regularexpression -1
+ #ifdef __GLIBC_PREREQ
+-# define QT_FEATURE_renameat2 (__GLIBC_PREREQ(2, 28) ? 1 : -1)
++# define QT_FEATURE_renameat2 -1
+ #else
+ # define QT_FEATURE_renameat2 -1
+ #endif
+ #define QT_FEATURE_sharedmemory -1
+ #define QT_FEATURE_slog2 -1
+ #ifdef __GLIBC_PREREQ
+-# define QT_FEATURE_statx (__GLIBC_PREREQ(2, 28) ? 1 : -1)
++# define QT_FEATURE_statx -1
+ #else
+ # define QT_FEATURE_statx -1
+ #endif
+diff --git a/src/corelib/io/qfilesystemengine_unix.cpp b/src/corelib/io/qfilesystemengine_unix.cpp
+index b2d81066db..d1783ebdf3 100644
+--- a/src/corelib/io/qfilesystemengine_unix.cpp
++++ b/src/corelib/io/qfilesystemengine_unix.cpp
+@@ -1248,16 +1248,6 @@ bool QFileSystemEngine::renameFile(const QFileSystemEntry &source, const QFileSy
+     if (Q_UNLIKELY(srcPath.isEmpty() || tgtPath.isEmpty()))
+         return emptyFileEntryWarning(), false;
+-#if defined(RENAME_NOREPLACE) && QT_CONFIG(renameat2)
+-    if (renameat2(AT_FDCWD, srcPath, AT_FDCWD, tgtPath, RENAME_NOREPLACE) == 0)
+-        return true;
+-
+-    // We can also get EINVAL for some non-local filesystems.
+-    if (errno != EINVAL) {
+-        error = QSystemError(errno, QSystemError::StandardLibraryError);
+-        return false;
+-    }
+-#endif
+ #if defined(Q_OS_DARWIN) && defined(RENAME_EXCL)
+     if (renameatx_np(AT_FDCWD, srcPath, AT_FDCWD, tgtPath, RENAME_EXCL) == 0)
+         return true;
diff --git a/meta/recipes-qt/qt5/qtbase/0019-Bootstrap-without-linkat-feature.patch b/meta/recipes-qt/qt5/qtbase/0019-Bootstrap-without-linkat-feature.patch
new file mode 100644 (file)
index 0000000..a1d0823
--- /dev/null
@@ -0,0 +1,27 @@
+From 703f89e35aaaec5ad781c222ae2dcd30f31320e9 Mon Sep 17 00:00:00 2001
+From: Samuli Piippo <samuli.piippo@qt.io>
+Date: Fri, 24 Nov 2017 15:16:31 +0200
+Subject: [PATCH] Bootstrap without linkat feature
+
+qmake does not work together with pseudo when unnamed temporary files
+are used with linkat.
+
+Upstream-Status: Inappropriate [OE specific]
+[YOCTO #11996]
+---
+ src/corelib/global/qconfig-bootstrapped.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/corelib/global/qconfig-bootstrapped.h b/src/corelib/global/qconfig-bootstrapped.h
+index 30166fe41c..e06f75541b 100644
+--- a/src/corelib/global/qconfig-bootstrapped.h
++++ b/src/corelib/global/qconfig-bootstrapped.h
+@@ -91,7 +91,7 @@
+ #define QT_FEATURE_itemmodel -1
+ #define QT_FEATURE_library -1
+ #ifdef __linux__
+-# define QT_FEATURE_linkat 1
++# define QT_FEATURE_linkat -1
+ #else
+ # define QT_FEATURE_linkat -1
+ #endif
diff --git a/meta/recipes-qt/qt5/qtbase/OEQt5Toolchain.cmake b/meta/recipes-qt/qt5/qtbase/OEQt5Toolchain.cmake
new file mode 100644 (file)
index 0000000..6f0042b
--- /dev/null
@@ -0,0 +1 @@
+set( OE_QMAKE_PATH_EXTERNAL_HOST_BINS $ENV{OE_QMAKE_PATH_HOST_BINS} )