From 7a027cd18c60d9abad83a60c98ccf27db26be067 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Sat, 7 Jan 2023 18:14:11 +0000 Subject: gentoo auto-resync : 07:01:2023 - 18:14:11 --- eclass/Manifest.gz | Bin 37360 -> 37531 bytes eclass/distutils-r1.eclass | 4 ++-- eclass/multibuild.eclass | 27 +++++------------------- eclass/multilib-build.eclass | 3 +-- eclass/out-of-source-utils.eclass | 43 ++++++++++++++++++++++++++++++++++++++ eclass/out-of-source.eclass | 9 +++++++- eclass/python-r1.eclass | 4 ++-- 7 files changed, 61 insertions(+), 29 deletions(-) create mode 100644 eclass/out-of-source-utils.eclass (limited to 'eclass') diff --git a/eclass/Manifest.gz b/eclass/Manifest.gz index 97a2ea250f08..34d4a5e99667 100644 Binary files a/eclass/Manifest.gz and b/eclass/Manifest.gz differ 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: ... -# @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: # @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 # @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 +# @AUTHOR: +# Michał Górny +# @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: ... +# @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 # Based on work of: Krzysztof Pawlik # @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 -- cgit v1.2.3