[oe] srctree and gitver

Chris Larson clarson at kergoth.com
Thu Sep 10 16:18:19 UTC 2009


On Thu, Sep 10, 2009 at 6:09 AM, Pierre Tardy <tardyp at gmail.com> wrote:
> Hello,
> Working on clutter, I want oe to build it easily, without making another
> recipe.
> I found out that adding those lines to local.conf will do the magic.
>
> INHERIT_pn-clutter-1.0 += "srctree"
> S_pn-clutter-1.0 = "/local/oe/localforks/clutter"
> PV_pn-clutter-1.0 = "local"
>
> The thing is I'd like to write:
> INHERIT_pn-clutter-1.0 += "srctree gitver"
> S_pn-clutter-1.0 = "/local/oe/localforks/clutter"
> PV_pn-clutter-1.0 = "${GITVER}"
>
> but GITVER wont get expanded:
>
> NOTE: Running task 1 of 16 (ID: 1, /local/oe/poky/meta/packages/clutter/
> clutter-1.0_git.bb, do_setscene)
> NOTE: package clutter-1.0-${GITVER}: started
> NOTE: package clutter-1.0-${GITVER}-r2: task do_setscene: started

Before I explain why it's behaving this way, I want to point out that
I think what you intended is not what those lines your local.conf are
doing.

INHERIT_pn-clutter += "foo"

This appends " foo" to the "INHERIT_pn-clutter" variable, then at the
end of parse time, if pn-bitbake is in OVERRIDES, INHERIT_pn-clutter
will overwrite INHERIT, so you'd lose such necessary inherits as
package_ipk (or deb, rpm..).  This appends to a conditional variable,
as opposed to conditionally appending to a variable.

INHERIT_append_pn-clutter = " foo" will append to "INHERIT" only if
"pn-clutter" is in OVERRIDES, which is I think what you intended.

Now, to the real problem.  Unfortunately, here we have to be aware of
an implementation detail within BitBake itself.  All of the classes in
INHERIT are parsed into the configuration metadata after parsing
bitbake.conf (and the other .conf's as a result).  It's done this way
because items in INHERIT are generally global, and this avoids having
to parse them for each recipe.  So, changing INHERIT for one recipe
isn't likely to do anything at all, hence the unexpanded GITVER.

This is what I'd advise for your situation, assuming you want to avoid
modifying the recipe (which it seems is the case):

Add these lines to conf/local.conf:
require conf/amend-recipes.inc
FILESPATHBASE =. "${TOPDIR}/files:"

Now in TOPDIR, run:
mkdir -p files/clutter

And create files/clutter/amend.inc containing:
inherit srctree gitver

S = "/local/oe/localforks/clutter"
PV = "${GITVER}"

amend-recipes.inc allows you to append a chunk of metadata to a given
recipe by placing an amend.inc in the recipe's FILESPATH.
-- 
Chris Larson
clarson at kergoth dot com
clarson at mvista dot com
Founder - BitBake, OpenEmbedded, OpenZaurus
Maintainer - Tslib
Software Engineer
MontaVista Software, Inc.




More information about the Openembedded-devel mailing list