gnu: sbcl-cl-cffi-gtk: Update to 20200417.
[jackhill/guix/guix.git] / gnu / packages / gdb.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013, 2014, 2015, 2019, 2020 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
4 ;;; Copyright © 2015, 2016, 2019 Efraim Flashner <efraim@flashner.co.il>
5 ;;; Copyright © 2020 Marius Bakke <mbakke@fastmail.com>
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 gdb)
23 #:use-module (gnu packages)
24 #:use-module (gnu packages ncurses)
25 #:use-module (gnu packages readline)
26 #:use-module (gnu packages dejagnu)
27 #:use-module (gnu packages texinfo)
28 #:use-module (gnu packages multiprecision)
29 #:use-module (gnu packages xml)
30 #:use-module (gnu packages guile)
31 #:use-module (gnu packages pretty-print)
32 #:use-module (gnu packages python)
33 #:use-module (gnu packages pkg-config)
34 #:use-module ((guix licenses) #:select (gpl3+))
35 #:use-module (guix packages)
36 #:use-module (guix download)
37 #:use-module (guix build-system gnu)
38 #:use-module (srfi srfi-1))
39
40 (define-public gdb-9.1
41 (package
42 (name "gdb")
43 (version "9.1")
44 (source (origin
45 (method url-fetch)
46 (uri (string-append "mirror://gnu/gdb/gdb-"
47 version ".tar.xz"))
48 (sha256
49 (base32
50 "0dqp1p7w836iwijg1zb4a784n0j4pyjiw5v6h8fg5lpx6b40x7k9"))))
51
52 (build-system gnu-build-system)
53 (arguments
54 `(#:tests? #f ; FIXME "make check" fails on single-processor systems.
55
56 #:out-of-source? #t
57
58 #:modules ((srfi srfi-1)
59 ,@%gnu-build-system-modules)
60
61 #:phases (modify-phases %standard-phases
62 (add-after
63 'configure 'post-configure
64 (lambda _
65 (for-each patch-makefile-SHELL
66 (find-files "." "Makefile\\.in"))
67 #t))
68 (add-after
69 'install 'remove-libs-already-in-binutils
70 (lambda* (#:key inputs outputs #:allow-other-keys)
71 ;; Like Binutils, GDB installs libbfd, libopcodes, etc.
72 ;; However, this leads to collisions when both are
73 ;; installed, and really is none of its business,
74 ;; conceptually. So remove them.
75 (let* ((binutils (assoc-ref inputs "binutils"))
76 (out (assoc-ref outputs "out"))
77 (files1 (with-directory-excursion binutils
78 (append (find-files "lib")
79 (find-files "include"))))
80 (files2 (with-directory-excursion out
81 (append (find-files "lib")
82 (find-files "include"))))
83 (common (lset-intersection string=?
84 files1 files2)))
85 (with-directory-excursion out
86 (for-each delete-file common)
87 #t)))))))
88 (inputs
89 `(("expat" ,expat)
90 ("mpfr" ,mpfr)
91 ("gmp" ,gmp)
92 ("readline" ,readline)
93 ("ncurses" ,ncurses)
94 ("guile" ,guile-2.0)
95 ("python" ,python)
96 ("python-wrapper" ,python-wrapper)
97 ("dejagnu" ,dejagnu)
98 ("source-highlight" ,source-highlight)
99
100 ;; Allow use of XML-formatted syscall information. This enables 'catch
101 ;; syscall' and similar commands.
102 ("libxml2" ,libxml2)))
103 (native-inputs
104 `(("texinfo" ,texinfo)
105 ("pkg-config" ,pkg-config)))
106 (home-page "https://www.gnu.org/software/gdb/")
107 (synopsis "The GNU debugger")
108 (description
109 "GDB is the GNU debugger. With it, you can monitor what a program is
110 doing while it runs or what it was doing just before a crash. It allows you
111 to specify the runtime conditions, to define breakpoints, and to change how
112 the program is running to try to fix bugs. It can be used to debug programs
113 written in C, C++, Ada, Objective-C, Pascal and more.")
114 (license gpl3+)))
115
116 ;; This version of GDB is required by some of the Rust compilers, see
117 ;; <https://bugs.gnu.org/37810>.
118 (define-public gdb-8.2
119 (package/inherit
120 gdb-9.1
121 (version "8.2.1")
122 (source (origin
123 (method url-fetch)
124 (uri (string-append "mirror://gnu/gdb/gdb-"
125 version ".tar.xz"))
126 (sha256
127 (base32
128 "00i27xqawjv282a07i73lp1l02n0a3ywzhykma75qg500wll6sha"))))))
129
130 (define-public gdb
131 ;; This is the fixed version that packages depend on. Update it rarely
132 ;; enough to avoid massive rebuilds.
133 gdb-9.1)