Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
57 lines
1.3 KiB
Nix
57 lines
1.3 KiB
Nix
{
|
|
lib,
|
|
stdenv,
|
|
fetchFromGitHub,
|
|
callPackage,
|
|
zig_0_14,
|
|
versionCheckHook,
|
|
}:
|
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
|
pname = "zig-zlint";
|
|
version = "0.7.9";
|
|
|
|
src = fetchFromGitHub {
|
|
name = "zlint"; # tests expect this
|
|
owner = "DonIsaac";
|
|
repo = "zlint";
|
|
tag = "v${finalAttrs.version}";
|
|
hash = "sha256-qJPOFMBvkvF10ixE17pV9X5LX3EyCVzzhrMGx1omTzE=";
|
|
};
|
|
|
|
nativeBuildInputs = [
|
|
zig_0_14.hook
|
|
];
|
|
|
|
zigBuildFlags = [
|
|
"-Dversion=v${finalAttrs.version}"
|
|
"--system"
|
|
(callPackage ./build.zig.zon.nix { })
|
|
];
|
|
|
|
doCheck = true;
|
|
zigCheckFlags = finalAttrs.zigBuildFlags;
|
|
|
|
doInstallCheck = true;
|
|
nativeInstallCheckInputs = [ versionCheckHook ];
|
|
versionCheckProgram = "${placeholder "out"}/bin/zlint";
|
|
versionCheckProgramArg = "--version";
|
|
|
|
# `zig build` produces a lot more artifacts, just copy over the ones we want
|
|
installPhase = ''
|
|
runHook preInstall
|
|
install -vDm755 zig-out/bin/zlint $out/bin/zlint
|
|
runHook postInstall
|
|
'';
|
|
|
|
meta = {
|
|
description = "Linter for the Zig programming language";
|
|
homepage = "https://github.com/DonIsaac/zlint";
|
|
changelog = "https://github.com/DonIsaac/zlint/releases/tag/v${finalAttrs.version}";
|
|
license = lib.licenses.mit;
|
|
maintainers = with lib.maintainers; [ christoph-heiss ];
|
|
mainProgram = "zlint";
|
|
inherit (zig_0_14.meta) platforms;
|
|
};
|
|
})
|