diff options
Diffstat (limited to 'meta')
-rw-r--r-- | meta/classes/staging.bbclass | 75 |
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 | ||
2 | SYSROOT_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 | ||
12 | SYSROOT_DIRS_NATIVE = " \ | ||
13 | ${bindir} \ | ||
14 | ${sbindir} \ | ||
15 | ${base_bindir} \ | ||
16 | ${base_sbindir} \ | ||
17 | ${libexecdir} \ | ||
18 | ${sysconfdir} \ | ||
19 | ${localstatedir} \ | ||
20 | " | ||
21 | SYSROOT_DIRS_append_class-native = " ${SYSROOT_DIRS_NATIVE}" | ||
22 | SYSROOT_DIRS_append_class-cross = " ${SYSROOT_DIRS_NATIVE}" | ||
23 | SYSROOT_DIRS_append_class-crosssdk = " ${SYSROOT_DIRS_NATIVE}" | ||
24 | |||
25 | # These directories will not be staged in the sysroot | ||
26 | SYSROOT_DIRS_BLACKLIST = " \ | ||
27 | ${mandir} \ | ||
28 | ${docdir} \ | ||
29 | ${infodir} \ | ||
30 | ${datadir}/locale \ | ||
31 | ${datadir}/applications \ | ||
32 | ${datadir}/fonts \ | ||
33 | ${datadir}/pixmaps \ | ||
34 | " | ||
1 | 35 | ||
2 | sysroot_stage_dir() { | 36 | sysroot_stage_dir() { |
3 | src="$1" | 37 | src="$1" |
@@ -14,43 +48,18 @@ sysroot_stage_dir() { | |||
14 | ) | 48 | ) |
15 | } | 49 | } |
16 | 50 | ||
17 | sysroot_stage_libdir() { | ||
18 | src="$1" | ||
19 | dest="$2" | ||
20 | |||
21 | sysroot_stage_dir $src $dest | ||
22 | } | ||
23 | |||
24 | sysroot_stage_dirs() { | 51 | sysroot_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 | ||
56 | sysroot_stage_all() { | 65 | sysroot_stage_all() { |