Gentoo Logo
Gentoo Spaceship




Note: Due to technical difficulties, the Archives are currently not up to date. GMANE provides an alternative service for most mailing lists.
c.f. bug 424647
List Archive: gentoo-dev
Navigation:
Lists: gentoo-dev: < Prev By Thread Next > < Prev By Date Next >
Headers:
To: gentoo-dev@g.o
From: Michał Górny <gentoo@...>
Subject: New eclass: scons.eclass
Date: Sun, 22 Aug 2010 12:04:52 +0200
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.

The basic reason for the new eclass is that a growing number of ebuilds
is calling SCons directly, and reimplementing the same ideas. This is
especially important with MAKEOPTS, as SCons implements only a subset
of GNU make options.

Currently, you can find a set of ebuilds which mangle the MAKEOPTS using
a copypaste sed expression (poor though), many other ebuilds which
don't mangle it at all (and thus risk passing unsupported options like
--load-average or --jobs without an argument), and even some which
ignore MAKEOPTS at all.

The eclass addresses the issue through providing scons-clean-makeopts()
function in a manner similar to flag-o-matic.eclass strip-flags()
function. This function, supposedly called within the package's
pkg_setup() phase function, makes sure MAKEOPTS contains a clean set of
options suitable for passing to scons.

Another issue the eclass addresses is passing USE-controlled options.
PMS provides use_with and use_enable calls, suitable for
autotools-based build systems; SCons uses make-like 'var=value' syntax
instead. This is where use-scons() comes in handy -- it outputs such a
variable definition, based on the state a particular USEflag.

The last thing the eclass does is simply adding the DEPEND for SCons. I
don't think that needs any explanation.

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-

-- 
Best regards,
Michał Górny

<http://mgorny.alt.pl>
<xmpp:mgorny@...>
Attachment:
scons.eclass (Binary data)
Attachment:
signature.asc (PGP signature)
Replies:
Re: New eclass: scons.eclass
-- Michał Górny
Re: New eclass: scons.eclass
-- Michał Górny
Re: New eclass: scons.eclass
-- David Leverton
Re: New eclass: scons.eclass
-- Alex Alexander
Navigation:
Lists: gentoo-dev: < Prev By Thread Next > < Prev By Date Next >
Previous by thread:
updated elass documentation syntax
Next by thread:
Re: New eclass: scons.eclass
Previous by date:
Re: updated elass documentation syntax
Next by date:
Re: New eclass: scons.eclass


Updated Jun 29, 2012

Summary: Archive of the gentoo-dev mailing list.

Donate to support our development efforts.

Copyright 2001-2013 Gentoo Foundation, Inc. Questions, Comments? Contact us.