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