gnome-screensaver 2.28.3: fix up configure as well now
[openembedded.git] / recipes / addons / devshell.bb
blob5921125d1276fe488424564eb1fdf3814adf5ed5
1 DESCRIPTION = "Runs a shell in an environment as emitted by BitBake to execute tasks"
2 LICENSE = "GPL"
3 PR = "r3"
5 inherit autotools pkgconfig
7 do_configure() {
11 def devshell_emit_env(o, d, all=False, funcwhitelist=None):
12 """Emits all items in the data store in a format such that it can be sourced by a shell."""
14 env = bb.data.keys(d)
16 for e in env:
17 if bb.data.getVarFlag(e, "func", d):
18 continue
19 bb.data.emit_var(e, o, d, all) and o.write('\n')
21 for e in env:
22 if not bb.data.getVarFlag(e, "func", d):
23 continue
24 if not funcwhitelist:
25 bb.data.emit_var(e, o, d) and o.write('\n')
26 continue
27 for i in funcwhitelist:
28 if e.startswith(i):
29 bb.data.emit_var(e, o, d) and o.write('\n')
30 break
32 python do_compile() {
33 import os
34 import os.path
36 workdir = bb.data.getVar('WORKDIR', d, 1)
37 shellfile = os.path.join(workdir, bb.data.expand("${TARGET_PREFIX}${DISTRO}-${MACHINE}-devshell", d))
39 f = open(shellfile, "w")
41 # emit variables and shell functions
42 devshell_emit_env(f, d, False, ["die", "oe", "autotools_do_configure"])
44 f.close()
47 do_install() {
51 do_stage() {
55 do_deploy() {
56 shellfile="${TARGET_PREFIX}${DISTRO}-${MACHINE}-devshell"
58 cd ${WORKDIR}
60 cp $shellfile tmpfile
61 echo "#!/bin/bash --rcfile" > $shellfile
62 sed -e "s:${S}:.:g" -e "s:exit 1:true:" tmpfile >> $shellfile
64 echo "export PS1='[OE::${TARGET_PREFIX}${DISTRO}-${MACHINE}]:\w\$ '" >> $shellfile
65 echo "alias ./configure=oe_runconf" >> $shellfile
66 echo "alias make=oe_runmake" >> $shellfile
68 mkdir -p ${DEPLOY_DIR}/addons
69 install -m 755 $shellfile ${DEPLOY_DIR}/addons
72 addtask deploy after do_install before do_package