[OE-core] Using external source trees with OE-Core

Mark Hatle mark.hatle at windriver.com
Fri Feb 24 14:41:09 UTC 2012


On 2/24/12 7:49 AM, Andreas Oberritter wrote:
> On 24.02.2012 13:55, Richard Purdie wrote:
>> Someone recently asked me about using external source trees with
>> OE-Core. I was aware of srctree.bbclass in OE-Classic and did start
>> looking at it but it has various elements I wasn't so keen on. I
>> therefore wondered if I could improve upon it. I did start from that
>> code base but came up with:
>>
>> http://git.yoctoproject.org/cgit.cgi/poky-contrib/commit/?h=rpurdie/a0&id=ac8a54c18c33aaab6758c34a3d6093d3d3384cee
>> [patch inline below]
>>
>> which I've called externalsrc.bbclass since it behaves a bit
>> differently. In particular, all the usual task targets are available.
>>
>> As an example usage with the above patch applied:
>>
>> cd ~
>> tar -xvzf $DL_DIR/libfm-0.1.17.tar.gz
>> (creates libfm-0.1.17 in my homedir)
>>
>> edit libfm_0.1.17.bb and add:
>>
>> inherit externalsrc
>> S = "/home/richard/libfm-0.1.17"
>
> Do I need to edit libfm_0.1.17.bb in-place, or can it be stored outside
> my layers to be built with bitbake -b, for example?

You should be able to add a bbappend for this item, in a custom development 
layer and not modify the original .bb.  It will still require the two line 
configuration change (and a custom layer configuration... but I recommend that 
anyway.)

> Does S need to contain an absolute path, or could it be set to a path
> relative to the location of the recipe?

I don't know for this development.... but relative can get very messy, 
especially when all of the project, work dir, etc can be overridden to create a 
custom environment for someone.  Enforcing an absolute path isn't a bad idea here.

> It would be nice if it was possible to include bitbake recipes in the
> source trees of my projects, which "just work".

Might be possible in something like base.bbclass to add the inherit if a value 
is set.. then in local.conf you could do something like:

EXTERNALSRC_libfm = "/home/richard/libfm-0.1.17"

And if it's set, the class could do the reset?  That would certainly be easier 
then a layer.

--Mark

> I think this was possible with srctree.bbclass, though I never had it
> working reliably. I think bitbake -cclean always raised errors.
>
> Regards,
> Andreas
>
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core at lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core





More information about the Openembedded-core mailing list