public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Sam James" <sam@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/devmanual:master commit in: general-concepts/autotools/
Date: Thu,  9 Dec 2021 04:24:37 +0000 (UTC)	[thread overview]
Message-ID: <1639023869.d9e28f40be32f76224ef0dbe2f3163e0615896f1.sam@gentoo> (raw)

commit:     d9e28f40be32f76224ef0dbe2f3163e0615896f1
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Thu Dec  9 04:19:23 2021 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Thu Dec  9 04:24:29 2021 +0000
URL:        https://gitweb.gentoo.org/proj/devmanual.git/commit/?id=d9e28f40

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 <AT> gentoo.org>

 general-concepts/autotools/text.xml | 45 ++++++++++++++++++++++++++-----------
 1 file 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>


             reply	other threads:[~2021-12-09  4:24 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-09  4:24 Sam James [this message]
  -- strict thread matches above, loose matches on Subject: below --
2022-03-01  9:59 [gentoo-commits] proj/devmanual:master commit in: general-concepts/autotools/ Sam James
2020-01-27 19:58 Ulrich Müller
2018-06-14 18:43 Göktürk Yüksek
2014-01-21 17:09 Justin Lecher
2013-09-07 19:14 Markos Chandras
2013-09-07 18:46 Markos Chandras

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1639023869.d9e28f40be32f76224ef0dbe2f3163e0615896f1.sam@gentoo \
    --to=sam@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox