poky/meta/classes/relocatable.bbclass
Peter Kjellerstedt 1332ac291d relocatable.bbclass: Avoid an exception if an empty pkgconfig dir exist
Rewrite relocatable_native_pcfiles() so that it can handle that any of
the checked pkgconfig directories are empty without causing an
exception.

(From OE-Core rev: f9c5df6dc1c13e9b05ff1b47ad84ad339f6779a4)

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-06-15 14:53:46 +01:00

21 lines
661 B
Plaintext

inherit chrpath
SYSROOT_PREPROCESS_FUNCS += "relocatable_binaries_preprocess relocatable_native_pcfiles"
python relocatable_binaries_preprocess() {
rpath_replace(d.expand('${SYSROOT_DESTDIR}'), d)
}
relocatable_native_pcfiles() {
for dir in ${libdir}/pkgconfig ${datadir}/pkgconfig; do
files_template=${SYSROOT_DESTDIR}$dir/*.pc
# Expand to any files matching $files_template
files=$(echo $files_template)
# $files_template and $files will differ if any files were found
if [ "$files_template" != "$files" ]; then
rel=$(realpath -m --relative-to=$dir ${base_prefix})
sed -i -e "s:${base_prefix}:\${pcfiledir}/$rel:g" $files
fi
done
}