depot/third_party/nixpkgs/pkgs/development/tools/analysis/lcov/default.nix
Default email 98eb3e9ef5 Project import generated by Copybara.
GitOrigin-RevId: 00d80d13810dbfea8ab4ed1009b09100cca86ba8
2024-07-01 15:47:52 +00:00

69 lines
1.6 KiB
Nix

{
lib,
stdenv,
fetchFromGitHub,
perl,
python3,
perlPackages,
makeWrapper,
}:
let
perlDeps = [
perlPackages.CaptureTiny
perlPackages.DateTime
perlPackages.DateTimeFormatW3CDTF
perlPackages.DevelCover
perlPackages.GD
perlPackages.JSONXS
perlPackages.PathTools
] ++ lib.optionals (!stdenv.isDarwin) [ perlPackages.MemoryProcess ];
in
stdenv.mkDerivation rec {
pname = "lcov";
version = "2.1";
src = fetchFromGitHub {
owner = "linux-test-project";
repo = "lcov";
rev = "v${version}";
hash = "sha256-QfA+mzLfpi2fuhcPvCKO7YnPef1GMhCbgBWdXFTXPzE=";
};
nativeBuildInputs = [ makeWrapper ];
buildInputs = [
perl
python3
];
preBuild = ''
patchShebangs bin/
makeFlagsArray=(PREFIX=$out LCOV_PERL_PATH=$(command -v perl))
'';
postInstall = ''
for f in "$out"/bin/{gen*,lcov,perl2lcov}; do
wrapProgram "$f" --set PERL5LIB ${perlPackages.makeFullPerlPath perlDeps}
done
'';
meta = {
description = "Code coverage tool that enhances GNU gcov";
longDescription = ''
LCOV is an extension of GCOV, a GNU tool which provides information
about what parts of a program are actually executed (i.e.,
"covered") while running a particular test case. The extension
consists of a set of PERL scripts which build on the textual GCOV
output to implement the following enhanced functionality such as
HTML output.
'';
homepage = "https://github.com/linux-test-project/lcov";
license = lib.licenses.gpl2Plus;
maintainers = with lib.maintainers; [ dezgeg ];
platforms = lib.platforms.all;
};
}