gitcmakeyoctobitbakeyocto-recipe

How to setup an Yocto recipe to build from a local git source?


Hej

I am playing a bit around with Yocto, a Raspberry Pi and some code I have written. I want to build by Yocto an image including the program I have written. I like to know how to setup the fetcher to fetch from a local git repo.

My setup is simple. The code is in the directory:

/home/user/git/myTest

I linked the directory into the directory which contains the recipe of my Yocto meta-layer. The directory is:

/home/user/poky/meta-test/myApp/myTest

Because it is a local git repo, it contains the ".git" folder.

/home/user/git/myTest/.git

Inside the directory there are many files:

/home/user/git/myTest/CMakeLists.txt
/home/user/git/myTest/src/main.cpp
/home/user/git/myTest/src/...

I like to know how to setup my recipe to use the git fetcher:

SUMMARY = "test"
SECTION = "app"
LICENSE = "CLOSED"

inherit cmake

SRCREV = "${AUTOREV}"

SRC_URI = "git://.git"

S = "${WORKDIR}/git"

I did check the Yocto/Bitbake documentation. But I did not find an example suited to do it. Any ideas?


Solution

  • GIT Fetcher in bitbake supports different protocols but with rather peculiar and non-standard syntax. In your case it should be something like

    SRC_URI = "git:///home/user/git/myTest/;protocol=file"