eclass/autotools: Sync with Gentoo

It's from Gentoo commit dd42e7c9d18fee3fe77d369ae34617f17ef18c83.
This commit is contained in:
Flatcar Buildbot 2024-10-21 07:06:05 +00:00
parent a4f6f68e47
commit 0458a74228

View File

@ -4,7 +4,7 @@
# @ECLASS: autotools.eclass # @ECLASS: autotools.eclass
# @MAINTAINER: # @MAINTAINER:
# base-system@gentoo.org # base-system@gentoo.org
# @SUPPORTED_EAPIS: 6 7 8 # @SUPPORTED_EAPIS: 7 8
# @BLURB: Regenerates auto* build scripts # @BLURB: Regenerates auto* build scripts
# @DESCRIPTION: # @DESCRIPTION:
# This eclass is for safely handling autotooled software packages that need to # This eclass is for safely handling autotooled software packages that need to
@ -27,16 +27,10 @@ if [[ -z ${_AUTOTOOLS_ECLASS} ]] ; then
_AUTOTOOLS_ECLASS=1 _AUTOTOOLS_ECLASS=1
case ${EAPI} in case ${EAPI} in
6)
ewarn "${CATEGORY}/${PF}: ebuild uses ${ECLASS} with deprecated EAPI ${EAPI}!"
ewarn "${CATEGORY}/${PF}: Support will be removed on 2024-10-08. Please port to newer EAPI."
;;
7|8) ;; 7|8) ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;; *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
esac esac
[[ ${EAPI} == 6 ]] && inherit eqawarn
GNUCONFIG_AUTO_DEPEND=no GNUCONFIG_AUTO_DEPEND=no
inherit gnuconfig libtool inherit gnuconfig libtool
@ -184,12 +178,7 @@ RDEPEND=""
# ebuilds form conditional depends by using ${AUTOTOOLS_DEPEND} in # ebuilds form conditional depends by using ${AUTOTOOLS_DEPEND} in
# their own DEPEND string. # their own DEPEND string.
: "${AUTOTOOLS_AUTO_DEPEND:=yes}" : "${AUTOTOOLS_AUTO_DEPEND:=yes}"
if [[ ${AUTOTOOLS_AUTO_DEPEND} != "no" ]] ; then [[ ${AUTOTOOLS_AUTO_DEPEND} != "no" ]] && BDEPEND=${AUTOTOOLS_DEPEND}
case ${EAPI} in
6) DEPEND=${AUTOTOOLS_DEPEND} ;;
*) BDEPEND=${AUTOTOOLS_DEPEND} ;;
esac
fi
_AUTOTOOLS_AUTO_DEPEND=${AUTOTOOLS_AUTO_DEPEND} # See top of eclass _AUTOTOOLS_AUTO_DEPEND=${AUTOTOOLS_AUTO_DEPEND} # See top of eclass
unset _automake_atom _autoconf_atom unset _automake_atom _autoconf_atom
@ -398,22 +387,16 @@ eaclocal() {
# - ${BROOT}/usr/share/aclocal # - ${BROOT}/usr/share/aclocal
# - ${ESYSROOT}/usr/share/aclocal # - ${ESYSROOT}/usr/share/aclocal
# See bug #677002 # See bug #677002
if [[ ${EAPI} != 6 ]] ; then if [[ ! -f "${T}"/aclocal/dirlist ]] ; then
if [[ ! -f "${T}"/aclocal/dirlist ]] ; then mkdir "${T}"/aclocal || die
mkdir "${T}"/aclocal || die cat <<- EOF > "${T}"/aclocal/dirlist || die
cat <<- EOF > "${T}"/aclocal/dirlist || die ${BROOT}/usr/share/aclocal
${BROOT}/usr/share/aclocal ${ESYSROOT}/usr/share/aclocal
${ESYSROOT}/usr/share/aclocal EOF
EOF
fi
local system_acdir=" --system-acdir=${T}/aclocal"
else
local system_acdir=""
fi fi
[[ ! -f aclocal.m4 || -n $(grep -e 'generated.*by aclocal' aclocal.m4) ]] && \ [[ ! -f aclocal.m4 || -n $(grep -e 'generated.*by aclocal' aclocal.m4) ]] && \
autotools_run_tool --at-m4flags aclocal "$@" $(eaclocal_amflags) ${system_acdir} autotools_run_tool --at-m4flags aclocal "$@" $(eaclocal_amflags) --system-acdir="${T}"/aclocal
} }
# @FUNCTION: _elibtoolize # @FUNCTION: _elibtoolize
@ -455,7 +438,7 @@ eautoconf() {
if [[ ${WANT_AUTOCONF} != "2.1" && -e configure.in ]] ; then if [[ ${WANT_AUTOCONF} != "2.1" && -e configure.in ]] ; then
case ${EAPI} in case ${EAPI} in
6|7) 7)
eqawarn "This package has a configure.in file which has long been deprecated. Please" eqawarn "This package has a configure.in file which has long been deprecated. Please"
eqawarn "update it to use configure.ac instead as newer versions of autotools will die" eqawarn "update it to use configure.ac instead as newer versions of autotools will die"
eqawarn "when it finds this file. See https://bugs.gentoo.org/426262 for details." eqawarn "when it finds this file. See https://bugs.gentoo.org/426262 for details."
@ -543,21 +526,13 @@ eautopoint() {
# use gettext directly. So we have to copy it in manually since # use gettext directly. So we have to copy it in manually since
# we can't let `autopoint` do it for us. # we can't let `autopoint` do it for us.
config_rpath_update() { config_rpath_update() {
local dst src local src="${BROOT}/usr/share/gettext/config.rpath"
case ${EAPI} in
6)
src="${EPREFIX}/usr/share/gettext/config.rpath"
;;
*)
src="${BROOT}/usr/share/gettext/config.rpath"
;;
esac
[[ $# -eq 0 ]] && set -- $(find -name config.rpath) [[ $# -eq 0 ]] && set -- $(find -name config.rpath)
[[ $# -eq 0 ]] && return 0 [[ $# -eq 0 ]] && return 0
einfo "Updating all config.rpath files" einfo "Updating all config.rpath files"
local dst
for dst in "$@" ; do for dst in "$@" ; do
einfo " ${dst}" einfo " ${dst}"
cp "${src}" "${dst}" || die cp "${src}" "${dst}" || die
@ -575,16 +550,7 @@ autotools_env_setup() {
local pv local pv
for pv in ${_LATEST_AUTOMAKE[@]/#*:} ; do for pv in ${_LATEST_AUTOMAKE[@]/#*:} ; do
# Break on first hit to respect _LATEST_AUTOMAKE order. # Break on first hit to respect _LATEST_AUTOMAKE order.
local hv_args="" has_version -b "=dev-build/automake-${pv}*" && export WANT_AUTOMAKE="${pv}" && break
case ${EAPI} in
6)
hv_args="--host-root"
;;
*)
hv_args="-b"
;;
esac
has_version ${hv_args} "=dev-build/automake-${pv}*" && export WANT_AUTOMAKE="${pv}" && break
done done
# During bootstrap in prefix there might be no automake merged yet # During bootstrap in prefix there might be no automake merged yet
@ -604,16 +570,7 @@ autotools_env_setup() {
local pv local pv
for pv in ${_LATEST_AUTOCONF[@]/#*:} ; do for pv in ${_LATEST_AUTOCONF[@]/#*:} ; do
# Break on first hit to respect _LATEST_AUTOCONF order. # Break on first hit to respect _LATEST_AUTOCONF order.
local hv_args="" has_version -b "=dev-build/autoconf-${pv}*" && export WANT_AUTOCONF="${pv}" && break
case ${EAPI} in
6)
hv_args="--host-root"
;;
*)
hv_args="-b"
;;
esac
has_version ${hv_args} "=dev-build/autoconf-${pv}*" && export WANT_AUTOCONF="${pv}" && break
done done
# During bootstrap in prefix there might be no autoconf merged yet # During bootstrap in prefix there might be no autoconf merged yet