public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Michał Górny" <mgorny@gentoo.org>
To: gentoo-dev-announce@lists.gentoo.org
Cc: gentoo-dev@lists.gentoo.org
Subject: [gentoo-dev] New eclass: scons-utils.eclass
Date: Thu, 7 Oct 2010 21:35:13 +0200	[thread overview]
Message-ID: <20101007213513.3a66c214@pomiocik.lan> (raw)

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

Hello devs,

I've just committed a new eclass to gx86 -- it's called scons-utils
and it's supposed to help creating clean ebuilds for packages using
the SCons buildsystem.

Right now, the eclass addresses the two following important issues:

${MAKEOPTS} cleaning
--------------------

Currently the ebuilds either ignore MAKEOPTS completely, pass it
unmodified or clean it up a little using a copy-paste sed expression.

The scons-utils eclass introduces scons_clean_makeopts() function which
is able to nicely adjust MAKEOPTS to fit SCons. But in fact, you
probably won't ever need to call it -- escons() does it for you.

use_scons()
-----------

Right now, ebuilds use complex variable mangling in order to prepare
SCons variable assignments based on USEflags. Consider the following
code snippet (from media-sound/mixxx):

use hifieq && mysconsargs+=" hifieq=1" || mysconsargs+=" hifieq=0"

With scons-utils you can move this into actual `mysconsargs`
declaration, putting it like that:

$(use_scons hifieq)


Trivial use example
-------------------

Well, enough talking. Now a simple example on how to use it:


inherit scons-utils

src_compile() {
	escons \
		$(use_scons nls gettext) \
		$(use_scons ssl)
}


`escons` here is similar to emake. It simply calls scons, passing
appropriate flags to it. If SCONSOPTS is set (optional, supposed to be
set in make.conf, never mangle it in ebuilds!), it will be used;
otherwise, scons-utils will use cleaned up version of MAKEOPTS.

`use_scons <flag>` outputs either `<flag>=0` or `<flag>=1` depending on
whether the <flag> flag is set.

`use_scons !<flag>` would output: `no<flag>=1` or `no<flag>=0`.

`use_scons <flag> <var>` outputs: `<var>=0` or `<var>=1`, checking
<flag> flag.

For a few more tricks, please take a look at the eclass docs.

Thank you for your attention. If you have any questions, I'll be happy
to answer them.

-- 
Best regards,
Michał Górny

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

             reply	other threads:[~2010-10-07 19:36 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-07 19:35 Michał Górny [this message]
2010-10-08 15:40 ` [gentoo-dev] New eclass: scons-utils.eclass Jeroen Roovers
2010-10-08 15:43   ` Gökdeniz Karadağ
2010-10-11 18:27     ` Jeroen Roovers

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20101007213513.3a66c214@pomiocik.lan \
    --to=mgorny@gentoo.org \
    --cc=gentoo-dev-announce@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox