summaryrefslogtreecommitdiffstats
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:41:27 +0100
commite8394314684f4c9855b9420d913cb45dad8bebf6 (patch)
treeeb9abe44e51662a205822b32e812763639134c89 /meta/classes
parent5f6e5e45d565ead19e7072826167b098181871b6 (diff)
downloadpoky-e8394314684f4c9855b9420d913cb45dad8bebf6.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()). (From OE-Core rev: 80e7e7f78d957b8159bede2a5cd5614d8d73039c) 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 @@
1# These directories will be staged in the sysroot
2SYSROOT_DIRS = " \
3 ${includedir} \
4 ${libdir} \
5 ${base_libdir} \
6 ${nonarch_base_libdir} \
7 ${datadir} \
8"
9
10# These directories are also staged in the sysroot when they contain files that
11# are usable on the build system
12SYSROOT_DIRS_NATIVE = " \
13 ${bindir} \
14 ${sbindir} \
15 ${base_bindir} \
16 ${base_sbindir} \
17 ${libexecdir} \
18 ${sysconfdir} \
19 ${localstatedir} \
20"
21SYSROOT_DIRS_append_class-native = " ${SYSROOT_DIRS_NATIVE}"
22SYSROOT_DIRS_append_class-cross = " ${SYSROOT_DIRS_NATIVE}"
23SYSROOT_DIRS_append_class-crosssdk = " ${SYSROOT_DIRS_NATIVE}"
24
25# These directories will not be staged in the sysroot
26SYSROOT_DIRS_BLACKLIST = " \
27 ${mandir} \
28 ${docdir} \
29 ${infodir} \
30 ${datadir}/locale \
31 ${datadir}/applications \
32 ${datadir}/fonts \
33 ${datadir}/pixmaps \
34"
1 35
2sysroot_stage_dir() { 36sysroot_stage_dir() {
3 src="$1" 37 src="$1"
@@ -14,43 +48,18 @@ sysroot_stage_dir() {
14 ) 48 )
15} 49}
16 50
17sysroot_stage_libdir() {
18 src="$1"
19 dest="$2"
20
21 sysroot_stage_dir $src $dest
22}
23
24sysroot_stage_dirs() { 51sysroot_stage_dirs() {
25 from="$1" 52 from="$1"
26 to="$2" 53 to="$2"
27 54
28 sysroot_stage_dir $from${includedir} $to${includedir} 55 for dir in ${SYSROOT_DIRS}; do
29 if [ "${BUILD_SYS}" = "${HOST_SYS}" ]; then 56 sysroot_stage_dir "$from$dir" "$to$dir"
30 sysroot_stage_dir $from${bindir} $to${bindir} 57 done
31 sysroot_stage_dir $from${sbindir} $to${sbindir} 58
32 sysroot_stage_dir $from${base_bindir} $to${base_bindir} 59 # Remove directories we do not care about
33 sysroot_stage_dir $from${base_sbindir} $to${base_sbindir} 60 for dir in ${SYSROOT_DIRS_BLACKLIST}; do
34 sysroot_stage_dir $from${libexecdir} $to${libexecdir} 61 rm -rf "$to$dir"
35 sysroot_stage_dir $from${sysconfdir} $to${sysconfdir} 62 done
36 sysroot_stage_dir $from${localstatedir} $to${localstatedir}
37 fi
38 if [ -d $from${libdir} ]
39 then
40 sysroot_stage_libdir $from${libdir} $to${libdir}
41 fi
42 if [ -d $from${base_libdir} ]
43 then
44 sysroot_stage_libdir $from${base_libdir} $to${base_libdir}
45 fi
46 if [ -d $from${nonarch_base_libdir} ]
47 then
48 sysroot_stage_libdir $from${nonarch_base_libdir} $to${nonarch_base_libdir}
49 fi
50 sysroot_stage_dir $from${datadir} $to${datadir}
51 # We don't care about docs/info/manpages/locales
52 rm -rf $to${mandir}/ $to${docdir}/ $to${infodir}/ ${to}${datadir}/locale/
53 rm -rf $to${datadir}/applications/ $to${datadir}/fonts/ $to${datadir}/pixmaps/
54} 63}
55 64
56sysroot_stage_all() { 65sysroot_stage_all() {