mirror of
https://github.com/SebastianWendel/nixpkgs.git
synced 2024-09-20 12:29:02 +02:00
parent
36ca4639d7
commit
3b74f1205c
|
@ -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 = [
|
||||
|
|
36
pkgs/development/compilers/zig/0.11.nix
Normal file
36
pkgs/development/compilers/zig/0.11.nix
Normal 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
|
||||
'';
|
||||
}
|
|
@ -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
|
||||
|
|
|
@ -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" ])
|
||||
|
|
|
@ -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 { };
|
||||
|
|
Loading…
Reference in a new issue