Merge pull request #305395 from ExpidusOS/feat/update-zig-0.12
zig_0_12: init
This commit is contained in:
commit
2af28fdb92
37
pkgs/development/compilers/zig/0.12.nix
Normal file
37
pkgs/development/compilers/zig/0.12.nix
Normal file
@ -0,0 +1,37 @@
|
||||
{ lib
|
||||
, stdenv
|
||||
, fetchFromGitHub
|
||||
, cmake
|
||||
, llvmPackages
|
||||
, libxml2
|
||||
, zlib
|
||||
, coreutils
|
||||
, callPackage
|
||||
}@args:
|
||||
|
||||
import ./generic.nix args {
|
||||
version = "0.12.0";
|
||||
|
||||
hash = "sha256-RNZiUZtaKXoab5kFrDij6YCAospeVvlLWheTc3FGMks=";
|
||||
|
||||
outputs = [ "out" "doc" ];
|
||||
|
||||
cmakeFlags = [
|
||||
# file RPATH_CHANGE could not write new RPATH
|
||||
(lib.cmakeBool "CMAKE_SKIP_BUILD_RPATH" true)
|
||||
|
||||
# always link against static build of LLVM
|
||||
(lib.cmakeBool "ZIG_STATIC_LLVM" true)
|
||||
|
||||
# ensure determinism in the compiler build
|
||||
(lib.cmakeFeature "ZIG_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 langref.html -t $doc/share/doc/zig-$version/html
|
||||
'';
|
||||
}
|
@ -40,7 +40,10 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
|
||||
# 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.
|
||||
postPatch = ''
|
||||
postPatch = if lib.versionAtLeast args.version "0.12" then ''
|
||||
substituteInPlace lib/std/zig/system.zig \
|
||||
--replace "/usr/bin/env" "${coreutils}/bin/env"
|
||||
'' else ''
|
||||
substituteInPlace lib/std/zig/system/NativeTargetInfo.zig \
|
||||
--replace "/usr/bin/env" "${coreutils}/bin/env"
|
||||
'';
|
||||
|
@ -25239,6 +25239,10 @@ with pkgs;
|
||||
zig_0_11 = darwin.apple_sdk_11_0.callPackage ../development/compilers/zig/0.11.nix {
|
||||
llvmPackages = llvmPackages_16;
|
||||
};
|
||||
# requires a newer Apple SDK
|
||||
zig_0_12 = darwin.apple_sdk_11_0.callPackage ../development/compilers/zig/0.12.nix {
|
||||
llvmPackages = llvmPackages_17;
|
||||
};
|
||||
zig = zig_0_11;
|
||||
|
||||
zig-shell-completions = callPackage ../development/compilers/zig/shell-completions.nix { };
|
||||
|
Loading…
Reference in New Issue
Block a user