[yocto] Package Level Dependencies
Rudolf J Streif
rudolf.streif at gmail.com
Sun Feb 21 17:38:14 PST 2016
Hi Sebastian,
> I have a recipe (say: "test123") that provides a complex piece of software
> (cmake-based). The software needs some configuration file (say
> "test123.conf"). There are multiple variants of the configuration file,
> sharing the same name, i.e. "test123.conf" exists in different variants for
> multiple hardware configurations.
>
> My aim would be to have multiple packages like "test123-config-XXX" and
> "test123-config-YYY", that cannot be installed at the same time, while
> having one of the packages is a dependency for the main package "test123".
These are two conflicting packages.
>
> Is there a way to achieve this? From my current understanding, dependencies
> are "per-recipe" and not "per-package". Is there any way to achieve package
> level dependencies? I would like to avoid having multiple recipes as there
> are many configuration file options which are currently located in the same
> large source repository as the main software.
Look at it from the perspective of conflicting packages.
My approach to this would be the following:
1. Write an include file test123.inc that includes all of the guts of your
recipe.
2. Write the two recipes test123-config-XXX_1.0.bb and test123-config-
YYY_1.0.bb:
test123-config-XXX_1.0.bb
require test123.inc
SRC_URI += "test123-XXX.conf"
do_install_append() {
# install config file here
install 544 test123-XXX.conf ${D}/<location>
}
RCONFLICTS_${PN} = "test123-config-YYY"
Analog for test123-config-YYY_1.0.bb
You are essentially sharing all of the recipe through the test123.inc and only
add the config file to the respective target recipe. The RCONFLICTS_${PN}
directive will flag an error if both conflicting packages are attempted to be
installed.
BR,
Rudi
More information about the yocto
mailing list