commit:     0bbdf985a4221d17467fda761dd798096a03516e
Author:     David Seifert <soap <AT> gentoo <DOT> org>
AuthorDate: Fri Mar 17 22:04:31 2023 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Sun Mar 26 12:27:25 2023 +0000
URL:        https://gitweb.gentoo.org/proj/qt.git/commit/?id=0bbdf985

eclass: standardize prologue/epilogue

Closes: https://github.com/gentoo/gentoo/pull/30061
Signed-off-by: David Seifert <soap <AT> gentoo.org>
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>

 eclass/qt5-build.eclass | 16 ++++++++++------
 eclass/qt6-build.eclass | 22 +++++++++++++---------
 2 files changed, 23 insertions(+), 15 deletions(-)

diff --git a/eclass/qt5-build.eclass b/eclass/qt5-build.eclass
index a3a7c881..ae74c2e0 100644
--- a/eclass/qt5-build.eclass
+++ b/eclass/qt5-build.eclass
@@ -11,15 +11,17 @@
 # @DESCRIPTION:
 # This eclass contains various functions that are used when building Qt5.
 
-if [[ ${CATEGORY} != dev-qt ]]; then
-       die "${ECLASS} is only to be used for building Qt 5"
-fi
-
 case ${EAPI} in
        8) ;;
        *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
 esac
 
+if [[ -z ${_QT5_BUILD_ECLASS} ]]; then
+_QT5_BUILD_ECLASS=1
+
+[[ ${CATEGORY} != dev-qt ]] &&
+       die "${ECLASS} is only to be used for building Qt 5"
+
 # @ECLASS_VARIABLE: QT5_BUILD_TYPE
 # @DESCRIPTION:
 # Default value is "release".
@@ -171,8 +173,6 @@ fi
 
 ######  Phase functions  ######
 
-EXPORT_FUNCTIONS src_prepare src_configure src_compile src_install src_test 
pkg_postinst pkg_postrm
-
 # @FUNCTION: qt5-build_src_prepare
 # @DESCRIPTION:
 # Prepares the environment and patches the sources if necessary.
@@ -971,3 +971,7 @@ qt5_regenerate_global_configs() {
                ewarn "${qmodule_pri} or ${qmodule_pri_orig} does not exist or 
is not a regular file"
        fi
 }
+
+fi
+
+EXPORT_FUNCTIONS src_prepare src_configure src_compile src_install src_test 
pkg_postinst pkg_postrm

diff --git a/eclass/qt6-build.eclass b/eclass/qt6-build.eclass
index b7e062e6..f92d37eb 100644
--- a/eclass/qt6-build.eclass
+++ b/eclass/qt6-build.eclass
@@ -1,4 +1,4 @@
-# Copyright 2021-2022 Gentoo Authors
+# Copyright 2021-2023 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: qt6-build.eclass
@@ -10,15 +10,17 @@
 # This eclass contains various functions that are used when building Qt6.
 # Requires EAPI 8.
 
-if [[ ${CATEGORY} != dev-qt ]]; then
-       die "qt6-build.eclass is only to be used for building Qt 6"
-fi
-
 case ${EAPI} in
-       8)      : ;;
-       *)      die "qt6-build.eclass: unsupported EAPI=${EAPI:-0}" ;;
+       8) ;;
+       *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
 esac
 
+if [[ -z ${_QT6_BUILD_ECLASS} ]]; then
+_QT6_BUILD_ECLASS=1
+
+[[ ${CATEGORY} != dev-qt ]] &&
+       die "${ECLASS} is only to be used for building Qt 6"
+
 # @ECLASS_VARIABLE: QT6_MODULE
 # @PRE_INHERIT
 # @DESCRIPTION:
@@ -99,8 +101,6 @@ BDEPEND="
 #      DEPEND+=" test? ( ~dev-qt/qttest-${PV} )"
 #fi
 
-EXPORT_FUNCTIONS src_prepare src_configure
-
 ######  Phase functions  ######
 
 # @FUNCTION: qt6-build_src_prepare
@@ -166,3 +166,7 @@ qt6_prepare_env() {
                QT6_QMLDIR QT6_DATADIR QT6_DOCDIR QT6_TRANSLATIONDIR \
                QT6_EXAMPLESDIR QT6_TESTSDIR QT6_SYSCONFDIR
 }
+
+fi
+
+EXPORT_FUNCTIONS src_prepare src_configure

Reply via email to