gnu: Add cl-ana.statistical-learning.
[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 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 "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
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 '(#: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"))
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)
68 #t))))))
69 (inputs
70 ;; GDB is needed to provide a sane default for `--db-command'.
71 `(("gdb" ,gdb)))
72 (native-inputs
73 `(("perl" ,perl)))
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
78 tools. There are Valgrind tools that can automatically detect many memory
79 management and threading bugs, and profile your programs in detail. You can
80 also use Valgrind to build new tools.")
81 (license gpl2+)))