Gentoo Archives: gentoo-dev

From: "Michał Górny" <mgorny@g.o>
To: gentoo-dev@l.g.o
Cc: "Michał Górny" <mgorny@g.o>
Subject: [gentoo-dev] [PATCH scons-utils] Support setting common SCons arguments using myesconsargs.
Date: Sun, 23 Oct 2011 18:21:18
Message-Id: 1319394037-4619-1-git-send-email-mgorny@gentoo.org
1 ---
2 scons-utils.eclass | 33 +++++++++++++++++++++++++--------
3 1 files changed, 25 insertions(+), 8 deletions(-)
4
5 diff --git a/scons-utils.eclass b/scons-utils.eclass
6 index a87b6e6..16fda7a 100644
7 --- a/scons-utils.eclass
8 +++ b/scons-utils.eclass
9 @@ -14,11 +14,21 @@
10 # @CODE
11 # inherit scons-utils toolchain-funcs
12 #
13 +# EAPI=4
14 +#
15 +# src_configure() {
16 +# myesconsargs=(
17 +# CC="$(tc-getCC)"
18 +# $(use_scons nls ENABLE_NLS)
19 +# )
20 +# }
21 +#
22 # src_compile() {
23 -# tc-export CC CXX
24 -# escons \
25 -# $(use_scons nls ENABLE_NLS) \
26 -# || die
27 +# escons
28 +# }
29 +#
30 +# src_install() {
31 +# escons install
32 # }
33 # @CODE
34
35 @@ -29,6 +39,12 @@
36 # @DESCRIPTION:
37 # The minimal version of SCons required for the build to work.
38
39 +# @ECLASS-VARIABLE: myesconsargs
40 +# @DEFAULT_UNSET
41 +# @DESCRIPTION:
42 +# List of package-specific options to pass to all SCons calls. Supposed to be
43 +# set in src_configure().
44 +
45 # @ECLASS-VARIABLE: SCONSOPTS
46 # @DEFAULT_UNSET
47 # @DESCRIPTION:
48 @@ -73,16 +89,17 @@ fi
49 # @FUNCTION: escons
50 # @USAGE: [scons-arg] ...
51 # @DESCRIPTION:
52 -# Call scons, passing the supplied arguments, ${MAKEOPTS} and
53 -# ${EXTRA_ESCONS}. Similar to emake. Like emake, this function does die
54 -# on failure in EAPI 4 (unless called nonfatal).
55 +# Call scons, passing the supplied arguments, ${myesconsargs[@]},
56 +# filtered ${MAKEOPTS}, ${EXTRA_ESCONS}. Similar to emake. Like emake,
57 +# this function does die on failure in EAPI 4 (unless called nonfatal).
58 escons() {
59 local ret
60
61 debug-print-function ${FUNCNAME} "${@}"
62
63 # if SCONSOPTS are _unset_, use cleaned MAKEOPTS
64 - set -- scons ${SCONSOPTS-$(scons_clean_makeopts)} ${EXTRA_ESCONS} "${@}"
65 + set -- scons ${SCONSOPTS-$(scons_clean_makeopts)} ${EXTRA_ESCONS} \
66 + "${myesconsargs[@]}" "${@}"
67 echo "${@}" >&2
68 "${@}"
69 ret=${?}
70 --
71 1.7.7.325.g05f6ed.dirty

Replies