1 # Copyright 1999-2018 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
4 # @ECLASS: toolchain-autoconf.eclass
6 # <base-system@gentoo.org>
7 # @SUPPORTED_EAPIS: 6 7
8 # @BLURB: Common code for sys-devel/autoconf ebuilds
10 # This eclass contains the common phase functions migrated from
11 # sys-devel/autoconf eblits.
15 die "${ECLASS} is banned in EAPI ${EAPI:-0}"
20 die "Unknown EAPI ${EAPI:-0}"
24 if [[ -z ${_TOOLCHAIN_AUTOCONF_ECLASS} ]]; then
26 EXPORT_FUNCTIONS src_prepare src_configure src_install
28 toolchain-autoconf_src_prepare() {
29 find -name Makefile.in -exec sed -i '/^pkgdatadir/s:$:-@VERSION@:' {} + || die
33 toolchain-autoconf_src_configure() {
34 # Disable Emacs in the build system since it is in a separate package.
36 econf --program-suffix="-${PV}" || die
37 # econf updates config.{sub,guess} which forces the manpages
38 # to be regenerated which we dont want to do #146621
42 # slot the info pages. do this w/out munging the source so we don't have
43 # to depend on texinfo to regen things. #464146 (among others)
45 [[ ${SLOT} == "0" ]] && return
47 pushd "${ED}"/usr/share/info >/dev/null || die
50 # Rewrite all the references to other pages.
51 # before: * aclocal-invocation: (automake)aclocal Invocation. Generating aclocal.m4.
52 # after: * aclocal-invocation v1.13: (automake-1.13)aclocal Invocation. Generating aclocal.m4.
53 local p pages=( *.info ) args=()
54 for p in "${pages[@]/%.info}" ; do
56 -e "/START-INFO-DIR-ENTRY/,/END-INFO-DIR-ENTRY/s|: (${p})| v${SLOT}&|"
57 -e "s:(${p}):(${p}-${SLOT}):g"
60 sed -i "${args[@]}" * || die
62 # Rewrite all the file references, and rename them in the process.
65 d=${f/.info/-${SLOT}.info}
66 mv "${f}" "${d}" || die
67 sed -i -e "s:${f}:${d}:g" * || die
70 popd >/dev/null || die
73 toolchain-autoconf_src_install() {
78 _TOOLCHAIN_AUTOCONF_ECLASS=1