1 DESCRIPTION = "Runs a shell in an environment as emitted by BitBake to execute tasks"
3 MAINTAINER = "Rene Wagner <rw@handhelds.org>"
6 inherit autotools pkgconfig
12 def devshell_emit_env(o, d, all=False, funcwhitelist=None):
13 """Emits all items in the data store in a format such that it can be sourced by a shell."""
21 if bb.data.getVarFlag(e, "func", d):
23 bb.data.emit_var(e, o, d, all) and o.write('\n')
26 if not bb.data.getVarFlag(e, "func", d):
29 bb.data.emit_var(e, o, d) and o.write('\n')
31 for i in funcwhitelist:
33 bb.data.emit_var(e, o, d) and o.write('\n')
40 workdir = bb.data.getVar('WORKDIR', d, 1)
41 shellfile = os.path.join(workdir, bb.data.expand("${TARGET_PREFIX}${DISTRO}-${MACHINE}-devshell", d))
43 f = open(shellfile, "w")
45 # emit variables and shell functions
46 devshell_emit_env(f, d, False, ["die", "oe", "autotools_do_configure"])
60 shellfile="${TARGET_PREFIX}${DISTRO}-${MACHINE}-devshell"
65 echo "#!/bin/bash --rcfile" > $shellfile
66 sed -e "s:${S}:.:g" -e "s:exit 1:true:" tmpfile >> $shellfile
68 echo "export PS1='[OE::${TARGET_PREFIX}${DISTRO}-${MACHINE}]:\w\$ '" >> $shellfile
69 echo "alias ./configure=oe_runconf" >> $shellfile
70 echo "alias make=oe_runmake" >> $shellfile
72 mkdir -p ${DEPLOY_DIR}/addons
73 install -m 755 $shellfile ${DEPLOY_DIR}/addons