diff options
-rwxr-xr-x[-rw-r--r--] | buildstream/_site.py | 6 | ||||
-rwxr-xr-x | buildstream/data/build-all.sh.in | 40 | ||||
-rwxr-xr-x | buildstream/data/build-module.sh.in | 41 | ||||
-rwxr-xr-x | buildstream/element.py | 1 | ||||
-rwxr-xr-x | setup.py | 3 |
5 files changed, 90 insertions, 1 deletions
diff --git a/buildstream/_site.py b/buildstream/_site.py index d7b34203c..f11e05062 100644..100755 --- a/buildstream/_site.py +++ b/buildstream/_site.py @@ -45,3 +45,9 @@ ostree_push = os.path.join(root, 'data', 'ostree-push') # ostree-pull-ssh shell script ostree_pull_ssh = os.path.join(root, 'data', 'ostree-pull-ssh') + +# Script template to call module building scripts +build_all_template = os.path.join(root, 'data', 'build-all.sh.in') + +# Module building script template +build_module_template = os.path.join(root, 'data', 'build-module.sh.in') 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 /) diff --git a/buildstream/element.py b/buildstream/element.py index 8600bbf98..f992129c2 100755 --- a/buildstream/element.py +++ b/buildstream/element.py @@ -42,6 +42,7 @@ from . import utils from . import _signals from . import _site + class Scope(Enum): """Types of scope for a given element""" @@ -105,7 +105,8 @@ setup(name='BuildStream', license='LGPL', use_scm_version=True, packages=find_packages(), - package_data={'buildstream': ['plugins/*/*.py', 'plugins/*/*.yaml', 'data/*.yaml', + package_data={'buildstream': ['plugins/*/*.py', 'plugins/*/*.yaml', + 'data/*.yaml', 'data/*.sh.in', 'data/ostree-push', 'data/ostree-pull-ssh']}, data_files=[('share/man/man1', list_man_pages())], install_requires=[ |