mirror of
https://git.yoctoproject.org/poky
synced 2026-04-17 18:32:12 +02:00
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: ceffd920c7bdae29cd1a606f1c20d1b2d3666f5b) Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit f9c5df6dc1c13e9b05ff1b47ad84ad339f6779a4) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
994783b52e
commit
92b2e7e49e
@@ -6,13 +6,15 @@ python relocatable_binaries_preprocess() {
|
||||
rpath_replace(d.expand('${SYSROOT_DESTDIR}'), d)
|
||||
}
|
||||
|
||||
relocatable_native_pcfiles () {
|
||||
if [ -d ${SYSROOT_DESTDIR}${libdir}/pkgconfig ]; then
|
||||
rel=${@os.path.relpath(d.getVar('base_prefix'), d.getVar('libdir') + "/pkgconfig")}
|
||||
sed -i -e "s:${base_prefix}:\${pcfiledir}/$rel:g" ${SYSROOT_DESTDIR}${libdir}/pkgconfig/*.pc
|
||||
fi
|
||||
if [ -d ${SYSROOT_DESTDIR}${datadir}/pkgconfig ]; then
|
||||
rel=${@os.path.relpath(d.getVar('base_prefix'), d.getVar('datadir') + "/pkgconfig")}
|
||||
sed -i -e "s:${base_prefix}:\${pcfiledir}/$rel:g" ${SYSROOT_DESTDIR}${datadir}/pkgconfig/*.pc
|
||||
fi
|
||||
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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user