blob: 794b6d27ec67c7122f0008a964a9fe06cddad28b [file] [log] [blame]
Tim Windelschmidt98000a52025-03-06 14:22:15 +01001{ pkgs ? import ../../../third_party/nix/default.nix { } }: with pkgs;
2symlinkJoin {
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 Windelschmidtea800252025-07-09 07:00:29 +020033 python3Minimal
Tim Windelschmidt98000a52025-03-06 14:22:15 +010034 ];
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 Windelschmidtea800252025-07-09 07:00:29 +020048 mv bundle.tar.zst $out/${name}-${platform.hostPlatform.config}.tar.zst
Tim Windelschmidt98000a52025-03-06 14:22:15 +010049 '';
50 }
51 ))
52 platforms;
53}