[gnome-continuous-yocto/gnomeostree-3.28-rocko: 4435/8267] relocatable: Make native .pc files relocatable
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-continuous-yocto/gnomeostree-3.28-rocko: 4435/8267] relocatable: Make native .pc files relocatable
- Date: Sun, 17 Dec 2017 02:01:58 +0000 (UTC)
commit e9256edb3399221f62e526ab5cbe3bd475c636c6
Author: Richard Purdie <richard purdie linuxfoundation org>
Date: Mon Jan 30 23:08:38 2017 +0000
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>
meta/classes/relocatable.bbclass | 13 ++++++++++++-
1 files changed, 12 insertions(+), 1 deletions(-)
---
diff --git a/meta/classes/relocatable.bbclass b/meta/classes/relocatable.bbclass
index 4ca9981..582812c 100644
--- a/meta/classes/relocatable.bbclass
+++ b/meta/classes/relocatable.bbclass
@@ -1,7 +1,18 @@
inherit chrpath
-SYSROOT_PREPROCESS_FUNCS += "relocatable_binaries_preprocess"
+SYSROOT_PREPROCESS_FUNCS += "relocatable_binaries_preprocess relocatable_native_pcfiles"
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
+}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]