2018-09-29 21:18:57 +02:00
|
|
|
{ stdenv, fetchFromGitHub, cmake, llvmPackages, libxml2, zlib }:
|
2017-10-20 05:51:45 +02:00
|
|
|
|
2020-04-14 00:37:09 +02:00
|
|
|
llvmPackages.stdenv.mkDerivation rec {
|
|
|
|
version = "0.6.0";
|
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-04-14 00:37:09 +02:00
|
|
|
sha256 = "13dwm2zpscn4n0p5x8ggs9n7mwmq9cgip383i3qqphg7m3pkls8z";
|
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
|
|
|
|
];
|
|
|
|
|
|
|
|
patches = [ ./llvm10_polly.patch ];
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
export llvm_extras=-Wl,${llvmPackages.llvm}/lib/LLVMPolly.so
|
|
|
|
substituteAllInPlace CMakeLists.txt
|
|
|
|
'';
|
2017-10-20 05:51:45 +02:00
|
|
|
|
2019-10-01 03:00:00 +02:00
|
|
|
preBuild = ''
|
|
|
|
export HOME=$TMPDIR;
|
|
|
|
'';
|
|
|
|
|
2020-04-14 00:37:09 +02:00
|
|
|
checkPhase = ''
|
|
|
|
runHook preCheck
|
|
|
|
./zig test $src/test/stage1/behavior.zig
|
|
|
|
runHook postCheck
|
|
|
|
'';
|
|
|
|
|
|
|
|
doCheck = true;
|
|
|
|
|
2017-10-20 05:51:45 +02:00
|
|
|
meta = with stdenv.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 ];
|
|
|
|
};
|
|
|
|
}
|