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

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

63 lines
1.2 KiB
Nix
Raw Normal View History

{ lib
2022-07-14 04:38:53 +00:00
, stdenv
, fetchFromGitHub
, cmake
, llvmPackages
, libxml2
, zlib
}:
2017-10-20 03:51:45 +00:00
stdenv.mkDerivation rec {
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";
repo = pname;
rev = version;
2022-02-17 00:29:52 +00:00
hash = "sha256-x2c4c9RSrNWGqEngio4ArW7dJjW0gg+8nqBwPcR721k=";
2017-10-20 03:51:45 +00:00
};
# Fix index out of bounds reading RPATH (cherry-picked from 0.10-dev)
patches = [ ./rpath.patch ];
nativeBuildInputs = [
cmake
llvmPackages.llvm.dev
];
2022-02-17 00:29:52 +00:00
buildInputs = [
libxml2
zlib
] ++ (with llvmPackages; [
libclang
lld
llvm
]);
preBuild = ''
export HOME=$TMPDIR;
'';
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
'';
meta = with lib; {
homepage = "https://ziglang.org/";
description =
"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;
};
}