nixpkgs/pkgs/development/compilers/zig/default.nix

46 lines
1.1 KiB
Nix
Raw Normal View History

{ lib, stdenv, fetchFromGitHub, cmake, llvmPackages, libxml2, zlib, substituteAll }:
2017-10-20 04:51:45 +01:00
llvmPackages.stdenv.mkDerivation rec {
2020-12-24 08:11:01 +00:00
version = "0.7.1";
pname = "zig";
2017-10-20 04:51:45 +01:00
src = fetchFromGitHub {
2018-09-29 20:18:57 +01:00
owner = "ziglang";
repo = pname;
rev = version;
2020-12-24 08:11:01 +00:00
sha256 = "1z6c4ym9jmga46cw2arn7zv2drcpmrf3vw139gscxp27n7q2z5md";
2017-10-20 04:51:45 +01:00
};
2018-03-19 00:13:46 +00:00
nativeBuildInputs = [ cmake ];
buildInputs = [
llvmPackages.clang-unwrapped
llvmPackages.llvm
llvmPackages.lld
libxml2
zlib
];
preBuild = ''
export HOME=$TMPDIR;
'';
checkPhase = ''
runHook preCheck
2020-12-24 08:11:01 +00:00
./zig test --cache-dir "$TMPDIR" -I $src/test $src/test/stage1/behavior.zig
runHook postCheck
'';
doCheck = true;
meta = with lib; {
description =
"General-purpose programming language and toolchain for maintaining robust, optimal, and reusable software";
homepage = "https://ziglang.org/";
2017-10-20 04:51:45 +01:00
license = licenses.mit;
platforms = platforms.unix;
maintainers = [ maintainers.andrewrk ];
2020-10-08 10:36:44 +01:00
# See https://github.com/NixOS/nixpkgs/issues/86299
broken = stdenv.isDarwin;
2017-10-20 04:51:45 +01:00
};
}