commit: 3214de4c965e8bc94c7f14f7f0d52c117df7a3cd
Author: Thomas Bracht Laumann Jespersen <t <AT> laumann <DOT> xyz>
AuthorDate: Wed Mar 16 14:12:36 2022 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Mar 18 18:10:17 2022 +0000
URL: https://gitweb.gentoo.org/proj/devmanual.git/commit/?id=3214de4c
eclass-writing: Add default src_configure to jmake example
The jmake sample eclass was written before EAPI 2 and thus predates
src_configure() where configuration and compilation where both handled
in src_compile().
Now it makes sense to have a separate jmake_src_configure() that is used
as the default src_configure().
Signed-off-by: Thomas Bracht Laumann Jespersen <t <AT> laumann.xyz>
Signed-off-by: Sam James <sam <AT> gentoo.org>
eclass-writing/text.xml | 19 ++++++++++++++-----
1 file changed, 14 insertions(+), 5 deletions(-)
diff --git a/eclass-writing/text.xml b/eclass-writing/text.xml
index 5378184..f5bb88b 100644
--- a/eclass-writing/text.xml
+++ b/eclass-writing/text.xml
@@ -667,7 +667,7 @@ src_compile() {
<body>
<p>
-A simple eclass which defines a number of functions and a default
+A simple eclass which defines a number of functions and default
<c>src_confgure</c> and
<c>src_compile</c> for the (hypothetical) <c>jmake</c> build system might look
something like the following:
</p>
@@ -684,9 +684,10 @@ something like the following:
# @BLURB: Demonstrate a simple build system eclass.
# @DESCRIPTION:
# Demonstrates EXPORT_FUNCTIONS and defines simple wrappers for the
-# (hypothetical) jmake build system and a default src_compile.
+# (hypothetical) jmake build system along with default src_configure and
+# src_compile phase functions
-EXPORT_FUNCTIONS src_compile
+EXPORT_FUNCTIONS src_configure src_compile
BDEPEND=">=sys-devel/jmake-2"
@@ -699,6 +700,15 @@ jmake-configure() {
jmake configure --prefix=/usr "$@"
}
+# @FUNCTION: jmake_src_configure
+# @USAGE: [additional-args]
+# @DESCRIPTION:
+# Calls jmake-configure() to configure a jmake project. Passes all arguments
+# through to the appropriate "jmake configure" command.
+jmake_src_configure() {
+ jmake-configure "$@" || die "configure failed"
+}
+
# @FUNCTION: jmake-build
# @USAGE: [additional-args]
# @DESCRIPTION:
@@ -710,9 +720,8 @@ jmake-build() {
# @FUNCTION: jmake_src_compile
# @DESCRIPTION:
-# Calls jmake-configure() and jmake-build() to compile a jmake project.
+# Calls jmake-build() to compile a jmake project.
jmake_src_compile() {
- jmake-configure || die "configure failed"
jmake-build || die "build failed"
}
</codesample>