Merge branch 'staging' into core-updates
[jackhill/guix/guix.git] / gnu / packages / valgrind.scm
CommitLineData
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>
5fd84e28 5;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
2cdf16c8 6;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
e78a0ae5
LC
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")
dc80b28d 35 (version "3.15.0")
e78a0ae5 36 (source (origin
2cdf16c8 37 (method url-fetch)
a9eeda20
MB
38 (uri (list (string-append "http://www.valgrind.org/downloads"
39 "/valgrind-" version ".tar.bz2")
40 (string-append "ftp://sourceware.org/pub/valgrind"
41 "/valgrind-" version ".tar.bz2")))
42 (sha256
43 (base32
dc80b28d 44 "1ccawxrni8brcvwhygy12iprkvz409hbr9xkk1bd03gnm2fplz21"))
350b7f8a 45 (patches (search-patches "valgrind-enable-arm.patch"))))
e78a0ae5 46 (build-system gnu-build-system)
84bf845a
DL
47 (outputs '("doc" ;16 MB
48 "out"))
e78a0ae5 49 (arguments
5fd84e28
EF
50 '(#:phases
51 (modify-phases %standard-phases
52 (add-after 'install 'patch-suppression-files
53 (lambda* (#:key outputs #:allow-other-keys)
54 ;; Don't assume the FHS.
55 (let* ((out (assoc-ref outputs "out"))
56 (dir (string-append out "/lib/valgrind")))
57 (substitute* (find-files dir "\\.supp$")
58 (("obj:/lib") "obj:*/lib")
59 (("obj:/usr/X11R6/lib") "obj:*/lib")
60 (("obj:/usr/lib") "obj:*/lib"))
84bf845a
DL
61 #t)))
62 (add-after 'install 'install-doc
63 (lambda* (#:key outputs #:allow-other-keys)
64 (let ((orig (format #f "~a/share/doc" (assoc-ref outputs "out")))
65 (dest (format #f "~a/share" (assoc-ref outputs "doc"))))
66 (mkdir-p dest)
67 (rename-file orig dest)
5fd84e28 68 #t))))))
2cdf16c8
TGR
69 (inputs
70 ;; GDB is needed to provide a sane default for `--db-command'.
71 `(("gdb" ,gdb)))
72 (native-inputs
73 `(("perl" ,perl)))
e78a0ae5
LC
74 (home-page "http://www.valgrind.org/")
75 (synopsis "Debugging and profiling tool suite")
76 (description
77 "Valgrind is an instrumentation framework for building dynamic analysis
78tools. There are Valgrind tools that can automatically detect many memory
35b9e423 79management and threading bugs, and profile your programs in detail. You can
e78a0ae5 80also use Valgrind to build new tools.")
350b7f8a 81 (license gpl2+)))