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>
9 ;;; This file is part of GNU Guix.
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.
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.
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/>.
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))
33 (define-public 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.
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")))
47 "1jik19rcd34ip8a5c9nv5wfj8k8maqb8cyclr4xhznq2gcpkl7y9"))
48 (patches (search-patches "valgrind-enable-arm.patch"))))
49 (build-system gnu-build-system)
50 (outputs '("doc" ;16 MB
53 `(,@(if (string-prefix? "powerpc" (or (%current-target-system)
55 `(#:make-flags '("CFLAGS+=-maltivec"))
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"))
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"))))
74 (rename-file orig dest)
78 (home-page "https://www.valgrind.org/")
79 (synopsis "Debugging and profiling tool suite")
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.")
87 ;; Hide this variant so end users get the "interactive" Valgrind below.
88 (properties '((hidden? . #t)))))
90 (define-public valgrind/interactive
94 ;; GDB is needed to provide a sane default for `--db-command'.