nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 perl,
6 python3,
7 perlPackages,
8 makeWrapper,
9}:
10
11let
12 perlDeps = [
13 perlPackages.CaptureTiny
14 perlPackages.DateTime
15 perlPackages.DateTimeFormatW3CDTF
16 perlPackages.DevelCover
17 perlPackages.GD
18 perlPackages.JSONXS
19 perlPackages.PathTools
20 ] ++ lib.optionals (!stdenv.isDarwin) [ perlPackages.MemoryProcess ];
21in
22stdenv.mkDerivation rec {
23 pname = "lcov";
24 version = "2.1";
25
26 src = fetchFromGitHub {
27 owner = "linux-test-project";
28 repo = "lcov";
29 rev = "v${version}";
30 hash = "sha256-QfA+mzLfpi2fuhcPvCKO7YnPef1GMhCbgBWdXFTXPzE=";
31 };
32
33 nativeBuildInputs = [ makeWrapper ];
34
35 buildInputs = [
36 perl
37 python3
38 ];
39
40 preBuild = ''
41 patchShebangs bin/
42 makeFlagsArray=(PREFIX=$out LCOV_PERL_PATH=$(command -v perl))
43 '';
44
45 postInstall = ''
46 for f in "$out"/bin/{gen*,lcov,perl2lcov}; do
47 wrapProgram "$f" --set PERL5LIB ${perlPackages.makeFullPerlPath perlDeps}
48 done
49 '';
50
51 meta = {
52 description = "Code coverage tool that enhances GNU gcov";
53
54 longDescription = ''
55 LCOV is an extension of GCOV, a GNU tool which provides information
56 about what parts of a program are actually executed (i.e.,
57 "covered") while running a particular test case. The extension
58 consists of a set of PERL scripts which build on the textual GCOV
59 output to implement the following enhanced functionality such as
60 HTML output.
61 '';
62
63 homepage = "https://github.com/linux-test-project/lcov";
64 license = lib.licenses.gpl2Plus;
65
66 maintainers = with lib.maintainers; [ dezgeg ];
67 platforms = lib.platforms.all;
68 };
69}