gnu: valgrind: Fix test failure with glibc 2.26.
[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 ;;;
7 ;;; This file is part of GNU Guix.
8 ;;;
9 ;;; GNU Guix is free software; you can redistribute it and/or modify it
10 ;;; under the terms of the GNU General Public License as published by
11 ;;; the Free Software Foundation; either version 3 of the License, or (at
12 ;;; your option) any later version.
13 ;;;
14 ;;; GNU Guix is distributed in the hope that it will be useful, but
15 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
16 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 ;;; GNU General Public License for more details.
18 ;;;
19 ;;; You should have received a copy of the GNU General Public License
20 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
21
22 (define-module (gnu packages valgrind)
23 #:use-module (guix packages)
24 #:use-module (guix download)
25 #:use-module (guix build-system gnu)
26 #:use-module (guix licenses)
27 #:use-module (gnu packages gdb)
28 #:use-module (gnu packages perl)
29 #:use-module (gnu packages))
30
31 (define-public valgrind
32 (package
33 (name "valgrind")
34 (version "3.12.0")
35 (source (origin
36 (method url-fetch)
37 (uri (string-append "http://valgrind.org/downloads/valgrind-"
38 version ".tar.bz2"))
39 (sha256
40 (base32
41 "18bnrw9b1d55wi1wnl68n25achsp9w48n51n1xw4fwjjnaal7jk7"))
42 (patches (search-patches "valgrind-enable-arm.patch"
43 "valgrind-glibc-compat.patch"))))
44 (build-system gnu-build-system)
45 (outputs '("doc" ;16 MB
46 "out"))
47 (arguments
48 '(#:phases
49 (modify-phases %standard-phases
50 (add-after 'install 'patch-suppression-files
51 (lambda* (#:key outputs #:allow-other-keys)
52 ;; Don't assume the FHS.
53 (let* ((out (assoc-ref outputs "out"))
54 (dir (string-append out "/lib/valgrind")))
55 (substitute* (find-files dir "\\.supp$")
56 (("obj:/lib") "obj:*/lib")
57 (("obj:/usr/X11R6/lib") "obj:*/lib")
58 (("obj:/usr/lib") "obj:*/lib"))
59 #t)))
60 (add-after 'install 'install-doc
61 (lambda* (#:key outputs #:allow-other-keys)
62 (let ((orig (format #f "~a/share/doc" (assoc-ref outputs "out")))
63 (dest (format #f "~a/share" (assoc-ref outputs "doc"))))
64 (mkdir-p dest)
65 (rename-file orig dest)
66 #t))))))
67 (inputs `(;; GDB is needed to provide a sane default for `--db-command'.
68 ("gdb" ,gdb)))
69 (native-inputs `(("perl" ,perl)))
70 (home-page "http://www.valgrind.org/")
71 (synopsis "Debugging and profiling tool suite")
72 (description
73 "Valgrind is an instrumentation framework for building dynamic analysis
74 tools. There are Valgrind tools that can automatically detect many memory
75 management and threading bugs, and profile your programs in detail. You can
76 also use Valgrind to build new tools.")
77 (license gpl2+)
78
79 ;; Building VEX on mips64el-linux fails with "opcode not supported on this
80 ;; processor: mips3".
81 (supported-systems (delete "mips64el-linux" %supported-systems))))