1{stdenv, fetchurl, perl}:
2
3stdenv.mkDerivation rec {
4 name = "lcov-1.10";
5
6 src = fetchurl {
7 url = "mirror://sourceforge/ltp/${name}.tar.gz";
8 sha256 = "13xq2ln4jjasslqzzhr5g11q1c19gwpng1jphzbzmylmrjz62ila";
9 };
10
11 patches =
12 [ ./lcov-except-unreach.patch ./no-warn-missing.patch ]
13 ++ stdenv.lib.optional stdenv.isFreeBSD ./freebsd-install.patch;
14
15 preBuild = ''
16 makeFlagsArray=(PREFIX=$out BIN_DIR=$out/bin MAN_DIR=$out/share/man)
17 '';
18
19 preInstall = ''
20 substituteInPlace bin/install.sh --replace /bin/bash $shell
21 '';
22
23 postInstall = ''
24 for i in "$out/bin/"*; do
25 substituteInPlace $i --replace /usr/bin/perl ${perl}/bin/perl
26 done
27 '';
28
29 meta = with stdenv.lib; {
30 description = "Code coverage tool that enhances GNU gcov";
31
32 longDescription =
33 '' LCOV is an extension of GCOV, a GNU tool which provides information
34 about what parts of a program are actually executed (i.e.,
35 "covered") while running a particular test case. The extension
36 consists of a set of PERL scripts which build on the textual GCOV
37 output to implement the following enhanced functionality such as
38 HTML output.
39 '';
40
41 homepage = http://ltp.sourceforge.net/coverage/lcov.php;
42 license = stdenv.lib.licenses.gpl2Plus;
43
44 maintainers = [ maintainers.mornfall ];
45 platforms = platforms.all;
46 };
47}