srctree and gitver
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
Signature · 1 line
Pierre
Quoted 14 lines · Pierre Tardy
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}"
Quoted 6 lines
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: taskdo_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.
Signature · 7 lines
Chris Larson clarson at kergoth dot com clarson at mvista dot com Founder - BitBake, OpenEmbedded, OpenZaurus Maintainer - Tslib Software Engineer MontaVista Software, Inc.