I'm using the zeus
Yocto release as Linux build system. In this release the recipe for hiredis
(hiredis is a minimalistic C client library for the Redis database) fetches and compiles the version 0.14.0
of this library.
I would like to use a more recent version of this library; in particular my goal is to fetch and compile the version 1.0.2
of hiredis
.
zeus
release of YoctoThe recipe hiredis_0.14.0.bb
, stored in the folder meta-openembedded/meta-oe/recipes-extended/hiredis
of the zeus
release, is the following:
DESCRIPTION = "Minimalistic C client library for Redis"
HOMEPAGE = "http://github.com/redis/hiredis"
LICENSE = "BSD-3-Clause"
SECTION = "libs"
DEPENDS = "redis"
LIC_FILES_CHKSUM = "file://COPYING;md5=d84d659a35c666d23233e54503aaea51"
SRCREV = "685030652cd98c5414ce554ff5b356dfe8437870"
SRC_URI = "git://github.com/redis/hiredis;protocol=git \
file://0001-Makefile-remove-hardcoding-of-CC.patch"
S = "${WORKDIR}/git"
inherit autotools-brokensep pkgconfig
EXTRA_OEMAKE = "PREFIX=${prefix} LIBRARY_PATH=${baselib}"
# By default INSTALL variable in Makefile is equal to 'cp -a', which preserves
# ownership and causes host-user-contamination QA issue.
# And PREFIX defaults to /usr/local.
do_install_prepend() {
export INSTALL='cp -r'
}
With this recipe bitbake
fetches the version 0.14.0
of hiredis
from the GitHub repository. I suppose that the version 0.14.0
is selected by the version of the recipe contained in its name "hiredis_0.14.0".
Note: I don't want to modify the recipe hiredis_0.14.0.bb
or add a new recipe (with the name hiredis_1.0.2.bb
) in the folder meta-openembedded/meta-oe/recipes-extended/hiredis
. I would like to create a .bbappend
file in my meta layer without modify the official meta-openembedded
layer of the zeus
release.
SRC_URI
not workI have tried to create a file hiredis_%.bbappend
with the following definition of the variable SRC_URI
:
SRC_URI = "git://github.com/redis/hiredis;protocol=git;branch=1.0.2"
But the compilation with bitbake
gives the following error message:
> bitbake hiredis
...
ERROR: hiredis-0.14.0-r0 do_fetch: Fetcher failure for URL: 'git://github.com/redis/hiredis;protocol=git;branch=1.0.2'. Unable to fetch URL from any source.
How can I create a my-layer/recipes-extended/hredis/hredis_%.bbappend
file to force the Git Fetcher to download a specific version of hredis
(for example the version 1.0.2
) from the GitHub repository?
I have found a solution by the creation of the following hiredis_%.bbappend
file:
PV="1.0.2"
# In SRC_URI I have change values of the protocol and the branch parameters
SRC_URI = "git://github.com/redis/hiredis;protocol=https;branch=master"
# Commit Hash of version 1.0.2 of hiredis library
SRCREV = "b731283245f3183af527237166261ad0768ba7d4"
inherit cmake
In this way the Git Fetcher downloads the version 1.0.2
from the GitHub repository and in the image is installed the dynamic library libhiredis.so.1.0.0
(the version showed by the name of the library is 1.0.0
instead 1.0.2
).
hiredis_%.bbappend
PV=1.0.2
(this select the version 1.0.2
instead 0.14.0
set by the recipe name)SRC_VALUE
as protocol=https;branch=master
instead protocol=git;branch=1.0.2
(see the attempt shown in the question)SRCREV
equal to git commit hash of the version 1.0.2inherit cmake
because the version 1.0.2
use CMake