2021-05-14 02:33:53 +00:00
|
|
|
{ lib
|
2022-07-14 04:38:53 +00:00
|
|
|
, stdenv
|
2021-05-14 02:33:53 +00:00
|
|
|
, fetchFromGitHub
|
|
|
|
, cmake
|
|
|
|
, llvmPackages
|
|
|
|
, libxml2
|
|
|
|
, zlib
|
|
|
|
}:
|
2017-10-20 03:51:45 +00:00
|
|
|
|
2021-06-04 19:43:02 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2019-04-09 05:08:26 +00:00
|
|
|
pname = "zig";
|
2022-02-17 00:29:52 +00:00
|
|
|
version = "0.9.1";
|
2017-10-20 03:51:45 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2018-09-29 19:18:57 +00:00
|
|
|
owner = "ziglang";
|
2019-04-09 05:08:26 +00:00
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2022-02-17 00:29:52 +00:00
|
|
|
hash = "sha256-x2c4c9RSrNWGqEngio4ArW7dJjW0gg+8nqBwPcR721k=";
|
2017-10-20 03:51:45 +00:00
|
|
|
};
|
|
|
|
|
2022-08-16 04:04:24 +00:00
|
|
|
# Fix index out of bounds reading RPATH (cherry-picked from 0.10-dev)
|
|
|
|
patches = [ ./rpath.patch ];
|
|
|
|
|
2021-05-14 02:33:53 +00:00
|
|
|
nativeBuildInputs = [
|
2021-06-04 19:43:02 +00:00
|
|
|
cmake
|
|
|
|
llvmPackages.llvm.dev
|
2021-05-14 02:33:53 +00:00
|
|
|
];
|
2022-02-17 00:29:52 +00:00
|
|
|
|
2020-04-13 22:37:09 +00:00
|
|
|
buildInputs = [
|
|
|
|
libxml2
|
|
|
|
zlib
|
2021-05-14 02:33:53 +00:00
|
|
|
] ++ (with llvmPackages; [
|
2021-05-14 20:27:34 +00:00
|
|
|
libclang
|
2021-05-14 02:33:53 +00:00
|
|
|
lld
|
|
|
|
llvm
|
|
|
|
]);
|
2020-04-13 22:37:09 +00:00
|
|
|
|
2019-10-01 01:00:00 +00:00
|
|
|
preBuild = ''
|
|
|
|
export HOME=$TMPDIR;
|
|
|
|
'';
|
|
|
|
|
2022-07-12 15:20:45 +00:00
|
|
|
cmakeFlags = [
|
|
|
|
# file RPATH_CHANGE could not write new RPATH
|
|
|
|
"-DCMAKE_SKIP_BUILD_RPATH=ON"
|
|
|
|
];
|
|
|
|
|
2021-06-14 16:09:01 +00: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 02:33:53 +00:00
|
|
|
homepage = "https://ziglang.org/";
|
2020-04-13 22:37:09 +00:00
|
|
|
description =
|
2020-04-13 22:44:34 +00:00
|
|
|
"General-purpose programming language and toolchain for maintaining robust, optimal, and reusable software";
|
2017-10-20 03:51:45 +00:00
|
|
|
license = licenses.mit;
|
2022-07-16 05:43:14 +00:00
|
|
|
maintainers = with maintainers; [ aiotter andrewrk AndersonTorres ];
|
2017-10-20 03:51:45 +00:00
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
|
|
|
}
|