lcov: Update to 1.10 as 1.9 fails with gcc 4.7 .gcno files.
This commit is contained in:
parent
c592783741
commit
f9d66c239e
@ -1,16 +1,15 @@
|
|||||||
{stdenv, fetchurl, perl}:
|
{stdenv, fetchurl, perl}:
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
name = "lcov-1.9";
|
name = "lcov-1.10";
|
||||||
|
|
||||||
src = fetchurl {
|
src = fetchurl {
|
||||||
url = "mirror://sourceforge/ltp/${name}.tar.gz";
|
url = "mirror://sourceforge/ltp/${name}.tar.gz";
|
||||||
sha256 = "1jhs1x2qy5la5gpdfl805zm11rsz6anla3b0wffk6wq79xfi4zn3";
|
sha256 = "13xq2ln4jjasslqzzhr5g11q1c19gwpng1jphzbzmylmrjz62ila";
|
||||||
};
|
};
|
||||||
|
|
||||||
patches =
|
patches =
|
||||||
[ ./find-source.patch ]
|
(stdenv.lib.optional stdenv.isFreeBSD ./freebsd-install.patch);
|
||||||
++ (stdenv.lib.optional stdenv.isFreeBSD ./freebsd-install.patch);
|
|
||||||
|
|
||||||
preBuild = ''
|
preBuild = ''
|
||||||
makeFlagsArray=(PREFIX=$out BIN_DIR=$out/bin MAN_DIR=$out/share/man)
|
makeFlagsArray=(PREFIX=$out BIN_DIR=$out/bin MAN_DIR=$out/share/man)
|
||||||
|
@ -1,84 +0,0 @@
|
|||||||
--- lcov-1.8/bin/geninfo 2010-01-29 11:14:46.000000000 +0100
|
|
||||||
+++ lcov-1.8/bin/geninfo 2010-04-18 23:33:43.000000000 +0200
|
|
||||||
@@ -51,6 +51,7 @@
|
|
||||||
|
|
||||||
use strict;
|
|
||||||
use File::Basename;
|
|
||||||
+use Cwd qw(abs_path);
|
|
||||||
use File::Spec::Functions qw /abs2rel catdir file_name_is_absolute splitdir
|
|
||||||
splitpath rel2abs/;
|
|
||||||
use Getopt::Long;
|
|
||||||
@@ -95,6 +96,7 @@ sub match_filename($@);
|
|
||||||
sub solve_ambiguous_match($$$);
|
|
||||||
sub split_filename($);
|
|
||||||
sub solve_relative_path($$);
|
|
||||||
+sub find_source_file($$);
|
|
||||||
sub read_gcov_header($);
|
|
||||||
sub read_gcov_file($);
|
|
||||||
sub info(@);
|
|
||||||
@@ -964,7 +966,7 @@ sub process_dafile($$)
|
|
||||||
|
|
||||||
if (defined($source))
|
|
||||||
{
|
|
||||||
- $source = solve_relative_path($base_dir, $source);
|
|
||||||
+ $source = find_source_file($base_dir, $source);
|
|
||||||
}
|
|
||||||
|
|
||||||
# gcov will happily create output even if there's no source code
|
|
||||||
@@ -981,18 +983,9 @@ sub process_dafile($$)
|
|
||||||
die("ERROR: could not read source file $source\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
- @matches = match_filename(defined($source) ? $source :
|
|
||||||
- $gcov_file, keys(%{$instr}));
|
|
||||||
+ next if ! -r $source;
|
|
||||||
|
|
||||||
- # Skip files that are not mentioned in the graph file
|
|
||||||
- if (!@matches)
|
|
||||||
- {
|
|
||||||
- warn("WARNING: cannot find an entry for ".$gcov_file.
|
|
||||||
- " in $graph_file_extension file, skipping ".
|
|
||||||
- "file!\n");
|
|
||||||
- unlink($gcov_file);
|
|
||||||
- next;
|
|
||||||
- }
|
|
||||||
+ @matches = ($source);
|
|
||||||
|
|
||||||
# Read in contents of gcov file
|
|
||||||
@result = read_gcov_file($gcov_file);
|
|
||||||
@@ -1242,6 +1235,25 @@ sub solve_relative_path($$)
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
+sub find_source_file($$)
|
|
||||||
+{
|
|
||||||
+ my ($base_dir, $source) = @_;
|
|
||||||
+ my $dir = $base_dir;
|
|
||||||
+
|
|
||||||
+ # Hack to make absolute paths work on Nixpkgs coverage
|
|
||||||
+ # reports. The source is in /nix/store/<bla>/.build/<bla>.
|
|
||||||
+ $source = $1 if $source =~ /^\/.*\/\.build\/(.*)$/;
|
|
||||||
+
|
|
||||||
+ while (!-e "$dir/$source") {
|
|
||||||
+ $dir = $dir . "/..";
|
|
||||||
+ if (length $dir > 1000) {
|
|
||||||
+ return "$base_dir/$source";
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+ return abs_path("$dir/$source");
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+
|
|
||||||
#
|
|
||||||
# match_filename(gcov_filename, list)
|
|
||||||
#
|
|
||||||
@@ -1918,7 +1930,7 @@ sub process_graphfile($$)
|
|
||||||
|
|
||||||
# Get path to data file in absolute and normalized form (begins with /,
|
|
||||||
# contains no more ../ or ./)
|
|
||||||
- $graph_filename = solve_relative_path($cwd, $graph_filename);
|
|
||||||
+ $graph_filename = find_source_file($cwd, $graph_filename);
|
|
||||||
|
|
||||||
# Get directory and basename of data file
|
|
||||||
($graph_dir, $graph_basename) = split_filename($graph_filename);
|
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user