Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

zig: 0.9.1 -> 0.10.0 #199947

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 9 additions & 30 deletions pkgs/development/compilers/zig/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,40 +7,17 @@
, zlib
}:

let
zig_0_10_0 = fetchFromGitHub {
owner = "ziglang";
repo = "zig";
rev = "0.10.0";
hash = "sha256-DNs937N7PLQimuM2anya4npYXcj6cyH+dRS7AiOX7tw=";
};
in
stdenv.mkDerivation rec {
stdenv.mkDerivation (finalAttrs: {
pname = "zig";
version = "0.9.1";
version = "0.10.0";

src = fetchFromGitHub {
owner = "ziglang";
repo = pname;
rev = version;
hash = "sha256-x2c4c9RSrNWGqEngio4ArW7dJjW0gg+8nqBwPcR721k=";
repo = "zig";
rev = finalAttrs.version;
hash = "sha256-DNs937N7PLQimuM2anya4npYXcj6cyH+dRS7AiOX7tw=";
};

patches = [
# Fix index out of bounds reading RPATH (cherry-picked from 0.10-dev)
./rpath.patch
# Fix build on macOS 13 (cherry-picked from 0.10-dev)
./ventura.patch
];

# TODO: remove on next upgrade
prePatch = ''
cp -R ${zig_0_10_0}/lib/libc/include/any-macos.13-any lib/libc/include/any-macos.13-any
cp -R ${zig_0_10_0}/lib/libc/include/aarch64-macos.13-none lib/libc/include/aarch64-macos.13-gnu
cp -R ${zig_0_10_0}/lib/libc/include/x86_64-macos.13-none lib/libc/include/x86_64-macos.13-gnu
cp ${zig_0_10_0}/lib/libc/darwin/libSystem.13.tbd lib/libc/darwin/
'';

nativeBuildInputs = [
cmake
llvmPackages.llvm.dev
Expand All @@ -49,7 +26,8 @@ stdenv.mkDerivation rec {
buildInputs = [
libxml2
zlib
] ++ (with llvmPackages; [
]
++ (with llvmPackages; [
libclang
lld
llvm
Expand All @@ -75,8 +53,9 @@ stdenv.mkDerivation rec {
homepage = "https://ziglang.org/";
description =
"General-purpose programming language and toolchain for maintaining robust, optimal, and reusable software";
changelog = "https://ziglang.org/download/${finalAttrs.version}/release-notes.html";
license = licenses.mit;
maintainers = with maintainers; [ aiotter andrewrk AndersonTorres ];
platforms = platforms.unix;
};
}
})