2023-08-10 01:43:09 +01:00
|
|
|
# zig.hook {#zig-hook}
|
2023-07-15 06:55:32 +01:00
|
|
|
|
|
|
|
[Zig](https://ziglang.org/) is a general-purpose programming language and toolchain for maintaining robust, optimal and reusable software.
|
|
|
|
|
2023-08-10 01:43:09 +01:00
|
|
|
In Nixpkgs, `zig.hook` overrides the default build, check and install phases.
|
2023-07-15 06:55:32 +01:00
|
|
|
|
|
|
|
## Example code snippet {#example-code-snippet}
|
|
|
|
|
|
|
|
```nix
|
|
|
|
{ lib
|
|
|
|
, stdenv
|
2023-08-10 01:55:18 +01:00
|
|
|
, zig_0_11
|
2023-07-15 06:55:32 +01:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
|
|
|
# . . .
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
2023-08-10 01:55:18 +01:00
|
|
|
zig_0_11.hook
|
2023-07-15 06:55:32 +01:00
|
|
|
];
|
|
|
|
|
|
|
|
zigBuildFlags = [ "-Dman-pages=true" ];
|
|
|
|
|
|
|
|
dontUseZigCheck = true;
|
|
|
|
|
|
|
|
# . . .
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
2023-08-10 01:43:09 +01:00
|
|
|
## Variables controlling zig.hook {#variables-controlling-zig-hook}
|
2023-07-15 06:55:32 +01:00
|
|
|
|
|
|
|
### `dontUseZigBuild` {#dontUseZigBuild}
|
|
|
|
|
|
|
|
Disables using `zigBuildPhase`.
|
|
|
|
|
|
|
|
### `zigBuildFlags` {#zigBuildFlags}
|
|
|
|
|
|
|
|
Controls the flags passed to the build phase.
|
|
|
|
|
|
|
|
### `dontUseZigCheck` {#dontUseZigCheck}
|
|
|
|
|
|
|
|
Disables using `zigCheckPhase`.
|
|
|
|
|
|
|
|
### `zigCheckFlags` {#zigCheckFlags}
|
|
|
|
|
|
|
|
Controls the flags passed to the check phase.
|
|
|
|
|
|
|
|
### `dontUseZigInstall` {#dontUseZigInstall}
|
|
|
|
|
|
|
|
Disables using `zigInstallPhase`.
|
|
|
|
|
|
|
|
### `zigInstallFlags` {#zigInstallFlags}
|
|
|
|
|
|
|
|
Controls the flags passed to the install phase.
|
|
|
|
|
2023-08-10 01:43:09 +01:00
|
|
|
### Variables honored by zig.hook {#variables-honored-by-zig-hook}
|
2023-07-15 06:55:32 +01:00
|
|
|
|
|
|
|
- `prefixKey`
|
|
|
|
- `dontAddPrefix`
|