I have a layer with recipes that is compatible with rocko. I'd like to add compatibility for thud. LAYERSERIES_COMPAT_layer
supports a list, so supporting more than one release with a layer seems to be intended.
Thud contains some version bumps to libraries that break compatibility. An example would be protobuf-3.6, which contains incompatible API changes to the earlier version used in rocko.
For all packages in the layer, I have patches for their sources that make them compatible with the new API versions (only).
Currently, there is a culture of creating different branches (or even forks) of meta-layers in order to support different library versions. This causes heavy fragmentation and deviation between the projects and departments.
If I can create recipes that work independent of, for example, the exact version of protobuf used in a build, then I can merge back some of those forks and branches and maintain one repo.
I tried some approach with conditional
.bbappend
, but couldn't find a way to do it. There seems to be no equivalent for COMPATIBLE_MACHINE, for example, that I could use to differentiate between releases.I also tried an approach of conditionally patching the sources depending on actual PV of a dependency. Basically trying to do what is described in the following snipped of recipe pseudo code:
DEPENDS += "protobuf"
SRC_URI = "git://github.com/foo/bar;"
if ${protobuf_PV} larger_or_equal "3.6.0"
SRC_URI_append = " file://replace_protobuf_scoped_ptr.patch"
endif
I found an existing answer here which made me doubt that this is possible: How can I reference/find the ${PV} of one recipe in another recipe in Yocto/Bitbake?
So, what mechanisms, if any, does bitbake provide to help me make a recipe compatible with different versions of dependencies in general, and with different yocto releases in particular?