2021-01-17 20:14:59 +00:00
|
|
|
{ stdenv, lib, makeWrapper, perl, perlPackages }:
|
2013-07-25 21:50:14 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
2024-05-24 23:03:30 +00:00
|
|
|
pname = "nixpkgs-lint";
|
|
|
|
version = "1";
|
2013-07-25 21:50:14 +00:00
|
|
|
|
2021-02-07 09:17:39 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
buildInputs = [ perl perlPackages.XMLSimple ];
|
2013-07-25 21:50:14 +00:00
|
|
|
|
2019-06-19 15:45:34 +00:00
|
|
|
dontUnpack = true;
|
2024-05-24 23:03:30 +00:00
|
|
|
dontBuild = true;
|
2013-07-25 21:50:14 +00:00
|
|
|
|
|
|
|
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}"
|
2013-07-25 21:50:14 +00:00
|
|
|
wrapProgram $out/bin/nixpkgs-lint --set PERL5LIB $PERL5LIB
|
|
|
|
'';
|
|
|
|
|
2021-01-17 20:14:59 +00:00
|
|
|
meta = with lib; {
|
|
|
|
maintainers = [ maintainers.eelco ];
|
2013-07-25 21:50:14 +00:00
|
|
|
description = "A utility for Nixpkgs contributors to check Nixpkgs for common errors";
|
2024-03-19 02:14:51 +00:00
|
|
|
mainProgram = "nixpkgs-lint";
|
2021-01-17 20:14:59 +00:00
|
|
|
platforms = platforms.unix;
|
2013-07-25 21:50:14 +00:00
|
|
|
};
|
|
|
|
}
|