public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] [PATCH scons-utils] Support setting common SCons arguments using myesconsargs.
@ 2011-10-23 18:20 Michał Górny
  2011-10-24  3:42 ` Nathan Phillip Brink
  0 siblings, 1 reply; 5+ messages in thread
From: Michał Górny @ 2011-10-23 18:20 UTC (permalink / raw
  To: gentoo-dev; +Cc: Michał Górny

---
 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




^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [gentoo-dev] [PATCH scons-utils] Support setting common SCons arguments using myesconsargs.
  2011-10-23 18:20 [gentoo-dev] [PATCH scons-utils] Support setting common SCons arguments using myesconsargs Michał Górny
@ 2011-10-24  3:42 ` Nathan Phillip Brink
  2011-10-24  7:46   ` Michał Górny
  0 siblings, 1 reply; 5+ messages in thread
From: Nathan Phillip Brink @ 2011-10-24  3:42 UTC (permalink / raw
  To: gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 552 bytes --]

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!

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [gentoo-dev] [PATCH scons-utils] Support setting common SCons arguments using myesconsargs.
  2011-10-24  3:42 ` Nathan Phillip Brink
@ 2011-10-24  7:46   ` Michał Górny
  2011-10-25  5:57     ` Mike Frysinger
  0 siblings, 1 reply; 5+ messages in thread
From: Michał Górny @ 2011-10-24  7:46 UTC (permalink / raw
  To: gentoo-dev; +Cc: binki

[-- Attachment #1: Type: text/plain, Size: 926 bytes --]

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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 316 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [gentoo-dev] [PATCH scons-utils] Support setting common SCons arguments using myesconsargs.
  2011-10-24  7:46   ` Michał Górny
@ 2011-10-25  5:57     ` Mike Frysinger
  2011-10-25 16:37       ` Michał Górny
  0 siblings, 1 reply; 5+ messages in thread
From: Mike Frysinger @ 2011-10-25  5:57 UTC (permalink / raw
  To: gentoo-dev

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



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [gentoo-dev] [PATCH scons-utils] Support setting common SCons arguments using myesconsargs.
  2011-10-25  5:57     ` Mike Frysinger
@ 2011-10-25 16:37       ` Michał Górny
  0 siblings, 0 replies; 5+ messages in thread
From: Michał Górny @ 2011-10-25 16:37 UTC (permalink / raw
  To: gentoo-dev; +Cc: vapier

[-- Attachment #1: Type: text/plain, Size: 1191 bytes --]

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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 316 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-10-25 16:38 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-23 18:20 [gentoo-dev] [PATCH scons-utils] Support setting common SCons arguments using myesconsargs Michał Górny
2011-10-24  3:42 ` Nathan Phillip Brink
2011-10-24  7:46   ` Michał Górny
2011-10-25  5:57     ` Mike Frysinger
2011-10-25 16:37       ` Michał Górny

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox