summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2021-06-29 10:15:54 +0100
committerV3n3RiX <venerix@redcorelinux.org>2021-06-29 10:15:54 +0100
commit9aa80713372911cec499b3adb2cd746790920916 (patch)
treeb8e99dc5dd60ac2094a27cc52f74aada8df38f05 /eclass
parentb4d43e8c611df4a8061b6f88d9e9f6b1e3c83903 (diff)
gentoo resync : 29.06.2021
Diffstat (limited to 'eclass')
-rw-r--r--eclass/Manifest.gzbin35998 -> 36158 bytes
-rw-r--r--eclass/acct-group.eclass19
-rw-r--r--eclass/acct-user.eclass19
-rw-r--r--eclass/distutils-r1.eclass43
-rw-r--r--eclass/eapi7-ver.eclass4
-rw-r--r--eclass/eutils.eclass16
-rw-r--r--eclass/java-pkg-simple.eclass85
-rw-r--r--eclass/l10n.eclass53
-rw-r--r--eclass/meson.eclass31
-rw-r--r--eclass/ninja-utils.eclass20
-rw-r--r--eclass/prefix.eclass4
-rw-r--r--eclass/rpm.eclass33
-rw-r--r--eclass/strip-linguas.eclass67
-rw-r--r--eclass/user-info.eclass4
-rw-r--r--eclass/user.eclass7
-rw-r--r--eclass/usr-ldscript.eclass11
16 files changed, 258 insertions, 158 deletions
diff --git a/eclass/Manifest.gz b/eclass/Manifest.gz
index 19367ca775cc..ef455c6a1fbc 100644
--- a/eclass/Manifest.gz
+++ b/eclass/Manifest.gz
Binary files differ
diff --git a/eclass/acct-group.eclass b/eclass/acct-group.eclass
index 11a9f29e6253..b309d3643212 100644
--- a/eclass/acct-group.eclass
+++ b/eclass/acct-group.eclass
@@ -1,4 +1,4 @@
-# Copyright 2019-2020 Gentoo Authors
+# Copyright 2019-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: acct-group.eclass
@@ -7,7 +7,7 @@
# @AUTHOR:
# Michael Orlitzky <mjo@gentoo.org>
# Michał Górny <mgorny@gentoo.org>
-# @SUPPORTED_EAPIS: 7
+# @SUPPORTED_EAPIS: 7 8
# @BLURB: Eclass used to create and maintain a single group entry
# @DESCRIPTION:
# This eclass represents and creates a single group entry. The name
@@ -20,22 +20,23 @@
# and add an ebuild with the following contents:
#
# @CODE
-# EAPI=7
+# EAPI=8
# inherit acct-group
# ACCT_GROUP_ID=200
# @CODE
#
-# Then you add appropriate dependency to your package. The dependency
-# type(s) should be:
-# - DEPEND (+ RDEPEND) if the group is already needed at build time,
-# - RDEPEND if it is needed at install time (e.g. you 'fowners' files
-# in pkg_preinst) or run time.
+# Then you add appropriate dependencies to your package. Note that
+# the build system might need to resolve names, too. The dependency
+# type(s) should be: BDEPEND if the group must be resolvable at build
+# time (e.g. 'fowners' uses it in src_install), IDEPEND if it must be
+# resolvable at install time (e.g. 'fowners' uses it in pkg_preinst),
+# and RDEPEND in every case.
if [[ -z ${_ACCT_GROUP_ECLASS} ]]; then
_ACCT_GROUP_ECLASS=1
case ${EAPI:-0} in
- 7) ;;
+ 7|8) ;;
*) die "EAPI=${EAPI:-0} not supported";;
esac
diff --git a/eclass/acct-user.eclass b/eclass/acct-user.eclass
index ee4358b5c75c..cf47470c1558 100644
--- a/eclass/acct-user.eclass
+++ b/eclass/acct-user.eclass
@@ -1,4 +1,4 @@
-# Copyright 2019-2020 Gentoo Authors
+# Copyright 2019-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: acct-user.eclass
@@ -7,7 +7,7 @@
# @AUTHOR:
# Michael Orlitzky <mjo@gentoo.org>
# Michał Górny <mgorny@gentoo.org>
-# @SUPPORTED_EAPIS: 7
+# @SUPPORTED_EAPIS: 7 8
# @BLURB: Eclass used to create and maintain a single user entry
# @DESCRIPTION:
# This eclass represents and creates a single user entry. The name
@@ -26,24 +26,25 @@
# contents:
#
# @CODE
-# EAPI=7
+# EAPI=8
# inherit acct-user
# ACCT_USER_ID=200
# ACCT_USER_GROUPS=( foo )
# acct-user_add_deps
# @CODE
#
-# Then you add appropriate dependency to your package. The dependency
-# type(s) should be:
-# - DEPEND (+ RDEPEND) if the user is already needed at build time,
-# - RDEPEND if it is needed at install time (e.g. you 'fowners' files
-# in pkg_preinst) or run time.
+# Then you add appropriate dependencies to your package. Note that
+# the build system might need to resolve names, too. The dependency
+# type(s) should be: BDEPEND if the user must be resolvable at build
+# time (e.g. 'fowners' uses it in src_install), IDEPEND if it must be
+# resolvable at install time (e.g. 'fowners' uses it in pkg_preinst),
+# and RDEPEND in every case.
if [[ -z ${_ACCT_USER_ECLASS} ]]; then
_ACCT_USER_ECLASS=1
case ${EAPI:-0} in
- 7) ;;
+ 7|8) ;;
*) die "EAPI=${EAPI:-0} not supported";;
esac
diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass
index cc0416fb1d9e..344aa46b2f94 100644
--- a/eclass/distutils-r1.eclass
+++ b/eclass/distutils-r1.eclass
@@ -421,7 +421,7 @@ distutils_enable_tests() {
test_deps+=" ${test_pkg}[${PYTHON_USEDEP}]"
else
test_deps+=" $(python_gen_cond_dep "
- ${test_pkg}[\${PYTHON_MULTI_USEDEP}]
+ ${test_pkg}[\${PYTHON_USEDEP}]
")"
fi
fi
@@ -616,6 +616,20 @@ _distutils-r1_handle_pyproject_toml() {
fi
}
+# @FUNCTION: _distutils-r1_check_all_phase_mismatch
+# @DESCRIPTION:
+# Verify whether *_all phase impls is not called from from non-*_all
+# subphase.
+_distutils-r1_check_all_phase_mismatch() {
+ if has "python_${EBUILD_PHASE}" "${FUNCNAME[@]}"; then
+ eqawarn "QA Notice: distutils-r1_python_${EBUILD_PHASE}_all called"
+ eqawarn "from python_${EBUILD_PHASE}. Did you mean to use"
+ eqawarn "python_${EBUILD_PHASE}_all()?"
+ [[ ${EAPI} != [67] ]] &&
+ die "distutils-r1_python_${EBUILD_PHASE}_all called from python_${EBUILD_PHASE}."
+ fi
+}
+
# @FUNCTION: distutils-r1_python_prepare_all
# @DESCRIPTION:
# The default python_prepare_all(). It applies the patches from PATCHES
@@ -626,6 +640,7 @@ _distutils-r1_handle_pyproject_toml() {
# distutils patches and/or quirks.
distutils-r1_python_prepare_all() {
debug-print-function ${FUNCNAME} "${@}"
+ _distutils-r1_check_all_phase_mismatch
if [[ ! ${DISTUTILS_OPTIONAL} ]]; then
default
@@ -740,24 +755,23 @@ distutils-r1_python_compile() {
}
# @FUNCTION: _distutils-r1_wrap_scripts
-# @USAGE: <path> <bindir>
+# @USAGE: <bindir>
# @INTERNAL
# @DESCRIPTION:
# Moves and wraps all installed scripts/executables as necessary.
_distutils-r1_wrap_scripts() {
debug-print-function ${FUNCNAME} "${@}"
- [[ ${#} -eq 2 ]] || die "usage: ${FUNCNAME} <path> <bindir>"
- local path=${1}
- local bindir=${2}
+ [[ ${#} -eq 1 ]] || die "usage: ${FUNCNAME} <bindir>"
+ local bindir=${1}
local scriptdir=$(python_get_scriptdir)
local f python_files=() non_python_files=()
- if [[ -d ${path}${scriptdir} ]]; then
- for f in "${path}${scriptdir}"/*; do
+ if [[ -d ${D%/}${scriptdir} ]]; then
+ for f in "${D%/}${scriptdir}"/*; do
[[ -d ${f} ]] && die "Unexpected directory: ${f}"
- debug-print "${FUNCNAME}: found executable at ${f#${path}/}"
+ debug-print "${FUNCNAME}: found executable at ${f#${D%/}/}"
local shebang
read -r shebang < "${f}"
@@ -769,7 +783,7 @@ _distutils-r1_wrap_scripts() {
non_python_files+=( "${f}" )
fi
- mkdir -p "${path}${bindir}" || die
+ mkdir -p "${D%/}${bindir}" || die
done
for f in "${python_files[@]}"; do
@@ -778,15 +792,15 @@ _distutils-r1_wrap_scripts() {
debug-print "${FUNCNAME}: installing wrapper at ${bindir}/${basename}"
local dosym=dosym
[[ ${EAPI} == [67] ]] && dosym=dosym8
- "${dosym}" -r "${path#${D}}"/usr/lib/python-exec/python-exec2 \
- "${path#${D}}${bindir#${EPREFIX}}/${basename}"
+ "${dosym}" -r /usr/lib/python-exec/python-exec2 \
+ "${bindir#${EPREFIX}}/${basename}"
done
for f in "${non_python_files[@]}"; do
local basename=${f##*/}
- debug-print "${FUNCNAME}: moving ${f#${path}/} to ${bindir}/${basename}"
- mv "${f}" "${path}${bindir}/${basename}" || die
+ debug-print "${FUNCNAME}: moving ${f#${D%/}/} to ${bindir}/${basename}"
+ mv "${f}" "${D%/}${bindir}/${basename}" || die
done
fi
}
@@ -923,8 +937,8 @@ distutils-r1_python_install() {
fi
if [[ ! ${DISTUTILS_SINGLE_IMPL} ]]; then
- _distutils-r1_wrap_scripts "${root}" "${scriptdir}"
multibuild_merge_root "${root}" "${D%/}"
+ _distutils-r1_wrap_scripts "${scriptdir}"
fi
}
@@ -933,6 +947,7 @@ distutils-r1_python_install() {
# The default python_install_all(). It installs the documentation.
distutils-r1_python_install_all() {
debug-print-function ${FUNCNAME} "${@}"
+ _distutils-r1_check_all_phase_mismatch
einstalldocs
}
diff --git a/eclass/eapi7-ver.eclass b/eclass/eapi7-ver.eclass
index 8f13fc9af762..a23e76ad3ee3 100644
--- a/eclass/eapi7-ver.eclass
+++ b/eclass/eapi7-ver.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2020 Gentoo Authors
+# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: eapi7-ver.eclass
@@ -58,7 +58,7 @@
case ${EAPI:-0} in
0|1|2|3|4|5|6) ;;
- 7) die "${ECLASS}: EAPI=${EAPI} includes all functions from this eclass" ;;
+ 7|8) die "${ECLASS}: EAPI=${EAPI} includes all functions from this eclass" ;;
*) die "${ECLASS}: EAPI=${EAPI} unknown" ;;
esac
diff --git a/eclass/eutils.eclass b/eclass/eutils.eclass
index 2d90c35d9ade..207d05e7f975 100644
--- a/eclass/eutils.eclass
+++ b/eclass/eutils.eclass
@@ -23,12 +23,12 @@ if [[ -z ${_EUTILS_ECLASS} ]]; then
_EUTILS_ECLASS=1
# implicitly inherited (now split) eclasses
-case ${EAPI:-0} in
+case ${EAPI} in
5|6)
- inherit desktop edos2unix epatch estack l10n ltprune multilib \
- preserve-libs toolchain-funcs vcs-clean wrapper
+ inherit desktop edos2unix epatch estack ltprune multilib \
+ preserve-libs strip-linguas toolchain-funcs vcs-clean wrapper
;;
- 7) inherit edos2unix l10n wrapper ;;
+ 7) inherit edos2unix strip-linguas wrapper ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
esac
@@ -172,10 +172,9 @@ in_iuse() {
has "${flag}" "${liuse[@]#[+-]}"
}
-fi
+fi # EAPI 5
-case ${EAPI:-0} in
-5|6)
+if [[ ${EAPI} == [56] ]] ; then
# @FUNCTION: eqawarn
# @USAGE: [message]
@@ -190,7 +189,6 @@ if ! declare -F eqawarn >/dev/null ; then
}
fi
-;;
-esac
+fi # EAPI [56]
fi
diff --git a/eclass/java-pkg-simple.eclass b/eclass/java-pkg-simple.eclass
index 0c3e1af70364..174fa08ce4ea 100644
--- a/eclass/java-pkg-simple.eclass
+++ b/eclass/java-pkg-simple.eclass
@@ -326,7 +326,7 @@ java-pkg-simple_prepend_resources() {
# If USE FLAG 'binary' exists and is set, it will just copy
# ${JAVA_BINJAR_FILENAME} to ${S} and skip the rest of src_compile.
java-pkg-simple_src_compile() {
- local sources=sources.lst classes=target/classes apidoc=target/api
+ local sources=sources.lst classes=target/classes apidoc=target/api moduleinfo
# auto generate classpath
java-pkg_gen-cp JAVA_GENTOO_CLASSPATH
@@ -344,7 +344,14 @@ java-pkg-simple_src_compile() {
fi
# gather sources
- find "${JAVA_SRC_DIR[@]}" -name \*.java > ${sources}
+ # if target < 9, we need to compile module-info.java separately
+ # as this feature is not supported before Java 9
+ if [[ java-pkg_get-target -lt 9 ]]; then
+ find "${JAVA_SRC_DIR[@]}" -name \*.java ! -name module-info.java > ${sources}
+ moduleinfo=$(find "${JAVA_SRC_DIR[@]}" -name module-info.java)
+ else
+ find "${JAVA_SRC_DIR[@]}" -name \*.java > ${sources}
+ fi
# create the target directory
mkdir -p ${classes} || die "Could not create target directory"
@@ -354,9 +361,33 @@ java-pkg-simple_src_compile() {
java-pkg-simple_getclasspath
java-pkg-simple_prepend_resources ${classes} "${JAVA_RESOURCE_DIRS[@]}"
- ejavac -d ${classes} -encoding ${JAVA_ENCODING}\
- ${classpath:+-classpath ${classpath}} ${JAVAC_ARGS}\
- @${sources}
+ if [[ -n ${moduleinfo} ]] || [[ java-pkg_get-target -lt 9 ]]; then
+ ejavac -d ${classes} -encoding ${JAVA_ENCODING}\
+ ${classpath:+-classpath ${classpath}} ${JAVAC_ARGS} @${sources}
+ else
+ ejavac -d ${classes} -encoding ${JAVA_ENCODING}\
+ ${classpath:+--module-path ${classpath}} --module-version ${PV}\
+ ${JAVAC_ARGS} @${sources}
+ fi
+
+ # handle module-info.java separately as it needs at least JDK 9
+ if [[ -n ${moduleinfo} ]]; then
+ if java-pkg_is-vm-version-ge "9" ; then
+ local tmp_source=${JAVA_PKG_WANT_SOURCE} tmp_target=${JAVA_PKG_WANT_TARGET}
+
+ JAVA_PKG_WANT_SOURCE="9"
+ JAVA_PKG_WANT_TARGET="9"
+ ejavac -d ${classes} -encoding ${JAVA_ENCODING}\
+ ${classpath:+--module-path ${classpath}} --module-version ${PV}\
+ ${JAVAC_ARGS} "${moduleinfo}"
+
+ JAVA_PKG_WANT_SOURCE=${tmp_source}
+ JAVA_PKG_WANT_TARGET=${tmp_target}
+ else
+ ewarn "Need at least JDK 9 to compile module-info.java in src_compile,"
+ ewarn "see https://bugs.gentoo.org/796875"
+ fi
+ fi
# javadoc
if has doc ${JAVA_PKG_IUSE} && use doc; then
@@ -422,7 +453,7 @@ java-pkg-simple_src_install() {
# It will perform test with frameworks that are defined in
# ${JAVA_TESTING_FRAMEWORKS}.
java-pkg-simple_src_test() {
- local test_sources=test_sources.lst classes=target/test-classes
+ local test_sources=test_sources.lst classes=target/test-classes moduleinfo
local tests_to_run classpath
# do not continue if the USE FLAG 'test' is explicitly unset
@@ -444,12 +475,46 @@ java-pkg-simple_src_test() {
java-pkg-simple_prepend_resources ${classes} "${JAVA_TEST_RESOURCE_DIRS[@]}"
# gathering sources for testing
- find "${JAVA_TEST_SRC_DIR[@]}" -name \*.java > ${test_sources}
+ # if target < 9, we need to compile module-info.java separately
+ # as this feature is not supported before Java 9
+ if [[ java-pkg_get-target -lt 9 ]]; then
+ find "${JAVA_TEST_SRC_DIR[@]}" -name \*.java ! -name module-info.java > ${test_sources}
+ moduleinfo=$(find "${JAVA_TEST_SRC_DIR[@]}" -name module-info.java)
+ else
+ find "${JAVA_TEST_SRC_DIR[@]}" -name \*.java > ${test_sources}
+ fi
+
# compile
- [[ -s ${test_sources} ]] && ejavac -d ${classes} ${JAVAC_ARGS} \
- -encoding ${JAVA_ENCODING} ${classpath:+-classpath ${classpath}} \
- @${test_sources}
+ if [[ -s ${test_sources} ]]; then
+ if [[ -n ${moduleinfo} ]] || [[ java-pkg_get-target -lt 9 ]]; then
+ ejavac -d ${classes} -encoding ${JAVA_ENCODING}\
+ ${classpath:+-classpath ${classpath}} ${JAVAC_ARGS} @${test_sources}
+ else
+ ejavac -d ${classes} -encoding ${JAVA_ENCODING}\
+ ${classpath:+--module-path ${classpath}} --module-version ${PV}\
+ ${JAVAC_ARGS} @${test_sources}
+ fi
+ fi
+
+ # handle module-info.java separately as it needs at least JDK 9
+ if [[ -n ${moduleinfo} ]]; then
+ if java-pkg_is-vm-version-ge "9" ; then
+ local tmp_source=${JAVA_PKG_WANT_SOURCE} tmp_target=${JAVA_PKG_WANT_TARGET}
+
+ JAVA_PKG_WANT_SOURCE="9"
+ JAVA_PKG_WANT_TARGET="9"
+ ejavac -d ${classes} -encoding ${JAVA_ENCODING}\
+ ${classpath:+--module-path ${classpath}} --module-version ${PV}\
+ ${JAVAC_ARGS} "${moduleinfo}"
+
+ JAVA_PKG_WANT_SOURCE=${tmp_source}
+ JAVA_PKG_WANT_TARGET=${tmp_target}
+ else
+ ewarn "Need at least JDK 9 to compile module-info.java in src_test,"
+ ewarn "see https://bugs.gentoo.org/796875"
+ fi
+ fi
# grab a set of tests that testing framework will run
tests_to_run=$(find "${classes}" -type f\
diff --git a/eclass/l10n.eclass b/eclass/l10n.eclass
index 5cf3931b7bf5..b1dff96ded12 100644
--- a/eclass/l10n.eclass
+++ b/eclass/l10n.eclass
@@ -15,11 +15,13 @@
# determining the cross-section between the user's set LINGUAS and what
# is offered by the package.
-case ${EAPI:-0} in
- [567]) ;;
+case ${EAPI} in
+ 5|6|7) ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
esac
+inherit strip-linguas
+
if [[ -z ${_L10N_ECLASS} ]]; then
_L10N_ECLASS=1
@@ -130,51 +132,4 @@ l10n_get_locales() {
printf "%s" "${locs}"
}
-# @FUNCTION: strip-linguas
-# @USAGE: [<allow LINGUAS>|<-i|-u> <directories of .po files>]
-# @DESCRIPTION:
-# Make sure that LINGUAS only contains languages that a package can
-# support. The first form allows you to specify a list of LINGUAS.
-# The -i builds a list of po files found in all the directories and uses
-# the intersection of the lists. The -u builds a list of po files found
-# in all the directories and uses the union of the lists.
-strip-linguas() {
- local ls newls nols
- if [[ $1 == "-i" ]] || [[ $1 == "-u" ]] ; then
- local op=$1; shift
- ls=$(find "$1" -name '*.po' -exec basename {} .po ';'); shift
- local d f
- for d in "$@" ; do
- if [[ ${op} == "-u" ]] ; then
- newls=${ls}
- else
- newls=""
- fi
- for f in $(find "$d" -name '*.po' -exec basename {} .po ';') ; do
- if [[ ${op} == "-i" ]] ; then
- has ${f} ${ls} && newls="${newls} ${f}"
- else
- has ${f} ${ls} || newls="${newls} ${f}"
- fi
- done
- ls=${newls}
- done
- else
- ls="$@"
- fi
-
- nols=""
- newls=""
- for f in ${LINGUAS} ; do
- if has ${f} ${ls} ; then
- newls="${newls} ${f}"
- else
- nols="${nols} ${f}"
- fi
- done
- [[ -n ${nols} ]] \
- && einfo "Sorry, but ${PN} does not support the LINGUAS:" ${nols}
- export LINGUAS=${newls:1}
-}
-
fi
diff --git a/eclass/meson.eclass b/eclass/meson.eclass
index c9a5e0b5956d..2a563e367c66 100644
--- a/eclass/meson.eclass
+++ b/eclass/meson.eclass
@@ -5,7 +5,7 @@
# @MAINTAINER:
# William Hubbs <williamh@gentoo.org>
# Mike Gilbert <floppym@gentoo.org>
-# @SUPPORTED_EAPIS: 6 7
+# @SUPPORTED_EAPIS: 6 7 8
# @BLURB: common ebuild functions for meson-based packages
# @DESCRIPTION:
# This eclass contains the default phase functions for packages which
@@ -15,7 +15,7 @@
# Typical ebuild using meson.eclass:
#
# @CODE
-# EAPI=6
+# EAPI=8
#
# inherit meson
#
@@ -23,7 +23,7 @@
#
# src_configure() {
# local emesonargs=(
-# $(meson_use qt4)
+# $(meson_use qt5)
# $(meson_feature threads)
# $(meson_use bindist official_branding)
# )
@@ -34,35 +34,28 @@
#
# @CODE
-case ${EAPI:-0} in
- 6|7) ;;
- *) die "EAPI=${EAPI} is not supported" ;;
+case ${EAPI} in
+ 6|7|8) ;;
+ *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
esac
if [[ -z ${_MESON_ECLASS} ]]; then
+_MESON_ECLASS=1
+[[ ${EAPI} == 6 ]] && inherit eapi7-ver
inherit multiprocessing ninja-utils python-utils-r1 toolchain-funcs
-if [[ ${EAPI} == 6 ]]; then
- inherit eapi7-ver
-fi
-
-fi
-
EXPORT_FUNCTIONS src_configure src_compile src_test src_install
-if [[ -z ${_MESON_ECLASS} ]]; then
-_MESON_ECLASS=1
-
-MESON_DEPEND=">=dev-util/meson-0.56.0
+_MESON_DEPEND=">=dev-util/meson-0.56.0
>=dev-util/ninja-1.8.2
dev-util/meson-format-array
"
-if [[ ${EAPI:-0} == [6] ]]; then
- DEPEND=${MESON_DEPEND}
+if [[ ${EAPI} == 6 ]]; then
+ DEPEND=${_MESON_DEPEND}
else
- BDEPEND=${MESON_DEPEND}
+ BDEPEND=${_MESON_DEPEND}
fi
# @ECLASS-VARIABLE: BUILD_DIR
diff --git a/eclass/ninja-utils.eclass b/eclass/ninja-utils.eclass
index ca8d67191dc4..c5e195a9f80b 100644
--- a/eclass/ninja-utils.eclass
+++ b/eclass/ninja-utils.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2018 Gentoo Foundation
+# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: ninja-utils.eclass
@@ -8,7 +8,7 @@
# @AUTHOR:
# Michał Górny <mgorny@gentoo.org>
# Mike Gilbert <floppym@gentoo.org>
-# @SUPPORTED_EAPIS: 2 4 5 6 7
+# @SUPPORTED_EAPIS: 5 6 7 8
# @BLURB: common bits to run dev-util/ninja builder
# @DESCRIPTION:
# This eclass provides a single function -- eninja -- that can be used
@@ -18,15 +18,14 @@
# be used indirectly by the eclasses for other build systems (CMake,
# Meson).
-if [[ -z ${_NINJA_UTILS_ECLASS} ]]; then
-
-case ${EAPI:-0} in
- 0|1|3) die "EAPI=${EAPI:-0} is not supported (too old)";;
- # copied from cmake-utils
- 2|4|5|6|7) ;;
- *) die "EAPI=${EAPI} is not yet supported" ;;
+case ${EAPI} in
+ 5|6|7|8) ;;
+ *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
esac
+if [[ -z ${_NINJA_UTILS_ECLASS} ]]; then
+_NINJA_UTILS_ECLASS=1
+
# @ECLASS-VARIABLE: NINJAOPTS
# @DEFAULT_UNSET
# @DESCRIPTION:
@@ -44,7 +43,7 @@ inherit multiprocessing
# with EAPI 6, it also supports being called via 'nonfatal'.
eninja() {
local nonfatal_args=()
- [[ ${EAPI:-0} != [245] ]] && nonfatal_args+=( -n )
+ [[ ${EAPI} != 5 ]] && nonfatal_args+=( -n )
if [[ -z ${NINJAOPTS+set} ]]; then
NINJAOPTS="-j$(makeopts_jobs) -l$(makeopts_loadavg "${MAKEOPTS}" 0)"
@@ -54,5 +53,4 @@ eninja() {
"$@" || die "${nonfatal_args[@]}" "${*} failed"
}
-_NINJA_UTILS_ECLASS=1
fi
diff --git a/eclass/prefix.eclass b/eclass/prefix.eclass
index da6f63bcc50c..0571dd1fb207 100644
--- a/eclass/prefix.eclass
+++ b/eclass/prefix.eclass
@@ -5,7 +5,7 @@
# @MAINTAINER:
# Feel free to contact the Prefix team through <prefix@gentoo.org> if
# you have problems, suggestions or questions.
-# @SUPPORTED_EAPIS: 5 6 7
+# @SUPPORTED_EAPIS: 5 6 7 8
# @BLURB: Eclass to provide Prefix functionality
# @DESCRIPTION:
# Gentoo Prefix allows users to install into a self defined offset
@@ -13,7 +13,7 @@
# additional functions and variables which are defined by this eclass.
case ${EAPI:-0} in
- [567]) ;;
+ [5678]) ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
esac
diff --git a/eclass/rpm.eclass b/eclass/rpm.eclass
index 351d7974877e..77db8e808796 100644
--- a/eclass/rpm.eclass
+++ b/eclass/rpm.eclass
@@ -4,11 +4,13 @@
# @ECLASS: rpm.eclass
# @MAINTAINER:
# base-system@gentoo.org
-# @SUPPORTED_EAPIS: 5 6 7
+# @SUPPORTED_EAPIS: 5 6 7 8
# @BLURB: convenience class for extracting RPMs
-case ${EAPI:-0} in
- [567]) inherit eutils ;;
+case ${EAPI} in
+ 5|6) inherit epatch eutils ;; # eutils for eqawarn
+ 7) inherit eutils ;; # not needed, but ebuilds may still rely on it
+ 8) ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
esac
@@ -19,9 +21,9 @@ _RPM_ECLASS=1
inherit estack
-case "${EAPI:-0}" in
- [0-6]) DEPEND=">=app-arch/rpm2targz-9.0.0.3g" ;;
- *) BDEPEND=">=app-arch/rpm2targz-9.0.0.3g" ;;
+case ${EAPI} in
+ 5|6) DEPEND="app-arch/rpm2targz" ;;
+ *) BDEPEND="app-arch/rpm2targz" ;;
esac
# @FUNCTION: rpm_unpack
@@ -34,15 +36,16 @@ rpm_unpack() {
for a in "$@" ; do
echo ">>> Unpacking ${a} to ${PWD}"
if [[ ${a} == ./* ]] ; then
- : nothing to do -- path is local
- elif [[ ${a} == ${DISTDIR}/* ]] ; then
- ewarn 'QA: do not use ${DISTDIR} with rpm_unpack -- it is added for you'
+ : # nothing to do -- path is local
+ elif [[ ${a} == "${DISTDIR}"/* ]] ; then
+ eqawarn 'do not use ${DISTDIR} with rpm_unpack -- it is added for you'
elif [[ ${a} == /* ]] ; then
- ewarn 'QA: do not use full paths with rpm_unpack -- use ./ paths instead'
+ eqawarn 'do not use full paths with rpm_unpack -- use ./ paths instead'
else
a="${DISTDIR}/${a}"
fi
- rpm2tar -O "${a}" | tar xf - || die "failure unpacking ${a}"
+ rpm2tar -O "${a}" | tar xf -
+ assert "failure unpacking ${a}"
done
}
@@ -64,9 +67,9 @@ srcrpm_unpack() {
# unpack everything
local a
- for a in *.tar.{gz,bz2,xz} *.t{gz,bz2,xz,pxz} *.zip *.ZIP ; do
+ for a in *.tar.{gz,bz2,xz} *.t{gz,bz2,xz} *.zip *.ZIP ; do
unpack "./${a}"
- rm -f "${a}"
+ rm -f "${a}" || die
done
eshopts_pop
@@ -90,11 +93,15 @@ rpm_src_unpack() {
# @FUNCTION: rpm_spec_epatch
# @USAGE: [spec]
+# @DEPRECATED: none
# @DESCRIPTION:
# Read the specified spec (defaults to ${PN}.spec) and attempt to apply
# all the patches listed in it. If the spec does funky things like moving
# files around, well this won't handle that.
rpm_spec_epatch() {
+ # no epatch in EAPI 7 and later
+ [[ ${EAPI} == [56] ]] || die "${FUNCNAME} is banned in EAPI ${EAPI}"
+
local p spec=$1
local dir
diff --git a/eclass/strip-linguas.eclass b/eclass/strip-linguas.eclass
new file mode 100644
index 000000000000..718341b4a626
--- /dev/null
+++ b/eclass/strip-linguas.eclass
@@ -0,0 +1,67 @@
+# Copyright 2004-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+# @ECLASS: strip-linguas.eclass
+# @MAINTAINER:
+# Ulrich Müller <ulm@gentoo.org>
+# @AUTHOR:
+# Mike Frysinger <vapier@gentoo.org>
+# @SUPPORTED_EAPIS: 5 6 7 8
+# @BLURB: convenience function for LINGUAS support
+
+case ${EAPI} in
+ 5|6|7|8) ;;
+ *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
+esac
+
+if [[ -z ${_STRIP_LINGUAS_ECLASS} ]]; then
+_STRIP_LINGUAS_ECLASS=1
+
+# @FUNCTION: strip-linguas
+# @USAGE: [<allow LINGUAS>|<-i|-u> <directories of .po files>]
+# @DESCRIPTION:
+# Make sure that LINGUAS only contains languages that a package can
+# support. The first form allows you to specify a list of LINGUAS.
+# The -i builds a list of po files found in all the directories and uses
+# the intersection of the lists. The -u builds a list of po files found
+# in all the directories and uses the union of the lists.
+strip-linguas() {
+ local d f ls newls nols
+
+ if [[ $1 == "-i" ]] || [[ $1 == "-u" ]]; then
+ local op=$1; shift
+ ls=$(find "$1" -name '*.po' -exec basename {} .po ';'); shift
+ for d; do
+ if [[ ${op} == "-u" ]]; then
+ newls=${ls}
+ else
+ newls=""
+ fi
+ for f in $(find "${d}" -name '*.po' -exec basename {} .po ';'); do
+ if [[ ${op} == "-i" ]]; then
+ has ${f} ${ls} && newls+=" ${f}"
+ else
+ has ${f} ${ls} || newls+=" ${f}"
+ fi
+ done
+ ls=${newls}
+ done
+ else
+ ls="$@"
+ fi
+
+ nols=""
+ newls=""
+ for f in ${LINGUAS}; do
+ if has ${f} ${ls}; then
+ newls+=" ${f}"
+ else
+ nols+=" ${f}"
+ fi
+ done
+ [[ -n ${nols} ]] \
+ && einfo "Sorry, but ${PN} does not support the LINGUAS:" ${nols}
+ export LINGUAS=${newls:1}
+}
+
+fi
diff --git a/eclass/user-info.eclass b/eclass/user-info.eclass
index d349fc17476b..8b8538bf843a 100644
--- a/eclass/user-info.eclass
+++ b/eclass/user-info.eclass
@@ -5,11 +5,11 @@
# @MAINTAINER:
# base-system@gentoo.org (Linux)
# Michał Górny <mgorny@gentoo.org> (NetBSD)
-# @SUPPORTED_EAPIS: 5 6 7
+# @SUPPORTED_EAPIS: 5 6 7 8
# @BLURB: Read-only access to user and group information
case ${EAPI:-0} in
- [567]) ;;
+ [5678]) ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
esac
diff --git a/eclass/user.eclass b/eclass/user.eclass
index e1f87a383ada..d03d31819fcc 100644
--- a/eclass/user.eclass
+++ b/eclass/user.eclass
@@ -5,7 +5,7 @@
# @MAINTAINER:
# base-system@gentoo.org (Linux)
# Michał Górny <mgorny@gentoo.org> (NetBSD)
-# @SUPPORTED_EAPIS: 0 1 2 3 4 5 6 7
+# @SUPPORTED_EAPIS: 5 6 7 8
# @BLURB: user management in ebuilds
# @DEPRECATED: acct-user/acct-group packages
# @DESCRIPTION:
@@ -16,8 +16,8 @@ if [[ -z ${_USER_ECLASS} ]]; then
_USER_ECLASS=1
case ${EAPI:-0} in
- 0|1|2|3|4|5|6|7) ;;
- *)
+ 5|6|7) ;;
+ 8)
if [[ ${CATEGORY} != acct-* ]]; then
eerror "In EAPI ${EAPI}, packages must not inherit user.eclass"
eerror "unless they are in the acct-user or acct-group category."
@@ -26,6 +26,7 @@ case ${EAPI:-0} in
die "Invalid \"inherit user\" in EAPI ${EAPI}"
fi
;;
+ *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
esac
inherit user-info
diff --git a/eclass/usr-ldscript.eclass b/eclass/usr-ldscript.eclass
index 4ee129bda836..2bf725abdd02 100644
--- a/eclass/usr-ldscript.eclass
+++ b/eclass/usr-ldscript.eclass
@@ -1,18 +1,18 @@
-# Copyright 2019 Gentoo Authors
+# Copyright 2019-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: usr-ldscript.eclass
# @MAINTAINER:
# Toolchain Ninjas <toolchain@gentoo.org>
-# @SUPPORTED_EAPIS: 4 5 6 7
+# @SUPPORTED_EAPIS: 5 6 7 8
# @BLURB: Defines the gen_usr_ldscript function.
if [[ -z ${_USR_LDSCRIPT_ECLASS} ]]; then
_USR_LDSCRIPT_ECLASS=1
-case ${EAPI:-0} in
- 4|5|6|7) ;;
- *) die "EAPI=${EAPI} is not supported" ;;
+case ${EAPI} in
+ 5|6|7|8) ;;
+ *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
esac
inherit multilib toolchain-funcs
@@ -49,7 +49,6 @@ gen_usr_ldscript() {
*-darwin*) ;;
*-android*) return 0 ;;
*linux*|*-freebsd*|*-openbsd*|*-netbsd*)
- use prefix && return 0
use split-usr || return 0
;;
*) return 0 ;;