diff options
Diffstat (limited to 'eclass')
-rw-r--r-- | eclass/Manifest.gz | bin | 37360 -> 37531 bytes | |||
-rw-r--r-- | eclass/distutils-r1.eclass | 4 | ||||
-rw-r--r-- | eclass/multibuild.eclass | 27 | ||||
-rw-r--r-- | eclass/multilib-build.eclass | 3 | ||||
-rw-r--r-- | eclass/out-of-source-utils.eclass | 43 | ||||
-rw-r--r-- | eclass/out-of-source.eclass | 9 | ||||
-rw-r--r-- | eclass/python-r1.eclass | 4 |
7 files changed, 61 insertions, 29 deletions
diff --git a/eclass/Manifest.gz b/eclass/Manifest.gz Binary files differindex 97a2ea250f08..34d4a5e99667 100644 --- a/eclass/Manifest.gz +++ b/eclass/Manifest.gz diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass index 371d52bcb7ef..8896768d3ce9 100644 --- a/eclass/distutils-r1.eclass +++ b/eclass/distutils-r1.eclass @@ -1,4 +1,4 @@ -# Copyright 1999-2022 Gentoo Authors +# Copyright 1999-2023 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 # @ECLASS: distutils-r1.eclass @@ -1559,7 +1559,7 @@ distutils-r1_python_test() { esac if [[ ${?} -ne 0 ]]; then - die "Tests failed with ${EPYTHON}" + die -n "Tests failed with ${EPYTHON}" fi } diff --git a/eclass/multibuild.eclass b/eclass/multibuild.eclass index 7ae03adbe18c..33edb9312a86 100644 --- a/eclass/multibuild.eclass +++ b/eclass/multibuild.eclass @@ -1,4 +1,4 @@ -# Copyright 1999-2022 Gentoo Authors +# Copyright 1999-2023 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 # @ECLASS: multibuild.eclass @@ -14,7 +14,10 @@ # implementations). case ${EAPI} in - 6|7|8) ;; + 6|7|8) + # backwards compatibility for run_in_build_dir + inherit out-of-source-utils + ;; *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;; esac @@ -175,26 +178,6 @@ multibuild_copy_sources() { multibuild_foreach_variant _multibuild_create_source_copy } -# @FUNCTION: run_in_build_dir -# @USAGE: <argv>... -# @DESCRIPTION: -# Run the given command in the directory pointed by BUILD_DIR. -run_in_build_dir() { - debug-print-function ${FUNCNAME} "${@}" - local ret - - [[ ${#} -ne 0 ]] || die "${FUNCNAME}: no command specified." - [[ ${BUILD_DIR} ]] || die "${FUNCNAME}: BUILD_DIR not set." - - mkdir -p "${BUILD_DIR}" || die - pushd "${BUILD_DIR}" >/dev/null || die - "${@}" - ret=${?} - popd >/dev/null || die - - return ${ret} -} - # @FUNCTION: multibuild_merge_root # @USAGE: <src-root> <dest-root> # @DESCRIPTION: diff --git a/eclass/multilib-build.eclass b/eclass/multilib-build.eclass index 40cc426a1359..1774ad057430 100644 --- a/eclass/multilib-build.eclass +++ b/eclass/multilib-build.eclass @@ -1,4 +1,4 @@ -# Copyright 2013-2022 Gentoo Authors +# Copyright 2013-2023 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 # @ECLASS: multilib-build.eclass @@ -7,7 +7,6 @@ # @AUTHOR: # Author: Michał Górny <mgorny@gentoo.org> # @SUPPORTED_EAPIS: 6 7 8 -# @PROVIDES: multibuild # @BLURB: flags and utility functions for building multilib packages # @DESCRIPTION: # The multilib-build.eclass exports USE flags and utility functions diff --git a/eclass/out-of-source-utils.eclass b/eclass/out-of-source-utils.eclass new file mode 100644 index 000000000000..d68b21088995 --- /dev/null +++ b/eclass/out-of-source-utils.eclass @@ -0,0 +1,43 @@ +# Copyright 2022-2023 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:-0} not supported" ;; +esac + +if [[ ! ${_OUT_OF_SOURCE_UTILS_ECLASS} ]]; then +_OUT_OF_SOURCE_UTILS_ECLASS=1 + +# @FUNCTION: run_in_build_dir +# @USAGE: <argv>... +# @DESCRIPTION: +# Run the given command in the directory pointed by BUILD_DIR. +run_in_build_dir() { + debug-print-function ${FUNCNAME} "${@}" + local ret + + [[ ${#} -eq 0 ]] && die "${FUNCNAME}: no command specified." + [[ -z ${BUILD_DIR} ]] && die "${FUNCNAME}: BUILD_DIR not set." + + mkdir -p "${BUILD_DIR}" || die + pushd "${BUILD_DIR}" >/dev/null || die + "${@}" + ret=${?} + popd >/dev/null || die + + return ${ret} +} + +fi diff --git a/eclass/out-of-source.eclass b/eclass/out-of-source.eclass index 81e03f3894db..06de39e6fc60 100644 --- a/eclass/out-of-source.eclass +++ b/eclass/out-of-source.eclass @@ -1,4 +1,4 @@ -# Copyright 1999-2022 Gentoo Authors +# Copyright 1999-2023 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 # @ECLASS: out-of-source.eclass @@ -40,6 +40,13 @@ esac if [[ ! ${_OUT_OF_SOURCE_ECLASS} ]]; then _OUT_OF_SOURCE_ECLASS=1 +# @ECLASS_VARIABLE: BUILD_DIR +# @OUTPUT_VARIABLE +# @DEFAULT_UNSET +# @DESCRIPTION: +# The current build directory. Defaults to ${WORKDIR}/${P}_build +# if unset. + # @FUNCTION: out-of-source_src_configure # @DESCRIPTION: # The default src_configure() implementation establishes a BUILD_DIR, diff --git a/eclass/python-r1.eclass b/eclass/python-r1.eclass index 622a479dcfa3..657922fe646d 100644 --- a/eclass/python-r1.eclass +++ b/eclass/python-r1.eclass @@ -1,4 +1,4 @@ -# Copyright 1999-2022 Gentoo Authors +# Copyright 1999-2023 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 # @ECLASS: python-r1.eclass @@ -8,7 +8,7 @@ # Author: Michał Górny <mgorny@gentoo.org> # Based on work of: Krzysztof Pawlik <nelchael@gentoo.org> # @SUPPORTED_EAPIS: 7 8 -# @PROVIDES: multibuild python-utils-r1 +# @PROVIDES: python-utils-r1 # @BLURB: A common, simple eclass for Python packages. # @DESCRIPTION: # A common eclass providing helper functions to build and install |