1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-17 19:21:04 +00:00
nixpkgs/doc/hooks/zig.section.md
Felix Uhl 4c704748b3
zig: 0.11 -> 0.12 (#306077)
This upgrades the default version of zig to zig_0_12, which builds
reproducibly on darwin.

Fixes #299091.

Also upgrades all packages compatible with zig 0.12 to that version.
I tried to upgrade packages currently pinning 0.11 as well, but only a
few worked.

Co-authored-by: Weijia Wang (wegank) <contact@weijia.wang>
2024-05-02 17:58:52 +00:00

1.5 KiB

zig.hook

Zig is a general-purpose programming language and toolchain for maintaining robust, optimal and reusable software.

In Nixpkgs, zig.hook overrides the default build, check and install phases.

Example code snippet

{ lib
, stdenv
, zig
}:

stdenv.mkDerivation {
  # . . .

  nativeBuildInputs = [
    zig.hook
  ];

  zigBuildFlags = [ "-Dman-pages=true" ];

  dontUseZigCheck = true;

  # . . .
}

Variables controlling zig.hook

zig.hook Exclusive Variables

The variables below are exclusive to zig.hook.

dontUseZigBuild

Disables using zigBuildPhase.

dontUseZigCheck

Disables using zigCheckPhase.

dontUseZigInstall

Disables using zigInstallPhase.

Similar variables

The following variables are similar to their stdenv.mkDerivation counterparts.

zig.hook Variable stdenv.mkDerivation Counterpart
zigBuildFlags buildFlags
zigCheckFlags checkFlags
zigInstallFlags installFlags

Variables honored by zig.hook

The following variables commonly used by stdenv.mkDerivation are honored by zig.hook.

  • prefixKey
  • dontAddPrefix