gnu: libretro-lowresnx: Update to 1.2.
[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 ;;; Copyright © 2020 Marius Bakke <marius@gnu.org>
8 ;;;
9 ;;; This file is part of GNU Guix.
10 ;;;
11 ;;; GNU Guix is free software; you can redistribute it and/or modify it
12 ;;; under the terms of the GNU General Public License as published by
13 ;;; the Free Software Foundation; either version 3 of the License, or (at
14 ;;; your option) any later version.
15 ;;;
16 ;;; GNU Guix is distributed in the hope that it will be useful, but
17 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
18 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 ;;; GNU General Public License for more details.
20 ;;;
21 ;;; You should have received a copy of the GNU General Public License
22 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
23
24 (define-module (gnu packages valgrind)
25 #:use-module (guix packages)
26 #:use-module (guix download)
27 #:use-module (guix build-system gnu)
28 #:use-module (guix licenses)
29 #:use-module (gnu packages gdb)
30 #:use-module (gnu packages perl)
31 #:use-module (gnu packages))
32
33 (define-public valgrind
34 (package
35 (name "valgrind")
36 ;; Note: check "guix refresh -l -e '(@ (gnu packages valgrind) valgrind)'"
37 ;; when updating this package to find which branch it should go to.
38 (version "3.16.1")
39 (source (origin
40 (method url-fetch)
41 (uri (list (string-append "https://sourceware.org/pub/valgrind"
42 "/valgrind-" version ".tar.bz2")
43 (string-append "ftp://sourceware.org/pub/valgrind"
44 "/valgrind-" version ".tar.bz2")))
45 (sha256
46 (base32
47 "1jik19rcd34ip8a5c9nv5wfj8k8maqb8cyclr4xhznq2gcpkl7y9"))
48 (patches (search-patches "valgrind-enable-arm.patch"))))
49 (build-system gnu-build-system)
50 (outputs '("doc" ;16 MB
51 "out"))
52 (arguments
53 `(,@(if (string-prefix? "powerpc" (or (%current-target-system)
54 (%current-system)))
55 `(#:make-flags '("CFLAGS+=-maltivec"))
56 '())
57 #:phases
58 (modify-phases %standard-phases
59 (add-after 'install 'patch-suppression-files
60 (lambda* (#:key outputs #:allow-other-keys)
61 ;; Don't assume the FHS.
62 (let* ((out (assoc-ref outputs "out"))
63 (dir (string-append out "/lib/valgrind")))
64 (substitute* (find-files dir "\\.supp$")
65 (("obj:/lib") "obj:*/lib")
66 (("obj:/usr/X11R6/lib") "obj:*/lib")
67 (("obj:/usr/lib") "obj:*/lib"))
68 #t)))
69 (add-after 'install 'install-doc
70 (lambda* (#:key outputs #:allow-other-keys)
71 (let ((orig (format #f "~a/share/doc" (assoc-ref outputs "out")))
72 (dest (format #f "~a/share" (assoc-ref outputs "doc"))))
73 (mkdir-p dest)
74 (rename-file orig dest)
75 #t))))))
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+)
86
87 ;; Hide this variant so end users get the "interactive" Valgrind below.
88 (properties '((hidden? . #t)))))
89
90 (define-public valgrind/interactive
91 (package/inherit
92 valgrind
93 (inputs
94 ;; GDB is needed to provide a sane default for `--db-command'.
95 `(("gdb" ,gdb)))
96 (properties '())))