diff options
author | Tristan Maat <tristan.maat@codethink.com> | 2017-06-23 15:48:00 +0100 |
---|---|---|
committer | Tristan Van Berkom <tristan.vanberkom@codethink.co.uk> | 2017-06-28 14:40:04 +0900 |
commit | 042390bd85a6fae2f38c26166ecf23730c4e4156 (patch) | |
tree | a4ca44de80f407f1007db0fa2de398428479a757 /buildstream/data | |
parent | fcbd0dfb50e83b6d4346656228a15ffeee4b0c78 (diff) | |
download | buildstream-042390bd85a6fae2f38c26166ecf23730c4e4156.tar.gz |
Add script templates
Diffstat (limited to 'buildstream/data')
-rwxr-xr-x | buildstream/data/build-all.sh.in | 40 | ||||
-rwxr-xr-x | buildstream/data/build-module.sh.in | 41 |
2 files changed, 81 insertions, 0 deletions
diff --git a/buildstream/data/build-all.sh.in b/buildstream/data/build-all.sh.in new file mode 100755 index 000000000..2d343ca0e --- /dev/null +++ b/buildstream/data/build-all.sh.in @@ -0,0 +1,40 @@ +#!/bin/sh +# +# DO NOT EDIT THIS FILE +# +# This is a build script generated by +# [BuildStream](https://wiki.gnome.org/Projects/BuildStream/). +# +# Builds all given modules using their respective scripts. + +set -eu + +echo "Buildstream native bootstrap script" + +export PATH='/usr/bin:/usr/sbin/:/sbin:/bin:/tools/bin:/tools/sbin' +export SRCDIR='./source' + +SUCCESS=false +CURRENT_MODULE='None' + +echo 'Setting up build environment...' + +except() {{ + if [ "$SUCCESS" = true ]; then + echo "Done!" + else + echo "Error building module ${{CURRENT_MODULE}}." + fi +}} +trap "except" EXIT + +for module in {modules}; do + CURRENT_MODULE="$module" + "$SRCDIR/build-$module" + + if [ -e /sbin/ldconfig ]; then + /sbin/ldcondig || true; + fi +done + +SUCCESS=true diff --git a/buildstream/data/build-module.sh.in b/buildstream/data/build-module.sh.in new file mode 100755 index 000000000..033a84654 --- /dev/null +++ b/buildstream/data/build-module.sh.in @@ -0,0 +1,41 @@ +#!/bin/sh +# +# DO NOT EDIT THIS FILE +# +# This is a build script generated by +# [BuildStream](https://wiki.gnome.org/Projects/BuildStream/). +# +# Builds the module {name}. + +set -e + +# Prepare the build environment +echo 'Building {name}' + +if [ -d '{build_root}' ]; then + rm -rf '{build_root}' +fi + +if [ -d '{install_root}' ]; then + rm -rf '{install_root}' +fi + +mkdir -p '{build_root}' +mkdir -p '{install_root}' + +cp -a "$SRCDIR/{name}" '{build_root}/{name}' +cd '{build_root}/{name}' + +export PREFIX='{install_root}' + +export {variables} + +# Build the module +{commands} + +rm -rf '{build_root}/{name}' + +# Install the module +echo 'Installing {name}' + +(cd '{install_root}'; find . | cpio -umdp /) |