Skip to content

Commit f9baca1

Browse files
Setting lcov to verision 1.16
The withCoverage option doesn't work at the moment with lcov-2.1.
1 parent ad06db8 commit f9baca1

File tree

2 files changed

+46
-0
lines changed

2 files changed

+46
-0
lines changed

default.nix

+1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ nixpkgs.callPackage ./elements.nix {
2828
qaAssetsDir unitTestDataDir fuzzSeedCorpusDir;
2929
boost = nixpkgs.boost175;
3030
miniupnpc = nixpkgs.callPackage ./miniupnpc-2.2.7.nix { };
31+
lcov = nixpkgs.callPackage ./lcov-1.16.nix { };
3132
stdenv = nixpkgs.clangStdenv;
3233
${if gitDir == null then null else "withSource"} = builtins.fetchGit gitDir;
3334
}

lcov-1.16.nix

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
{lib, stdenv, fetchFromGitHub, perl, perlPackages, makeWrapper }:
2+
3+
stdenv.mkDerivation rec {
4+
pname = "lcov";
5+
version = "1.16";
6+
7+
src = fetchFromGitHub {
8+
owner = "linux-test-project";
9+
repo = "lcov";
10+
rev = "v${version}";
11+
sha256 = "sha256-X1T5OqR6NgTNGedH1on3+XZ7369007By6tRJK8xtmbk=";
12+
};
13+
14+
nativeBuildInputs = [ makeWrapper ];
15+
buildInputs = [ perl ];
16+
17+
preBuild = ''
18+
patchShebangs bin/
19+
makeFlagsArray=(PREFIX=$out LCOV_PERL_PATH=$(command -v perl))
20+
'';
21+
22+
postInstall = ''
23+
wrapProgram $out/bin/lcov --set PERL5LIB ${perlPackages.makeFullPerlPath [ perlPackages.PerlIOgzip perlPackages.JSON ]}
24+
wrapProgram $out/bin/genpng --set PERL5LIB ${perlPackages.makeFullPerlPath [ perlPackages.GD ]}
25+
'';
26+
27+
meta = with lib; {
28+
description = "Code coverage tool that enhances GNU gcov";
29+
30+
longDescription =
31+
'' LCOV is an extension of GCOV, a GNU tool which provides information
32+
about what parts of a program are actually executed (i.e.,
33+
"covered") while running a particular test case. The extension
34+
consists of a set of PERL scripts which build on the textual GCOV
35+
output to implement the following enhanced functionality such as
36+
HTML output.
37+
'';
38+
39+
homepage = "https://ltp.sourceforge.net/coverage/lcov.php";
40+
license = lib.licenses.gpl2Plus;
41+
42+
maintainers = with maintainers; [ dezgeg ];
43+
platforms = platforms.all;
44+
};
45+
}

0 commit comments

Comments
 (0)