2021-05-14 03:33:53 +01:00
|
|
|
{ lib
|
|
|
|
, fetchFromGitHub
|
|
|
|
, cmake
|
|
|
|
, llvmPackages
|
|
|
|
, libxml2
|
|
|
|
, zlib
|
|
|
|
}:
|
2017-10-20 04:51:45 +01:00
|
|
|
|
2021-06-04 20:43:02 +01:00
|
|
|
let
|
|
|
|
inherit (llvmPackages) stdenv;
|
|
|
|
in
|
|
|
|
stdenv.mkDerivation rec {
|
2019-04-09 06:08:26 +01:00
|
|
|
pname = "zig";
|
2021-09-07 16:56:35 +01:00
|
|
|
version = "0.8.1";
|
2017-10-20 04:51:45 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2018-09-29 20:18:57 +01:00
|
|
|
owner = "ziglang";
|
2019-04-09 06:08:26 +01:00
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2021-09-07 16:56:35 +01:00
|
|
|
hash = "sha256-zMSOH8ZWcvzHRwOgGIbLO9Q6jf1P5QL5KCMD+frp+JA=";
|
2017-10-20 04:51:45 +01:00
|
|
|
};
|
|
|
|
|
2021-05-14 03:33:53 +01:00
|
|
|
nativeBuildInputs = [
|
2021-06-04 20:43:02 +01:00
|
|
|
cmake
|
|
|
|
llvmPackages.llvm.dev
|
2021-05-14 03:33:53 +01:00
|
|
|
];
|
2020-04-13 23:37:09 +01:00
|
|
|
buildInputs = [
|
|
|
|
libxml2
|
|
|
|
zlib
|
2021-05-14 03:33:53 +01:00
|
|
|
] ++ (with llvmPackages; [
|
2021-05-14 21:27:34 +01:00
|
|
|
libclang
|
2021-05-14 03:33:53 +01:00
|
|
|
lld
|
|
|
|
llvm
|
|
|
|
]);
|
2020-04-13 23:37:09 +01:00
|
|
|
|
2019-10-01 02:00:00 +01:00
|
|
|
preBuild = ''
|
|
|
|
export HOME=$TMPDIR;
|
|
|
|
'';
|
|
|
|
|
2021-06-14 17:09:01 +01:00
|
|
|
doCheck = true;
|
|
|
|
checkPhase = ''
|
|
|
|
runHook preCheck
|
|
|
|
./zig test --cache-dir "$TMPDIR" -I $src/test $src/test/behavior.zig
|
|
|
|
runHook postCheck
|
|
|
|
'';
|
|
|
|
|
2021-01-22 11:25:31 +00:00
|
|
|
meta = with lib; {
|
2021-05-14 03:33:53 +01:00
|
|
|
homepage = "https://ziglang.org/";
|
2020-04-13 23:37:09 +01:00
|
|
|
description =
|
2020-04-13 23:44:34 +01:00
|
|
|
"General-purpose programming language and toolchain for maintaining robust, optimal, and reusable software";
|
2017-10-20 04:51:45 +01:00
|
|
|
license = licenses.mit;
|
2021-05-14 03:33:53 +01:00
|
|
|
maintainers = with maintainers; [ andrewrk AndersonTorres ];
|
2017-10-20 04:51:45 +01:00
|
|
|
platforms = platforms.unix;
|
2021-09-07 16:56:35 +01:00
|
|
|
broken = stdenv.isDarwin; # See https://github.com/NixOS/nixpkgs/issues/86299
|
2017-10-20 04:51:45 +01:00
|
|
|
};
|
|
|
|
}
|
2021-06-14 17:09:01 +01:00
|
|
|
|