From d8ccff833d8d6e90b92f8656c6fa3c0238e693ce Mon Sep 17 00:00:00 2001 From: Maxim Cournoyer Date: Fri, 8 May 2020 17:15:01 -0400 Subject: gnu: lcov: Update to commit 40580cd659. * gnu/packages/code.scm (lcov): Update to commit 40580cd659. (arguments): Enable tests and specify the test target. [phases]{patch-pwd, wrap}: Add phases. [inputs]: Add perl-json and perl-perlio-gzip. --- gnu/packages/code.scm | 76 ++++++++++++++++++++++++++++++++++----------------- 1 file changed, 51 insertions(+), 25 deletions(-) diff --git a/gnu/packages/code.scm b/gnu/packages/code.scm index fcf0e07db7..ee47582ec8 100644 --- a/gnu/packages/code.scm +++ b/gnu/packages/code.scm @@ -12,6 +12,7 @@ ;;; Copyright © 2013 Andreas Enge ;;; Copyright © 2014 Mark H Weaver ;;; Copyright © 2019 Hartmut Goebel +;;; Copyright © 2020 Maxim Cournoyer ;;; ;;; This file is part of GNU Guix. ;;; @@ -49,6 +50,7 @@ #:use-module (gnu packages graphviz) #:use-module (gnu packages pcre) #:use-module (gnu packages perl) + #:use-module (gnu packages perl-compression) #:use-module (gnu packages pkg-config) #:use-module (gnu packages python) #:use-module (gnu packages sqlite) @@ -375,36 +377,60 @@ stack traces.") (license license:gpl3+))) (define-public lcov - (package - (name "lcov") - (version "1.14") - (source (origin - (method url-fetch) - (uri (string-append "mirror://sourceforge/ltp/Coverage%20Analysis" - "/LCOV-" version "/lcov-" version ".tar.gz")) - (sha256 - (base32 - "06h7ixyznf6vz1qvksjgy5f3q2nw9akf6zx59npf0h3l32cmd68l")))) - (build-system gnu-build-system) - (arguments - '(#:make-flags - (let ((out (assoc-ref %outputs "out"))) - (list (string-append "PREFIX=" out))) - #:phases - (modify-phases %standard-phases - (delete 'configure)) ; no configure script - #:tests? #f)) ; no 'check' target - (inputs `(("perl" ,perl))) - (home-page "http://ltp.sourceforge.net/coverage/lcov.php") - (synopsis "Code coverage tool that enhances GNU gcov") - (description - "LCOV is an extension of @command{gcov}, a tool part of the + ;; Use a recent commit from upstream since the latest official release + ;; (1.14) doesn't support GCC 9 (see: + ;; https://github.com/linux-test-project/lcov/issues/58). + (let* ((commit "40580cd65909bc8324ae09b36bca2e178652ff3f") + (revision "0") + (version (git-version "1.14" revision commit))) + (package + (name "lcov") + (version "1.14") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/linux-test-project/lcov.git") + (commit commit))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "0shgmh6fzhnj1qfdl90jgjmlbb1ih1qh879dca8hc58yggy3hqgb")))) + (build-system gnu-build-system) + (arguments + '(#:test-target "test" + #:make-flags (list (string-append "PREFIX=" + (assoc-ref %outputs "out"))) + #:phases + (modify-phases %standard-phases + (add-after 'unpack 'patch-pwd + ;; Lift the requirement of having a shell in PATH. + (lambda _ + (substitute* "bin/geninfo" + (("qw/abs_path/") + "qw/abs_path getcwd/")) + (substitute* '("bin/lcov" "bin/geninfo") + (("`pwd`") + "getcwd()")) + #t)) + (delete 'configure) ;no configure script + (add-after 'install 'wrap + (lambda* (#:key outputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out"))) + (wrap-program (string-append out "/bin/geninfo") + `("PERL5LIB" ":" prefix (,(getenv "PERL5LIB"))))) + #t))))) + (inputs `(("perl" ,perl) + ("perl-json" ,perl-json) + ("perl-perlio-gzip" ,perl-perlio-gzip))) + (home-page "http://ltp.sourceforge.net/coverage/lcov.php") + (synopsis "Code coverage tool that enhances GNU gcov") + (description "LCOV is an extension of @command{gcov}, a tool part of the GNU@tie{}Binutils, 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 @command{gcov} output to implement the following enhanced functionality such as HTML output.") - (license license:gpl2+))) + (license license:gpl2+)))) (define-public rtags (package -- cgit v1.2.3