projects/guix·blob java-team · refs

160 lines · 6.5 KiB

1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2013, 2014, 2022 Ludovic Courtès <[email protected]>
3;;; Copyright © 2015 Andreas Enge <[email protected]>
4;;; Copyright © 2015 Mark H Weaver <[email protected]>
5;;; Copyright © 2016, 2020, 2022, 2023 Efraim Flashner <[email protected]>
6;;; Copyright © 2018 Tobias Geerinckx-Rice <[email protected]>
7;;; Copyright © 2020 Marius Bakke <[email protected]>
8;;; Copyright © 2022 Denis Carikli <[email protected]>
9;;; Copyright © 2023 Simon Tournier <[email protected]>
10;;; Copyright © 2024 Janneke Nieuwenhuizen <[email protected]>
11;;; Copyright © 2025 Zheng Junjie <[email protected]>
12;;;
13;;; This file is part of GNU Guix.
14;;;
15;;; GNU Guix is free software; you can redistribute it and/or modify it
16;;; under the terms of the GNU General Public License as published by
17;;; the Free Software Foundation; either version 3 of the License, or (at
18;;; your option) any later version.
19;;;
20;;; GNU Guix is distributed in the hope that it will be useful, but
21;;; WITHOUT ANY WARRANTY; without even the implied warranty of
22;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23;;; GNU General Public License for more details.
24;;;
25;;; You should have received a copy of the GNU General Public License
26;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
27
28(define-module (gnu packages valgrind)
29 #:use-module (srfi srfi-1)
30 #:use-module (guix build-system gnu)
31 #:use-module (guix download)
32 #:use-module (guix git-download)
33 #:use-module (guix gexp)
34 #:use-module (guix licenses)
35 #:use-module (guix packages)
36 #:use-module (guix utils)
37 #:use-module (gnu packages)
38 #:use-module (gnu packages base)
39 #:use-module (gnu packages gdb)
40 #:use-module (gnu packages perl)
41 #:use-module (gnu packages python))
42
43(define-public valgrind/pinned
44 (package
45 (name "valgrind")
46 (version "3.25.1")
47 (source (origin
48 (method url-fetch)
49 (uri (list (string-append "https://sourceware.org/pub/valgrind"
50 "/valgrind-" version ".tar.bz2")
51 (string-append "ftp://sourceware.org/pub/valgrind"
52 "/valgrind-" version ".tar.bz2")))
53 (sha256
54 (base32
55 "1bvilavwimza3n6v5r2ypxydk737krn3n6ywxxlc4ibvfb8bipk1"))))
56 (build-system gnu-build-system)
57 (outputs '("doc" ;16 MB
58 "out"))
59 (arguments
60 (append
61 (if (string-prefix? "powerpc" (or (%current-target-system)
62 (%current-system)))
63 (list #:make-flags #~(list "CFLAGS+=-maltivec"))
64 '())
65 (list #:phases
66 #~(modify-phases %standard-phases
67 (add-after 'install 'patch-suppression-files
68 (lambda _
69 ;; Don't assume the FHS.
70 (let* ((dir (string-append #$output "/lib/valgrind")))
71 (substitute* (find-files dir "\\.supp$")
72 (("obj:/lib") "obj:*/lib")
73 (("obj:/usr/X11R6/lib") "obj:*/lib")
74 (("obj:/usr/lib") "obj:*/lib")))))
75 (add-after 'install 'install-doc
76 (lambda _
77 (let ((orig (string-append #$output "/share/doc"))
78 (dest (string-append #$output:doc "/share")))
79 (mkdir-p dest)
80 (rename-file orig dest))))))))
81 (native-inputs
82 (list perl))
83 (home-page "https://www.valgrind.org/")
84 (synopsis "Debugging and profiling tool suite")
85 (description
86 "Valgrind is an instrumentation framework for building dynamic analysis
87tools. There are Valgrind tools that can automatically detect many memory
88management and threading bugs, and profile your programs in detail. You can
89also use Valgrind to build new tools.")
90 ;; https://valgrind.org/info/platforms.html
91 (supported-systems (fold delete %supported-systems
92 '("i586-gnu" "x86_64-gnu" "armhf-linux")))
93 (license gpl2+)
94
95 ;; Hide this variant so end users get the "interactive" Valgrind below.
96 (properties '((hidden? . #t)))))
97
98(define-public valgrind
99 (package
100 (inherit valgrind/pinned)
101 (version "3.27.0")
102 (source (origin
103 (method url-fetch)
104 (uri (list (string-append "https://sourceware.org/pub/valgrind"
105 "/valgrind-" version ".tar.bz2")
106 (string-append "ftp://sourceware.org/pub/valgrind"
107 "/valgrind-" version ".tar.bz2")))
108 (sha256
109 (base32
110 "1vsv47wkmz2yd15alzd03839ikmd26bip9wfd58qzvjphbg3fnav"))))))
111
112(define-public valgrind/interactive
113 (package/inherit valgrind
114 (inputs
115 ;; GDB is needed to provide a sane default for `--db-command'.
116 (list gdb
117 `(,(canonical-package (libc-for-target)) "debug")
118 python)) ;for cg_* shebangs
119 (properties '())))
120
121(define-public vex
122 (let ((commit "61f2373464af0a8df436bd88be36bdf129c2032f")
123 (revision "0"))
124 (package
125 (name "vex")
126 (version "0.0.0")
127 (source
128 (origin
129 (method git-fetch)
130 (uri (git-reference
131 (url "https://github.com/angr/vex")
132 (commit commit)))
133 (file-name (git-file-name name version))
134 (sha256
135 (base32 "1wf1vxkjq81mv18nf6dm2sc2zfzwpf2fdwjqhkkm2xxsxc48gzb1"))))
136 (build-system gnu-build-system)
137 (arguments
138 (list
139 #:tests? #f ;XXX: there is no easy way to run them
140 #:make-flags
141 #~(list (string-append "AR=" #$(ar-for-target))
142 (string-append "CC=" #$(cc-for-target))
143 (string-append "CC_NATIVE=" #$(cc-for-target))
144 "--makefile=Makefile-gcc")
145 #:phases
146 #~(modify-phases %standard-phases
147 (delete 'configure) ;no configure
148 ;; TODO: Check how to add "include" as well.
149 (replace 'install
150 (lambda _
151 (let ((lib (string-append #$output "/lib")))
152 (install-file "libvex.a" lib)
153 (install-file "libvex.so" lib)))))))
154 (home-page "https://github.com/angr/vex")
155 (synopsis "Patched version of VEX to work with PyVEX")
156 (description
157 "This package provides an alternative variant of libVEX (of the Valgrind
158project: valgrind.org) for use with @url{https://github.com/angr/pyvex,
159PyVEX}.")
160 (license gpl2+))))