2021-05-20 23:08:51 +00:00
|
|
|
{ lib
|
|
|
|
, fetchFromGitHub
|
|
|
|
, cmake
|
|
|
|
, llvmPackages
|
|
|
|
, libxml2
|
|
|
|
, zlib
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-06-06 07:54:09 +00:00
|
|
|
let
|
|
|
|
inherit (llvmPackages) stdenv;
|
|
|
|
in
|
|
|
|
stdenv.mkDerivation rec {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "zig";
|
2021-06-06 07:54:09 +00:00
|
|
|
version = "0.8.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "ziglang";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2021-06-06 07:54:09 +00:00
|
|
|
hash = "sha256-bILjcKX8jPl2n1HRYvYRb7jJkobwqmSJ+hHXSn9n2ag=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
nativeBuildInputs = [
|
2021-06-06 07:54:09 +00:00
|
|
|
cmake
|
|
|
|
llvmPackages.llvm.dev
|
2021-05-20 23:08:51 +00:00
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
buildInputs = [
|
|
|
|
libxml2
|
|
|
|
zlib
|
2021-05-20 23:08:51 +00:00
|
|
|
] ++ (with llvmPackages; [
|
|
|
|
libclang
|
|
|
|
lld
|
|
|
|
llvm
|
|
|
|
]);
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
preBuild = ''
|
|
|
|
export HOME=$TMPDIR;
|
|
|
|
'';
|
|
|
|
|
2021-06-28 23:13:55 +00:00
|
|
|
doCheck = true;
|
|
|
|
checkPhase = ''
|
|
|
|
runHook preCheck
|
|
|
|
./zig test --cache-dir "$TMPDIR" -I $src/test $src/test/behavior.zig
|
|
|
|
runHook postCheck
|
|
|
|
'';
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2021-05-20 23:08:51 +00:00
|
|
|
homepage = "https://ziglang.org/";
|
2020-04-24 23:36:52 +00:00
|
|
|
description =
|
|
|
|
"General-purpose programming language and toolchain for maintaining robust, optimal, and reusable software";
|
|
|
|
license = licenses.mit;
|
2021-05-20 23:08:51 +00:00
|
|
|
maintainers = with maintainers; [ andrewrk AndersonTorres ];
|
2020-04-24 23:36:52 +00:00
|
|
|
platforms = platforms.unix;
|
2020-10-16 20:44:37 +00:00
|
|
|
# See https://github.com/NixOS/nixpkgs/issues/86299
|
|
|
|
broken = stdenv.isDarwin;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|
2021-06-28 23:13:55 +00:00
|
|
|
|