nixpkgs/maintainers/scripts/nixpkgs-lint.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

30 lines
812 B
Nix
Raw Normal View History

2021-01-17 20:14:59 +00:00
{ stdenv, lib, makeWrapper, perl, perlPackages }:
stdenv.mkDerivation {
pname = "nixpkgs-lint";
version = "1";
nativeBuildInputs = [ makeWrapper ];
buildInputs = [ perl perlPackages.XMLSimple ];
2019-06-19 15:45:34 +00:00
dontUnpack = true;
dontBuild = true;
installPhase =
''
mkdir -p $out/bin
cp ${./nixpkgs-lint.pl} $out/bin/nixpkgs-lint
2024-05-24 23:00:03 +00:00
# make the built version hermetic
substituteInPlace $out/bin/nixpkgs-lint \
--replace-fail "#! /usr/bin/env nix-shell" "#! ${lib.getExe perl}"
wrapProgram $out/bin/nixpkgs-lint --set PERL5LIB $PERL5LIB
'';
2021-01-17 20:14:59 +00:00
meta = with lib; {
maintainers = [ maintainers.eelco ];
description = "A utility for Nixpkgs contributors to check Nixpkgs for common errors";
mainProgram = "nixpkgs-lint";
2021-01-17 20:14:59 +00:00
platforms = platforms.unix;
};
}