On Sun, Aug 22, 2010 at 12:04:52PM +0200, Michał Górny wrote: > Hello, > > As per bug #333911, I'm working on a new eclass, providing some basic > functions common to most of the ebuilds using the SCons build system. > > [...] > > I'm attaching the eclass draft (the same which is attached to bug > #333911), and inlining a simple use example below: > > #v+ > inherit scons > > # ... > > pkg_setup() { > scons-clean-makeopts > } > > src_compile() { > scons \ > $(scons-use unicode) \ > $(scons-use gnutls ssl gnutls openssl) \ > ${MAKEOPTS} || die > # expands into: > # scons unicode={1|0} ssl={gnutls|openssl} -jN || die > } > #v-
Looks nice :) You could avoid having to define pkg_setup in every ebuild by defining a default one in your eclass: --- scons.eclass.old 2010-08-22 13:11:57.000000000 +0300 +++ scons.eclass 2010-08-22 13:15:57.000000000 +0300 @@ -39,6 +39,15 @@ DEPEND="dev-util/scons" fi +# -- phase functions -- + +# @FUNCTION: scons_pkg_setup +# @DESCRIPTION: +# default pkg_setup, runs scons-clean-makeopts +scons_pkg_setup() { + scons-clean-makeopts +} + # -- public functions -- # @FUNCTION: scons-clean-makeopts @@ -185,3 +194,5 @@ _scons-clean-makeopts-perform-test '-j2 HOME=/tmp' '-j2' _scons-clean-makeopts-perform-test '--jobs funnystuff -k' "--jobs=${jc} -k" } + +EXPORT_FUNCTIONS pkg_setup > -- > Best regards, > Michał Górny > > <http://mgorny.alt.pl> > <xmpp:mgo...@jabber.ru> -- Alex Alexander -=- wired Gentoo Linux Developer -=- Council / Qt / Chromium / KDE / more www.linuxized.com
pgp0A6fSdvEeq.pgp
Description: PGP signature