Commit | Line | Data |
---|---|---|
e78a0ae5 | 1 | ;;; GNU Guix --- Functional package management for GNU |
5f36ea03 | 2 | ;;; Copyright © 2013, 2014 Ludovic Courtès <ludo@gnu.org> |
43640a33 | 3 | ;;; Copyright © 2015 Andreas Enge <andreas@enge.fr> |
1d6c8db5 | 4 | ;;; Copyright © 2015 Mark H Weaver <mhw@netris.org> |
cd8c4197 | 5 | ;;; Copyright © 2016, 2020 Efraim Flashner <efraim@flashner.co.il> |
2cdf16c8 | 6 | ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr> |
b611597a | 7 | ;;; Copyright © 2020 Marius Bakke <marius@gnu.org> |
e78a0ae5 LC |
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") | |
25ceae92 MB |
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") | |
e78a0ae5 | 39 | (source (origin |
2cdf16c8 | 40 | (method url-fetch) |
cd8c4197 | 41 | (uri (list (string-append "https://sourceware.org/pub/valgrind" |
a9eeda20 MB |
42 | "/valgrind-" version ".tar.bz2") |
43 | (string-append "ftp://sourceware.org/pub/valgrind" | |
44 | "/valgrind-" version ".tar.bz2"))) | |
45 | (sha256 | |
46 | (base32 | |
25ceae92 | 47 | "1jik19rcd34ip8a5c9nv5wfj8k8maqb8cyclr4xhznq2gcpkl7y9")) |
350b7f8a | 48 | (patches (search-patches "valgrind-enable-arm.patch")))) |
e78a0ae5 | 49 | (build-system gnu-build-system) |
84bf845a DL |
50 | (outputs '("doc" ;16 MB |
51 | "out")) | |
e78a0ae5 | 52 | (arguments |
d74ea9e5 EF |
53 | `(,@(if (string-prefix? "powerpc" (or (%current-target-system) |
54 | (%current-system))) | |
55 | `(#:make-flags '("CFLAGS+=-maltivec")) | |
56 | '()) | |
57 | #:phases | |
5fd84e28 EF |
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")) | |
84bf845a DL |
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) | |
5fd84e28 | 75 | #t)))))) |
2cdf16c8 TGR |
76 | (native-inputs |
77 | `(("perl" ,perl))) | |
cd8c4197 | 78 | (home-page "https://www.valgrind.org/") |
e78a0ae5 LC |
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 | |
35b9e423 | 83 | management and threading bugs, and profile your programs in detail. You can |
e78a0ae5 | 84 | also use Valgrind to build new tools.") |
b611597a MB |
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 '()))) |