zig_0_11: init

https://ziglang.org/download/0.11.0/release-notes.html
This commit is contained in:
figsoda 2023-08-05 10:07:49 -04:00 committed by Anderson Torres
parent 36ca4639d7
commit 3b74f1205c
5 changed files with 51 additions and 10 deletions

View file

@ -8,9 +8,11 @@
, coreutils
}@args:
import ./generic.nix args "sha256-69QIkkKzApOGfrBdgtmxFMDytRkSh+0YiaJQPbXsBeo=" {
import ./generic.nix args {
version = "0.10.1";
hash = "sha256-69QIkkKzApOGfrBdgtmxFMDytRkSh+0YiaJQPbXsBeo=";
outputs = [ "out" "doc" ];
patches = [

View file

@ -0,0 +1,36 @@
{ lib
, stdenv
, fetchFromGitHub
, cmake
, llvmPackages
, libxml2
, zlib
, coreutils
}@args:
import ./generic.nix args {
version = "0.11.0";
hash = "sha256-iuU1fzkbJxI+0N1PiLQM013Pd1bzrgqkbIyTxo5gB2I=";
outputs = [ "out" "doc" ];
cmakeFlags = [
# file RPATH_CHANGE could not write new RPATH
"-DCMAKE_SKIP_BUILD_RPATH=ON"
# always link against static build of LLVM
"-DZIG_STATIC_LLVM=ON"
# ensure determinism in the compiler build
"-DZIG_TARGET_MCPU=baseline"
];
postBuild = ''
stage3/bin/zig run ../tools/docgen.zig -- ../doc/langref.html.in langref.html --zig $PWD/stage3/bin/zig
'';
postInstall = ''
install -Dm444 -t $doc/share/doc/zig-$version/html langref.html
'';
}

View file

@ -8,9 +8,11 @@
, coreutils
}@args:
import ./generic.nix args "sha256-x2c4c9RSrNWGqEngio4ArW7dJjW0gg+8nqBwPcR721k=" {
import ./generic.nix args {
version = "0.9.1";
hash = "sha256-x2c4c9RSrNWGqEngio4ArW7dJjW0gg+8nqBwPcR721k=";
patches = [
# Fix index out of bounds reading RPATH (cherry-picked from 0.10-dev)
./rpath.patch

View file

@ -9,7 +9,7 @@
, ...
}:
hash: args:
args:
stdenv.mkDerivation (finalAttrs: {
pname = "zig";
@ -18,7 +18,7 @@ stdenv.mkDerivation (finalAttrs: {
owner = "ziglang";
repo = "zig";
rev = finalAttrs.version;
inherit hash;
inherit (args) hash;
};
nativeBuildInputs = [
@ -35,7 +35,7 @@ stdenv.mkDerivation (finalAttrs: {
llvm
]);
doInstallCheck = true;
env.ZIG_GLOBAL_CACHE_DIR = "$TMPDIR/zig-cache";
# Zig's build looks at /usr/bin/env to find dynamic linking info. This doesn't
# work in Nix's sandbox. Use env from our coreutils instead.
@ -44,10 +44,7 @@ stdenv.mkDerivation (finalAttrs: {
--replace "/usr/bin/env" "${coreutils}/bin/env"
'';
preBuild = ''
export ZIG_GLOBAL_CACHE_DIR=$(mktemp -d)
'';
doInstallCheck = true;
installCheckPhase = ''
runHook preInstallCheck
@ -64,4 +61,4 @@ stdenv.mkDerivation (finalAttrs: {
maintainers = with lib.maintainers; [ aiotter andrewrk AndersonTorres figsoda ];
platforms = lib.platforms.unix;
};
} // args)
} // removeAttrs args [ "hash" ])

View file

@ -25477,6 +25477,10 @@ with pkgs;
zig_0_10 = darwin.apple_sdk_11_0.callPackage ../development/compilers/zig/0.10.nix {
llvmPackages = llvmPackages_15;
};
# requires a newer Apple SDK
zig_0_11 = darwin.apple_sdk_11_0.callPackage ../development/compilers/zig/0.11.nix {
llvmPackages = llvmPackages_16;
};
zig = zig_0_10;
zigHook = callPackage ../development/compilers/zig/hook.nix { };