summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2017-01-30 23:08:38 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-01-31 23:47:33 +0000
commite9256edb3399221f62e526ab5cbe3bd475c636c6 (patch)
treeedf403f9b5011fe239d4f1b0041bd9d0829c94e8
parent2bb0b1d9b51309038fcaaa6e1a62990cd2e7e257 (diff)
downloadpoky-e9256edb3399221f62e526ab5cbe3bd475c636c6.tar.gz
relocatable: Make native .pc files relocatable
The native .pc files currently have hardcoded paths in them meaning each has to be relocated at final install time. pkg-config has built in functionality to avoid this, namely the pcfiledir variable. This function translates .pc files to use the variable meaning further relocation later is unnecessary. (From OE-Core rev: a3f4e9ff55c7d9eba175e83eb6c99cf349a74432) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/classes/relocatable.bbclass13
1 files changed, 12 insertions, 1 deletions
diff --git a/meta/classes/relocatable.bbclass b/meta/classes/relocatable.bbclass
index 4ca9981f44..582812c1cf 100644
--- a/meta/classes/relocatable.bbclass
+++ b/meta/classes/relocatable.bbclass
@@ -1,7 +1,18 @@
1inherit chrpath 1inherit chrpath
2 2
3SYSROOT_PREPROCESS_FUNCS += "relocatable_binaries_preprocess" 3SYSROOT_PREPROCESS_FUNCS += "relocatable_binaries_preprocess relocatable_native_pcfiles"
4 4
5python relocatable_binaries_preprocess() { 5python relocatable_binaries_preprocess() {
6 rpath_replace(d.expand('${SYSROOT_DESTDIR}'), d) 6 rpath_replace(d.expand('${SYSROOT_DESTDIR}'), d)
7} 7}
8
9relocatable_native_pcfiles () {
10 if [ -d ${SYSROOT_DESTDIR}${libdir}/pkgconfig ]; then
11 rel=${@os.path.relpath(d.getVar('base_prefix'), d.getVar('libdir') + "/pkgconfig")}
12 sed -i -e "s:${base_prefix}:\${pcfiledir}/$rel:g" ${SYSROOT_DESTDIR}${libdir}/pkgconfig/*.pc
13 fi
14 if [ -d ${SYSROOT_DESTDIR}${datadir}/pkgconfig ]; then
15 rel=${@os.path.relpath(d.getVar('base_prefix'), d.getVar('datadir') + "/pkgconfig")}
16 sed -i -e "s:${base_prefix}:\${pcfiledir}/$rel:g" ${SYSROOT_DESTDIR}${datadir}/pkgconfig/*.pc
17 fi
18}