aboutsummaryrefslogtreecommitdiffstats
path: root/meta/classes
diff options
context:
space:
mode:
authorPeter Kjellerstedt <peter.kjellerstedt@axis.com>2016-05-12 10:37:48 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-05-13 13:40:49 +0100
commit80e7e7f78d957b8159bede2a5cd5614d8d73039c (patch)
tree9d6ef05bf311e3b6f3dfba976de390a5a2d45f6e /meta/classes
parent7b8a99c2715583b48d1d3a1d9004c0607b99ddd1 (diff)
downloadopenembedded-core-contrib-80e7e7f78d957b8159bede2a5cd5614d8d73039c.tar.gz
staging.bbclass: Make it easier to define which dirs to stage
The directories that should be staged in the sysroot are now specified in the SYSROOT_DIRS variable. Extra directories that should be staged for native are specified in SYSROOT_DIRS_NATIVE. Finally, directories that should not be staged are specified in SYSROOT_DIRS_BLACKLIST. This also removes the sysroot_stage_libdir() function as it is no longer used (it was just a wrapper for sysroot_stage_dir()). Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-rw-r--r--meta/classes/staging.bbclass75
1 files changed, 42 insertions, 33 deletions
diff --git a/meta/classes/staging.bbclass b/meta/classes/staging.bbclass
index bc5dfa81af..a0f82be4ab 100644
--- a/meta/classes/staging.bbclass
+++ b/meta/classes/staging.bbclass
@@ -1,3 +1,37 @@
+# These directories will be staged in the sysroot
+SYSROOT_DIRS = " \
+ ${includedir} \
+ ${libdir} \
+ ${base_libdir} \
+ ${nonarch_base_libdir} \
+ ${datadir} \
+"
+
+# These directories are also staged in the sysroot when they contain files that
+# are usable on the build system
+SYSROOT_DIRS_NATIVE = " \
+ ${bindir} \
+ ${sbindir} \
+ ${base_bindir} \
+ ${base_sbindir} \
+ ${libexecdir} \
+ ${sysconfdir} \
+ ${localstatedir} \
+"
+SYSROOT_DIRS_append_class-native = " ${SYSROOT_DIRS_NATIVE}"
+SYSROOT_DIRS_append_class-cross = " ${SYSROOT_DIRS_NATIVE}"
+SYSROOT_DIRS_append_class-crosssdk = " ${SYSROOT_DIRS_NATIVE}"
+
+# These directories will not be staged in the sysroot
+SYSROOT_DIRS_BLACKLIST = " \
+ ${mandir} \
+ ${docdir} \
+ ${infodir} \
+ ${datadir}/locale \
+ ${datadir}/applications \
+ ${datadir}/fonts \
+ ${datadir}/pixmaps \
+"
sysroot_stage_dir() {
src="$1"
@@ -14,43 +48,18 @@ sysroot_stage_dir() {
)
}
-sysroot_stage_libdir() {
- src="$1"
- dest="$2"
-
- sysroot_stage_dir $src $dest
-}
-
sysroot_stage_dirs() {
from="$1"
to="$2"
- sysroot_stage_dir $from${includedir} $to${includedir}
- if [ "${BUILD_SYS}" = "${HOST_SYS}" ]; then
- sysroot_stage_dir $from${bindir} $to${bindir}
- sysroot_stage_dir $from${sbindir} $to${sbindir}
- sysroot_stage_dir $from${base_bindir} $to${base_bindir}
- sysroot_stage_dir $from${base_sbindir} $to${base_sbindir}
- sysroot_stage_dir $from${libexecdir} $to${libexecdir}
- sysroot_stage_dir $from${sysconfdir} $to${sysconfdir}
- sysroot_stage_dir $from${localstatedir} $to${localstatedir}
- fi
- if [ -d $from${libdir} ]
- then
- sysroot_stage_libdir $from${libdir} $to${libdir}
- fi
- if [ -d $from${base_libdir} ]
- then
- sysroot_stage_libdir $from${base_libdir} $to${base_libdir}
- fi
- if [ -d $from${nonarch_base_libdir} ]
- then
- sysroot_stage_libdir $from${nonarch_base_libdir} $to${nonarch_base_libdir}
- fi
- sysroot_stage_dir $from${datadir} $to${datadir}
- # We don't care about docs/info/manpages/locales
- rm -rf $to${mandir}/ $to${docdir}/ $to${infodir}/ ${to}${datadir}/locale/
- rm -rf $to${datadir}/applications/ $to${datadir}/fonts/ $to${datadir}/pixmaps/
+ for dir in ${SYSROOT_DIRS}; do
+ sysroot_stage_dir "$from$dir" "$to$dir"
+ done
+
+ # Remove directories we do not care about
+ for dir in ${SYSROOT_DIRS_BLACKLIST}; do
+ rm -rf "$to$dir"
+ done
}
sysroot_stage_all() {