kdePackages.kirigami-addons: 1.5.0 -> 1.6.0 (#360539)
[NixPkgs.git] / pkgs / development / compilers / zig / 0.11 / hook.nix
blob399b3889a2266a2f67566fc3b27d2fc4522f33d7
1 { makeSetupHook, zig }:
3 makeSetupHook {
4   name = "zig-hook";
6   propagatedBuildInputs = [ zig ];
8   substitutions = {
9     # This zig_default_flags below is meant to avoid CPU feature impurity in
10     # Nixpkgs. However, this flagset is "unstable": it is specifically meant to
11     # be controlled by the upstream development team - being up to that team
12     # exposing or not that flags to the outside (especially the package manager
13     # teams).
15     # Because of this hurdle, @andrewrk from Zig Software Foundation proposed
16     # some solutions for this issue. Hopefully they will be implemented in
17     # future releases of Zig. When this happens, this flagset should be
18     # revisited accordingly.
20     # Below are some useful links describing the discovery process of this 'bug'
21     # in Nixpkgs:
23     # https://github.com/NixOS/nixpkgs/issues/169461
24     # https://github.com/NixOS/nixpkgs/issues/185644
25     # https://github.com/NixOS/nixpkgs/pull/197046
26     # https://github.com/NixOS/nixpkgs/pull/241741#issuecomment-1624227485
27     # https://github.com/ziglang/zig/issues/14281#issuecomment-1624220653
29     zig_default_flags = [
30       "-Dcpu=baseline"
31       "-Doptimize=ReleaseSafe"
32     ];
33   };
35   passthru = {
36     inherit zig;
37   };
39   meta = {
40     description = "Setup hook for using the Zig compiler in Nixpkgs";
41     inherit (zig.meta) maintainers platforms broken;
42   };
43 } ./setup-hook.sh