commit:     f2e99107a9bf5b96497f666bde7bc0cbdb84663f
Author:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Mon Apr 27 22:01:10 2020 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Tue Apr 28 21:40:28 2020 +0000
URL:        https://gitweb.gentoo.org/proj/qt.git/commit/?id=f2e99107

qt5-build.eclass: Introduce qt5_tools_configure

This is run in src_configure for qttools modules unless
QT5_TARGET_SUBDIRS is defined.

Implementing an idea of Chiitoo in the linked PR.

Closes: https://github.com/gentoo/qt/pull/218
Thanks-to: Jimi Huotari <chiitoo <AT> gentoo.org>
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>

 eclass/qt5-build.eclass | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)

diff --git a/eclass/qt5-build.eclass b/eclass/qt5-build.eclass
index 9a757cce..d82f3d25 100644
--- a/eclass/qt5-build.eclass
+++ b/eclass/qt5-build.eclass
@@ -194,6 +194,9 @@ qt5-build_src_configure() {
        if [[ ${QT5_MODULE} == qtbase ]]; then
                qt5_base_configure
        fi
+       if [[ ${QT5_MINOR_VERSION} -ge 15 ]] && [[ ${QT5_MODULE} == qttools ]] 
&& [[ -z ${QT5_TARGET_SUBDIRS[@]} ]]; then
+               qt5_tools_configure
+       fi
 
        qt5_foreach_target_subdir qt5_qmake
 }
@@ -670,6 +673,34 @@ qt5_base_configure() {
 
 }
 
+# @FUNCTION: qt5_tools_configure
+# @INTERNAL
+# @DESCRIPTION:
+# Disables modules other than ${PN} belonging to qttools.
+qt5_tools_configure() {
+       # configure arguments
+       local qmakeargs=(
+               --
+               # not packaged in Gentoo
+               -no-feature-distancefieldgenerator
+               -no-feature-kmap2qmap
+               -no-feature-macdeployqt
+               -no-feature-makeqpf
+               -no-feature-qev
+               -no-feature-qtattributionsscanner
+               -no-feature-windeployqt
+               -no-feature-winrtrunner
+       )
+
+       local i
+       for i in assistant designer linguist pixeltool qdbus qdoc qtdiag 
qtpaths qtplugininfo; do
+               [[ ${PN} == ${i} ]] || qmakeargs+=( -no-feature-${i} )
+       done
+
+       # allow the ebuild to override what we set here
+       myqmakeargs=( "${qmakeargs[@]}" "${myqmakeargs[@]}" )
+}
+
 # @FUNCTION: qt5_qmake_args
 # @INTERNAL
 # @DESCRIPTION:

Reply via email to