792b51d22f
GitOrigin-RevId: d5f237872975e6fb6f76eef1368b5634ffcd266f
57 lines
1.1 KiB
Nix
57 lines
1.1 KiB
Nix
{ lib
|
|
, fetchFromGitHub
|
|
, cmake
|
|
, llvmPackages
|
|
, libxml2
|
|
, zlib
|
|
}:
|
|
|
|
let
|
|
inherit (llvmPackages) stdenv;
|
|
in
|
|
stdenv.mkDerivation rec {
|
|
pname = "zig";
|
|
version = "0.9.1";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "ziglang";
|
|
repo = pname;
|
|
rev = version;
|
|
hash = "sha256-x2c4c9RSrNWGqEngio4ArW7dJjW0gg+8nqBwPcR721k=";
|
|
};
|
|
|
|
nativeBuildInputs = [
|
|
cmake
|
|
llvmPackages.llvm.dev
|
|
];
|
|
|
|
buildInputs = [
|
|
libxml2
|
|
zlib
|
|
] ++ (with llvmPackages; [
|
|
libclang
|
|
lld
|
|
llvm
|
|
]);
|
|
|
|
preBuild = ''
|
|
export HOME=$TMPDIR;
|
|
'';
|
|
|
|
doCheck = true;
|
|
checkPhase = ''
|
|
runHook preCheck
|
|
./zig test --cache-dir "$TMPDIR" -I $src/test $src/test/behavior.zig
|
|
runHook postCheck
|
|
'';
|
|
|
|
meta = with lib; {
|
|
homepage = "https://ziglang.org/";
|
|
description =
|
|
"General-purpose programming language and toolchain for maintaining robust, optimal, and reusable software";
|
|
license = licenses.mit;
|
|
maintainers = with maintainers; [ andrewrk AndersonTorres ];
|
|
platforms = platforms.unix;
|
|
broken = stdenv.isDarwin; # See https://github.com/NixOS/nixpkgs/issues/86299
|
|
};
|
|
}
|