aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/ti/ti-devshell.bb
diff options
context:
space:
mode:
authorMartin Jansa <Martin.Jansa@gmail.com>2010-05-27 12:44:07 +0200
committerMartin Jansa <Martin.Jansa@gmail.com>2010-05-27 12:44:07 +0200
commit293b05335ab540c4c8402e0a5caf2886b786a318 (patch)
tree11e5a7c2dce338058f150e08d1ff47c9d4d8eccd /recipes/ti/ti-devshell.bb
parent1ee2156592ba17f64f3c9b8970285a259730b871 (diff)
parente9aacc4ce4784c91cb4908145b8fb7b3ec8aa6e0 (diff)
downloadopenembedded-293b05335ab540c4c8402e0a5caf2886b786a318.tar.gz
Merge remote branch 'origin/org.openembedded.dev' into shr/testing2010
Conflicts: recipes/linux/linux-openmoko-devel_git.bb recipes/openmoko-3rdparty/pisi_0.5.2.bb recipes/openmoko-3rdparty/pisi_0.5.3.bb recipes/openmoko-3rdparty/pisi_0.5.bb recipes/uclibc/uclibc_nptl.bb
Diffstat (limited to 'recipes/ti/ti-devshell.bb')
-rw-r--r--recipes/ti/ti-devshell.bb73
1 files changed, 73 insertions, 0 deletions
diff --git a/recipes/ti/ti-devshell.bb b/recipes/ti/ti-devshell.bb
new file mode 100644
index 0000000000..0eba7991a8
--- /dev/null
+++ b/recipes/ti/ti-devshell.bb
@@ -0,0 +1,73 @@
+DESCRIPTION = "Runs a shell in an environment as emitted by BitBake to execute tasks"
+LICENSE = "GPL"
+
+PR = "r1"
+
+inherit autotools pkgconfig
+
+require ti-paths.inc
+
+do_configure() {
+ :
+}
+
+def tidevshell_emit_env(o, d, all=False, funcwhitelist=None):
+ """Emits all items in the data store in a format such that it can be sourced by a shell."""
+
+ env = bb.data.keys(d)
+
+ for e in env:
+ if bb.data.getVarFlag(e, "func", d):
+ continue
+ bb.data.emit_var(e, o, d, all) and o.write('\n')
+
+ for e in env:
+ if not bb.data.getVarFlag(e, "func", d):
+ continue
+ if not funcwhitelist:
+ bb.data.emit_var(e, o, d) and o.write('\n')
+ continue
+ for i in funcwhitelist:
+ if e.startswith(i):
+ bb.data.emit_var(e, o, d) and o.write('\n')
+ break
+
+python do_compile() {
+ import os
+ import os.path
+
+ workdir = bb.data.getVar('WORKDIR', d, 1)
+ shellfile = os.path.join(workdir, bb.data.expand("${TARGET_PREFIX}${DISTRO}-${MACHINE}-ti-devshell", d))
+
+ f = open(shellfile, "w")
+
+ # emit variables and shell functions
+ tidevshell_emit_env(f, d, False, ["die", "oe", "autotools_do_configure"])
+
+ f.close()
+}
+
+do_install() {
+ :
+}
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+do_deploy() {
+ shellfile="${TARGET_PREFIX}${DISTRO}-${MACHINE}-ti-devshell"
+
+ cd ${WORKDIR}
+
+ cp $shellfile tmpfile
+ echo "#!/bin/bash --rcfile" > $shellfile
+ sed -e "s:${S}:.:g" -e "s:exit 1:true:" tmpfile >> $shellfile
+
+ echo "export PS1='[OE::${TARGET_PREFIX}${DISTRO}-${MACHINE}]:\w\$ '" >> $shellfile
+ echo "alias ./configure=oe_runconf" >> $shellfile
+ echo "alias make=oe_runmake" >> $shellfile
+
+ mkdir -p ${DEPLOY_DIR}/addons
+ install -m 755 $shellfile ${DEPLOY_DIR}/addons
+}
+
+addtask deploy after do_install before do_package