diff options
author | Kang Kai <kai.kang@windriver.com> | 2013-02-20 14:06:17 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-02-22 06:09:24 -0800 |
commit | 3624d8965f54770d19388bc015d679b2a1daab08 (patch) | |
tree | 952276dbf49ab1cb9b1820b4a2b039f393670b8b | |
parent | f3fe7efb1fe997f8fd00062c83a4a7cbf1bb19c6 (diff) | |
download | poky-3624d8965f54770d19388bc015d679b2a1daab08.tar.gz |
external-python-tarball: code refactoring
external-python-tarball only can be built when inherit package_ipk now.
Update it to reuse existed populate sdk code that it could be built for
rpm and deb too.
Remove var DEPENDS, SDK_* and flags of do_populate_sdk because they are
already defined in populate_sdk bbclasses.
[Yocto 3006]
(From OE-Core rev: 57134958a2c6b74de8654600e33acdd265966638)
Signed-off-by: Kang Kai <kai.kang@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/recipes-core/meta/external-python-tarball.bb | 67 |
1 files changed, 4 insertions, 63 deletions
diff --git a/meta/recipes-core/meta/external-python-tarball.bb b/meta/recipes-core/meta/external-python-tarball.bb index 2085acc223..2513cf68f7 100644 --- a/meta/recipes-core/meta/external-python-tarball.bb +++ b/meta/recipes-core/meta/external-python-tarball.bb | |||
@@ -3,17 +3,9 @@ LICENSE = "MIT" | |||
3 | LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=3f40d7994397109285ec7b81fdeb3b58 \ | 3 | LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=3f40d7994397109285ec7b81fdeb3b58 \ |
4 | file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" | 4 | file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" |
5 | 5 | ||
6 | DEPENDS = "opkg-native opkg-utils-native virtual/fakeroot-native sed-native" | 6 | PR = "r2" |
7 | 7 | ||
8 | PR = "r1" | 8 | TOOLCHAIN_TARGET_TASK ?= "" |
9 | |||
10 | inherit meta | ||
11 | |||
12 | SDK_DIR = "${WORKDIR}/sdk" | ||
13 | SDK_OUTPUT = "${SDK_DIR}/image" | ||
14 | SDK_DEPLOY = "${TMPDIR}/deploy/sdk" | ||
15 | |||
16 | IPKG_HOST = "opkg-cl -f ${IPKGCONF_SDK} -o ${SDK_OUTPUT}" | ||
17 | 9 | ||
18 | TOOLCHAIN_HOST_TASK ?= "\ | 10 | TOOLCHAIN_HOST_TASK ?= "\ |
19 | nativesdk-python-core \ | 11 | nativesdk-python-core \ |
@@ -43,56 +35,5 @@ RDEPENDS = "${TOOLCHAIN_HOST_TASK}" | |||
43 | 35 | ||
44 | EXCLUDE_FROM_WORLD = "1" | 36 | EXCLUDE_FROM_WORLD = "1" |
45 | 37 | ||
46 | do_populate_sdk() { | 38 | inherit meta |
47 | rm -rf ${SDK_OUTPUT} | 39 | inherit populate_sdk |
48 | mkdir -p ${SDK_OUTPUT} | ||
49 | mkdir -p ${SDK_OUTPUT}${localstatedir}/lib/opkg/ | ||
50 | |||
51 | rm -f ${IPKGCONF_TARGET} | ||
52 | touch ${IPKGCONF_TARGET} | ||
53 | rm -f ${IPKGCONF_SDK} | ||
54 | touch ${IPKGCONF_SDK} | ||
55 | |||
56 | package_update_index_ipk | ||
57 | package_generate_ipkg_conf | ||
58 | |||
59 | for arch in ${PACKAGE_ARCHS}; do | ||
60 | revipkgarchs="$arch $revipkgarchs" | ||
61 | done | ||
62 | |||
63 | ${IPKG_HOST} update | ||
64 | ${IPKG_HOST} install ${TOOLCHAIN_HOST_TASK} | ||
65 | |||
66 | install -d ${SDK_OUTPUT}/${SDKPATHNATIVE}${localstatedir_nativesdk}/lib/opkg | ||
67 | mv ${SDK_OUTPUT}/var/lib/opkg/* ${SDK_OUTPUT}/${SDKPATHNATIVE}${localstatedir_nativesdk}/lib/opkg/ | ||
68 | rm -Rf ${SDK_OUTPUT}/var | ||
69 | |||
70 | install -d ${SDK_OUTPUT}/${SDKPATHNATIVE}/${sysconfdir} | ||
71 | install -m 0644 ${IPKGCONF_SDK} ${SDK_OUTPUT}/${SDKPATHNATIVE}/${sysconfdir}/ | ||
72 | |||
73 | rm -f ${SDK_OUTPUT}/${SDKPATHNATIVE}${libdir_nativesdk}/*.la | ||
74 | |||
75 | # Link the ld.so.cache file into the hosts filesystem | ||
76 | ln -s /etc/ld.so.cache ${SDK_OUTPUT}/${SDKPATHNATIVE}/etc/ld.so.cache | ||
77 | |||
78 | # Add version information | ||
79 | versionfile=${SDK_OUTPUT}/${SDKPATH}/version-${MULTIMACH_TARGET_SYS} | ||
80 | touch $versionfile | ||
81 | echo 'Distro: ${DISTRO}' >> $versionfile | ||
82 | echo 'Distro Version: ${DISTRO_VERSION}' >> $versionfile | ||
83 | echo 'Metadata Revision: ${METADATA_REVISION}' >> $versionfile | ||
84 | echo 'Timestamp: ${DATETIME}' >> $versionfile | ||
85 | |||
86 | # Package it up | ||
87 | mkdir -p ${SDK_DEPLOY} | ||
88 | cd ${SDK_OUTPUT} | ||
89 | tar --owner=root --group=root -cj --file=${SDK_DEPLOY}/${TOOLCHAIN_OUTPUTNAME}.tar.bz2 . | ||
90 | } | ||
91 | |||
92 | do_populate_sdk[nostamp] = "1" | ||
93 | do_populate_sdk[recrdeptask] = "do_package_write" | ||
94 | addtask populate_sdk before do_build after do_install | ||
95 | |||
96 | inherit blacklist | ||
97 | |||
98 | PNBLACKLIST[external-python-tarball] = "${@base_contains('PACKAGE_CLASSES', 'package_ipk', '', 'This recipe requires \'package_ipk\' support to be enabled in PACKAGE_CLASSES.', d)}" | ||