diff --git a/doc/examples/cmake/elements/base.bst b/doc/examples/cmake/elements/base.bst new file mode 100644 index 0000000000000000000000000000000000000000..1b85a9e8c5ff4c70ffeebcb2e45aa688f5c185cf --- /dev/null +++ b/doc/examples/cmake/elements/base.bst @@ -0,0 +1,5 @@ +kind: stack +description: Base stack + +depends: +- base/alpine.bst diff --git a/doc/examples/cmake/elements/base/alpine.bst b/doc/examples/cmake/elements/base/alpine.bst new file mode 100644 index 0000000000000000000000000000000000000000..cf85df5bfd097f1c753d3b751ab14fc9bae61682 --- /dev/null +++ b/doc/examples/cmake/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/cmake/elements/hello.bst b/doc/examples/cmake/elements/hello.bst new file mode 100644 index 0000000000000000000000000000000000000000..654dad2b57b9232b6f5244e33747b8d8fff9fa38 --- /dev/null +++ b/doc/examples/cmake/elements/hello.bst @@ -0,0 +1,14 @@ +depends: +- base.bst +description: |2 + + Hello world example from cmake +kind: cmake +sources: +- kind: local + path: files/hello + directory: Source +variables: + command-subdir: build + conf-root: "%{build-root}/Source" + diff --git a/doc/examples/cmake/files/hello/CMakeLists.txt b/doc/examples/cmake/files/hello/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..4176932967b5fb2b2579354e63df247f314be156 --- /dev/null +++ b/doc/examples/cmake/files/hello/CMakeLists.txt @@ -0,0 +1,14 @@ + +# Set the minimum version of CMake that can be used +# To find the cmake version run +# $ cmake --version +cmake_minimum_required(VERSION 2.8) + +# Set the project name +project (hello_buildstreams C) + +# Add an executable +add_executable(hello_buildstream main.c) + + +install(TARGETS hello_buildstream DESTINATION /bin) diff --git a/doc/examples/cmake/files/hello/main.c b/doc/examples/cmake/files/hello/main.c new file mode 100644 index 0000000000000000000000000000000000000000..3c7b38d1987c7915b7bd7ecc9f6020e169444c9f --- /dev/null +++ b/doc/examples/cmake/files/hello/main.c @@ -0,0 +1,7 @@ +#include <stdio.h> +int main() +{ + // printf() displays the string inside quotation + printf("Hello, World!\n"); + return 0; +} diff --git a/doc/examples/cmake/project.conf b/doc/examples/cmake/project.conf new file mode 100644 index 0000000000000000000000000000000000000000..047ab7ff185304420b955dd02fd9d8af4eb222d7 --- /dev/null +++ b/doc/examples/cmake/project.conf @@ -0,0 +1,13 @@ +# Unique project name +name: cmake-out-of-source-build + +# Required BuildStream format version +format-version: 9 + +# Subdirectory where elements are stored +element-path: elements + +# Define some aliases for the tarballs we download +aliases: + alpine: https://gnome7.codethink.co.uk/tarballs/ + gnu: https://ftp.gnu.org/gnu/automake/ diff --git a/doc/examples/out-of-source-autotool-in-source-tree/elements/base.bst b/doc/examples/out-of-source-autotool-in-source-tree/elements/base.bst new file mode 100644 index 0000000000000000000000000000000000000000..1b85a9e8c5ff4c70ffeebcb2e45aa688f5c185cf --- /dev/null +++ b/doc/examples/out-of-source-autotool-in-source-tree/elements/base.bst @@ -0,0 +1,5 @@ +kind: stack +description: Base stack + +depends: +- base/alpine.bst diff --git a/doc/examples/out-of-source-autotool-in-source-tree/elements/base/alpine.bst b/doc/examples/out-of-source-autotool-in-source-tree/elements/base/alpine.bst new file mode 100644 index 0000000000000000000000000000000000000000..cf85df5bfd097f1c753d3b751ab14fc9bae61682 --- /dev/null +++ b/doc/examples/out-of-source-autotool-in-source-tree/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/out-of-source-autotool-in-source-tree/elements/hello.bst b/doc/examples/out-of-source-autotool-in-source-tree/elements/hello.bst new file mode 100644 index 0000000000000000000000000000000000000000..9b82fe68823158ac50dac039e833c785f235124c --- /dev/null +++ b/doc/examples/out-of-source-autotool-in-source-tree/elements/hello.bst @@ -0,0 +1,15 @@ +depends: +- base.bst +description: |2 + + Hello world example from automake +kind: autotools +sources: +- directory: SourB + kind: tar + ref: 80da43bb5665596ee389e6d8b64b4f122ea4b92a685b1dbd813cd1f0e0c2d83f + url: gnu:automake-1.16.tar.gz +variables: + conf-root: "%{build-root}/SourB/doc/amhello" + command-subdir: build + diff --git a/doc/examples/out-of-source-autotool-in-source-tree/project.conf b/doc/examples/out-of-source-autotool-in-source-tree/project.conf new file mode 100644 index 0000000000000000000000000000000000000000..b6f21d4f9e8ddab8a063aa9629bf745c0d8479bd --- /dev/null +++ b/doc/examples/out-of-source-autotool-in-source-tree/project.conf @@ -0,0 +1,13 @@ +# Unique project name +name: Out-of-Source-builds-in-autotool-in-Source-tree + +# Required BuildStream format version +format-version: 9 + +# Subdirectory where elements are stored +element-path: elements + +# Define some aliases for the tarballs we download +aliases: + alpine: https://gnome7.codethink.co.uk/tarballs/ + gnu: https://ftp.gnu.org/gnu/automake/ diff --git a/doc/examples/out-of-source-build-helloworld/elements/base.bst b/doc/examples/out-of-source-build-helloworld/elements/base.bst new file mode 100644 index 0000000000000000000000000000000000000000..1b85a9e8c5ff4c70ffeebcb2e45aa688f5c185cf --- /dev/null +++ b/doc/examples/out-of-source-build-helloworld/elements/base.bst @@ -0,0 +1,5 @@ +kind: stack +description: Base stack + +depends: +- base/alpine.bst diff --git a/doc/examples/out-of-source-build-helloworld/elements/base/alpine.bst b/doc/examples/out-of-source-build-helloworld/elements/base/alpine.bst new file mode 100644 index 0000000000000000000000000000000000000000..cf85df5bfd097f1c753d3b751ab14fc9bae61682 --- /dev/null +++ b/doc/examples/out-of-source-build-helloworld/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/out-of-source-build-helloworld/elements/hello.bst b/doc/examples/out-of-source-build-helloworld/elements/hello.bst new file mode 100644 index 0000000000000000000000000000000000000000..49e81ae29be2929ecff13805664ca9e34075de71 --- /dev/null +++ b/doc/examples/out-of-source-build-helloworld/elements/hello.bst @@ -0,0 +1,14 @@ +depends: +- base.bst +description: |2 + + Hello world example from automake +kind: autotools +sources: +- directory: Source + kind: local + path: files/hello +variables: + conf-root: "%{build-root}/Source" + command-subdir: build + diff --git a/doc/examples/out-of-source-build-helloworld/files/hello/Makefile.am b/doc/examples/out-of-source-build-helloworld/files/hello/Makefile.am new file mode 100644 index 0000000000000000000000000000000000000000..af437a64d6d80a47ea903fd842a648fc59cbcd9a --- /dev/null +++ b/doc/examples/out-of-source-build-helloworld/files/hello/Makefile.am @@ -0,0 +1 @@ +SUBDIRS = src diff --git a/doc/examples/out-of-source-build-helloworld/files/hello/README b/doc/examples/out-of-source-build-helloworld/files/hello/README new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/doc/examples/out-of-source-build-helloworld/files/hello/configure.ac b/doc/examples/out-of-source-build-helloworld/files/hello/configure.ac new file mode 100644 index 0000000000000000000000000000000000000000..8cee3f71dc7dfa54d94a385fbb36c213ab6cc083 --- /dev/null +++ b/doc/examples/out-of-source-build-helloworld/files/hello/configure.ac @@ -0,0 +1,6 @@ +AC_INIT([helloworld], [0.1], [will.salmon@codethink.co.uk]) +AM_INIT_AUTOMAKE([-Wall -Werror foreign]) +AC_PROG_CC +AC_CONFIG_FILES([Makefile + src/Makefile]) +AC_OUTPUT diff --git a/doc/examples/out-of-source-build-helloworld/files/hello/src/Makefile.am b/doc/examples/out-of-source-build-helloworld/files/hello/src/Makefile.am new file mode 100644 index 0000000000000000000000000000000000000000..2a4d8a81092acb7bd541028e5b8093957d9aa2a9 --- /dev/null +++ b/doc/examples/out-of-source-build-helloworld/files/hello/src/Makefile.am @@ -0,0 +1,2 @@ +bin_PROGRAMS = hello +hello_SOURCES = hello.c libhello.c diff --git a/doc/examples/out-of-source-build-helloworld/files/hello/src/hello.c b/doc/examples/out-of-source-build-helloworld/files/hello/src/hello.c new file mode 100644 index 0000000000000000000000000000000000000000..83e762c2994e4f2c690116c84cc6e461d8f83d7a --- /dev/null +++ b/doc/examples/out-of-source-build-helloworld/files/hello/src/hello.c @@ -0,0 +1,20 @@ +/* + * hello.c - Simple hello program + */ +#include <stdio.h> +#include <libhello.h> + +int main(int argc, char *argv[]) +{ + const char *person = NULL; + + if (argc > 1) + person = argv[1]; + + if (person) + hello(person); + else + hello("stranger"); + + return 0; +} diff --git a/doc/examples/out-of-source-build-helloworld/files/hello/src/libhello.c b/doc/examples/out-of-source-build-helloworld/files/hello/src/libhello.c new file mode 100644 index 0000000000000000000000000000000000000000..759b33926aaf068e0fd96b21ea22a09c72b1bd00 --- /dev/null +++ b/doc/examples/out-of-source-build-helloworld/files/hello/src/libhello.c @@ -0,0 +1,9 @@ +/* + * libhello.c - The hello library + */ +#include <stdio.h> + +void hello(const char *person) +{ + printf("Hello %s\n", person); +} diff --git a/doc/examples/out-of-source-build-helloworld/files/hello/src/libhello.h b/doc/examples/out-of-source-build-helloworld/files/hello/src/libhello.h new file mode 100644 index 0000000000000000000000000000000000000000..f714f3659fa19509765bb93e8f9eb706fb4cfdb7 --- /dev/null +++ b/doc/examples/out-of-source-build-helloworld/files/hello/src/libhello.h @@ -0,0 +1,8 @@ +/* + * libhello.h - The hello library + */ + +/* + * A function to say hello to @person + */ +void hello(const char *person); diff --git a/doc/examples/out-of-source-build-helloworld/project.conf b/doc/examples/out-of-source-build-helloworld/project.conf new file mode 100644 index 0000000000000000000000000000000000000000..9b33a6e055a8e23dc9d4a52efe41688bed7bb7cc --- /dev/null +++ b/doc/examples/out-of-source-build-helloworld/project.conf @@ -0,0 +1,13 @@ +# Unique project name +name: our-of-source-build-helloworld + +# Required BuildStream format version +format-version: 9 + +# Subdirectory where elements are stored +element-path: elements + +# Define some aliases for the tarballs we download +aliases: + alpine: https://gnome7.codethink.co.uk/tarballs/ + gnu: https://ftp.gnu.org/gnu/automake/