diff options
author | Richard Purdie <rpurdie@linux.intel.com> | 2010-11-02 13:11:37 +0000 |
---|---|---|
committer | Richard Purdie <rpurdie@linux.intel.com> | 2010-11-02 13:11:37 +0000 |
commit | d45af98d0122ab72615ce8df019017926f7c84e0 (patch) | |
tree | d8423931d4b5f53184497f9d83c309e2f6287224 | |
parent | 30feed75dfed81c03537ba63a94e7fe8949c042d (diff) | |
download | poky-d45af98d0122ab72615ce8df019017926f7c84e0.tar.gz |
external-python-tarball: Add ability to generate an externally usable standalone python tarball
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
-rw-r--r-- | meta/recipes-tbd/meta/external-python-tarball.bb | 87 |
1 files changed, 87 insertions, 0 deletions
diff --git a/meta/recipes-tbd/meta/external-python-tarball.bb b/meta/recipes-tbd/meta/external-python-tarball.bb new file mode 100644 index 0000000000..a27213dc63 --- /dev/null +++ b/meta/recipes-tbd/meta/external-python-tarball.bb | |||
@@ -0,0 +1,87 @@ | |||
1 | DESCRIPTION = "Meta package for building a standalone python tarball" | ||
2 | LICENSE = "MIT" | ||
3 | DEPENDS = "opkg-native opkg-utils-native virtual/fakeroot-native sed-native" | ||
4 | |||
5 | inherit meta | ||
6 | |||
7 | SDK_DIR = "${WORKDIR}/sdk" | ||
8 | SDK_OUTPUT = "${SDK_DIR}/image" | ||
9 | SDK_DEPLOY = "${TMPDIR}/deploy/sdk" | ||
10 | |||
11 | IPKG_HOST = "opkg-cl -f ${IPKGCONF_SDK} -o ${SDK_OUTPUT}" | ||
12 | |||
13 | TOOLCHAIN_HOST_TASK ?= "\ | ||
14 | python-nativesdk-core \ | ||
15 | python-nativesdk-textutils \ | ||
16 | python-nativesdk-sqlite3 \ | ||
17 | python-nativesdk-pickle \ | ||
18 | python-nativesdk-logging \ | ||
19 | python-nativesdk-elementtree \ | ||
20 | python-nativesdk-curses \ | ||
21 | python-nativesdk-compile \ | ||
22 | python-nativesdk-compiler \ | ||
23 | python-nativesdk-fcntl \ | ||
24 | python-nativesdk-shell \ | ||
25 | python-nativesdk-misc \ | ||
26 | python-nativesdk-subprocess \ | ||
27 | python-nativesdk-xmlrpc \ | ||
28 | python-nativesdk-netclient \ | ||
29 | python-nativesdk-netserver \ | ||
30 | python-nativesdk-distutils" | ||
31 | |||
32 | TOOLCHAIN_OUTPUTNAME ?= "python-nativesdk-standalone" | ||
33 | |||
34 | RDEPENDS = "${TOOLCHAIN_HOST_TASK}" | ||
35 | |||
36 | EXCLUDE_FROM_WORLD = "1" | ||
37 | |||
38 | do_populate_sdk() { | ||
39 | rm -rf ${SDK_OUTPUT} | ||
40 | mkdir -p ${SDK_OUTPUT} | ||
41 | mkdir -p ${SDK_OUTPUT}${localstatedir}/lib/opkg/ | ||
42 | |||
43 | rm -f ${IPKGCONF_TARGET} | ||
44 | touch ${IPKGCONF_TARGET} | ||
45 | rm -f ${IPKGCONF_SDK} | ||
46 | touch ${IPKGCONF_SDK} | ||
47 | |||
48 | package_update_index_ipk | ||
49 | package_generate_ipkg_conf | ||
50 | |||
51 | for arch in ${PACKAGE_ARCHS}; do | ||
52 | revipkgarchs="$arch $revipkgarchs" | ||
53 | done | ||
54 | |||
55 | ${IPKG_HOST} update | ||
56 | ${IPKG_HOST} install ${TOOLCHAIN_HOST_TASK} | ||
57 | |||
58 | install -d ${SDK_OUTPUT}/${SDKPATHNATIVE}${localstatedir_nativesdk}/lib/opkg | ||
59 | mv ${SDK_OUTPUT}/var/lib/opkg/* ${SDK_OUTPUT}/${SDKPATHNATIVE}${localstatedir_nativesdk}/lib/opkg/ | ||
60 | rm -Rf ${SDK_OUTPUT}/var | ||
61 | |||
62 | install -d ${SDK_OUTPUT}/${SDKPATHNATIVE}/${sysconfdir} | ||
63 | install -m 0644 ${IPKGCONF_SDK} ${SDK_OUTPUT}/${SDKPATHNATIVE}/${sysconfdir}/ | ||
64 | |||
65 | rm -f ${SDK_OUTPUT}/${SDKPATHNATIVE}${libdir_nativesdk}/*.la | ||
66 | |||
67 | # Link the ld.so.cache file into the hosts filesystem | ||
68 | ln -s /etc/ld.so.cache ${SDK_OUTPUT}/${SDKPATHNATIVE}/etc/ld.so.cache | ||
69 | |||
70 | # Add version information | ||
71 | versionfile=${SDK_OUTPUT}/${SDKPATH}/version-${MULTIMACH_TARGET_SYS} | ||
72 | touch $versionfile | ||
73 | echo 'Distro: ${DISTRO}' >> $versionfile | ||
74 | echo 'Distro Version: ${DISTRO_VERSION}' >> $versionfile | ||
75 | echo 'Metadata Revision: ${METADATA_REVISION}' >> $versionfile | ||
76 | echo 'Timestamp: ${DATETIME}' >> $versionfile | ||
77 | |||
78 | # Package it up | ||
79 | mkdir -p ${SDK_DEPLOY} | ||
80 | cd ${SDK_OUTPUT} | ||
81 | ${FAKEROOT} tar cfj ${SDK_DEPLOY}/${TOOLCHAIN_OUTPUTNAME}.tar.bz2 . | ||
82 | } | ||
83 | |||
84 | do_populate_sdk[nostamp] = "1" | ||
85 | do_populate_sdk[recrdeptask] = "do_package_write" | ||
86 | addtask populate_sdk before do_build after do_install | ||
87 | |||