FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Gentoo > Gentoo Development

 
 
LinkBack Thread Tools
 
Old 10-23-2011, 06:20 PM
Michał Górny
 
Default Support setting common SCons arguments using myesconsargs.

---
scons-utils.eclass | 33 +++++++++++++++++++++++++--------
1 files changed, 25 insertions(+), 8 deletions(-)

diff --git a/scons-utils.eclass b/scons-utils.eclass
index a87b6e6..16fda7a 100644
--- a/scons-utils.eclass
+++ b/scons-utils.eclass
@@ -14,11 +14,21 @@
# @CODE
# inherit scons-utils toolchain-funcs
#
+# EAPI=4
+#
+# src_configure() {
+# myesconsargs=(
+# CC="$(tc-getCC)"
+# $(use_scons nls ENABLE_NLS)
+# )
+# }
+#
# src_compile() {
-# tc-export CC CXX
-# escons
-# $(use_scons nls ENABLE_NLS)
-# || die
+# escons
+# }
+#
+# src_install() {
+# escons install
# }
# @CODE

@@ -29,6 +39,12 @@
# @DESCRIPTION:
# The minimal version of SCons required for the build to work.

+# @ECLASS-VARIABLE: myesconsargs
+# @DEFAULT_UNSET
+# @DESCRIPTION:
+# List of package-specific options to pass to all SCons calls. Supposed to be
+# set in src_configure().
+
# @ECLASS-VARIABLE: SCONSOPTS
# @DEFAULT_UNSET
# @DESCRIPTION:
@@ -73,16 +89,17 @@ fi
# @FUNCTION: escons
# @USAGE: [scons-arg] ...
# @DESCRIPTION:
-# Call scons, passing the supplied arguments, ${MAKEOPTS} and
-# ${EXTRA_ESCONS}. Similar to emake. Like emake, this function does die
-# on failure in EAPI 4 (unless called nonfatal).
+# Call scons, passing the supplied arguments, ${myesconsargs[@]},
+# filtered ${MAKEOPTS}, ${EXTRA_ESCONS}. Similar to emake. Like emake,
+# this function does die on failure in EAPI 4 (unless called nonfatal).
escons() {
local ret

debug-print-function ${FUNCNAME} "${@}"

# if SCONSOPTS are _unset_, use cleaned MAKEOPTS
- set -- scons ${SCONSOPTS-$(scons_clean_makeopts)} ${EXTRA_ESCONS} "${@}"
+ set -- scons ${SCONSOPTS-$(scons_clean_makeopts)} ${EXTRA_ESCONS}
+ "${myesconsargs[@]}" "${@}"
echo "${@}" >&2
"${@}"
ret=${?}
--
1.7.7.325.g05f6ed.dirty
 
Old 10-24-2011, 03:42 AM
Nathan Phillip Brink
 
Default Support setting common SCons arguments using myesconsargs.

On Sun, Oct 23, 2011 at 08:20:37PM +0200, Micha?? G??rny wrote:
> ---
> scons-utils.eclass | 33 +++++++++++++++++++++++++--------
> 1 files changed, 25 insertions(+), 8 deletions(-)
...
> +# @ECLASS-VARIABLE: myesconsargs
> +# @DEFAULT_UNSET
> +# @DESCRIPTION:
> +# List of package-specific options to pass to all SCons calls. Supposed to be
> +# set in src_configure().

Shouldn't this variable be named MYESCONSARGS since it is being
introduced into the global scope?

--
binki

Look out for missing or extraneous apostrophes!
 
Old 10-24-2011, 07:46 AM
Michał Górny
 
Default Support setting common SCons arguments using myesconsargs.

On Mon, 24 Oct 2011 03:42:24 +0000
Nathan Phillip Brink <binki@gentoo.org> wrote:

> On Sun, Oct 23, 2011 at 08:20:37PM +0200, Micha?? G??rny wrote:
> > ---
> > scons-utils.eclass | 33 +++++++++++++++++++++++++--------
> > 1 files changed, 25 insertions(+), 8 deletions(-)
> ...
> > +# @ECLASS-VARIABLE: myesconsargs
> > +# @DEFAULT_UNSET
> > +# @DESCRIPTION:
> > +# List of package-specific options to pass to all SCons calls.
> > Supposed to be +# set in src_configure().
>
> Shouldn't this variable be named MYESCONSARGS since it is being
> introduced into the global scope?

I can't deny that but I'd like to keep it consistent with cmake-utils
and autotools-utils. Alternate approach would be to make it local to
src_configure() and add scons-utils_src_configure() which would export
it under internal name but I don't think that's really worth the effort.

--
Best regards,
Michał Górny
 
Old 10-25-2011, 05:57 AM
Mike Frysinger
 
Default Support setting common SCons arguments using myesconsargs.

On Mon, Oct 24, 2011 at 03:46, Michał Górny wrote:
> On Mon, 24 Oct 2011 03:42:24 +0000 Nathan Phillip Brink wrote:
>> On Sun, Oct 23, 2011 at 08:20:37PM +0200, Micha?? G??rny wrote:
>> > ---
>> > *scons-utils.eclass | * 33 +++++++++++++++++++++++++--------
>> > *1 files changed, 25 insertions(+), 8 deletions(-)
>> ...
>> > +# @ECLASS-VARIABLE: myesconsargs
>> > +# @DEFAULT_UNSET
>> > +# @DESCRIPTION:
>> > +# List of package-specific options to pass to all SCons calls.
>> > Supposed to be +# set in src_configure().
>>
>> Shouldn't this variable be named MYESCONSARGS since it is being
>> introduced into the global scope?
>
> I can't deny that but I'd like to keep it consistent with cmake-utils
> and autotools-utils. Alternate approach would be to make it local to
> src_configure() and add scons-utils_src_configure() which would export
> it under internal name but I don't think that's really worth the effort.

sounds like you want @VARIABLE and not @ECLASS-VARIABLE
-mike
 
Old 10-25-2011, 04:37 PM
Michał Górny
 
Default Support setting common SCons arguments using myesconsargs.

On Tue, 25 Oct 2011 01:57:11 -0400
Mike Frysinger <vapier@gentoo.org> wrote:

> On Mon, Oct 24, 2011 at 03:46, Michał Górny wrote:
> > On Mon, 24 Oct 2011 03:42:24 +0000 Nathan Phillip Brink wrote:
> >> On Sun, Oct 23, 2011 at 08:20:37PM +0200, Micha?? G??rny wrote:
> >> > ---
> >> > *scons-utils.eclass | * 33 +++++++++++++++++++++++++--------
> >> > *1 files changed, 25 insertions(+), 8 deletions(-)
> >> ...
> >> > +# @ECLASS-VARIABLE: myesconsargs
> >> > +# @DEFAULT_UNSET
> >> > +# @DESCRIPTION:
> >> > +# List of package-specific options to pass to all SCons calls.
> >> > Supposed to be +# set in src_configure().
> >>
> >> Shouldn't this variable be named MYESCONSARGS since it is being
> >> introduced into the global scope?
> >
> > I can't deny that but I'd like to keep it consistent with
> > cmake-utils and autotools-utils. Alternate approach would be to
> > make it local to src_configure() and add
> > scons-utils_src_configure() which would export it under internal
> > name but I don't think that's really worth the effort.
>
> sounds like you want @VARIABLE and not @ECLASS-VARIABLE

Thanks, fixed.

--
Best regards,
Michał Górny
 

Thread Tools




All times are GMT. The time now is 05:31 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org