| Tim Windelschmidt | 98000a5 | 2025-03-06 14:22:15 +0100 | [diff] [blame] | 1 | { pkgs ? import ../../../third_party/nix/default.nix { } }: with pkgs; |
| 2 | symlinkJoin { |
| 3 | name = "toolchain"; |
| 4 | paths = |
| 5 | let |
| 6 | platforms = with pkgsCross; [ |
| 7 | aarch64-multiplatform-musl |
| 8 | musl64 |
| 9 | ]; |
| 10 | in |
| 11 | map |
| 12 | (platform: ( |
| 13 | let |
| 14 | merged = buildEnv { |
| 15 | name = "toolchain-env"; |
| 16 | paths = with platform.pkgsStatic; [ |
| 17 | gnumake |
| 18 | flex |
| 19 | bison |
| 20 | lz4 |
| 21 | busybox |
| 22 | findutils |
| 23 | bc |
| 24 | util-linux-minimal # custom pkg |
| 25 | perl |
| 26 | nasm |
| 27 | acpica-tools |
| 28 | patch |
| 29 | diffutils |
| 30 | qemu-minimal # custom pkg |
| 31 | m4 |
| 32 | strace |
| Tim Windelschmidt | ea80025 | 2025-07-09 07:00:29 +0200 | [diff] [blame] | 33 | python3Minimal |
| Tim Windelschmidt | 98000a5 | 2025-03-06 14:22:15 +0100 | [diff] [blame] | 34 | ]; |
| 35 | }; |
| 36 | in |
| 37 | stdenv.mkDerivation rec { |
| 38 | name = "toolchain-bundle"; |
| 39 | buildInputs = [ gnutar zstd ]; |
| 40 | |
| 41 | phases = [ "buildPhase" "installPhase" ]; |
| 42 | buildPhase = '' |
| 43 | tar --zstd --sort=name --hard-dereference -hcf bundle.tar.zst -C ${merged} . |
| 44 | ''; |
| 45 | |
| 46 | installPhase = '' |
| 47 | mkdir $out |
| Tim Windelschmidt | ea80025 | 2025-07-09 07:00:29 +0200 | [diff] [blame] | 48 | mv bundle.tar.zst $out/${name}-${platform.hostPlatform.config}.tar.zst |
| Tim Windelschmidt | 98000a5 | 2025-03-06 14:22:15 +0100 | [diff] [blame] | 49 | ''; |
| 50 | } |
| 51 | )) |
| 52 | platforms; |
| 53 | } |