summaryrefslogtreecommitdiff
path: root/recipes/addons
diff options
context:
space:
mode:
authorDenys Dmytriyenko <denis@denix.org>2009-03-17 14:32:59 -0400
committerDenys Dmytriyenko <denis@denix.org>2009-03-17 14:32:59 -0400
commit709c4d66e0b107ca606941b988bad717c0b45d9b (patch)
tree37ee08b1eb308f3b2b6426d5793545c38396b838 /recipes/addons
parentfa6cd5a3b993f16c27de4ff82b42684516d433ba (diff)
rename packages/ to recipes/ per earlier agreement
See links below for more details: http://thread.gmane.org/gmane.comp.handhelds.openembedded/21326 http://thread.gmane.org/gmane.comp.handhelds.openembedded/21816 Signed-off-by: Denys Dmytriyenko <denis@denix.org> Acked-by: Mike Westerhof <mwester@dls.net> Acked-by: Philip Balister <philip@balister.org> Acked-by: Khem Raj <raj.khem@gmail.com> Acked-by: Marcin Juszkiewicz <hrw@openembedded.org> Acked-by: Koen Kooi <koen@openembedded.org> Acked-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
Diffstat (limited to 'recipes/addons')
-rw-r--r--recipes/addons/devshell.bb75
1 files changed, 75 insertions, 0 deletions
diff --git a/recipes/addons/devshell.bb b/recipes/addons/devshell.bb
new file mode 100644
index 0000000000..9ac6821e0e
--- /dev/null
+++ b/recipes/addons/devshell.bb
@@ -0,0 +1,75 @@
+DESCRIPTION = "Runs a shell in an environment as emitted by BitBake to execute tasks"
+LICENSE = "GPL"
+PR = "r3"
+
+inherit autotools pkgconfig
+
+do_configure() {
+ :
+}
+
+def devshell_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."""
+
+ import bb
+ import bb.data
+
+ 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}-devshell", d))
+
+ f = open(shellfile, "w")
+
+ # emit variables and shell functions
+ devshell_emit_env(f, d, False, ["die", "oe", "autotools_do_configure"])
+
+ f.close()
+}
+
+do_install() {
+ :
+}
+
+do_stage() {
+ :
+}
+
+do_deploy() {
+ shellfile="${TARGET_PREFIX}${DISTRO}-${MACHINE}-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