Introduce a new out-of-source-utils.eclass to carry run_in_build_dir()
helper function. This function used to be defined in multibuild.eclass
and indirectly exposed through the eclasses using it. However, it is
used rather rarely and it is technically also useful for
out-of-source.eclass, so it makes more sense for it to be standalone.
In the end, eclasses are cheap.
Signed-off-by: Michał Górny <
mgorny@gentoo.org>
---
eclass/out-of-source-utils.eclass | 43 +++++++++++++++++++++++++++++++
1 file changed, 43 insertions(+)
create mode 100644 eclass/out-of-source-utils.eclass
diff --git a/eclass/out-of-source-utils.eclass b/eclass/out-of-source-utils.eclass
new file mode 100644
index 000000000000..450237b224b3
--- /dev/null
+++ b/eclass/out-of-source-utils.eclass
@@ -0,0 +1,43 @@
+# Copyright 2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+# @ECLASS: out-of-source-utils.eclass
+# @MAINTAINER:
+# Michał Górny <
mgorny@gentoo.org>
+# @AUTHOR:
+# Michał Górny <
mgorny@gentoo.org>
+# @SUPPORTED_EAPIS: 6 7 8
+# @BLURB: Utility functions for building packages out-of-source
+# @DESCRIPTION:
+# This eclass provides a run_in_build_dir() helper that can be used
+# to execute specified command inside BUILD_DIR.
+
+case ${EAPI} in
+ 6|7|8) ;;
+ *) die "${ECLASS}: EAPI ${EAPI} unsupported."
+esac
+
+if [[ ! ${_OUT_OF_SOURCE_UTILS_ECLASS} ]]; then
+_OUT_OF_S