diff options
author | Arsen Arsenović <arsen@gentoo.org> | 2023-03-26 10:40:17 +0200 |
---|---|---|
committer | Arsen Arsenović <arsen@gentoo.org> | 2023-03-27 22:27:11 +0200 |
commit | 8839833a322cc2776225c20de422b38540a5d27f (patch) | |
tree | 52b7ace624c80dbbf8178fe9935c56d9b3169571 /eclass | |
parent | dev-vcs/pre-commit: drop 2.20.0-r1 (diff) | |
download | gentoo-8839833a322cc2776225c20de422b38540a5d27f.tar.gz gentoo-8839833a322cc2776225c20de422b38540a5d27f.tar.bz2 gentoo-8839833a322cc2776225c20de422b38540a5d27f.zip |
toolchain-autoconf.eclass: Add option to disable Info slotting
Closes: https://bugs.gentoo.org/902461
Signed-off-by: Arsen Arsenović <arsen@gentoo.org>
Diffstat (limited to 'eclass')
-rw-r--r-- | eclass/toolchain-autoconf.eclass | 46 |
1 files changed, 43 insertions, 3 deletions
diff --git a/eclass/toolchain-autoconf.eclass b/eclass/toolchain-autoconf.eclass index 2ba27638468e..ed8d5ff1412a 100644 --- a/eclass/toolchain-autoconf.eclass +++ b/eclass/toolchain-autoconf.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: toolchain-autoconf.eclass @@ -18,6 +18,20 @@ esac if [[ -z ${_TOOLCHAIN_AUTOCONF_ECLASS} ]]; then _TOOLCHAIN_AUTOCONF_ECLASS=1 +# @ECLASS_VARIABLE: TC_AUTOCONF_BREAK_INFOS +# @DESCRIPTION: +# Enables slotting logic on the installed info pages. This includes +# mangling the pages in order to include a version number. Empty by +# default, and only exists for old ebuild revisions to use. Do not set +# in new ebuilds. Set to a non-empty value to enable. +# @DEPRECATED: none +: "${TC_AUTOCONF_BREAK_INFOS:=}" + +# @ECLASS_VARIABLE: TC_AUTOCONF_INFOPATH +# @DESCRIPTION: +# Where to install info files if not slotting. +TC_AUTOCONF_INFOPATH="${EPREFIX}/usr/share/autoconf-${PV}/info" + toolchain-autoconf_src_prepare() { find -name Makefile.in -exec sed -i '/^pkgdatadir/s:$:-@VERSION@:' {} + || die default @@ -26,7 +40,15 @@ toolchain-autoconf_src_prepare() { toolchain-autoconf_src_configure() { # Disable Emacs in the build system since it is in a separate package. export EMACS=no - econf --program-suffix="-${PV}" || die + local myconf=( + --program-suffix="-${PV}" + ) + if [[ -z "${TC_AUTOCONF_BREAK_INFOS}" && "${SLOT}" != 0 ]]; then + myconf+=( + --infodir="${TC_AUTOCONF_INFOPATH}" + ) + fi + econf "${myconf[@]}" || die # econf updates config.{sub,guess} which forces the manpages # to be regenerated which we dont want to do #146621 touch man/*.1 @@ -65,7 +87,25 @@ slot_info_pages() { toolchain-autoconf_src_install() { default - slot_info_pages + if [[ -n "${TC_AUTOCONF_BREAK_INFOS}" ]]; then + slot_info_pages + else + rm -f dir || die + + local major="$(ver_cut 1)" + local minor="$(ver_cut 2)" + local idx="$((99999-(major*1000+minor)))" + newenvd - "06autoconf${idx}" <<-EOF + INFOPATH="${TC_AUTOCONF_INFOPATH}" + EOF + + pushd "${D}/${TC_AUTOCONF_INFOPATH}" >/dev/null || die + for f in *.info*; do + # Install convenience aliases for versioned Autoconf pages. + ln -s "$f" "${f/./-${PV}.}" || die + done + popd >/dev/null || die + fi } fi |