2021-01-22 12:25:31 +01:00
|
|
|
{ lib, stdenv, fetchFromGitHub, cmake, llvmPackages, libxml2, zlib, substituteAll }:
|
2017-10-20 05:51:45 +02:00
|
|
|
|
2020-04-14 00:37:09 +02:00
|
|
|
llvmPackages.stdenv.mkDerivation rec {
|
2020-12-24 09:11:01 +01:00
|
|
|
version = "0.7.1";
|
2019-04-09 07:08:26 +02:00
|
|
|
pname = "zig";
|
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;
|
2020-12-24 09:11:01 +01:00
|
|
|
sha256 = "1z6c4ym9jmga46cw2arn7zv2drcpmrf3vw139gscxp27n7q2z5md";
|
2017-10-20 05:51:45 +02:00
|
|
|
};
|
|
|
|
|
2018-03-19 01:13:46 +01:00
|
|
|
nativeBuildInputs = [ cmake ];
|
2020-04-14 00:37:09 +02:00
|
|
|
buildInputs = [
|
|
|
|
llvmPackages.clang-unwrapped
|
|
|
|
llvmPackages.llvm
|
|
|
|
llvmPackages.lld
|
|
|
|
libxml2
|
|
|
|
zlib
|
|
|
|
];
|
|
|
|
|
2019-10-01 03:00:00 +02:00
|
|
|
preBuild = ''
|
|
|
|
export HOME=$TMPDIR;
|
|
|
|
'';
|
|
|
|
|
2020-04-14 00:37:09 +02:00
|
|
|
checkPhase = ''
|
|
|
|
runHook preCheck
|
2020-12-24 09:11:01 +01:00
|
|
|
./zig test --cache-dir "$TMPDIR" -I $src/test $src/test/stage1/behavior.zig
|
2020-04-14 00:37:09 +02:00
|
|
|
runHook postCheck
|
|
|
|
'';
|
|
|
|
|
|
|
|
doCheck = true;
|
|
|
|
|
2021-01-22 12:25:31 +01:00
|
|
|
meta = with lib; {
|
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";
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "https://ziglang.org/";
|
2017-10-20 05:51:45 +02:00
|
|
|
license = licenses.mit;
|
|
|
|
platforms = platforms.unix;
|
|
|
|
maintainers = [ maintainers.andrewrk ];
|
2020-10-08 11:36:44 +02:00
|
|
|
# See https://github.com/NixOS/nixpkgs/issues/86299
|
|
|
|
broken = stdenv.isDarwin;
|
2017-10-20 05:51:45 +02:00
|
|
|
};
|
|
|
|
}
|