From 3fbe53aec0f340a90858265ca8f890314fa5d523 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sat, 30 Oct 2021 00:21:04 +0200 Subject: examples: move recipes to subdirectory --- crates/driver/src/main.rs | 2 +- examples/bar.yml | 9 --- examples/binutils.yml | 67 ----------------- examples/busybox.yml | 64 ---------------- examples/e2fsprogs.yml | 54 -------------- examples/foo.yml | 14 ---- examples/gcc-libs.yml | 32 -------- examples/gcc.yml | 126 -------------------------------- examples/glibc.yml | 70 ------------------ examples/gmp.yml | 55 -------------- examples/libgcc-initial.yml | 52 ------------- examples/libgcc.yml | 33 --------- examples/linux-uapi-headers.yml | 22 ------ examples/linux.yml | 61 ---------------- examples/ls.yml | 12 --- examples/make_ext4fs.yml | 44 ----------- examples/mpc.yml | 59 --------------- examples/mpfr.yml | 59 --------------- examples/recipes/bar.yml | 9 +++ examples/recipes/binutils.yml | 67 +++++++++++++++++ examples/recipes/busybox.yml | 64 ++++++++++++++++ examples/recipes/e2fsprogs.yml | 54 ++++++++++++++ examples/recipes/foo.yml | 14 ++++ examples/recipes/gcc-libs.yml | 32 ++++++++ examples/recipes/gcc.yml | 126 ++++++++++++++++++++++++++++++++ examples/recipes/glibc.yml | 70 ++++++++++++++++++ examples/recipes/gmp.yml | 55 ++++++++++++++ examples/recipes/libgcc-initial.yml | 52 +++++++++++++ examples/recipes/libgcc.yml | 33 +++++++++ examples/recipes/linux-uapi-headers.yml | 22 ++++++ examples/recipes/linux.yml | 61 ++++++++++++++++ examples/recipes/ls.yml | 12 +++ examples/recipes/make_ext4fs.yml | 44 +++++++++++ examples/recipes/mpc.yml | 59 +++++++++++++++ examples/recipes/mpfr.yml | 59 +++++++++++++++ examples/recipes/rootfs.yml | 56 ++++++++++++++ examples/recipes/toolchain.yml | 31 ++++++++ examples/recipes/zlib.yml | 52 +++++++++++++ examples/rootfs.yml | 56 -------------- examples/toolchain.yml | 31 -------- examples/zlib.yml | 52 ------------- 41 files changed, 973 insertions(+), 973 deletions(-) delete mode 100644 examples/bar.yml delete mode 100644 examples/binutils.yml delete mode 100644 examples/busybox.yml delete mode 100644 examples/e2fsprogs.yml delete mode 100644 examples/foo.yml delete mode 100644 examples/gcc-libs.yml delete mode 100644 examples/gcc.yml delete mode 100644 examples/glibc.yml delete mode 100644 examples/gmp.yml delete mode 100644 examples/libgcc-initial.yml delete mode 100644 examples/libgcc.yml delete mode 100644 examples/linux-uapi-headers.yml delete mode 100644 examples/linux.yml delete mode 100644 examples/ls.yml delete mode 100644 examples/make_ext4fs.yml delete mode 100644 examples/mpc.yml delete mode 100644 examples/mpfr.yml create mode 100644 examples/recipes/bar.yml create mode 100644 examples/recipes/binutils.yml create mode 100644 examples/recipes/busybox.yml create mode 100644 examples/recipes/e2fsprogs.yml create mode 100644 examples/recipes/foo.yml create mode 100644 examples/recipes/gcc-libs.yml create mode 100644 examples/recipes/gcc.yml create mode 100644 examples/recipes/glibc.yml create mode 100644 examples/recipes/gmp.yml create mode 100644 examples/recipes/libgcc-initial.yml create mode 100644 examples/recipes/libgcc.yml create mode 100644 examples/recipes/linux-uapi-headers.yml create mode 100644 examples/recipes/linux.yml create mode 100644 examples/recipes/ls.yml create mode 100644 examples/recipes/make_ext4fs.yml create mode 100644 examples/recipes/mpc.yml create mode 100644 examples/recipes/mpfr.yml create mode 100644 examples/recipes/rootfs.yml create mode 100644 examples/recipes/toolchain.yml create mode 100644 examples/recipes/zlib.yml delete mode 100644 examples/rootfs.yml delete mode 100644 examples/toolchain.yml delete mode 100644 examples/zlib.yml diff --git a/crates/driver/src/main.rs b/crates/driver/src/main.rs index 6e783ea..b9a6173 100644 --- a/crates/driver/src/main.rs +++ b/crates/driver/src/main.rs @@ -28,7 +28,7 @@ fn main() { let runner = unsafe { Runner::new(&runner::Options { jobs: opts.jobs }) }.unwrap(); - let ctx = context::Context::new(recipe::read_recipes("examples").unwrap()); + let ctx = context::Context::new(recipe::read_recipes("examples/recipes").unwrap()); let mut rsv = resolve::Resolver::new(&ctx); diff --git a/examples/bar.yml b/examples/bar.yml deleted file mode 100644 index f25322e..0000000 --- a/examples/bar.yml +++ /dev/null @@ -1,9 +0,0 @@ -tasks: - build: - output: - default: {} - run: | - findmnt -o +PROPAGATION - mkdir -p {{destdir}} - echo bar > {{destdir}}/bar - diff --git a/examples/binutils.yml b/examples/binutils.yml deleted file mode 100644 index d524596..0000000 --- a/examples/binutils.yml +++ /dev/null @@ -1,67 +0,0 @@ -meta: - version: '2.37' -tasks: - unpack: - fetch: - - name: '{{pn}}-{{pv}}.tar.xz' - sha256: '820d9724f020a3e69cb337893a0b63c2db161dadcb0e06fc11dc29eb1e84a32c' - run: | - tar xf {{dldir}}/{{pn}}-{{pv}}.tar.xz - - configure: - args: - host: 'platform' - target: 'platform' - inherit: - task: 'unpack' - build_depends: - - recipe: 'toolchain' - task: 'build_depends' - depends: - - recipe: 'toolchain' - task: 'depends' - run: | - mkdir {{pn}}-build - cd {{pn}}-build - ../{{pn}}-{{pv}}/configure \ - --build={{build.gnu_triplet}} \ - --host={{host.gnu_triplet}} \ - --target={{target.gnu_triplet}} \ - --prefix={{host.prefix}} \ - --with-sysroot={{host_to_target.sysroot}} \ - --enable-libssp \ - --enable-deterministic-archives \ - --enable-plugins \ - --disable-bootstrap \ - --disable-multilib \ - --disable-werror \ - --disable-nls \ - --disable-sim \ - --disable-gdb - find -name config.log -delete - - compile: - args: - host: 'platform' - target: 'platform' - inherit: - task: 'configure' - run: | - cd {{pn}}-build - make - find -name config.log -delete - - install: - args: - host: 'platform' - target: 'platform' - inherit: - task: 'compile' - output: - default: - runtime_depends: - - recipe: 'toolchain' - task: 'depends' - run: | - cd {{pn}}-build - make DESTDIR={{destdir}} install diff --git a/examples/busybox.yml b/examples/busybox.yml deleted file mode 100644 index aa37687..0000000 --- a/examples/busybox.yml +++ /dev/null @@ -1,64 +0,0 @@ -meta: - version: '1.34.0' -tasks: - unpack: - fetch: - - name: '{{pn}}-{{pv}}.tar.bz2' - sha256: 'ec8d1615edb045b83b81966604759c4d4ac921434ab4011da604f629c06074ce' - run: | - tar xf {{dldir}}/{{pn}}-{{pv}}.tar.bz2 - - - configure: - inherit: - task: 'unpack' - run: | - mkdir {{pn}}-build - cd {{pn}}-build - make \ - -f ../{{pn}}-{{pv}}/Makefile \ - KBUILD_SRC=../{{pn}}-{{pv}} \ - defconfig - - compile: - args: - host: 'platform' - inherit: - task: 'configure' - build_depends: - - recipe: 'toolchain' - task: 'build_depends' - depends: - - recipe: 'toolchain' - task: 'depends' - run: | - cd {{pn}}-build - make \ - ARCH={{host.karch}} \ - CROSS_COMPILE={{cross_compile}} \ - EXTRA_CFLAGS='-DBB_EXTRA_VERSION=""' \ - {{pn}} busybox.links - sed -i \ - -e 's@^/usr@@' \ - -e 's@^/sbin@/bin@' \ - {{pn}}.links - - install: - args: - host: 'platform' - inherit: - task: 'compile' - output: - default: - runtime_depends: - - recipe: 'toolchain' - task: 'depends' - run: | - cd {{pn}}-build - make \ - ARCH={{host.karch}} \ - CROSS_COMPILE={{cross_compile}} \ - EXTRA_CFLAGS='-DBB_EXTRA_VERSION=""' \ - CONFIG_PREFIX={{destdir}}{{host.prefix}} \ - install - rm {{destdir}}{{host.prefix}}/bin/strings diff --git a/examples/e2fsprogs.yml b/examples/e2fsprogs.yml deleted file mode 100644 index b8377f0..0000000 --- a/examples/e2fsprogs.yml +++ /dev/null @@ -1,54 +0,0 @@ -meta: - version: '1.46.4' -tasks: - unpack: - fetch: - - name: '{{pn}}-{{pv}}.tar.xz' - sha256: 'b11042533c1b1dcf17512f0da48e05b0c573dada1dd8b762864d10f4dc399713' - run: | - tar xf {{dldir}}/{{pn}}-{{pv}}.tar.xz - - configure: - args: - host: 'platform' - inherit: - task: 'unpack' - build_depends: - - recipe: 'toolchain' - task: 'build_depends' - depends: - - recipe: 'toolchain' - task: 'depends' - run: | - mkdir {{pn}}-build - cd {{pn}}-build - ../{{pn}}-{{pv}}/configure \ - --build={{build.gnu_triplet}} \ - --host={{host.gnu_triplet}} \ - --prefix={{host.prefix}} - find -name config.log -delete - - compile: - args: - host: 'platform' - inherit: - task: 'configure' - run: | - cd {{pn}}-build - make - find -name config.log -delete - - install: - args: - host: 'platform' - inherit: - task: 'compile' - output: - default: - runtime_depends: - - recipe: 'toolchain' - task: 'depends' - run: | - cd {{pn}}-build - make DESTDIR={{destdir}} install - diff --git a/examples/foo.yml b/examples/foo.yml deleted file mode 100644 index 2982795..0000000 --- a/examples/foo.yml +++ /dev/null @@ -1,14 +0,0 @@ -tasks: - build: - output: - default: {} - run: | - ls -lha - ls -lha /proc/self/fd - mkdir -p {{destdir}}/foo - cd {{destdir}} - echo foobar > foo/bar - touch foo/bla - touch foo/x - touch foo/z - touch foo/y diff --git a/examples/gcc-libs.yml b/examples/gcc-libs.yml deleted file mode 100644 index 54c34df..0000000 --- a/examples/gcc-libs.yml +++ /dev/null @@ -1,32 +0,0 @@ -meta: - name: 'gcc' - version: '11.2.0' -tasks: - compile: - args: - host: 'platform' - inherit: - recipe: 'libgcc' - task: 'compile' - args: - host: 'build' - target: 'host' - run: | - cd {{pn}}-build - make all-target-libatomic all-target-libgomp all-target-libquadmath all-target-libstdc++-v3 - - install: - args: - host: 'platform' - inherit: - task: 'compile' - output: - default: - path: 'sysroot' - run: | - cd {{pn}}-build - make DESTDIR={{destdir}}/install install-target-libgcc install-target-libatomic install-target-libgomp install-target-libquadmath install-target-libstdc++-v3 - rm -r {{destdir}}/install{{build.prefix}}/lib/gcc - mv -T {{destdir}}/install/{{build_to_host.sysroot}} {{destdir}}/sysroot - cp -al {{destdir}}/install{{build.prefix}}/* {{destdir}}/sysroot{{host.prefix}} - rm {{destdir}}/sysroot{{host.prefix}}/lib/*.la diff --git a/examples/gcc.yml b/examples/gcc.yml deleted file mode 100644 index 2911734..0000000 --- a/examples/gcc.yml +++ /dev/null @@ -1,126 +0,0 @@ -meta: - version: '11.2.0' -tasks: - unpack: - fetch: - - name: '{{pn}}-{{pv}}.tar.xz' - sha256: 'd08edc536b54c372a1010ff6619dd274c0f1603aa49212ba20f7aa2cda36fa8b' - run: | - tar xf {{dldir}}/{{pn}}-{{pv}}.tar.xz - - sed -i -e 's@^MULTILIB_OSDIRNAMES@# &@' {{pn}}-{{pv}}/gcc/config/*/t-* - - header-stubs: - args: - host: 'platform' - target: 'platform' - output: - default: {} - run: | - if {{not host_to_target.is_same}}; then - mkdir -p {{destdir}}{{target.prefix}}/include - touch {{destdir}}{{target.prefix}}/include/limits.h - fi - - configure: - args: - host: 'platform' - target: 'platform' - inherit: - task: 'unpack' - build_depends: - - recipe: 'toolchain' - task: 'build_depends' - - recipe: 'binutils' - task: 'install' - args: - target: 'target' - depends: - - recipe: 'toolchain' - task: 'depends' - - recipe: 'mpc' - task: 'install' - - recipe: 'zlib' - task: 'install' - - task: 'header-stubs' - noinherit: true - run: | - export CXX_FOR_TARGET="$CXX_FOR_TARGET -nostdinc++" - - mkdir {{pn}}-build - cd {{pn}}-build - ../{{pn}}-{{pv}}/configure \ - --build={{build.gnu_triplet}} \ - --host={{host.gnu_triplet}} \ - --target={{target.gnu_triplet}} \ - --prefix={{host.prefix}} \ - --libdir={{host.prefix}}/lib \ - --libexecdir={{host.prefix}}/lib \ - --with-sysroot={{host_to_target.sysroot}} \ - --with-build-sysroot={{sysroot}} \ - --with-native-system-header-dir={{target.prefix}}/include \ - --with-toolexeclibdir={{host_to_target.sysroot}}{{target.prefix}}/lib \ - --with-gxx-include-dir={{host_to_target.sysroot}}{{target.prefix}}/include/c++/"$(cat ../{{pn}}-{{pv}}/gcc/BASE-VER)" \ - --with-gnu-ld \ - --enable-shared \ - --enable-languages=c,c++ \ - --enable-threads=posix \ - --disable-multilib \ - --enable-c99 \ - --enable-long-long \ - --enable-symvers=gnu \ - --enable-libstdcxx-pch \ - --without-local-prefix \ - --disable-install-libiberty \ - --disable-libssp \ - --enable-libitm \ - --enable-lto \ - --disable-bootstrap \ - --with-system-zlib \ - --with-linker-hash-style=gnu \ - --enable-linker-build-id \ - --with-ppl=no \ - --with-cloog=no \ - --enable-checking=release \ - --enable-cheaders=c_global \ - --without-isl \ - --with-system-zlib \ - --enable-standard-branch-protection \ - --with-glibc-version=2.28 \ - --enable-initfini-array \ - --enable-__cxa_atexit - find -name config.log -delete - - compile: - args: - host: 'platform' - target: 'platform' - inherit: - task: 'configure' - depends: - - task: 'header-stubs' - noinherit: true - run: | - cd {{pn}}-build - make all-host - find -name config.log -delete - - install: - args: - host: 'platform' - target: 'platform' - inherit: - task: 'compile' - output: - default: - runtime_depends: - - recipe: 'binutils' - task: 'install' - - recipe: 'mpc' - task: 'install' - - recipe: 'zlib' - task: 'install' - run: | - cd {{pn}}-build - make DESTDIR={{destdir}} install-host - diff --git a/examples/glibc.yml b/examples/glibc.yml deleted file mode 100644 index e9fa405..0000000 --- a/examples/glibc.yml +++ /dev/null @@ -1,70 +0,0 @@ -meta: - version: '2.34' -tasks: - unpack: - fetch: - - name: '{{pn}}-{{pv}}.tar.xz' - sha256: '44d26a1fe20b8853a48f470ead01e4279e869ac149b195dda4e44a195d981ab2' - run: | - tar xf {{dldir}}/{{pn}}-{{pv}}.tar.xz - - configure: - args: - host: 'platform' - inherit: - task: 'unpack' - build_depends: - - recipe: 'gcc' - task: 'install' - - recipe: 'libgcc-initial' - task: 'install' - depends: - - recipe: 'linux-uapi-headers' - task: 'install' - run: | - export BUILD_CC="$CC_FOR_BUILD" - - mkdir {{pn}}-build - cd {{pn}}-build - ../{{pn}}-{{pv}}/configure \ - --build={{build.gnu_triplet}} \ - --host={{host.gnu_triplet}} \ - --prefix={{host.prefix}} \ - --includedir={{host.prefix}}/include \ - --libdir={{host.prefix}}/lib \ - --libexecdir={{host.prefix}}/lib \ - --enable-add-ons \ - --enable-obsolete-rpc \ - --enable-kernel=2.6.32 \ - --enable-bind-now \ - --disable-profile \ - --enable-stackguard-randomization \ - --enable-lock-elision \ - --disable-werror - - echo slibdir={{host.prefix}}/lib >> configparms - echo sbindir={{host.prefix}}/bin >> configparms - echo rootsbindir={{host.prefix}}/bin >> configparms - - compile: - args: - host: 'platform' - inherit: - task: 'configure' - run: | - cd {{pn}}-build - make - - install: - args: - host: 'platform' - inherit: - task: 'compile' - output: - default: - runtime_depends: - - recipe: 'linux-uapi-headers' - task: 'install' - run: | - cd {{pn}}-build - make install_root={{destdir}} install diff --git a/examples/gmp.yml b/examples/gmp.yml deleted file mode 100644 index 9575edd..0000000 --- a/examples/gmp.yml +++ /dev/null @@ -1,55 +0,0 @@ -meta: - version: '6.2.1' -tasks: - unpack: - fetch: - - name: '{{pn}}-{{pv}}.tar.lz' - sha256: '2c7f4f0d370801b2849c48c9ef3f59553b5f1d3791d070cffb04599f9fc67b41' - run: | - tar xf {{dldir}}/{{pn}}-{{pv}}.tar.lz - - configure: - args: - host: 'platform' - inherit: - task: 'unpack' - build_depends: - - recipe: 'toolchain' - task: 'build_depends' - depends: - - recipe: 'toolchain' - task: 'depends' - run: | - mkdir {{pn}}-build - cd {{pn}}-build - ../{{pn}}-{{pv}}/configure \ - --build={{build.gnu_triplet}} \ - --host={{host.gnu_triplet}} \ - --prefix={{host.prefix}} - find -name config.log -delete - - compile: - args: - host: 'platform' - inherit: - task: 'configure' - run: | - cd {{pn}}-build - make - - install: - args: - host: 'platform' - inherit: - task: 'compile' - output: - default: - runtime_depends: - - recipe: 'toolchain' - task: 'depends' - run: | - cd {{pn}}-build - make DESTDIR={{destdir}} install - rm {{destdir}}{{host.prefix}}/lib/*.a - rm {{destdir}}{{host.prefix}}/lib/*.la - diff --git a/examples/libgcc-initial.yml b/examples/libgcc-initial.yml deleted file mode 100644 index fc047e8..0000000 --- a/examples/libgcc-initial.yml +++ /dev/null @@ -1,52 +0,0 @@ -meta: - name: 'gcc' - version: '11.2.0' -tasks: - configure: - args: - host: 'platform' - target: 'platform' - inherit: - recipe: 'gcc' - task: 'compile' - depends: - - recipe: 'gcc' - task: 'header-stubs' - run: | - cd {{pn}}-build - make configure-target-libgcc - - # A hack borrowed from OpenEmbedded: - # We can build an initial libgcc without having to rebuild the whole gcc - # afterwards by manipulating the Makefile - sed -i -r \ - -e 's@^(INHIBIT_LIBC_CFLAGS =).*@\1 -Dinhibit_libc@' \ - gcc/libgcc.mvars - sed -i -r \ - -e 's@^(thread_header =).*@\1 gthr-single.h@' \ - -e 's@^(enable_shared =).*@\1 no@' \ - {{target.gnu_triplet}}/libgcc/Makefile - - compile: - args: - host: 'platform' - target: 'platform' - inherit: - task: 'configure' - run: | - cd {{pn}}-build - make all-target-libgcc - - install: - args: - host: 'platform' - target: 'platform' - inherit: - task: 'compile' - output: - default: {} - run: | - cd {{pn}}-build - make DESTDIR={{destdir}} install-target-libgcc - - ln -s libgcc.a {{destdir}}{{host.prefix}}/lib/gcc/{{target.gnu_triplet}}/"$(cat ../{{pn}}-{{pv}}/gcc/BASE-VER)"/libgcc_eh.a diff --git a/examples/libgcc.yml b/examples/libgcc.yml deleted file mode 100644 index 9d5eb3f..0000000 --- a/examples/libgcc.yml +++ /dev/null @@ -1,33 +0,0 @@ -meta: - name: 'gcc' - version: '11.2.0' -tasks: - compile: - args: - host: 'platform' - target: 'platform' - inherit: - recipe: 'gcc' - task: 'compile' - depends: - - recipe: 'glibc' - task: 'install' - args: - host: 'target' - run: | - cd {{pn}}-build - make all-target-libgcc - - install: - args: - host: 'platform' - target: 'platform' - inherit: - task: 'compile' - output: - default: {} - run: | - cd {{pn}}-build - make DESTDIR={{destdir}} install-target-libgcc - rm {{destdir}}{{host_to_target.sysroot}}{{target.prefix}}/lib/libgcc_s.so* - rmdir -p --ignore-fail-on-non-empty {{destdir}}{{host_to_target.sysroot}}{{target.prefix}}/lib diff --git a/examples/linux-uapi-headers.yml b/examples/linux-uapi-headers.yml deleted file mode 100644 index fdd9a8e..0000000 --- a/examples/linux-uapi-headers.yml +++ /dev/null @@ -1,22 +0,0 @@ -meta: - name: 'linux' - version: '5.10.66' -tasks: - unpack: - fetch: - - name: '{{pn}}-{{pv}}.tar.xz' - sha256: '5dfa06bbbbd164b9ea669ec637b1e6d05fb5fea8ef3aeb6729f2cbcd0dfcc8a7' - run: | - tar xf {{dldir}}/{{pn}}-{{pv}}.tar.xz - - install: - args: - host: 'platform' - inherit: - task: 'unpack' - output: - default: {} - run: | - cd {{pn}}-{{pv}} - make INSTALL_HDR_PATH={{destdir}}{{host.prefix}} ARCH={{host.karch}} headers_install - diff --git a/examples/linux.yml b/examples/linux.yml deleted file mode 100644 index a7f4394..0000000 --- a/examples/linux.yml +++ /dev/null @@ -1,61 +0,0 @@ -meta: - version: '5.10.66' -tasks: - unpack: - fetch: - - name: '{{pn}}-{{pv}}.tar.xz' - sha256: '5dfa06bbbbd164b9ea669ec637b1e6d05fb5fea8ef3aeb6729f2cbcd0dfcc8a7' - run: | - tar xf {{dldir}}/{{pn}}-{{pv}}.tar.xz - - configure: - args: - host: 'platform' - inherit: - task: 'unpack' - build_depends: - - recipe: 'gcc' - task: 'install' - run: | - mkdir {{pn}}-build - cd {{pn}}-build - make \ - -f ../{{pn}}-{{pv}}/Makefile \ - ARCH={{host.karch}} \ - CROSS_COMPILE={{cross_compile}} \ - defconfig - - compile: - args: - host: 'platform' - inherit: - task: 'configure' - run: | - export KBUILD_BUILD_TIMESTAMP="@${SOURCE_DATE_EPOCH}" - - cd {{pn}}-build - make \ - ARCH={{host.karch}} \ - CROSS_COMPILE={{cross_compile}} \ - all - - install: - args: - host: 'platform' - inherit: - task: 'compile' - output: - boot: - path: 'boot' - modules: - path: 'modules' - run: | - cd {{pn}}-build - mkdir -p {{destdir}}/boot - make \ - ARCH={{host.karch}} \ - CROSS_COMPILE={{cross_compile}} \ - INSTALL_PATH={{destdir}}/boot \ - INSTALL_MOD_PATH={{destdir}}/modules{{host.prefix}} \ - DEPMOD=true \ - install modules_install diff --git a/examples/ls.yml b/examples/ls.yml deleted file mode 100644 index 633336d..0000000 --- a/examples/ls.yml +++ /dev/null @@ -1,12 +0,0 @@ -tasks: - build: - depends: - - recipe: 'foo' - task: 'build' - - recipe: 'bar' - task: 'build' - output: - default: {} - run: | - ls -lh / - ls -lhR {{sysroot}} diff --git a/examples/make_ext4fs.yml b/examples/make_ext4fs.yml deleted file mode 100644 index 53fed98..0000000 --- a/examples/make_ext4fs.yml +++ /dev/null @@ -1,44 +0,0 @@ -meta: - version: '2020-01-05-5c201be7d72aff735da27e17c29852e0cefe3e52' -tasks: - unpack: - fetch: - - name: '{{pn}}-{{pv}}.tar.gz' - sha256: 'bfe984cc757c676639090a5b34bdfc359cdef9b723de77efbce590872dce4132' - run: | - tar xf {{dldir}}/{{pn}}-{{pv}}.tar.gz - - compile: - args: - host: 'platform' - build_depends: - - recipe: 'toolchain' - task: 'build_depends' - depends: - - recipe: 'toolchain' - task: 'depends' - - recipe: 'zlib' - task: 'install' - inherit: - task: 'unpack' - run: | - cd {{pn}}-{{pv}} - make - - install: - args: - host: 'platform' - inherit: - task: 'compile' - output: - default: - runtime_depends: - - recipe: 'toolchain' - task: 'depends' - - recipe: 'zlib' - task: 'install' - run: | - cd {{pn}}-{{pv}} - install -d {{destdir}}{{host.prefix}}/bin - install -m755 make_ext4fs {{destdir}}{{host.prefix}}/bin/ - diff --git a/examples/mpc.yml b/examples/mpc.yml deleted file mode 100644 index 8a4aadf..0000000 --- a/examples/mpc.yml +++ /dev/null @@ -1,59 +0,0 @@ -meta: - version: '1.2.1' -tasks: - unpack: - fetch: - - name: '{{pn}}-{{pv}}.tar.gz' - sha256: '17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459' - run: | - tar xf {{dldir}}/{{pn}}-{{pv}}.tar.gz - - configure: - args: - host: 'platform' - inherit: - task: 'unpack' - build_depends: - - recipe: 'toolchain' - task: 'build_depends' - depends: - - recipe: 'toolchain' - task: 'depends' - - recipe: 'mpfr' - task: 'install' - run: | - mkdir {{pn}}-build - cd {{pn}}-build - ../{{pn}}-{{pv}}/configure \ - --build={{build.gnu_triplet}} \ - --host={{host.gnu_triplet}} \ - --prefix={{host.prefix}} - find -name config.log -delete - - compile: - args: - host: 'platform' - inherit: - task: 'configure' - run: | - cd {{pn}}-build - make - - install: - args: - host: 'platform' - inherit: - task: 'compile' - output: - default: - runtime_depends: - - recipe: 'toolchain' - task: 'depends' - - recipe: 'mpfr' - task: 'install' - run: | - cd {{pn}}-build - make DESTDIR={{destdir}} install - rm {{destdir}}{{host.prefix}}/lib/*.a - rm {{destdir}}{{host.prefix}}/lib/*.la - diff --git a/examples/mpfr.yml b/examples/mpfr.yml deleted file mode 100644 index 61642ac..0000000 --- a/examples/mpfr.yml +++ /dev/null @@ -1,59 +0,0 @@ -meta: - version: '4.1.0' -tasks: - unpack: - fetch: - - name: '{{pn}}-{{pv}}.tar.xz' - sha256: '0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f' - run: | - tar xf {{dldir}}/{{pn}}-{{pv}}.tar.xz - - configure: - args: - host: 'platform' - inherit: - task: 'unpack' - build_depends: - - recipe: 'toolchain' - task: 'build_depends' - depends: - - recipe: 'toolchain' - task: 'depends' - - recipe: 'gmp' - task: 'install' - run: | - mkdir {{pn}}-build - cd {{pn}}-build - ../{{pn}}-{{pv}}/configure \ - --build={{build.gnu_triplet}} \ - --host={{host.gnu_triplet}} \ - --prefix={{host.prefix}} - find -name config.log -delete - - compile: - args: - host: 'platform' - inherit: - task: 'configure' - run: | - cd {{pn}}-build - make - - install: - args: - host: 'platform' - inherit: - task: 'compile' - output: - default: - runtime_depends: - - recipe: 'toolchain' - task: 'depends' - - recipe: 'gmp' - task: 'install' - run: | - cd {{pn}}-build - make DESTDIR={{destdir}} install - rm {{destdir}}{{host.prefix}}/lib/*.a - rm {{destdir}}{{host.prefix}}/lib/*.la - diff --git a/examples/recipes/bar.yml b/examples/recipes/bar.yml new file mode 100644 index 0000000..f25322e --- /dev/null +++ b/examples/recipes/bar.yml @@ -0,0 +1,9 @@ +tasks: + build: + output: + default: {} + run: | + findmnt -o +PROPAGATION + mkdir -p {{destdir}} + echo bar > {{destdir}}/bar + diff --git a/examples/recipes/binutils.yml b/examples/recipes/binutils.yml new file mode 100644 index 0000000..d524596 --- /dev/null +++ b/examples/recipes/binutils.yml @@ -0,0 +1,67 @@ +meta: + version: '2.37' +tasks: + unpack: + fetch: + - name: '{{pn}}-{{pv}}.tar.xz' + sha256: '820d9724f020a3e69cb337893a0b63c2db161dadcb0e06fc11dc29eb1e84a32c' + run: | + tar xf {{dldir}}/{{pn}}-{{pv}}.tar.xz + + configure: + args: + host: 'platform' + target: 'platform' + inherit: + task: 'unpack' + build_depends: + - recipe: 'toolchain' + task: 'build_depends' + depends: + - recipe: 'toolchain' + task: 'depends' + run: | + mkdir {{pn}}-build + cd {{pn}}-build + ../{{pn}}-{{pv}}/configure \ + --build={{build.gnu_triplet}} \ + --host={{host.gnu_triplet}} \ + --target={{target.gnu_triplet}} \ + --prefix={{host.prefix}} \ + --with-sysroot={{host_to_target.sysroot}} \ + --enable-libssp \ + --enable-deterministic-archives \ + --enable-plugins \ + --disable-bootstrap \ + --disable-multilib \ + --disable-werror \ + --disable-nls \ + --disable-sim \ + --disable-gdb + find -name config.log -delete + + compile: + args: + host: 'platform' + target: 'platform' + inherit: + task: 'configure' + run: | + cd {{pn}}-build + make + find -name config.log -delete + + install: + args: + host: 'platform' + target: 'platform' + inherit: + task: 'compile' + output: + default: + runtime_depends: + - recipe: 'toolchain' + task: 'depends' + run: | + cd {{pn}}-build + make DESTDIR={{destdir}} install diff --git a/examples/recipes/busybox.yml b/examples/recipes/busybox.yml new file mode 100644 index 0000000..aa37687 --- /dev/null +++ b/examples/recipes/busybox.yml @@ -0,0 +1,64 @@ +meta: + version: '1.34.0' +tasks: + unpack: + fetch: + - name: '{{pn}}-{{pv}}.tar.bz2' + sha256: 'ec8d1615edb045b83b81966604759c4d4ac921434ab4011da604f629c06074ce' + run: | + tar xf {{dldir}}/{{pn}}-{{pv}}.tar.bz2 + + + configure: + inherit: + task: 'unpack' + run: | + mkdir {{pn}}-build + cd {{pn}}-build + make \ + -f ../{{pn}}-{{pv}}/Makefile \ + KBUILD_SRC=../{{pn}}-{{pv}} \ + defconfig + + compile: + args: + host: 'platform' + inherit: + task: 'configure' + build_depends: + - recipe: 'toolchain' + task: 'build_depends' + depends: + - recipe: 'toolchain' + task: 'depends' + run: | + cd {{pn}}-build + make \ + ARCH={{host.karch}} \ + CROSS_COMPILE={{cross_compile}} \ + EXTRA_CFLAGS='-DBB_EXTRA_VERSION=""' \ + {{pn}} busybox.links + sed -i \ + -e 's@^/usr@@' \ + -e 's@^/sbin@/bin@' \ + {{pn}}.links + + install: + args: + host: 'platform' + inherit: + task: 'compile' + output: + default: + runtime_depends: + - recipe: 'toolchain' + task: 'depends' + run: | + cd {{pn}}-build + make \ + ARCH={{host.karch}} \ + CROSS_COMPILE={{cross_compile}} \ + EXTRA_CFLAGS='-DBB_EXTRA_VERSION=""' \ + CONFIG_PREFIX={{destdir}}{{host.prefix}} \ + install + rm {{destdir}}{{host.prefix}}/bin/strings diff --git a/examples/recipes/e2fsprogs.yml b/examples/recipes/e2fsprogs.yml new file mode 100644 index 0000000..b8377f0 --- /dev/null +++ b/examples/recipes/e2fsprogs.yml @@ -0,0 +1,54 @@ +meta: + version: '1.46.4' +tasks: + unpack: + fetch: + - name: '{{pn}}-{{pv}}.tar.xz' + sha256: 'b11042533c1b1dcf17512f0da48e05b0c573dada1dd8b762864d10f4dc399713' + run: | + tar xf {{dldir}}/{{pn}}-{{pv}}.tar.xz + + configure: + args: + host: 'platform' + inherit: + task: 'unpack' + build_depends: + - recipe: 'toolchain' + task: 'build_depends' + depends: + - recipe: 'toolchain' + task: 'depends' + run: | + mkdir {{pn}}-build + cd {{pn}}-build + ../{{pn}}-{{pv}}/configure \ + --build={{build.gnu_triplet}} \ + --host={{host.gnu_triplet}} \ + --prefix={{host.prefix}} + find -name config.log -delete + + compile: + args: + host: 'platform' + inherit: + task: 'configure' + run: | + cd {{pn}}-build + make + find -name config.log -delete + + install: + args: + host: 'platform' + inherit: + task: 'compile' + output: + default: + runtime_depends: + - recipe: 'toolchain' + task: 'depends' + run: | + cd {{pn}}-build + make DESTDIR={{destdir}} install + diff --git a/examples/recipes/foo.yml b/examples/recipes/foo.yml new file mode 100644 index 0000000..2982795 --- /dev/null +++ b/examples/recipes/foo.yml @@ -0,0 +1,14 @@ +tasks: + build: + output: + default: {} + run: | + ls -lha + ls -lha /proc/self/fd + mkdir -p {{destdir}}/foo + cd {{destdir}} + echo foobar > foo/bar + touch foo/bla + touch foo/x + touch foo/z + touch foo/y diff --git a/examples/recipes/gcc-libs.yml b/examples/recipes/gcc-libs.yml new file mode 100644 index 0000000..54c34df --- /dev/null +++ b/examples/recipes/gcc-libs.yml @@ -0,0 +1,32 @@ +meta: + name: 'gcc' + version: '11.2.0' +tasks: + compile: + args: + host: 'platform' + inherit: + recipe: 'libgcc' + task: 'compile' + args: + host: 'build' + target: 'host' + run: | + cd {{pn}}-build + make all-target-libatomic all-target-libgomp all-target-libquadmath all-target-libstdc++-v3 + + install: + args: + host: 'platform' + inherit: + task: 'compile' + output: + default: + path: 'sysroot' + run: | + cd {{pn}}-build + make DESTDIR={{destdir}}/install install-target-libgcc install-target-libatomic install-target-libgomp install-target-libquadmath install-target-libstdc++-v3 + rm -r {{destdir}}/install{{build.prefix}}/lib/gcc + mv -T {{destdir}}/install/{{build_to_host.sysroot}} {{destdir}}/sysroot + cp -al {{destdir}}/install{{build.prefix}}/* {{destdir}}/sysroot{{host.prefix}} + rm {{destdir}}/sysroot{{host.prefix}}/lib/*.la diff --git a/examples/recipes/gcc.yml b/examples/recipes/gcc.yml new file mode 100644 index 0000000..2911734 --- /dev/null +++ b/examples/recipes/gcc.yml @@ -0,0 +1,126 @@ +meta: + version: '11.2.0' +tasks: + unpack: + fetch: + - name: '{{pn}}-{{pv}}.tar.xz' + sha256: 'd08edc536b54c372a1010ff6619dd274c0f1603aa49212ba20f7aa2cda36fa8b' + run: | + tar xf {{dldir}}/{{pn}}-{{pv}}.tar.xz + + sed -i -e 's@^MULTILIB_OSDIRNAMES@# &@' {{pn}}-{{pv}}/gcc/config/*/t-* + + header-stubs: + args: + host: 'platform' + target: 'platform' + output: + default: {} + run: | + if {{not host_to_target.is_same}}; then + mkdir -p {{destdir}}{{target.prefix}}/include + touch {{destdir}}{{target.prefix}}/include/limits.h + fi + + configure: + args: + host: 'platform' + target: 'platform' + inherit: + task: 'unpack' + build_depends: + - recipe: 'toolchain' + task: 'build_depends' + - recipe: 'binutils' + task: 'install' + args: + target: 'target' + depends: + - recipe: 'toolchain' + task: 'depends' + - recipe: 'mpc' + task: 'install' + - recipe: 'zlib' + task: 'install' + - task: 'header-stubs' + noinherit: true + run: | + export CXX_FOR_TARGET="$CXX_FOR_TARGET -nostdinc++" + + mkdir {{pn}}-build + cd {{pn}}-build + ../{{pn}}-{{pv}}/configure \ + --build={{build.gnu_triplet}} \ + --host={{host.gnu_triplet}} \ + --target={{target.gnu_triplet}} \ + --prefix={{host.prefix}} \ + --libdir={{host.prefix}}/lib \ + --libexecdir={{host.prefix}}/lib \ + --with-sysroot={{host_to_target.sysroot}} \ + --with-build-sysroot={{sysroot}} \ + --with-native-system-header-dir={{target.prefix}}/include \ + --with-toolexeclibdir={{host_to_target.sysroot}}{{target.prefix}}/lib \ + --with-gxx-include-dir={{host_to_target.sysroot}}{{target.prefix}}/include/c++/"$(cat ../{{pn}}-{{pv}}/gcc/BASE-VER)" \ + --with-gnu-ld \ + --enable-shared \ + --enable-languages=c,c++ \ + --enable-threads=posix \ + --disable-multilib \ + --enable-c99 \ + --enable-long-long \ + --enable-symvers=gnu \ + --enable-libstdcxx-pch \ + --without-local-prefix \ + --disable-install-libiberty \ + --disable-libssp \ + --enable-libitm \ + --enable-lto \ + --disable-bootstrap \ + --with-system-zlib \ + --with-linker-hash-style=gnu \ + --enable-linker-build-id \ + --with-ppl=no \ + --with-cloog=no \ + --enable-checking=release \ + --enable-cheaders=c_global \ + --without-isl \ + --with-system-zlib \ + --enable-standard-branch-protection \ + --with-glibc-version=2.28 \ + --enable-initfini-array \ + --enable-__cxa_atexit + find -name config.log -delete + + compile: + args: + host: 'platform' + target: 'platform' + inherit: + task: 'configure' + depends: + - task: 'header-stubs' + noinherit: true + run: | + cd {{pn}}-build + make all-host + find -name config.log -delete + + install: + args: + host: 'platform' + target: 'platform' + inherit: + task: 'compile' + output: + default: + runtime_depends: + - recipe: 'binutils' + task: 'install' + - recipe: 'mpc' + task: 'install' + - recipe: 'zlib' + task: 'install' + run: | + cd {{pn}}-build + make DESTDIR={{destdir}} install-host + diff --git a/examples/recipes/glibc.yml b/examples/recipes/glibc.yml new file mode 100644 index 0000000..e9fa405 --- /dev/null +++ b/examples/recipes/glibc.yml @@ -0,0 +1,70 @@ +meta: + version: '2.34' +tasks: + unpack: + fetch: + - name: '{{pn}}-{{pv}}.tar.xz' + sha256: '44d26a1fe20b8853a48f470ead01e4279e869ac149b195dda4e44a195d981ab2' + run: | + tar xf {{dldir}}/{{pn}}-{{pv}}.tar.xz + + configure: + args: + host: 'platform' + inherit: + task: 'unpack' + build_depends: + - recipe: 'gcc' + task: 'install' + - recipe: 'libgcc-initial' + task: 'install' + depends: + - recipe: 'linux-uapi-headers' + task: 'install' + run: | + export BUILD_CC="$CC_FOR_BUILD" + + mkdir {{pn}}-build + cd {{pn}}-build + ../{{pn}}-{{pv}}/configure \ + --build={{build.gnu_triplet}} \ + --host={{host.gnu_triplet}} \ + --prefix={{host.prefix}} \ + --includedir={{host.prefix}}/include \ + --libdir={{host.prefix}}/lib \ + --libexecdir={{host.prefix}}/lib \ + --enable-add-ons \ + --enable-obsolete-rpc \ + --enable-kernel=2.6.32 \ + --enable-bind-now \ + --disable-profile \ + --enable-stackguard-randomization \ + --enable-lock-elision \ + --disable-werror + + echo slibdir={{host.prefix}}/lib >> configparms + echo sbindir={{host.prefix}}/bin >> configparms + echo rootsbindir={{host.prefix}}/bin >> configparms + + compile: + args: + host: 'platform' + inherit: + task: 'configure' + run: | + cd {{pn}}-build + make + + install: + args: + host: 'platform' + inherit: + task: 'compile' + output: + default: + runtime_depends: + - recipe: 'linux-uapi-headers' + task: 'install' + run: | + cd {{pn}}-build + make install_root={{destdir}} install diff --git a/examples/recipes/gmp.yml b/examples/recipes/gmp.yml new file mode 100644 index 0000000..9575edd --- /dev/null +++ b/examples/recipes/gmp.yml @@ -0,0 +1,55 @@ +meta: + version: '6.2.1' +tasks: + unpack: + fetch: + - name: '{{pn}}-{{pv}}.tar.lz' + sha256: '2c7f4f0d370801b2849c48c9ef3f59553b5f1d3791d070cffb04599f9fc67b41' + run: | + tar xf {{dldir}}/{{pn}}-{{pv}}.tar.lz + + configure: + args: + host: 'platform' + inherit: + task: 'unpack' + build_depends: + - recipe: 'toolchain' + task: 'build_depends' + depends: + - recipe: 'toolchain' + task: 'depends' + run: | + mkdir {{pn}}-build + cd {{pn}}-build + ../{{pn}}-{{pv}}/configure \ + --build={{build.gnu_triplet}} \ + --host={{host.gnu_triplet}} \ + --prefix={{host.prefix}} + find -name config.log -delete + + compile: + args: + host: 'platform' + inherit: + task: 'configure' + run: | + cd {{pn}}-build + make + + install: + args: + host: 'platform' + inherit: + task: 'compile' + output: + default: + runtime_depends: + - recipe: 'toolchain' + task: 'depends' + run: | + cd {{pn}}-build + make DESTDIR={{destdir}} install + rm {{destdir}}{{host.prefix}}/lib/*.a + rm {{destdir}}{{host.prefix}}/lib/*.la + diff --git a/examples/recipes/libgcc-initial.yml b/examples/recipes/libgcc-initial.yml new file mode 100644 index 0000000..fc047e8 --- /dev/null +++ b/examples/recipes/libgcc-initial.yml @@ -0,0 +1,52 @@ +meta: + name: 'gcc' + version: '11.2.0' +tasks: + configure: + args: + host: 'platform' + target: 'platform' + inherit: + recipe: 'gcc' + task: 'compile' + depends: + - recipe: 'gcc' + task: 'header-stubs' + run: | + cd {{pn}}-build + make configure-target-libgcc + + # A hack borrowed from OpenEmbedded: + # We can build an initial libgcc without having to rebuild the whole gcc + # afterwards by manipulating the Makefile + sed -i -r \ + -e 's@^(INHIBIT_LIBC_CFLAGS =).*@\1 -Dinhibit_libc@' \ + gcc/libgcc.mvars + sed -i -r \ + -e 's@^(thread_header =).*@\1 gthr-single.h@' \ + -e 's@^(enable_shared =).*@\1 no@' \ + {{target.gnu_triplet}}/libgcc/Makefile + + compile: + args: + host: 'platform' + target: 'platform' + inherit: + task: 'configure' + run: | + cd {{pn}}-build + make all-target-libgcc + + install: + args: + host: 'platform' + target: 'platform' + inherit: + task: 'compile' + output: + default: {} + run: | + cd {{pn}}-build + make DESTDIR={{destdir}} install-target-libgcc + + ln -s libgcc.a {{destdir}}{{host.prefix}}/lib/gcc/{{target.gnu_triplet}}/"$(cat ../{{pn}}-{{pv}}/gcc/BASE-VER)"/libgcc_eh.a diff --git a/examples/recipes/libgcc.yml b/examples/recipes/libgcc.yml new file mode 100644 index 0000000..9d5eb3f --- /dev/null +++ b/examples/recipes/libgcc.yml @@ -0,0 +1,33 @@ +meta: + name: 'gcc' + version: '11.2.0' +tasks: + compile: + args: + host: 'platform' + target: 'platform' + inherit: + recipe: 'gcc' + task: 'compile' + depends: + - recipe: 'glibc' + task: 'install' + args: + host: 'target' + run: | + cd {{pn}}-build + make all-target-libgcc + + install: + args: + host: 'platform' + target: 'platform' + inherit: + task: 'compile' + output: + default: {} + run: | + cd {{pn}}-build + make DESTDIR={{destdir}} install-target-libgcc + rm {{destdir}}{{host_to_target.sysroot}}{{target.prefix}}/lib/libgcc_s.so* + rmdir -p --ignore-fail-on-non-empty {{destdir}}{{host_to_target.sysroot}}{{target.prefix}}/lib diff --git a/examples/recipes/linux-uapi-headers.yml b/examples/recipes/linux-uapi-headers.yml new file mode 100644 index 0000000..fdd9a8e --- /dev/null +++ b/examples/recipes/linux-uapi-headers.yml @@ -0,0 +1,22 @@ +meta: + name: 'linux' + version: '5.10.66' +tasks: + unpack: + fetch: + - name: '{{pn}}-{{pv}}.tar.xz' + sha256: '5dfa06bbbbd164b9ea669ec637b1e6d05fb5fea8ef3aeb6729f2cbcd0dfcc8a7' + run: | + tar xf {{dldir}}/{{pn}}-{{pv}}.tar.xz + + install: + args: + host: 'platform' + inherit: + task: 'unpack' + output: + default: {} + run: | + cd {{pn}}-{{pv}} + make INSTALL_HDR_PATH={{destdir}}{{host.prefix}} ARCH={{host.karch}} headers_install + diff --git a/examples/recipes/linux.yml b/examples/recipes/linux.yml new file mode 100644 index 0000000..a7f4394 --- /dev/null +++ b/examples/recipes/linux.yml @@ -0,0 +1,61 @@ +meta: + version: '5.10.66' +tasks: + unpack: + fetch: + - name: '{{pn}}-{{pv}}.tar.xz' + sha256: '5dfa06bbbbd164b9ea669ec637b1e6d05fb5fea8ef3aeb6729f2cbcd0dfcc8a7' + run: | + tar xf {{dldir}}/{{pn}}-{{pv}}.tar.xz + + configure: + args: + host: 'platform' + inherit: + task: 'unpack' + build_depends: + - recipe: 'gcc' + task: 'install' + run: | + mkdir {{pn}}-build + cd {{pn}}-build + make \ + -f ../{{pn}}-{{pv}}/Makefile \ + ARCH={{host.karch}} \ + CROSS_COMPILE={{cross_compile}} \ + defconfig + + compile: + args: + host: 'platform' + inherit: + task: 'configure' + run: | + export KBUILD_BUILD_TIMESTAMP="@${SOURCE_DATE_EPOCH}" + + cd {{pn}}-build + make \ + ARCH={{host.karch}} \ + CROSS_COMPILE={{cross_compile}} \ + all + + install: + args: + host: 'platform' + inherit: + task: 'compile' + output: + boot: + path: 'boot' + modules: + path: 'modules' + run: | + cd {{pn}}-build + mkdir -p {{destdir}}/boot + make \ + ARCH={{host.karch}} \ + CROSS_COMPILE={{cross_compile}} \ + INSTALL_PATH={{destdir}}/boot \ + INSTALL_MOD_PATH={{destdir}}/modules{{host.prefix}} \ + DEPMOD=true \ + install modules_install diff --git a/examples/recipes/ls.yml b/examples/recipes/ls.yml new file mode 100644 index 0000000..633336d --- /dev/null +++ b/examples/recipes/ls.yml @@ -0,0 +1,12 @@ +tasks: + build: + depends: + - recipe: 'foo' + task: 'build' + - recipe: 'bar' + task: 'build' + output: + default: {} + run: | + ls -lh / + ls -lhR {{sysroot}} diff --git a/examples/recipes/make_ext4fs.yml b/examples/recipes/make_ext4fs.yml new file mode 100644 index 0000000..53fed98 --- /dev/null +++ b/examples/recipes/make_ext4fs.yml @@ -0,0 +1,44 @@ +meta: + version: '2020-01-05-5c201be7d72aff735da27e17c29852e0cefe3e52' +tasks: + unpack: + fetch: + - name: '{{pn}}-{{pv}}.tar.gz' + sha256: 'bfe984cc757c676639090a5b34bdfc359cdef9b723de77efbce590872dce4132' + run: | + tar xf {{dldir}}/{{pn}}-{{pv}}.tar.gz + + compile: + args: + host: 'platform' + build_depends: + - recipe: 'toolchain' + task: 'build_depends' + depends: + - recipe: 'toolchain' + task: 'depends' + - recipe: 'zlib' + task: 'install' + inherit: + task: 'unpack' + run: | + cd {{pn}}-{{pv}} + make + + install: + args: + host: 'platform' + inherit: + task: 'compile' + output: + default: + runtime_depends: + - recipe: 'toolchain' + task: 'depends' + - recipe: 'zlib' + task: 'install' + run: | + cd {{pn}}-{{pv}} + install -d {{destdir}}{{host.prefix}}/bin + install -m755 make_ext4fs {{destdir}}{{host.prefix}}/bin/ + diff --git a/examples/recipes/mpc.yml b/examples/recipes/mpc.yml new file mode 100644 index 0000000..8a4aadf --- /dev/null +++ b/examples/recipes/mpc.yml @@ -0,0 +1,59 @@ +meta: + version: '1.2.1' +tasks: + unpack: + fetch: + - name: '{{pn}}-{{pv}}.tar.gz' + sha256: '17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459' + run: | + tar xf {{dldir}}/{{pn}}-{{pv}}.tar.gz + + configure: + args: + host: 'platform' + inherit: + task: 'unpack' + build_depends: + - recipe: 'toolchain' + task: 'build_depends' + depends: + - recipe: 'toolchain' + task: 'depends' + - recipe: 'mpfr' + task: 'install' + run: | + mkdir {{pn}}-build + cd {{pn}}-build + ../{{pn}}-{{pv}}/configure \ + --build={{build.gnu_triplet}} \ + --host={{host.gnu_triplet}} \ + --prefix={{host.prefix}} + find -name config.log -delete + + compile: + args: + host: 'platform' + inherit: + task: 'configure' + run: | + cd {{pn}}-build + make + + install: + args: + host: 'platform' + inherit: + task: 'compile' + output: + default: + runtime_depends: + - recipe: 'toolchain' + task: 'depends' + - recipe: 'mpfr' + task: 'install' + run: | + cd {{pn}}-build + make DESTDIR={{destdir}} install + rm {{destdir}}{{host.prefix}}/lib/*.a + rm {{destdir}}{{host.prefix}}/lib/*.la + diff --git a/examples/recipes/mpfr.yml b/examples/recipes/mpfr.yml new file mode 100644 index 0000000..61642ac --- /dev/null +++ b/examples/recipes/mpfr.yml @@ -0,0 +1,59 @@ +meta: + version: '4.1.0' +tasks: + unpack: + fetch: + - name: '{{pn}}-{{pv}}.tar.xz' + sha256: '0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f' + run: | + tar xf {{dldir}}/{{pn}}-{{pv}}.tar.xz + + configure: + args: + host: 'platform' + inherit: + task: 'unpack' + build_depends: + - recipe: 'toolchain' + task: 'build_depends' + depends: + - recipe: 'toolchain' + task: 'depends' + - recipe: 'gmp' + task: 'install' + run: | + mkdir {{pn}}-build + cd {{pn}}-build + ../{{pn}}-{{pv}}/configure \ + --build={{build.gnu_triplet}} \ + --host={{host.gnu_triplet}} \ + --prefix={{host.prefix}} + find -name config.log -delete + + compile: + args: + host: 'platform' + inherit: + task: 'configure' + run: | + cd {{pn}}-build + make + + install: + args: + host: 'platform' + inherit: + task: 'compile' + output: + default: + runtime_depends: + - recipe: 'toolchain' + task: 'depends' + - recipe: 'gmp' + task: 'install' + run: | + cd {{pn}}-build + make DESTDIR={{destdir}} install + rm {{destdir}}{{host.prefix}}/lib/*.a + rm {{destdir}}{{host.prefix}}/lib/*.la + diff --git a/examples/recipes/rootfs.yml b/examples/recipes/rootfs.yml new file mode 100644 index 0000000..77b50ba --- /dev/null +++ b/examples/recipes/rootfs.yml @@ -0,0 +1,56 @@ +tasks: + install: + args: + host: 'platform' + depends: + - recipe: 'busybox' + task: 'install' + - recipe: 'toolchain' + task: 'build_depends' + args: + target: 'host' + output: + default: {} + run: | + mkdir -p \ + {{destdir}}/dev \ + {{destdir}}/proc \ + {{destdir}}/sys \ + {{destdir}}/root \ + {{destdir}}/run \ + {{destdir}}/var \ + {{destdir}}/usr/bin \ + {{destdir}}/usr/lib + + ln -s bin {{destdir}}/usr/sbin + ln -s usr/bin {{destdir}}/bin + ln -s usr/bin {{destdir}}/sbin + ln -s usr/lib {{destdir}}/lib + ln -s ../run {{destdir}}/var/run + + rsync -aHAXK {{sysroot}}/ {{destdir}} + + + image-ext4: + args: + host: 'platform' + build_depends: + - recipe: 'e2fsprogs' + task: 'install' + - recipe: 'make_ext4fs' + task: 'install' + depends: + - task: 'install' + output: + default: {} + run: | + IMAGE={{destdir}}/{{pn}}.ext4 + UUID="$( + python3 \ + -c 'import sys; import uuid; print(uuid.UUID(hex=sys.argv[1][:32], version=4))' \ + "$INPUT_HASH" + )" + + mkdir {{destdir}} + {{build.prefix}}/bin/make_ext4fs -l 2G -T "$SOURCE_DATE_EPOCH" -L root "$IMAGE" {{sysroot}} + E2FSPROGS_FAKE_TIME="$SOURCE_DATE_EPOCH" {{build.prefix}}/sbin/tune2fs -U "$UUID" "$IMAGE" diff --git a/examples/recipes/toolchain.yml b/examples/recipes/toolchain.yml new file mode 100644 index 0000000..ab8e6de --- /dev/null +++ b/examples/recipes/toolchain.yml @@ -0,0 +1,31 @@ +tasks: + build_depends: + args: + host: 'platform' + target: 'platform' + output: + default: + runtime_depends: + - recipe: 'gcc' + task: 'install' + - recipe: 'libgcc' + task: 'install' + + depends: + args: + host: 'platform' + output: + default: + runtime_depends: + - recipe: 'glibc' + task: 'install' + - recipe: 'gcc-libs' + task: 'install' + + build: + args: + host: 'platform' + build_depends: + - task: 'build_depends' + depends: + - task: 'depends' diff --git a/examples/recipes/zlib.yml b/examples/recipes/zlib.yml new file mode 100644 index 0000000..7146cde --- /dev/null +++ b/examples/recipes/zlib.yml @@ -0,0 +1,52 @@ +meta: + version: '1.2.11' +tasks: + unpack: + fetch: + - name: '{{pn}}-{{pv}}.tar.gz' + sha256: 'c3e5e9fdd5004dcb542feda5ee4f0ff0744628baf8ed2dd5d66f8ca1197cb1a1' + run: | + tar xf {{dldir}}/{{pn}}-{{pv}}.tar.gz + + configure: + args: + host: 'platform' + inherit: + task: 'unpack' + build_depends: + - recipe: 'toolchain' + task: 'build_depends' + depends: + - recipe: 'toolchain' + task: 'depends' + run: | + mkdir {{pn}}-build + cd {{pn}}-build + ../{{pn}}-{{pv}}/configure \ + --prefix={{host.prefix}} + find -name configure.log -delete + + compile: + args: + host: 'platform' + inherit: + task: 'configure' + run: | + cd {{pn}}-build + make + + install: + args: + host: 'platform' + inherit: + task: 'compile' + output: + default: + runtime_depends: + - recipe: 'toolchain' + task: 'depends' + run: | + cd {{pn}}-build + make DESTDIR={{destdir}} install + rm {{destdir}}{{host.prefix}}/lib/*.a + diff --git a/examples/rootfs.yml b/examples/rootfs.yml deleted file mode 100644 index 77b50ba..0000000 --- a/examples/rootfs.yml +++ /dev/null @@ -1,56 +0,0 @@ -tasks: - install: - args: - host: 'platform' - depends: - - recipe: 'busybox' - task: 'install' - - recipe: 'toolchain' - task: 'build_depends' - args: - target: 'host' - output: - default: {} - run: | - mkdir -p \ - {{destdir}}/dev \ - {{destdir}}/proc \ - {{destdir}}/sys \ - {{destdir}}/root \ - {{destdir}}/run \ - {{destdir}}/var \ - {{destdir}}/usr/bin \ - {{destdir}}/usr/lib - - ln -s bin {{destdir}}/usr/sbin - ln -s usr/bin {{destdir}}/bin - ln -s usr/bin {{destdir}}/sbin - ln -s usr/lib {{destdir}}/lib - ln -s ../run {{destdir}}/var/run - - rsync -aHAXK {{sysroot}}/ {{destdir}} - - - image-ext4: - args: - host: 'platform' - build_depends: - - recipe: 'e2fsprogs' - task: 'install' - - recipe: 'make_ext4fs' - task: 'install' - depends: - - task: 'install' - output: - default: {} - run: | - IMAGE={{destdir}}/{{pn}}.ext4 - UUID="$( - python3 \ - -c 'import sys; import uuid; print(uuid.UUID(hex=sys.argv[1][:32], version=4))' \ - "$INPUT_HASH" - )" - - mkdir {{destdir}} - {{build.prefix}}/bin/make_ext4fs -l 2G -T "$SOURCE_DATE_EPOCH" -L root "$IMAGE" {{sysroot}} - E2FSPROGS_FAKE_TIME="$SOURCE_DATE_EPOCH" {{build.prefix}}/sbin/tune2fs -U "$UUID" "$IMAGE" diff --git a/examples/toolchain.yml b/examples/toolchain.yml deleted file mode 100644 index ab8e6de..0000000 --- a/examples/toolchain.yml +++ /dev/null @@ -1,31 +0,0 @@ -tasks: - build_depends: - args: - host: 'platform' - target: 'platform' - output: - default: - runtime_depends: - - recipe: 'gcc' - task: 'install' - - recipe: 'libgcc' - task: 'install' - - depends: - args: - host: 'platform' - output: - default: - runtime_depends: - - recipe: 'glibc' - task: 'install' - - recipe: 'gcc-libs' - task: 'install' - - build: - args: - host: 'platform' - build_depends: - - task: 'build_depends' - depends: - - task: 'depends' diff --git a/examples/zlib.yml b/examples/zlib.yml deleted file mode 100644 index 7146cde..0000000 --- a/examples/zlib.yml +++ /dev/null @@ -1,52 +0,0 @@ -meta: - version: '1.2.11' -tasks: - unpack: - fetch: - - name: '{{pn}}-{{pv}}.tar.gz' - sha256: 'c3e5e9fdd5004dcb542feda5ee4f0ff0744628baf8ed2dd5d66f8ca1197cb1a1' - run: | - tar xf {{dldir}}/{{pn}}-{{pv}}.tar.gz - - configure: - args: - host: 'platform' - inherit: - task: 'unpack' - build_depends: - - recipe: 'toolchain' - task: 'build_depends' - depends: - - recipe: 'toolchain' - task: 'depends' - run: | - mkdir {{pn}}-build - cd {{pn}}-build - ../{{pn}}-{{pv}}/configure \ - --prefix={{host.prefix}} - find -name configure.log -delete - - compile: - args: - host: 'platform' - inherit: - task: 'configure' - run: | - cd {{pn}}-build - make - - install: - args: - host: 'platform' - inherit: - task: 'compile' - output: - default: - runtime_depends: - - recipe: 'toolchain' - task: 'depends' - run: | - cd {{pn}}-build - make DESTDIR={{destdir}} install - rm {{destdir}}{{host.prefix}}/lib/*.a - -- cgit v1.2.3