summaryrefslogtreecommitdiff
path: root/meta
diff options
context:
space:
mode:
authorRichard Purdie <rpurdie@linux.intel.com>2010-11-02 13:11:37 +0000
committerRichard Purdie <rpurdie@linux.intel.com>2010-11-02 13:11:37 +0000
commitd45af98d0122ab72615ce8df019017926f7c84e0 (patch)
treed8423931d4b5f53184497f9d83c309e2f6287224 /meta
parent30feed75dfed81c03537ba63a94e7fe8949c042d (diff)
downloadopenembedded-core-d45af98d0122ab72615ce8df019017926f7c84e0.tar.gz
openembedded-core-d45af98d0122ab72615ce8df019017926f7c84e0.tar.bz2
openembedded-core-d45af98d0122ab72615ce8df019017926f7c84e0.zip
external-python-tarball: Add ability to generate an externally usable standalone python tarball
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Diffstat (limited to 'meta')
-rw-r--r--meta/recipes-tbd/meta/external-python-tarball.bb87
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 @@
+DESCRIPTION = "Meta package for building a standalone python tarball"
+LICENSE = "MIT"
+DEPENDS = "opkg-native opkg-utils-native virtual/fakeroot-native sed-native"
+
+inherit meta
+
+SDK_DIR = "${WORKDIR}/sdk"
+SDK_OUTPUT = "${SDK_DIR}/image"
+SDK_DEPLOY = "${TMPDIR}/deploy/sdk"
+
+IPKG_HOST = "opkg-cl -f ${IPKGCONF_SDK} -o ${SDK_OUTPUT}"
+
+TOOLCHAIN_HOST_TASK ?= "\
+ python-nativesdk-core \
+ python-nativesdk-textutils \
+ python-nativesdk-sqlite3 \
+ python-nativesdk-pickle \
+ python-nativesdk-logging \
+ python-nativesdk-elementtree \
+ python-nativesdk-curses \
+ python-nativesdk-compile \
+ python-nativesdk-compiler \
+ python-nativesdk-fcntl \
+ python-nativesdk-shell \
+ python-nativesdk-misc \
+ python-nativesdk-subprocess \
+ python-nativesdk-xmlrpc \
+ python-nativesdk-netclient \
+ python-nativesdk-netserver \
+ python-nativesdk-distutils"
+
+TOOLCHAIN_OUTPUTNAME ?= "python-nativesdk-standalone"
+
+RDEPENDS = "${TOOLCHAIN_HOST_TASK}"
+
+EXCLUDE_FROM_WORLD = "1"
+
+do_populate_sdk() {
+ rm -rf ${SDK_OUTPUT}
+ mkdir -p ${SDK_OUTPUT}
+ mkdir -p ${SDK_OUTPUT}${localstatedir}/lib/opkg/
+
+ rm -f ${IPKGCONF_TARGET}
+ touch ${IPKGCONF_TARGET}
+ rm -f ${IPKGCONF_SDK}
+ touch ${IPKGCONF_SDK}
+
+ package_update_index_ipk
+ package_generate_ipkg_conf
+
+ for arch in ${PACKAGE_ARCHS}; do
+ revipkgarchs="$arch $revipkgarchs"
+ done
+
+ ${IPKG_HOST} update
+ ${IPKG_HOST} install ${TOOLCHAIN_HOST_TASK}
+
+ install -d ${SDK_OUTPUT}/${SDKPATHNATIVE}${localstatedir_nativesdk}/lib/opkg
+ mv ${SDK_OUTPUT}/var/lib/opkg/* ${SDK_OUTPUT}/${SDKPATHNATIVE}${localstatedir_nativesdk}/lib/opkg/
+ rm -Rf ${SDK_OUTPUT}/var
+
+ install -d ${SDK_OUTPUT}/${SDKPATHNATIVE}/${sysconfdir}
+ install -m 0644 ${IPKGCONF_SDK} ${SDK_OUTPUT}/${SDKPATHNATIVE}/${sysconfdir}/
+
+ rm -f ${SDK_OUTPUT}/${SDKPATHNATIVE}${libdir_nativesdk}/*.la
+
+ # Link the ld.so.cache file into the hosts filesystem
+ ln -s /etc/ld.so.cache ${SDK_OUTPUT}/${SDKPATHNATIVE}/etc/ld.so.cache
+
+ # Add version information
+ versionfile=${SDK_OUTPUT}/${SDKPATH}/version-${MULTIMACH_TARGET_SYS}
+ touch $versionfile
+ echo 'Distro: ${DISTRO}' >> $versionfile
+ echo 'Distro Version: ${DISTRO_VERSION}' >> $versionfile
+ echo 'Metadata Revision: ${METADATA_REVISION}' >> $versionfile
+ echo 'Timestamp: ${DATETIME}' >> $versionfile
+
+ # Package it up
+ mkdir -p ${SDK_DEPLOY}
+ cd ${SDK_OUTPUT}
+ ${FAKEROOT} tar cfj ${SDK_DEPLOY}/${TOOLCHAIN_OUTPUTNAME}.tar.bz2 .
+}
+
+do_populate_sdk[nostamp] = "1"
+do_populate_sdk[recrdeptask] = "do_package_write"
+addtask populate_sdk before do_build after do_install
+