mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-08-27 02:34:53 +00:00
44 lines
865 B
Nix
44 lines
865 B
Nix
{
|
|
stdenv,
|
|
lib,
|
|
makeWrapper,
|
|
perl,
|
|
perlPackages,
|
|
}:
|
|
|
|
stdenv.mkDerivation {
|
|
pname = "nixpkgs-lint";
|
|
version = "1";
|
|
|
|
__structuredAttrs = true;
|
|
strictDeps = true;
|
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
buildInputs = [
|
|
perl
|
|
perlPackages.XMLSimple
|
|
];
|
|
|
|
dontUnpack = true;
|
|
dontBuild = true;
|
|
|
|
installPhase = ''
|
|
runHook preInstall
|
|
|
|
mkdir -p $out/bin
|
|
cp ${./nixpkgs-lint.pl} $out/bin/nixpkgs-lint
|
|
# 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
|
|
|
|
runHook postInstall
|
|
'';
|
|
|
|
meta = {
|
|
description = "Utility for Nixpkgs contributors to check Nixpkgs for common errors";
|
|
mainProgram = "nixpkgs-lint";
|
|
platforms = lib.platforms.unix;
|
|
};
|
|
}
|