zig.hook: rename from zigHook

This makes using specific versions of zig easier (without overrides)
This commit is contained in:
figsoda 2023-08-09 20:43:09 -04:00 committed by Anderson Torres
parent a52cccf791
commit 17d404ee80
20 changed files with 59 additions and 100 deletions

View File

@ -1,22 +1,22 @@
# zigHook {#zighook}
# zig.hook {#zig-hook}
[Zig](https://ziglang.org/) is a general-purpose programming language and toolchain for maintaining robust, optimal and reusable software.
In Nixpkgs, `zigHook` overrides the default build, check and install phases.
In Nixpkgs, `zig.hook` overrides the default build, check and install phases.
## Example code snippet {#example-code-snippet}
```nix
{ lib
, stdenv
, zigHook
, zig
}:
stdenv.mkDerivation {
# . . .
nativeBuildInputs = [
zigHook
zig.hook
];
zigBuildFlags = [ "-Dman-pages=true" ];
@ -27,7 +27,7 @@ stdenv.mkDerivation {
}
```
## Variables controlling zigHook {#variables-controlling-zighook}
## Variables controlling zig.hook {#variables-controlling-zig-hook}
### `dontUseZigBuild` {#dontUseZigBuild}
@ -53,7 +53,7 @@ Disables using `zigInstallPhase`.
Controls the flags passed to the install phase.
### Variables honored by zigHook {#variablesHonoredByZigHook}
### Variables honored by zig.hook {#variables-honored-by-zig-hook}
- `prefixKey`
- `dontAddPrefix`

View File

@ -1,7 +1,7 @@
{ lib
, stdenv
, fetchFromGitHub
, zigHook
, zig_0_9
}:
stdenv.mkDerivation (finalAttrs: {
@ -16,7 +16,7 @@ stdenv.mkDerivation (finalAttrs: {
};
nativeBuildInputs = [
zigHook
zig_0_9.hook
];
meta = {
@ -24,6 +24,6 @@ stdenv.mkDerivation (finalAttrs: {
homepage = "https://github.com/benbusby/colorstorm";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ ];
inherit (zigHook.meta) platforms;
inherit (zig_0_9.meta) platforms;
};
})

View File

@ -17,7 +17,7 @@
, util-linux
, xwininfo
, zenity
, zigHook
, zig_0_10
}:
stdenv.mkDerivation (finalAttrs: {
@ -33,7 +33,7 @@ stdenv.mkDerivation (finalAttrs: {
nativeBuildInputs = [
pkg-config
zigHook
zig_0_10.hook
makeWrapper
];

View File

@ -4,7 +4,7 @@
, pkg-config
, river
, wayland
, zigHook
, zig_0_9
}:
stdenv.mkDerivation (finalAttrs: {
@ -23,7 +23,7 @@ stdenv.mkDerivation (finalAttrs: {
pkg-config
river
wayland
zigHook
zig_0_9.hook
];
meta = with lib; {
@ -42,6 +42,6 @@ stdenv.mkDerivation (finalAttrs: {
changelog = "https://git.sr.ht/~novakane/rivercarro/refs/v${finalAttrs.version}";
license = licenses.gpl3Plus;
maintainers = with maintainers; [ kraem ];
inherit (zigHook.meta) platforms;
inherit (zig_0_9.meta) platforms;
};
})

View File

@ -7,7 +7,7 @@
, scdoc
, wayland
, wayland-protocols
, zigHook
, zig_0_10
}:
stdenv.mkDerivation (finalAttrs: {
@ -26,7 +26,7 @@ stdenv.mkDerivation (finalAttrs: {
pkg-config
scdoc
wayland
zigHook
zig_0_10.hook
];
buildInputs = [

View File

@ -14,7 +14,7 @@
, wayland-protocols
, wlroots_0_16
, xwayland
, zigHook
, zig_0_10
, withManpages ? true
, xwaylandSupport ? true
}:
@ -37,7 +37,7 @@ stdenv.mkDerivation (finalAttrs: {
pkg-config
wayland
xwayland
zigHook
zig_0_10.hook
]
++ lib.optional withManpages scdoc;

View File

@ -6,6 +6,7 @@
, libxml2
, zlib
, coreutils
, callPackage
}@args:
import ./generic.nix args {

View File

@ -6,6 +6,7 @@
, libxml2
, zlib
, coreutils
, callPackage
}@args:
import ./generic.nix args {

View File

@ -6,6 +6,7 @@
, libxml2
, zlib
, coreutils
, callPackage
}@args:
import ./generic.nix args {

View File

@ -6,6 +6,7 @@
, libxml2
, zlib
, coreutils
, callPackage
, ...
}:
@ -53,6 +54,12 @@ stdenv.mkDerivation (finalAttrs: {
runHook postInstallCheck
'';
passthru = {
hook = callPackage ./hook.nix {
zig = finalAttrs.finalPackage;
};
};
meta = {
description = "General-purpose programming language and toolchain for maintaining robust, optimal, and reusable software";
homepage = "https://ziglang.org/";

View File

@ -1,7 +1,7 @@
{ lib
, stdenv
, fetchFromGitHub
, zigHook
, zig
, callPackage
}:
@ -18,7 +18,7 @@ stdenv.mkDerivation (finalAttrs: {
};
nativeBuildInputs = [
zigHook
zig.hook
];
postPatch = ''

View File

@ -6,7 +6,7 @@
, libGLU
, libsndfile
, openal
, zigHook
, zig_0_9
}:
stdenv.mkDerivation (finalAttrs: {
@ -21,7 +21,7 @@ stdenv.mkDerivation (finalAttrs: {
hash = "sha256-Hg+VcWI28GzY/CPm1lUftP0RGztOnzizrKJQVTmeJ9I=";
};
nativeBuildInputs = [ zigHook ];
nativeBuildInputs = [ zig_0_9.hook ];
buildInputs = [
glfw

View File

@ -2,7 +2,7 @@
, stdenv
, fetchFromGitHub
, installShellFiles
, zigHook
, zig_0_10
}:
stdenv.mkDerivation (finalAttrs: {
@ -19,7 +19,7 @@ stdenv.mkDerivation (finalAttrs: {
nativeBuildInputs = [
installShellFiles
zigHook
zig_0_10.hook
];
postInstall = ''
@ -32,6 +32,6 @@ stdenv.mkDerivation (finalAttrs: {
changelog = "https://github.com/orhun/linuxwave/blob/${finalAttrs.src.rev}/CHANGELOG.md";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ figsoda ];
inherit (zigHook.meta) platforms;
inherit (zig_0_10.meta) platforms;
};
})

View File

@ -3,7 +3,7 @@
, fetchFromSourcehut
, libX11
, libXfixes
, zigHook
, zig_0_10
}:
stdenv.mkDerivation (finalAttrs: {
@ -17,7 +17,7 @@ stdenv.mkDerivation (finalAttrs: {
hash = "sha256-V5bAZHoScTzFZBPUhPd7xc/c32SXPLAJp+vsc/lCyeI=";
};
nativeBuildInputs = [ zigHook ];
nativeBuildInputs = [ zig_0_10.hook ];
buildInputs = [
libX11

View File

@ -1,9 +1,8 @@
{ lib
, stdenv
, fetchFromGitHub
, findup
, testers
, zigHook
, zig_0_10
}:
stdenv.mkDerivation (finalAttrs: {
@ -17,7 +16,7 @@ stdenv.mkDerivation (finalAttrs: {
hash = "sha256-Tpyiy5oJQ04lqVEOFshFC0+90VoNILQ+N6Dd7lbuH/Q=";
};
nativeBuildInputs = [ zigHook ];
nativeBuildInputs = [ zig_0_10.hook ];
passthru.tests.version = testers.testVersion { package = finalAttrs.findup; };

View File

@ -2,7 +2,7 @@
, stdenv
, fetchurl
, ncurses
, zigHook
, zig_0_10
}:
stdenv.mkDerivation (finalAttrs: {
@ -15,7 +15,7 @@ stdenv.mkDerivation (finalAttrs: {
};
nativeBuildInputs = [
zigHook
zig_0_10.hook
];
buildInputs = [
@ -28,6 +28,6 @@ stdenv.mkDerivation (finalAttrs: {
changelog = "https://dev.yorhel.nl/ncdu/changes2";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ pSub rodrgz ];
inherit (zigHook.meta) platforms;
inherit (zig_0_10.meta) platforms;
};
})

View File

@ -2,7 +2,7 @@
, stdenv
, fetchFromGitHub
, fetchpatch
, zigHook
, zig
}:
stdenv.mkDerivation rec {
@ -33,7 +33,7 @@ stdenv.mkDerivation rec {
];
nativeBuildInputs = [
zigHook
zig.hook
];
meta = with lib; {

View File

@ -3,8 +3,7 @@
, fetchFromGitHub
, installShellFiles
, testers
, zf
, zigHook
, zig_0_10
}:
stdenv.mkDerivation (finalAttrs: {
@ -21,7 +20,7 @@ stdenv.mkDerivation (finalAttrs: {
nativeBuildInputs = [
installShellFiles
zigHook
zig_0_10.hook
];
doCheck = false; # it's failing somehow

View File

@ -2,7 +2,7 @@
, stdenv
, fetchFromGitHub
, testers
, zigHook
, zig
}:
stdenv.mkDerivation (finalAttrs: {
@ -16,7 +16,7 @@ stdenv.mkDerivation (finalAttrs: {
hash = "sha256-C6sG8iqXs64x2AWCxKGFPyoXC1Fn4p2eSLWwJAQ8CSc=";
};
nativeBuildInputs = [ zigHook ];
nativeBuildInputs = [ zig.hook ];
passthru.tests.version = testers.testVersion { package = finalAttrs.dt; };

View File

@ -509,11 +509,7 @@ with pkgs;
colorpicker = callPackage ../tools/misc/colorpicker { };
colorstorm = callPackage ../applications/misc/colorstorm {
zigHook = zigHook.override {
zig = buildPackages.zig_0_9;
};
};
colorstorm = callPackage ../applications/misc/colorstorm { };
comedilib = callPackage ../development/libraries/comedilib { };
@ -6143,17 +6139,9 @@ with pkgs;
rex = callPackage ../tools/system/rex { };
river = callPackage ../applications/window-managers/river {
zigHook = zigHook.override {
zig = buildPackages.zig_0_10;
};
};
river = callPackage ../applications/window-managers/river { };
rivercarro = callPackage ../applications/misc/rivercarro {
zigHook = zigHook.override {
zig = buildPackages.zig_0_9;
};
};
rivercarro = callPackage ../applications/misc/rivercarro { };
river-luatile = callPackage ../applications/misc/river-luatile{ };
@ -8001,11 +7989,7 @@ with pkgs;
findutils = callPackage ../tools/misc/findutils { };
findup = callPackage ../tools/misc/findup {
zigHook = zigHook.override {
zig = buildPackages.zig_0_10;
};
};
findup = callPackage ../tools/misc/findup { };
fingerprintx = callPackage ../tools/security/fingerprintx { };
@ -9728,11 +9712,7 @@ with pkgs;
ffmpeg = ffmpeg-full;
};
linuxwave = callPackage ../tools/audio/linuxwave {
zigHook = zigHook.override {
zig = buildPackages.zig_0_10;
};
};
linuxwave = callPackage ../tools/audio/linuxwave { };
littlefs-fuse = callPackage ../tools/filesystems/littlefs-fuse { };
@ -14755,11 +14735,7 @@ with pkgs;
stdenv = if stdenv.isDarwin then llvmPackages_16.stdenv else stdenv;
};
clipbuzz = callPackage ../tools/misc/clipbuzz {
zigHook = zigHook.override {
zig = buildPackages.zig_0_10;
};
};
clipbuzz = callPackage ../tools/misc/clipbuzz { };
xclip = callPackage ../tools/misc/xclip { };
@ -18346,11 +18322,7 @@ with pkgs;
vscode-langservers-extracted = callPackage ../development/tools/language-servers/vscode-langservers-extracted { };
zls = callPackage ../development/tools/language-servers/zls {
zigHook = zigHook.override {
zig = buildPackages.zig_0_11;
};
};
zls = callPackage ../development/tools/language-servers/zls { };
ansible-later = callPackage ../tools/admin/ansible/later.nix { };
@ -25569,8 +25541,6 @@ with pkgs;
};
zig = zig_0_11;
zigHook = callPackage ../development/compilers/zig/hook.nix { };
zimlib = callPackage ../development/libraries/zimlib { };
zita-convolver = callPackage ../development/libraries/audio/zita-convolver { };
@ -32461,11 +32431,7 @@ with pkgs;
waycorner = callPackage ../applications/misc/waycorner { };
waylock = callPackage ../applications/misc/waylock {
zigHook = zigHook.override {
zig = buildPackages.zig_0_10;
};
};
waylock = callPackage ../applications/misc/waylock { };
wayshot = callPackage ../tools/misc/wayshot { };
@ -33445,9 +33411,6 @@ with pkgs;
mepo = callPackage ../applications/misc/mepo {
inherit (gnome) zenity;
zigHook = zigHook.override {
zig = buildPackages.zig_0_10;
};
};
meshcentral = callPackage ../tools/admin/meshcentral { };
@ -34116,11 +34079,7 @@ with pkgs;
netcoredbg = callPackage ../development/tools/misc/netcoredbg { };
ncdu = callPackage ../tools/misc/ncdu {
zigHook = zigHook.override {
zig = buildPackages.zig_0_10;
};
};
ncdu = callPackage ../tools/misc/ncdu { };
ncdu_1 = callPackage ../tools/misc/ncdu/1.nix { };
@ -37282,11 +37241,7 @@ with pkgs;
inherit (perlPackages) PathTiny;
};
blackshades = callPackage ../games/blackshades {
zigHook = zigHook.override {
zig = buildPackages.zig_0_9;
};
};
blackshades = callPackage ../games/blackshades { };
blobby = callPackage ../games/blobby { };
@ -41756,11 +41711,7 @@ with pkgs;
duden = callPackage ../applications/misc/duden { };
zf = callPackage ../tools/misc/zf {
zigHook = zigHook.override {
zig = buildPackages.zig_0_10;
};
};
zf = callPackage ../tools/misc/zf { };
isolate = callPackage ../tools/security/isolate { };