diff options
author | Phil Dawson <phil.dawson@codethink.co.uk> | 2018-06-27 11:58:30 +0100 |
---|---|---|
committer | Phil Dawson <phil.dawson@codethink.co.uk> | 2018-08-01 09:05:45 +0100 |
commit | 8c0522adde2a1dac10d52171cee701068e74631e (patch) | |
tree | 2ce52c293ccbb04e7b3cb37b6200b100d090ed6d /doc | |
parent | 6cd3df09f36df55b28b613c8fcee48bae6722244 (diff) | |
download | buildstream-8c0522adde2a1dac10d52171cee701068e74631e.tar.gz |
Add project for workspaces tutorial
This is part of the work towards issue #437
Diffstat (limited to 'doc')
-rw-r--r-- | doc/examples/developing/elements/base.bst | 5 | ||||
-rw-r--r-- | doc/examples/developing/elements/base/alpine.bst | 13 | ||||
-rw-r--r-- | doc/examples/developing/elements/hello.bst | 22 | ||||
-rw-r--r-- | doc/examples/developing/files/src/Makefile | 12 | ||||
-rw-r--r-- | doc/examples/developing/files/src/hello.c | 10 | ||||
-rw-r--r-- | doc/examples/developing/project.conf | 12 | ||||
-rw-r--r-- | doc/examples/developing/update.patch | 10 |
7 files changed, 84 insertions, 0 deletions
diff --git a/doc/examples/developing/elements/base.bst b/doc/examples/developing/elements/base.bst new file mode 100644 index 000000000..1b85a9e8c --- /dev/null +++ b/doc/examples/developing/elements/base.bst @@ -0,0 +1,5 @@ +kind: stack +description: Base stack + +depends: +- base/alpine.bst diff --git a/doc/examples/developing/elements/base/alpine.bst b/doc/examples/developing/elements/base/alpine.bst new file mode 100644 index 000000000..cf85df5bf --- /dev/null +++ b/doc/examples/developing/elements/base/alpine.bst @@ -0,0 +1,13 @@ +kind: import +description: | + + Alpine Linux base runtime + +sources: +- kind: tar + + # This is a post doctored, trimmed down system image + # of the Alpine linux distribution. + # + url: alpine:integration-tests-base.v1.x86_64.tar.xz + ref: 3eb559250ba82b64a68d86d0636a6b127aa5f6d25d3601a79f79214dc9703639 diff --git a/doc/examples/developing/elements/hello.bst b/doc/examples/developing/elements/hello.bst new file mode 100644 index 000000000..f7f21e01e --- /dev/null +++ b/doc/examples/developing/elements/hello.bst @@ -0,0 +1,22 @@ +kind: manual +description: | + + Building manually + +# Depend on the base system +depends: +- base.bst + +# Stage the files/src directory for building +sources: + - kind: local + path: files/src + +# Now configure the commands to run +config: + + build-commands: + - make PREFIX="%{prefix}" + + install-commands: + - make -j1 PREFIX="%{prefix}" DESTDIR="%{install-root}" install diff --git a/doc/examples/developing/files/src/Makefile b/doc/examples/developing/files/src/Makefile new file mode 100644 index 000000000..8c8425116 --- /dev/null +++ b/doc/examples/developing/files/src/Makefile @@ -0,0 +1,12 @@ +# Sample makefile for hello.c +# +.PHONY: all install + +all: hello + +install: + install -d ${DESTDIR}${PREFIX}/bin + install -m 755 hello ${DESTDIR}${PREFIX}/bin + +hello: hello.c + $(CC) -Wall -o $@ $< diff --git a/doc/examples/developing/files/src/hello.c b/doc/examples/developing/files/src/hello.c new file mode 100644 index 000000000..b53408209 --- /dev/null +++ b/doc/examples/developing/files/src/hello.c @@ -0,0 +1,10 @@ +/* + * hello.c - Simple hello world program + */ +#include <stdio.h> + +int main(int argc, char *argv[]) +{ + printf("Hello World\n"); + return 0; +} diff --git a/doc/examples/developing/project.conf b/doc/examples/developing/project.conf new file mode 100644 index 000000000..de266178e --- /dev/null +++ b/doc/examples/developing/project.conf @@ -0,0 +1,12 @@ +# Unique project name +name: running-commands + +# Required BuildStream format version +format-version: 9 + +# Subdirectory where elements are stored +element-path: elements + +# Define an alias for our alpine tarball +aliases: + alpine: https://gnome7.codethink.co.uk/tarballs/ diff --git a/doc/examples/developing/update.patch b/doc/examples/developing/update.patch new file mode 100644 index 000000000..e645ffd1e --- /dev/null +++ b/doc/examples/developing/update.patch @@ -0,0 +1,10 @@ +-- hello.c 2018-06-25 14:48:32.077568920 +0100 ++++ hello.c 2018-06-25 14:49:23.025553785 +0100 +@@ -5,6 +5,6 @@ + + int main(int argc, char *argv[]) + { +- printf("Hello World\n"); ++ printf("Hello World\nWe can use workspaces!\n"); + return 0; + } |