gnu: r-gamlss: Update to 5.2-0.
[jackhill/guix/guix.git] / gnu / packages / valgrind.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013, 2014 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2015 Andreas Enge <andreas@enge.fr>
4 ;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
5 ;;; Copyright © 2016, 2020 Efraim Flashner <efraim@flashner.co.il>
6 ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
7 ;;;
8 ;;; This file is part of GNU Guix.
9 ;;;
10 ;;; GNU Guix is free software; you can redistribute it and/or modify it
11 ;;; under the terms of the GNU General Public License as published by
12 ;;; the Free Software Foundation; either version 3 of the License, or (at
13 ;;; your option) any later version.
14 ;;;
15 ;;; GNU Guix is distributed in the hope that it will be useful, but
16 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
17 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 ;;; GNU General Public License for more details.
19 ;;;
20 ;;; You should have received a copy of the GNU General Public License
21 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
22
23 (define-module (gnu packages valgrind)
24 #:use-module (guix packages)
25 #:use-module (guix download)
26 #:use-module (guix build-system gnu)
27 #:use-module (guix licenses)
28 #:use-module (gnu packages gdb)
29 #:use-module (gnu packages perl)
30 #:use-module (gnu packages))
31
32 (define-public valgrind
33 (package
34 (name "valgrind")
35 (version "3.15.0")
36 (source (origin
37 (method url-fetch)
38 (uri (list (string-append "https://sourceware.org/pub/valgrind"
39 "/valgrind-" version ".tar.bz2")
40 (string-append "ftp://sourceware.org/pub/valgrind"
41 "/valgrind-" version ".tar.bz2")))
42 (sha256
43 (base32
44 "1ccawxrni8brcvwhygy12iprkvz409hbr9xkk1bd03gnm2fplz21"))
45 (patches (search-patches "valgrind-enable-arm.patch"))))
46 (build-system gnu-build-system)
47 (outputs '("doc" ;16 MB
48 "out"))
49 (arguments
50 `(,@(if (string-prefix? "powerpc" (or (%current-target-system)
51 (%current-system)))
52 `(#:make-flags '("CFLAGS+=-maltivec"))
53 '())
54 #:phases
55 (modify-phases %standard-phases
56 (add-after 'install 'patch-suppression-files
57 (lambda* (#:key outputs #:allow-other-keys)
58 ;; Don't assume the FHS.
59 (let* ((out (assoc-ref outputs "out"))
60 (dir (string-append out "/lib/valgrind")))
61 (substitute* (find-files dir "\\.supp$")
62 (("obj:/lib") "obj:*/lib")
63 (("obj:/usr/X11R6/lib") "obj:*/lib")
64 (("obj:/usr/lib") "obj:*/lib"))
65 #t)))
66 (add-after 'install 'install-doc
67 (lambda* (#:key outputs #:allow-other-keys)
68 (let ((orig (format #f "~a/share/doc" (assoc-ref outputs "out")))
69 (dest (format #f "~a/share" (assoc-ref outputs "doc"))))
70 (mkdir-p dest)
71 (rename-file orig dest)
72 #t))))))
73 (inputs
74 ;; GDB is needed to provide a sane default for `--db-command'.
75 `(("gdb" ,gdb)))
76 (native-inputs
77 `(("perl" ,perl)))
78 (home-page "https://www.valgrind.org/")
79 (synopsis "Debugging and profiling tool suite")
80 (description
81 "Valgrind is an instrumentation framework for building dynamic analysis
82 tools. There are Valgrind tools that can automatically detect many memory
83 management and threading bugs, and profile your programs in detail. You can
84 also use Valgrind to build new tools.")
85 (license gpl2+)))