mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-08-31 12:44:44 +00:00
By moving the zig setup hook to the zig derivation itself, we allow for zig to splice correctly with `callPackage`, meaning that the correct zig can be pulled in during builds when zig is in `nativeBuildInputs` (for example). This change retains the `zig.hook` attribute for backward compatibility by just pointing to the zig derivation. This also removes `zig_default_flags`, since now the setup hook is not a derivation that can be overridden. Overriding the build flags can now be done by setting `dontSetZigDefaultFlags = true`.
32 lines
724 B
Nix
32 lines
724 B
Nix
{
|
|
stdenv,
|
|
zig,
|
|
callPackage,
|
|
wrapCCWith,
|
|
wrapBintoolsWith,
|
|
overrideCC,
|
|
}:
|
|
{
|
|
# Provided for backward compatibility, as the `zig` derivation now sets
|
|
# setupHook.
|
|
hook = zig;
|
|
|
|
bintools-unwrapped = callPackage ./bintools.nix { inherit zig; };
|
|
bintools = wrapBintoolsWith { bintools = zig.bintools-unwrapped; };
|
|
|
|
cc-unwrapped = callPackage ./cc.nix { inherit zig; };
|
|
cc = wrapCCWith {
|
|
cc = zig.cc-unwrapped;
|
|
bintools = zig.bintools;
|
|
extraPackages = [ ];
|
|
nixSupport.cc-cflags = [
|
|
"-target"
|
|
"${stdenv.targetPlatform.system}-${stdenv.targetPlatform.parsed.abi.name}"
|
|
];
|
|
};
|
|
|
|
stdenv = overrideCC stdenv zig.cc;
|
|
|
|
fetchDeps = callPackage ./fetcher.nix { inherit zig; };
|
|
}
|