diff options
author | Tristan Maat <tristan.maat@codethink.co.uk> | 2017-10-04 14:02:06 +0100 |
---|---|---|
committer | Tristan Maat <tristan.maat@codethink.co.uk> | 2017-10-13 15:59:26 +0100 |
commit | 12d86fc144f994131d706ae4027bf8d6f88eed32 (patch) | |
tree | 561fe4c33a0ebf744dfcfeced2e4b7db400eeb23 /tests/frontend/project/elements/manual-build-output.txt | |
parent | c1954f6d78278b5b8ea1851b73ec8803e1caba56 (diff) | |
download | buildstream-12d86fc144f994131d706ae4027bf8d6f88eed32.tar.gz |
Add tests for %{script} formatnon-sandbox-builds
Diffstat (limited to 'tests/frontend/project/elements/manual-build-output.txt')
-rwxr-xr-x | tests/frontend/project/elements/manual-build-output.txt | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/tests/frontend/project/elements/manual-build-output.txt b/tests/frontend/project/elements/manual-build-output.txt new file mode 100755 index 000000000..a6a98efb6 --- /dev/null +++ b/tests/frontend/project/elements/manual-build-output.txt @@ -0,0 +1,60 @@ +#!/bin/sh +# +# DO NOT EDIT THIS FILE +# +# This is a build script generated by +# [BuildStream](https://wiki.gnome.org/Projects/BuildStream/). +# +# Builds the module manual-build. + +set -e + +# Prepare the build environment +echo 'Building manual-build' + +if [ -d '/buildstream/build' ]; then + rm -rf '/buildstream/build' +fi + +if [ -d '/buildstream/install' ]; then + rm -rf '/buildstream/install' +fi + +mkdir -p '/buildstream/build' +mkdir -p '/buildstream/install' + +if [ -d "$SRCDIR/manual-build/" ]; then + cp -a "$SRCDIR/manual-build/." '/buildstream/build' +fi +cd '/buildstream/build' + +export PREFIX='/buildstream/install' + +export HOME=/tmp LC_ALL=C LOGNAME=tomjon MAKEFLAGS=-j1 PATH=/usr/bin:/bin:/usr/sbin:/sbin SHELL=/bin/sh TERM=dumb TZ=UTC USER=tomjon USERNAME=tomjon V=1 + +# Build the module +(set -ex; echo 'Hi :)' +) || exit 1 +(set -ex; find "/buildstream/install" -type f \ + '(' -perm -111 -o -name '*.so*' \ + -o -name '*.cmxs' -o -name '*.node' ')' \ + -exec sh -ec \ + 'read -n4 hdr <"$1" # check for elf header + if [ "$hdr" != "$(printf \\x7fELF)" ]; then + exit 0 + fi + debugfile="/buildstream/install/usr/lib/debug/$(basename "$1")" + mkdir -p "$(dirname "$debugfile")" + objcopy --only-keep-debug "$1" "$debugfile" + chmod 644 "$debugfile" + strip --remove-section=.comment --remove-section=.note --strip-unneeded "$1" + objcopy --add-gnu-debuglink "$debugfile" "$1"' - {} ';' +) || exit 1 + + +rm -rf '/buildstream/build' + +# Install the module +echo 'Installing manual-build' + +(cd '/buildstream/install'; find . | cpio -umdp /)
\ No newline at end of file |