summaryrefslogtreecommitdiff
path: root/buildstream/data
diff options
context:
space:
mode:
authorTristan Maat <tristan.maat@codethink.com>2017-06-23 15:48:00 +0100
committerTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2017-06-28 14:40:04 +0900
commit042390bd85a6fae2f38c26166ecf23730c4e4156 (patch)
treea4ca44de80f407f1007db0fa2de398428479a757 /buildstream/data
parentfcbd0dfb50e83b6d4346656228a15ffeee4b0c78 (diff)
downloadbuildstream-042390bd85a6fae2f38c26166ecf23730c4e4156.tar.gz
Add script templates
Diffstat (limited to 'buildstream/data')
-rwxr-xr-xbuildstream/data/build-all.sh.in40
-rwxr-xr-xbuildstream/data/build-module.sh.in41
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 /)