aboutsummaryrefslogtreecommitdiffstats
path: root/meta/classes
diff options
context:
space:
mode:
Diffstat (limited to 'meta/classes')
-rw-r--r--meta/classes/cmake_qt5.bbclass36
-rw-r--r--meta/classes/populate_sdk_qt5.bbclass8
-rw-r--r--meta/classes/populate_sdk_qt5_base.bbclass29
-rw-r--r--meta/classes/qmake5.bbclass4
-rw-r--r--meta/classes/qmake5_base.bbclass140
5 files changed, 118 insertions, 99 deletions
diff --git a/meta/classes/cmake_qt5.bbclass b/meta/classes/cmake_qt5.bbclass
new file mode 100644
index 0000000000..5d605a685d
--- /dev/null
+++ b/meta/classes/cmake_qt5.bbclass
@@ -0,0 +1,36 @@
+inherit cmake
+inherit qmake5_paths
+
+DEPENDS_prepend = "qtbase qtbase-native "
+
+EXTRA_OECMAKE_prepend = " \
+ -DOE_QMAKE_PATH_PREFIX=${OE_QMAKE_PATH_PREFIX} \
+ -DOE_QMAKE_PATH_HEADERS=${OE_QMAKE_PATH_HEADERS} \
+ -DOE_QMAKE_PATH_LIBS=${OE_QMAKE_PATH_LIBS} \
+ -DOE_QMAKE_PATH_ARCHDATA=${OE_QMAKE_PATH_ARCHDATA} \
+ -DOE_QMAKE_PATH_DATA=${OE_QMAKE_PATH_DATA} \
+ -DOE_QMAKE_PATH_BINS=${OE_QMAKE_PATH_BINS} \
+ -DOE_QMAKE_PATH_LIBEXECS=${OE_QMAKE_PATH_LIBEXECS} \
+ -DOE_QMAKE_PATH_PLUGINS=${OE_QMAKE_PATH_PLUGINS} \
+ -DOE_QMAKE_PATH_IMPORTS=${OE_QMAKE_PATH_IMPORTS} \
+ -DOE_QMAKE_PATH_QML=${OE_QMAKE_PATH_QML} \
+ -DOE_QMAKE_PATH_TRANSLATIONS=${OE_QMAKE_PATH_TRANSLATIONS} \
+ -DOE_QMAKE_PATH_DOCS=${OE_QMAKE_PATH_DOCS} \
+ -DOE_QMAKE_PATH_SETTINGS=${OE_QMAKE_PATH_SETTINGS} \
+ -DOE_QMAKE_PATH_EXAMPLES=${OE_QMAKE_PATH_EXAMPLES} \
+ -DOE_QMAKE_PATH_TESTS=${OE_QMAKE_PATH_TESTS} \
+ -DOE_QMAKE_PATH_HOST_PREFIX=${OE_QMAKE_PATH_HOST_PREFIX} \
+ -DOE_QMAKE_PATH_HOST_BINS=${OE_QMAKE_PATH_HOST_BINS} \
+ -DOE_QMAKE_PATH_HOST_DATA=${OE_QMAKE_PATH_HOST_DATA} \
+ -DOE_QMAKE_PATH_HOST_LIBS=${OE_QMAKE_PATH_HOST_LIBS} \
+ -DOE_QMAKE_PATH_EXTERNAL_HOST_BINS=${OE_QMAKE_PATH_EXTERNAL_HOST_BINS} \
+ -DOE_QMAKE_PATH_QT_HEADERS=${OE_QMAKE_PATH_QT_HEADERS} \
+ -DOE_QMAKE_PATH_QT_ARCHDATA=${OE_QMAKE_PATH_QT_ARCHDATA} \
+ -DOE_QMAKE_PATH_QT_DATA=${OE_QMAKE_PATH_QT_DATA} \
+ -DOE_QMAKE_PATH_QT_BINS=${OE_QMAKE_PATH_QT_BINS} \
+ -DOE_QMAKE_PATH_QT_TRANSLATIONS=${OE_QMAKE_PATH_QT_TRANSLATIONS} \
+ -DOE_QMAKE_PATH_QT_DOCS=${OE_QMAKE_PATH_QT_DOCS} \
+ -DOE_QMAKE_PATH_QT_SETTINGS=${OE_QMAKE_PATH_QT_SETTINGS} \
+ -DOE_QMAKE_PATH_QT_EXAMPLES=${OE_QMAKE_PATH_QT_EXAMPLES} \
+ -DOE_QMAKE_PATH_QT_TESTS=${OE_QMAKE_PATH_QT_TESTS} \
+"
diff --git a/meta/classes/populate_sdk_qt5.bbclass b/meta/classes/populate_sdk_qt5.bbclass
new file mode 100644
index 0000000000..bbf137d78c
--- /dev/null
+++ b/meta/classes/populate_sdk_qt5.bbclass
@@ -0,0 +1,8 @@
+# Copyright (C) 2014 O.S. Systems Software LTDA.
+
+inherit populate_sdk_qt5_base
+
+TOOLCHAIN_HOST_TASK += "nativesdk-packagegroup-qt5-toolchain-host"
+TOOLCHAIN_TARGET_TASK += "packagegroup-qt5-toolchain-target"
+
+FEATURE_PACKAGES_qtcreator-debug = "packagegroup-qt5-qtcreator-debug"
diff --git a/meta/classes/populate_sdk_qt5_base.bbclass b/meta/classes/populate_sdk_qt5_base.bbclass
new file mode 100644
index 0000000000..b6ce596713
--- /dev/null
+++ b/meta/classes/populate_sdk_qt5_base.bbclass
@@ -0,0 +1,29 @@
+# This allow reuse of Qt paths
+inherit qmake5_paths
+
+create_sdk_files_prepend () {
+ # Generate a qt.conf file to be deployed with the SDK
+ qtconf=${SDK_OUTPUT}/${SDKPATHNATIVE}${OE_QMAKE_PATH_HOST_BINS}/qt.conf
+ touch $qtconf
+ echo '[Paths]' >> $qtconf
+ echo 'Prefix = ${OE_QMAKE_PATH_PREFIX}' >> $qtconf
+ echo 'Headers = ${OE_QMAKE_PATH_QT_HEADERS}' >> $qtconf
+ echo 'Libraries = ${OE_QMAKE_PATH_LIBS}' >> $qtconf
+ echo 'ArchData = ${OE_QMAKE_PATH_QT_ARCHDATA}' >> $qtconf
+ echo 'Data = ${OE_QMAKE_PATH_QT_DATA}' >> $qtconf
+ echo 'Binaries = ${OE_QMAKE_PATH_QT_BINS}' >> $qtconf
+ echo 'LibraryExecutables = ${OE_QMAKE_PATH_LIBEXECS}' >> $qtconf
+ echo 'Plugins = ${OE_QMAKE_PATH_PLUGINS}' >> $qtconf
+ echo 'Imports = ${OE_QMAKE_PATH_IMPORTS}' >> $qtconf
+ echo 'Qml2Imports = ${OE_QMAKE_PATH_QML}' >> $qtconf
+ echo 'Translations = ${OE_QMAKE_PATH_QT_TRANSLATIONS}' >> $qtconf
+ echo 'Documentation = ${OE_QMAKE_PATH_QT_DOCS}' >> $qtconf
+ echo 'Settings = ${OE_QMAKE_PATH_QT_SETTINGS}' >> $qtconf
+ echo 'Examples = ${OE_QMAKE_PATH_QT_EXAMPLES}' >> $qtconf
+ echo 'Tests = ${OE_QMAKE_PATH_QT_TESTS}' >> $qtconf
+ echo 'HostPrefix = ${SDKPATHNATIVE}' >> $qtconf
+ echo 'HostData = ${SDKTARGETSYSROOT}${OE_QMAKE_PATH_QT_ARCHDATA}' >> $qtconf
+ echo 'HostBinaries = ${SDKPATHNATIVE}${OE_QMAKE_PATH_HOST_BINS}' >> $qtconf
+ echo 'HostLibraries = ${SDKPATHNATIVE}${OE_QMAKE_PATH_LIBS}' >> $qtconf
+ echo 'Sysroot = ${SDKTARGETSYSROOT}' >> $qtconf
+}
diff --git a/meta/classes/qmake5.bbclass b/meta/classes/qmake5.bbclass
index 1a960e8f32..2b43f2e38b 100644
--- a/meta/classes/qmake5.bbclass
+++ b/meta/classes/qmake5.bbclass
@@ -17,3 +17,7 @@ do_install() {
do_install_class-native() {
qmake5_base_native_do_install
}
+
+do_install_class-nativesdk() {
+ qmake5_base_nativesdk_do_install
+}
diff --git a/meta/classes/qmake5_base.bbclass b/meta/classes/qmake5_base.bbclass
index 8f1d143a30..c2a849856f 100644
--- a/meta/classes/qmake5_base.bbclass
+++ b/meta/classes/qmake5_base.bbclass
@@ -1,9 +1,6 @@
# 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}"
+OE_QMAKE_PLATFORM_NATIVE = "linux-oe-g++"
+OE_QMAKE_PLATFORM = "linux-oe-g++"
# 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 ?= ""
@@ -29,61 +26,31 @@ EXTRA_OEMAKE = " \
OE_QMAKE_LDFLAGS='${OE_QMAKE_LDFLAGS}' \
OE_QMAKE_AR='${OE_QMAKE_AR}' \
OE_QMAKE_STRIP='${OE_QMAKE_STRIP}' \
+ OE_QMAKE_WAYLAND_SCANNER='${OE_QMAKE_WAYLAND_SCANNER}' \
OE_QMAKE_INCDIR_QT='${STAGING_DIR_TARGET}/${OE_QMAKE_PATH_HEADERS}' \
"
-OE_QMAKE_QMAKE = "${OE_QMAKE_PATH_EXTERNAL_HOST_BINS}/qmake"
-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"
-
-# qmake reads if from shell environment
-export OE_QMAKE_QTCONF_PATH = "${WORKDIR}/qt.conf"
+OE_QMAKESPEC = "${QMAKE_MKSPEC_PATH_NATIVE}/mkspecs/${OE_QMAKE_PLATFORM_NATIVE}"
+OE_XQMAKESPEC = "${QMAKE_MKSPEC_PATH}/mkspecs/${OE_QMAKE_PLATFORM}"
+OE_QMAKE_QMAKE = "${STAGING_BINDIR_NATIVE}${QT_DIR_NAME}/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"
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}
-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_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
+ cat > ${QT_CONF_PATH} <<EOF
[Paths]
Prefix = ${OE_QMAKE_PATH_PREFIX}
Headers = ${OE_QMAKE_PATH_HEADERS}
@@ -103,21 +70,12 @@ 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}
+HostSpec = ${OE_QMAKESPEC}
+TartgetSpec = ${OE_XQMAKESPEC}
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.
@@ -193,60 +151,44 @@ 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 -- $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"
+ 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"
}
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_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}
}
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}
-
- if ls ${D}${libdir}/pkgconfig/*.pc >/dev/null 2>/dev/null; then
- sed -i ${D}${libdir}/pkgconfig/*.pc \
- -e "s@-L${STAGING_LIBDIR}@-L\${libdir}@g" \
- -e "s@${STAGING_DIR_TARGET}@@g"
+ # 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
}