kde5.eclass: Cleanup obsolete blocker
[gentoo.git] / eclass / toolchain-autoconf.eclass
1 # Copyright 1999-2017 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 # @ECLASS: toolchain-autoconf.eclass
5 # @MAINTAINER:
6 # <base-system@gentoo.org>
7 # @BLURB: Common code for sys-devel/autoconf ebuilds
8 # @DESCRIPTION:
9 # This eclass contains the common phase functions migrated from
10 # sys-devel/autoconf eblits.
11
12 if [[ -z ${_TOOLCHAIN_AUTOCONF_ECLASS} ]]; then
13
14 inherit eutils
15
16 EXPORT_FUNCTIONS src_prepare src_configure src_install
17
18 toolchain-autoconf_src_prepare() {
19         find -name Makefile.in -exec sed -i '/^pkgdatadir/s:$:-@VERSION@:' {} + || die
20
21         [[ ${#PATCHES[@]} -gt 0 ]] && epatch "${PATCHES[@]}"
22 }
23
24 toolchain-autoconf_src_configure() {
25         # Disable Emacs in the build system since it is in a separate package.
26         export EMACS=no
27         econf --program-suffix="-${PV}" || die
28         # econf updates config.{sub,guess} which forces the manpages
29         # to be regenerated which we dont want to do #146621
30         touch man/*.1
31 }
32
33 # slot the info pages.  do this w/out munging the source so we don't have
34 # to depend on texinfo to regen things.  #464146 (among others)
35 slot_info_pages() {
36         [[ ${SLOT} == "0" ]] && return
37
38         pushd "${ED}"/usr/share/info >/dev/null || die
39         rm -f dir || die
40
41         # Rewrite all the references to other pages.
42         # before: * aclocal-invocation: (automake)aclocal Invocation.   Generating aclocal.m4.
43         # after:  * aclocal-invocation v1.13: (automake-1.13)aclocal Invocation.   Generating aclocal.m4.
44         local p pages=( *.info ) args=()
45         for p in "${pages[@]/%.info}" ; do
46                 args+=(
47                         -e "/START-INFO-DIR-ENTRY/,/END-INFO-DIR-ENTRY/s|: (${p})| v${SLOT}&|"
48                         -e "s:(${p}):(${p}-${SLOT}):g"
49                 )
50         done
51         sed -i "${args[@]}" * || die
52
53         # Rewrite all the file references, and rename them in the process.
54         local f d
55         for f in * ; do
56                 d=${f/.info/-${SLOT}.info}
57                 mv "${f}" "${d}" || die
58                 sed -i -e "s:${f}:${d}:g" * || die
59         done
60
61         popd >/dev/null || die
62 }
63
64 toolchain-autoconf_src_install() {
65         default
66         slot_info_pages
67 }
68
69 _TOOLCHAIN_AUTOCONF_ECLASS=1
70 fi