aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam James <sam@gentoo.org>2021-12-09 04:19:23 +0000
committerSam James <sam@gentoo.org>2021-12-09 04:24:29 +0000
commitd9e28f40be32f76224ef0dbe2f3163e0615896f1 (patch)
tree813d2c045b945685dcc601ce913cab63ef355351 /general-concepts
parentquickstart: mention PATCHES, use .patch and not .diff (diff)
downloaddevmanual-d9e28f40be32f76224ef0dbe2f3163e0615896f1.tar.gz
devmanual-d9e28f40be32f76224ef0dbe2f3163e0615896f1.tar.bz2
devmanual-d9e28f40be32f76224ef0dbe2f3163e0615896f1.zip
general-concepts/autotools: use EAPI 8 in examples and autotools.eclass helpers
- Use EAPI 8 in examples - Use eaclocal, eautoconf - Define WANT_AUTOCONF/WANT_AUTOMAKE in global scope before inheriting autotools.eclass. The eclass declares these as @PRE_INHERIT which is necessary for e.g. ensuring dependencies are set. Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'general-concepts')
-rw-r--r--general-concepts/autotools/text.xml45
1 files changed, 32 insertions, 13 deletions
diff --git a/general-concepts/autotools/text.xml b/general-concepts/autotools/text.xml
index b7170ba..11cacf3 100644
--- a/general-concepts/autotools/text.xml
+++ b/general-concepts/autotools/text.xml
@@ -116,23 +116,28 @@ either <c>Makefile.am</c> or <c>configure.ac</c>:
</p>
<codesample lang="ebuild">
-EAPI=5
+EAPI=8
+WANT_AUTOCONF=2.5
+WANT_AUTOMAKE=1.9
inherit autotools
+IUSE="nls"
+
+BDEPEND="nls? ( sys-devel/gettext )"
+
src_prepare() {
+ default
+
# Remove problematic LDFLAGS declaration
sed -i -e '/^LDFLAGS/d' src/Makefile.am || die
# Rerun autotools
- einfo "Regenerating autotools files..."
- WANT_AUTOCONF=2.5 eautoconf
- WANT_AUTOMAKE=1.9 eautomake
+ eautoreconf
}
-src_compile() {
+src_configure() {
econf $(use_enable nls)
- emake
}
</codesample>
@@ -591,10 +596,17 @@ In the first case you usually want to do something like:
</p>
<codesample lang="ebuild">
-einfo "Regenerating autotools files..."
-cp "${WORKDIR}/gentoo-m4" "${S}/m4" || die "m4 copy failed"
-WANT_AUTOCONF="2.5" aclocal -I "${S}/m4" || die "aclocal failed"
-WANT_AUTOCONF="2.5" autoconf || die "autoconf failed"
+WANT_AUTOCONF="2.5"
+inherit autotools
+
+src_prepare() {
+ default
+
+ einfo "Regenerating autotools files..."
+ cp "${WORKDIR}/gentoo-m4" "${S}/m4" || die "m4 copy failed"
+ eaclocal -I "${S}/m4"
+ eautoconf
+}
</codesample>
<p>
@@ -602,9 +614,16 @@ and so on. In the second case you can simplify it in this way:
</p>
<codesample lang="ebuild">
-einfo "Regenerating autotools files..."
-WANT_AUTOCONF="2.5" aclocal -I "${WORKDIR}/gentoo-m4" || die "aclocal failed"
-WANT_AUTOCONF="2.5" autoconf || die "autoconf failed"
+WANT_AUTOCONF="2.5"
+inherit autotools
+
+src_prepare() {
+ default
+
+ einfo "Regenerating autotools files..."
+ eaclocal -I "${WORKDIR}/gentoo-m4"
+ eautoconf
+}
</codesample>
<p>