Commit 3b74f120 authored by figsoda's avatar figsoda Committed by Anderson Torres
Browse files
parent 36ca4639
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -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 −0
Original line number Diff line number Diff line
{ 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
  '';
}
+3 −1
Original line number Diff line number Diff line
@@ -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
+5 −8
Original line number Diff line number Diff line
@@ -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" ])
+4 −0
Original line number Diff line number Diff line
@@ -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 { };