mirror of
https://github.com/ziglang/zig.git
synced 2025-02-16 09:30:17 +00:00
Add initial support for nix build
with Nix Flakes
parent
3eca90f72f
commit
e44826f4c2
@ -63,6 +63,30 @@ Alternatively, you can use this sample `flake.nix`:
|
|||||||
};
|
};
|
||||||
# For compatibility with older versions of the `nix` binary
|
# For compatibility with older versions of the `nix` binary
|
||||||
devShell = self.devShells.${system}.default;
|
devShell = self.devShells.${system}.default;
|
||||||
|
|
||||||
|
packages.default = pkgs.stdenv.mkDerivation {
|
||||||
|
pname = "zig";
|
||||||
|
# TODO: Fix the output of `zig version`.
|
||||||
|
version = "0.10.0-dev";
|
||||||
|
src = self;
|
||||||
|
|
||||||
|
nativeBuildInputs = with pkgs; [
|
||||||
|
cmake
|
||||||
|
] ++ (with llvmPackages_14; [
|
||||||
|
libclang
|
||||||
|
lld
|
||||||
|
llvm
|
||||||
|
]);
|
||||||
|
|
||||||
|
preBuild = ''
|
||||||
|
export HOME=$TMPDIR;
|
||||||
|
'';
|
||||||
|
|
||||||
|
cmakeFlags = [
|
||||||
|
# https://github.com/ziglang/zig/issues/12069
|
||||||
|
"-DZIG_STATIC_ZLIB=on"
|
||||||
|
];
|
||||||
|
};
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user