From f756ee76674e2afb569c5159fee784eb4d1fa7a7 Mon Sep 17 00:00:00 2001 From: Weijia Wang <9713184+wegank@users.noreply.github.com> Date: Mon, 24 Jun 2024 00:16:17 +0200 Subject: lcov: 1.16 -> 2.1 --- pkgs/development/tools/analysis/lcov/default.nix | 61 +++++++++++++++++------- 1 file changed, 43 insertions(+), 18 deletions(-) (limited to 'pkgs/development/tools') diff --git a/pkgs/development/tools/analysis/lcov/default.nix b/pkgs/development/tools/analysis/lcov/default.nix index 349b44730b8a2..c5e3b43eea061 100644 --- a/pkgs/development/tools/analysis/lcov/default.nix +++ b/pkgs/development/tools/analysis/lcov/default.nix @@ -1,18 +1,42 @@ - {lib, stdenv, fetchFromGitHub, perl, perlPackages, makeWrapper }: +{ + lib, + stdenv, + fetchFromGitHub, + perl, + python3, + perlPackages, + makeWrapper, +}: +let + perlDeps = [ + perlPackages.CaptureTiny + perlPackages.DateTime + perlPackages.DateTimeFormatW3CDTF + perlPackages.DevelCover + perlPackages.GD + perlPackages.JSONXS + perlPackages.MemoryProcess + perlPackages.PathTools + ]; +in stdenv.mkDerivation rec { pname = "lcov"; - version = "1.16"; + version = "2.1"; src = fetchFromGitHub { owner = "linux-test-project"; repo = "lcov"; rev = "v${version}"; - sha256 = "sha256-X1T5OqR6NgTNGedH1on3+XZ7369007By6tRJK8xtmbk="; + hash = "sha256-QfA+mzLfpi2fuhcPvCKO7YnPef1GMhCbgBWdXFTXPzE="; }; nativeBuildInputs = [ makeWrapper ]; - buildInputs = [ perl ]; + + buildInputs = [ + perl + python3 + ]; preBuild = '' patchShebangs bin/ @@ -20,26 +44,27 @@ stdenv.mkDerivation rec { ''; postInstall = '' - wrapProgram $out/bin/lcov --set PERL5LIB ${perlPackages.makeFullPerlPath [ perlPackages.PerlIOgzip perlPackages.JSON ]} - wrapProgram $out/bin/genpng --set PERL5LIB ${perlPackages.makeFullPerlPath [ perlPackages.GD ]} + for f in "$out"/bin/{gen*,lcov,perl2lcov}; do + wrapProgram "$f" --set PERL5LIB ${perlPackages.makeFullPerlPath perlDeps} + done ''; - meta = with lib; { + 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. - ''; + 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://ltp.sourceforge.net/coverage/lcov.php"; + homepage = "https://github.com/linux-test-project/lcov"; license = lib.licenses.gpl2Plus; - maintainers = with maintainers; [ dezgeg ]; - platforms = platforms.all; + maintainers = with lib.maintainers; [ dezgeg ]; + platforms = lib.platforms.all; }; } -- cgit 1.4.1