summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2023-08-22 21:47:11 +0100
committerV3n3RiX <venerix@koprulu.sector>2023-08-22 21:47:11 +0100
commit9368ace94caa5cdda868a0dbb7c75a3fc7a2b911 (patch)
treea9a5e87e053b6853c703732ad8050bd895efc1ea /eclass
parentc1d361b300cff921a04bd9ae2f800bf8914559eb (diff)
gentoo auto-resync : 22:08:2023 - 21:47:11
Diffstat (limited to 'eclass')
-rw-r--r--eclass/Manifest.gzbin38313 -> 38505 bytes
-rw-r--r--eclass/check-reqs.eclass8
-rw-r--r--eclass/cmake.eclass7
-rw-r--r--eclass/crossdev.eclass77
-rw-r--r--eclass/kernel-2.eclass7
5 files changed, 90 insertions, 9 deletions
diff --git a/eclass/Manifest.gz b/eclass/Manifest.gz
index bbf4f8d1a3a0..e3f447d9828f 100644
--- a/eclass/Manifest.gz
+++ b/eclass/Manifest.gz
Binary files differ
diff --git a/eclass/check-reqs.eclass b/eclass/check-reqs.eclass
index f6409e9a02c5..fac2f4553d74 100644
--- a/eclass/check-reqs.eclass
+++ b/eclass/check-reqs.eclass
@@ -291,9 +291,11 @@ _check-reqs_output() {
[[ ${EBUILD_PHASE} == "pretend" && -z ${CHECKREQS_DONOTHING} ]] && msg="eerror"
if [[ -n ${CHECKREQS_FAILED} ]]; then
${msg}
- ${msg} "Space constraints set in the ebuild were not met!"
- ${msg} "The build will most probably fail, you should enhance the space"
- ${msg} "as per failed tests."
+ ${msg} "Memory or space constraints set in the ebuild were not met!"
+ ${msg} "The build will most probably fail, you should:"
+ ${msg} "- enhance the memory (reduce MAKEOPTS, add swap), or"
+ ${msg} "- add more space"
+ ${msg} "as required depending on the failed tests."
${msg}
[[ ${EBUILD_PHASE} == "pretend" && -z ${CHECKREQS_DONOTHING} ]] && \
diff --git a/eclass/cmake.eclass b/eclass/cmake.eclass
index 16b3e300ccae..fb3f9b6352be 100644
--- a/eclass/cmake.eclass
+++ b/eclass/cmake.eclass
@@ -125,6 +125,12 @@ fi
# read-only. This is a user flag and should under _no circumstances_ be set in
# the ebuild. Helps in improving QA of build systems that write to source tree.
+# @ECLASS_VARIABLE: CMAKE_SKIP_TESTS
+# @USER_VARIABLE
+# @DEFAULT_UNSET
+# @DESCRIPTION:
+# Array of tests that should be skipped when running CTest.
+
[[ ${CMAKE_MIN_VERSION} ]] && die "CMAKE_MIN_VERSION is banned; if necessary, set BDEPEND=\">=dev-util/cmake-${CMAKE_MIN_VERSION}\" directly"
[[ ${CMAKE_BUILD_DIR} ]] && die "The ebuild must be migrated to BUILD_DIR"
[[ ${CMAKE_REMOVE_MODULES} ]] && die "CMAKE_REMOVE_MODULES is banned, set CMAKE_REMOVE_MODULES_LIST array instead"
@@ -681,6 +687,7 @@ cmake_src_test() {
[[ -e CTestTestfile.cmake ]] || { echo "No tests found. Skipping."; return 0 ; }
[[ -n ${TEST_VERBOSE} ]] && myctestargs+=( --extra-verbose --output-on-failure )
+ [[ -n ${CMAKE_SKIP_TESTS} ]] && myctestargs+=( -E '('$( IFS='|'; echo "${CMAKE_SKIP_TESTS[*]}")')' )
set -- ctest -j "$(makeopts_jobs "${MAKEOPTS}" 999)" \
--test-load "$(makeopts_loadavg)" "${myctestargs[@]}" "$@"
diff --git a/eclass/crossdev.eclass b/eclass/crossdev.eclass
new file mode 100644
index 000000000000..d6c99e4f32b7
--- /dev/null
+++ b/eclass/crossdev.eclass
@@ -0,0 +1,77 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+# @ECLASS: crossdev.eclass
+# @MAINTAINER:
+# cat@catcream.org
+# @AUTHOR:
+# Alfred Persson Forsberg <cat@catcream.org> (21 Jul 2023)
+# @SUPPORTED_EAPIS: 7 8
+# @BLURB: Convenience wrappers for packages used by the Crossdev tool.
+
+inherit toolchain-funcs
+
+case ${EAPI} in
+ 7|8) ;;
+ *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
+esac
+
+if [[ -z ${_CROSSDEV_ECLASS} ]]; then
+_CROSSDEV_ECLASS=1
+
+# @ECLASS_VARIABLE: _CROSS_CATEGORY_PREFIX
+# @INTERNAL
+# @DESCRIPTION:
+# This variable specifies the category prefix for a Crossdev
+# package. For GCC Crossdev it is "cross-", and for LLVM it is
+# "cross_llvm-"
+_CROSS_CATEGORY_PREFIX=""
+
+# @ECLASS_VARIABLE: _IS_CROSSPKG_LLVM
+# @INTERNAL
+# @DESCRIPTION:
+# Is true if the package is in a LLVM Crossdev category, otherwise false
+_IS_CROSSPKG_LLVM=0
+if [[ ${CATEGORY} == cross_llvm-* ]] ; then
+ _IS_CROSSPKG_LLVM=1
+ _CROSS_CATEGORY_PREFIX="cross_llvm-"
+fi
+
+# @ECLASS_VARIABLE: _IS_CROSSPKG_GCC
+# @INTERNAL
+# @DESCRIPTION:
+# Is true if the package is in a GCC Crossdev category, otherwise false
+_IS_CROSSPKG_GCC=0
+if [[ ${CATEGORY} == cross-* ]] ; then
+ _IS_CROSSPKG_GCC=1
+ _CROSS_CATEGORY_PREFIX="cross-"
+fi
+
+# @ECLASS_VARIABLE: _IS_CROSSPKG
+# @INTERNAL
+# @DESCRIPTION:
+# Is true if the package is in a any Crossdev category, otherwise false
+[[ ${_IS_CROSSPKG_LLVM} == 1 || ${_IS_CROSSPKG_GCC} == 1 ]] && _IS_CROSSPKG=1
+
+# Default CBUILD and CTARGET to CHOST if unset.
+export CBUILD=${CBUILD:-${CHOST}}
+export CTARGET=${CTARGET:-${CHOST}}
+
+if [[ ${CTARGET} == ${CHOST} ]] ; then
+ # cross-aarch64-gentoo-linux-musl -> aarch64-gentoo-linux-musl
+ [[ ${_IS_CROSSPKG} == 1 ]] && export CTARGET=${CATEGORY#${_CROSS_CATEGORY_PREFIX}}
+fi
+
+# @FUNCTION: target_is_not_host
+# @RETURN: Shell true if we're targeting an triple other than host
+target_is_not_host() {
+ [[ ${CHOST} != ${CTARGET} ]]
+}
+
+# @FUNCTION: is_crosspkg
+# @RETURN: Shell true if package belongs to any crossdev category
+is_crosspkg() {
+ [[ ${_IS_CROSSPKG} == 1 ]]
+}
+
+fi
diff --git a/eclass/kernel-2.eclass b/eclass/kernel-2.eclass
index bdeabb9fc2dc..dc9ed25e8b60 100644
--- a/eclass/kernel-2.eclass
+++ b/eclass/kernel-2.eclass
@@ -281,7 +281,7 @@
# If you do change them, there is a chance that we will not fix resulting bugs;
# that of course does not mean we're not willing to help.
-inherit estack multiprocessing toolchain-funcs
+inherit crossdev estack multiprocessing toolchain-funcs
case ${EAPI} in
7|8) ;;
@@ -293,11 +293,6 @@ esac
# I will remove it when I come up with something more reasonable.
[[ ${PROFILE_ARCH} == ppc64 ]] && CHOST="powerpc64-${CHOST#*-}"
-export CTARGET=${CTARGET:-${CHOST}}
-if [[ ${CTARGET} == ${CHOST} && ${CATEGORY/cross-} != ${CATEGORY} ]]; then
- export CTARGET=${CATEGORY/cross-}
-fi
-
HOMEPAGE="https://www.kernel.org/ https://wiki.gentoo.org/wiki/Kernel ${HOMEPAGE}"
: "${LICENSE:="GPL-2"}"