[yocto] Yocto and Google protobuffer

Pietro pulsarpietro at posteo.net
Fri Sep 2 01:08:22 PDT 2016


Maciej Borzęcki
<maciej.borzecki at rndity.com> writes:

> On Thu, Sep 1, 2016 at 5:45 PM, Pietro <pulsarpietro at posteo.net> wrote:
>> Herman van Hazendonk <me at herrie.org>
>> writes:
>>
>>> If it takes the wrong version, it could be your layers aren't in the
>>> right order. That's the first thing to check.
>>>
>>> You might want to try to run bitbake with
>>>
>>> -f protobuf -c cleanall or -f protobuf-native -c cleanall
>>>
>>> This will remove all locally ;)
>>>
>>> Then rebuild it... I haven't played much with the -native bits, so not
>>> sure how those work.
>>>
>> I needed to specify DEPENDS = "protobuf-native" to get it working, I
>> would be really interested to understand exactly what that does, but I
>> must admit to myself I can't understand everything in a single shot.
>
> Quoting my first email:
>>> All you need to do,
>>>is include meta-oe in your layers (bblayers.conf) and have
>>> protobuf-native listed in DEPENDS inside your package recipe.
>
> DEPENDS lists build time dependencies, like libraries, tools etc.
> protobuf-native, by convention, means that the package was built for
> your build host. This enables you to run protoc during the build to
> generate proper language bindings.
>
Where are all these "native" binaries stored ? Is it "sysroot" ?

How can I declare run-time dependencies ?

Such library should be cross-compiled in order to successfully
link my package's binaries against it, on the other hand when building
the "protoc" the target should be the host machine as such tool will be
run on the host machine when required.

I wonder if is the "native" keyword in the DEPENDS statement to draw the
line, so in a recipe A:

i) DEPENDS = "protobuf"
   tells that the recipe depends on the protobuf at run-time - namely during
   the linking and when the binary resulting from A is executed.
   So protobuf is cross-compiled.
   
ii) DEPENDS = "protobuf-native"
    tells that the recipe depends on the prottobuf at build-time and a
    result of that protobuf is NOT cross compiled.

>>
>> So never mind.
>>
>> I still have another question :-)
>>
>> I am about to create another recipe for the gprc library for C++, to
>> build it on my local machine has been pretty simple:
>>
>> $ git clone -b $(curl -L http://grpc.io/release)
>> https://github.com/grpc/grpc
>> $ cd grpc
>> $ git submodule update --init
>> $ make
>> $ [sudo] make install
>>
>> The recipe I have created so far would clone/checkout the source code
>> from a GIT repo or something similar and then the build process could
>> start straight away.
>>
>> In my case I have an additional step:
>>
>> git submodule update --init
>>
>
> There's a submodule fetcher, when setting SRC_URI use `gitsm://`
> instead of `git://` see
> https://www.yoctoproject.org/docs/2.1/bitbake-user-manual/bitbake-user-manual.html#gitsm-fetcher
> for details.
>
> Cheers,
> -- 
> Maciej Borzecki
> RnDity
Thanks, I'll give to it a go.




More information about the yocto mailing list