qttools: fix cmake usage of linguist tools
PATCH 1/1 qttools: fix cmake usage of linguist tools
Without this, Qt5LinguistTools/Qt5LinguistToolsConfig.cmake would attempt to locate lrelease and lupdate under prefix, even while we were cross-compiling and prefix points at the native system's root dirs.
--- recipes-qt/qt5/qttools-native_git.bb | 5 +++- ...ols-cmake-allow-overriding-the-location-f.patch | 30 ++++++++++++++++++++++ recipes-qt/qt5/qttools_git.bb | 1 + 3 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 recipes-qt/qt5/qttools/0004-linguist-tools-cmake-allow-overriding-the-location-f.patch
recipes-qt/qt5/qttools-native_git.bb +4 -1
@@ -13,7 +13,10 @@ QT_MODULE = "qttools" require qt5-native.inc require qt5-git.inc -SRC_URI += "file://0001-Allow-to-build-only-lrelease-lupdate-lconvert.patch" +SRC_URI += "\ + file://0001-Allow-to-build-only-lrelease-lupdate-lconvert.patch \ + file://0004-linguist-tools-cmake-allow-overriding-the-location-f.patch \ +" do_configure() { ${OE_QMAKE_QMAKE} ${OE_QMAKE_DEBUG_OUTPUT} -r ${S} CONFIG+=linguistonly
recipes-qt/qt5/qttools/0004-linguist-tools-cmake-allow-overriding-the-location-f.patch new file +30 -0
@@ -0,0 +1,30 @@ +From 9af593b50b61679f1ac40321c5afdf23f4cf395a Mon Sep 17 00:00:00 2001 +From: Cody P Schafer <[email protected]> +Date: Thu, 9 Jul 2015 11:28:19 -0400 +Subject: [PATCH] linguist-tools cmake: allow overriding the location for + lupdate and lrelease + +--- + src/linguist/Qt5LinguistToolsConfig.cmake.in | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/src/linguist/Qt5LinguistToolsConfig.cmake.in b/src/linguist/Qt5LinguistToolsConfig.cmake.in +index 4318b16..02651c3 100644 +--- a/src/linguist/Qt5LinguistToolsConfig.cmake.in ++++ b/src/linguist/Qt5LinguistToolsConfig.cmake.in +@@ -22,7 +22,11 @@ unset(_realCurr) + unset(_IMPORT_PREFIX) + !!ENDIF + !!ELIF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE) +-get_filename_component(_qt5_linguisttools_install_prefix \"${CMAKE_CURRENT_LIST_DIR}/$${CMAKE_RELATIVE_INSTALL_DIR}\" ABSOLUTE) ++if (OE_QMAKE_PATH_QT_BINS) ++ set(_qt5_linguisttools_install_prefix \"${OE_QMAKE_PATH_QT_BINS}\") ++else() ++ get_filename_component(_qt5_linguisttools_install_prefix \"${CMAKE_CURRENT_LIST_DIR}/$${CMAKE_RELATIVE_INSTALL_DIR}\" ABSOLUTE) ++endif() + !!ELSE + set(_qt5_linguisttools_install_prefix \"$$[QT_INSTALL_PREFIX]\") + !!ENDIF +-- +2.4.5 +
recipes-qt/qt5/qttools_git.bb +1 -0
@@ -14,6 +14,7 @@ DEPENDS += "qtbase qtdeclarative qtxmlpatterns" SRC_URI += " \ file://0002-assistant-help-fix-linking-of-dependent-libraries.patch \ file://0003-add-noqtwebkit-configuration.patch \ + file://0004-linguist-tools-cmake-allow-overriding-the-location-f.patch \ " FILES_${PN}-tools += "${datadir}/${QT_DIR_NAME}/phrasebooks"
Signature · 1 line
2.4.5
Quoted 11 lines · Cody P Schafer
Without this, Qt5LinguistTools/Qt5LinguistToolsConfig.cmake would attempt to locate lrelease and lupdate under prefix, even while we were cross-compiling and prefix points at the native system's root dirs.
Signed-off-by Cody P Schafer <[email protected]>--- recipes-qt/qt5/qttools-native_git.bb | 5 +++- ...ols-cmake-allow-overriding-the-location-f.patch | 30 ++++++++++++++++++++++ recipes-qt/qt5/qttools_git.bb | 1 + 3 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 recipes-qt/qt5/qttools/0004-linguist-tools-cmake-allow-overriding-the-location-f.patch
On second thought, I'm not quite sure this is the right solution.
It appears the core of the issue is that cmake_qt5 is pulling in the Qt5LinguistTools cmake from the target sysroot, when it should really be using the native sysroot.
Does anyone have pointers on the "right" way to handle cmake files and cross compilation?
Quoted 13 lines · Cody P Schafer
Quoted 11 lines · Cody P Schafer
Without this, Qt5LinguistTools/Qt5LinguistToolsConfig.cmake would attempt to locate lrelease and lupdate under prefix, even while we were cross-compiling and prefix points at the native system's root dirs.
Signed-off-by Cody P Schafer <[email protected]>--- recipes-qt/qt5/qttools-native_git.bb | 5 +++- ...ols-cmake-allow-overriding-the-location-f.patch | 30 ++++++++++++++++++++++ recipes-qt/qt5/qttools_git.bb | 1 + 3 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 recipes-qt/qt5/qttools/0004-linguist-tools-cmake-allow-overriding-the-location-f.patch
Quoted 8 lines
On second thought, I'm not quite sure this is the right solution.
It appears the core of the issue is that
cmake_qt5is pulling in the Qt5LinguistTools cmake from the target sysroot, when it should really be using the native sysroot.Does anyone have pointers on the "right" way to handle cmake files and cross compilation?
After a bit more digging, it appears the issue I'm having is that sometimes the .cmake in the native sysroot is used, and sometimes the .cmake in the target (beaglebone, in my case) sysroot is used.
And the beaglebone one doesn't work (probably expected).
And this patch doesn't actually work: my build appears to have only succeeded due to selecting the functional cmake file.
PATCH v2 1/1 qttools: fix cmake usage of linguist tools
Without this, Qt5LinguistTools/Qt5LinguistToolsConfig.cmake would attempt to locate lrelease and lupdate under prefix, even while we were cross-compiling and prefix points at the native system's root dirs.
---
I'm still not sure this is the right place for this fix because I'm not sure why it seems like cmake files for Qt5LinguistTools are sometimes pulled from STAGING_DIR_NATIVE, and other times pulled from STAGING_DIR_HOST.
But at the least this _appears_ to workaround my issue.
--- classes/qmake5_paths.bbclass | 1 + recipes-qt/qt5/qttools-native_git.bb | 5 +- ...ols-cmake-allow-overriding-the-location-f.patch | 63 ++++++++++++++++++++++ recipes-qt/qt5/qttools_git.bb | 1 + 4 files changed, 69 insertions(+), 1 deletion(-) create mode 100644 recipes-qt/qt5/qttools/0004-linguist-tools-cmake-allow-overriding-the-location-f.patch
classes/qmake5_paths.bbclass +1 -0
@@ -20,6 +20,7 @@ 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}"
recipes-qt/qt5/qttools-native_git.bb +4 -1
@@ -13,7 +13,10 @@ QT_MODULE = "qttools" require qt5-native.inc require qt5-git.inc -SRC_URI += "file://0001-Allow-to-build-only-lrelease-lupdate-lconvert.patch" +SRC_URI += "\ + file://0001-Allow-to-build-only-lrelease-lupdate-lconvert.patch \ + file://0004-linguist-tools-cmake-allow-overriding-the-location-f.patch \ +" do_configure() { ${OE_QMAKE_QMAKE} ${OE_QMAKE_DEBUG_OUTPUT} -r ${S} CONFIG+=linguistonly
recipes-qt/qt5/qttools/0004-linguist-tools-cmake-allow-overriding-the-location-f.patch new file +63 -0
63 lines not on this page · raw message
recipes-qt/qt5/qttools_git.bb +1 -0
@@ -14,6 +14,7 @@ DEPENDS += "qtbase qtdeclarative qtxmlpatterns" SRC_URI += " \ file://0002-assistant-help-fix-linking-of-dependent-libraries.patch \ file://0003-add-noqtwebkit-configuration.patch \ + file://0004-linguist-tools-cmake-allow-overriding-the-location-f.patch \ " FILES_${PN}-tools += "${datadir}/${QT_DIR_NAME}/phrasebooks"
Signature · 1 line
2.4.5