commit:     18416c5d4797ba363d217e574e967c15aaf39eaa
Author:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Sun Sep  5 11:17:11 2021 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Sun Sep  5 18:23:24 2021 +0000
URL:        https://gitweb.gentoo.org/proj/qt.git/commit/?id=18416c5d

qt5-build.eclass: Always run qt5_tools_configure for QT5_MODULE=qttools

Run qt5_qmake directly inside qt5_tools_configure(), copy the resulting
qttools-config.pri into QT5_BUILD_DIR again.

Add linguist-tools handling.

Bug: https://bugs.gentoo.org/728278
Bug: https://bugs.gentoo.org/811147
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>

 eclass/qt5-build.eclass | 19 +++++++++++++++----
 1 file changed, 15 insertions(+), 4 deletions(-)

diff --git a/eclass/qt5-build.eclass b/eclass/qt5-build.eclass
index 4f687c8a..40c9387a 100644
--- a/eclass/qt5-build.eclass
+++ b/eclass/qt5-build.eclass
@@ -166,7 +166,7 @@ qt5-build_src_configure() {
        if [[ ${QT5_MODULE} == qtbase ]]; then
                qt5_base_configure
        fi
-       if [[ ${QT5_MODULE} == qttools ]] && [[ -z ${QT5_TARGET_SUBDIRS[@]} ]]; 
then
+       if [[ ${QT5_MODULE} == qttools ]]; then
                qt5_tools_configure
        fi
 
@@ -643,7 +643,10 @@ qt5_base_configure() {
 # @FUNCTION: qt5_tools_configure
 # @INTERNAL
 # @DESCRIPTION:
-# Disables modules other than ${PN} belonging to qttools.
+# Most of qttools require files that are only generated when qmake is
+# run in the root directory. Related bugs: 676948, 716514.
+# Runs qt5_qmake in root directory to create qttools-config.pri and copy to
+# ${QT5_BUILD_DIR}, disabling modules other than ${PN} belonging to qttools.
 qt5_tools_configure() {
        # configure arguments
        local qmakeargs=(
@@ -659,13 +662,21 @@ qt5_tools_configure() {
                -no-feature-winrtrunner
        )
 
-       local i
+       local i module=${PN}
+       case ${PN} in
+               linguist-tools) module=linguist ;;
+               *) ;;
+       esac
        for i in assistant designer linguist pixeltool qdbus qdoc qtdiag 
qtpaths qtplugininfo; do
-               [[ ${PN} == ${i} ]] || qmakeargs+=( -no-feature-${i} )
+               [[ ${module} != ${i} ]] && qmakeargs+=( -no-feature-${i} )
        done
 
        # allow the ebuild to override what we set here
        myqmakeargs=( "${qmakeargs[@]}" "${myqmakeargs[@]}" )
+
+       mkdir -p "${QT5_BUILD_DIR}" || die
+       qt5_qmake "${QT5_BUILD_DIR}"
+       cp qttools-config.pri "${QT5_BUILD_DIR}" || die
 }
 
 # @FUNCTION: qt5_qmake_args

Reply via email to