commit:     4100f922ad8fd7df2186d8e8544511a7d0c0d9ba
Author:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Sun Jun 18 16:04:40 2023 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Thu Jun 22 15:53:37 2023 +0000
URL:        https://gitweb.gentoo.org/proj/qt.git/commit/?id=4100f922

qt5-build.eclass: Import out-of-source quirks from qdoc/qtlocation

We probably won't get this fixed in Qt5 cycle anymore. Standardises
the quirk via new internal helper function qt5_tools_oos_quirk() to
avoid qt5_qmake usage in ebuilds.

Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>

 eclass/qt5-build.eclass | 39 +++++++++++++++++++++++++++++++++++++--
 1 file changed, 37 insertions(+), 2 deletions(-)

diff --git a/eclass/qt5-build.eclass b/eclass/qt5-build.eclass
index 8779d5e9..31e3be2e 100644
--- a/eclass/qt5-build.eclass
+++ b/eclass/qt5-build.eclass
@@ -720,9 +720,44 @@ qt5_tools_configure() {
        # allow the ebuild to override what we set here
        myqmakeargs=( "${qmakeargs[@]}" "${myqmakeargs[@]}" )
 
-       mkdir -p "${QT5_BUILD_DIR}" || die
+       # out-of-source build quirks
+       case ${PN} in
+               qdoc)
+                       # bug 676948
+                       qt5_tools_oos_quirk qtqdoc-config.pri src/qdoc
+                       ;;
+               qtlocation)
+                       # src/plugins/geoservices requires files that are only 
generated
+                       # when qmake is run in the root directory. bug 633776
+                       qt5_tools_oos_quirk qtlocation-config.pri src/location
+                       ;;
+               *) ;;
+       esac
+
+       qt5_tools_oos_quirk qttools-config.pri
+}
+
+# @FUNCTION: qt5_tools_oos_quirk
+# @INTERNAL
+# @USAGE: <file> or <file> <path>
+# @DESCRIPTION:
+# Quirk for out-of-source builds. Runs qmake in root directory, copies
+# generated pri <file> from source <path> to build dir <path>.
+# If no <path> is given, <file> is copied to ${QT5_BUILD_DIR}.
+qt5_tools_oos_quirk() {
+       if [[ "$#" == 2 ]]; then
+               local source="${2}/${1}"
+               local dest="${QT5_BUILD_DIR}/${2}"
+       elif [[ "$#" == 1 ]]; then
+               local source="${1}"
+               local dest="${QT5_BUILD_DIR}"
+       else
+               die "${FUNCNAME[0]} must be passed either one or two arguments"
+       fi
+
+       mkdir -p "${dest}" || die
        qt5_qmake "${QT5_BUILD_DIR}"
-       cp qttools-config.pri "${QT5_BUILD_DIR}" || die
+       cp "${source}" "${dest}" || die
 }
 
 # @FUNCTION: qt5_qmake_args

Reply via email to