gnu: emacs-svg-icon: Fix grammar.
[jackhill/guix/guix.git] / gnu / packages / gdb.scm
CommitLineData
fbbb1c0f 1;;; GNU Guix --- Functional package management for GNU
480b3279 2;;; Copyright © 2013, 2014, 2015, 2019, 2020 Ludovic Courtès <ludo@gnu.org>
5245251e 3;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
4d70a8fe 4;;; Copyright © 2015, 2016, 2019 Efraim Flashner <efraim@flashner.co.il>
6610e847 5;;; Copyright © 2020 Marius Bakke <mbakke@fastmail.com>
b581dd36 6;;; Copyright © 2020 Vincent Legoll <vincent.legoll@gmail.com>
76129cd3 7;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
fbbb1c0f
LC
8;;;
9;;; This file is part of GNU Guix.
10;;;
11;;; GNU Guix is free software; you can redistribute it and/or modify it
12;;; under the terms of the GNU General Public License as published by
13;;; the Free Software Foundation; either version 3 of the License, or (at
14;;; your option) any later version.
15;;;
16;;; GNU Guix is distributed in the hope that it will be useful, but
17;;; WITHOUT ANY WARRANTY; without even the implied warranty of
18;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19;;; GNU General Public License for more details.
20;;;
21;;; You should have received a copy of the GNU General Public License
22;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
23
1ffa7090 24(define-module (gnu packages gdb)
b20441f2 25 #:use-module (gnu packages)
76129cd3 26 #:use-module (gnu packages hurd)
1ffa7090
LC
27 #:use-module (gnu packages ncurses)
28 #:use-module (gnu packages readline)
29 #:use-module (gnu packages dejagnu)
30 #:use-module (gnu packages texinfo)
31 #:use-module (gnu packages multiprecision)
32 #:use-module (gnu packages xml)
684a2f59 33 #:use-module (gnu packages guile)
480b3279 34 #:use-module (gnu packages pretty-print)
1ffa7090 35 #:use-module (gnu packages python)
684a2f59 36 #:use-module (gnu packages pkg-config)
183c9a89 37 #:use-module ((guix licenses) #:select (gpl3+))
fbbb1c0f
LC
38 #:use-module (guix packages)
39 #:use-module (guix download)
480b3279 40 #:use-module (guix build-system gnu)
5b6b1608 41 #:use-module ((guix build utils) #:select (alist-replace))
480b3279 42 #:use-module (srfi srfi-1))
fbbb1c0f 43
5b6b1608 44(define-public gdb-10
fbbb1c0f
LC
45 (package
46 (name "gdb")
5b6b1608 47 (version "10.1")
fbbb1c0f
LC
48 (source (origin
49 (method url-fetch)
50 (uri (string-append "mirror://gnu/gdb/gdb-"
684a2f59 51 version ".tar.xz"))
fbbb1c0f
LC
52 (sha256
53 (base32
5b6b1608 54 "1h32dckz1y8fnyxh22iyw8h3hnhxr79v1ng85px3ljn1xv71wbzq"))))
6610e847 55
fbbb1c0f
LC
56 (build-system gnu-build-system)
57 (arguments
2fecbdbd
LC
58 `(#:tests? #f ; FIXME "make check" fails on single-processor systems.
59
759883ab
MB
60 #:out-of-source? #t
61
2fecbdbd
LC
62 #:modules ((srfi srfi-1)
63 ,@%gnu-build-system-modules)
64
f19b9b96
LC
65 #:phases (modify-phases %standard-phases
66 (add-after
67 'configure 'post-configure
68 (lambda _
69 (for-each patch-makefile-SHELL
a3401d64
MW
70 (find-files "." "Makefile\\.in"))
71 #t))
f19b9b96 72 (add-after
2fecbdbd 73 'install 'remove-libs-already-in-binutils
ef2a3871 74 (lambda* (#:key native-inputs inputs outputs
76129cd3 75 #:allow-other-keys)
2fecbdbd 76 ;; Like Binutils, GDB installs libbfd, libopcodes, etc.
f19b9b96
LC
77 ;; However, this leads to collisions when both are
78 ;; installed, and really is none of its business,
79 ;; conceptually. So remove them.
ef2a3871
MB
80 (let* ((binutils (or (assoc-ref inputs "binutils")
81 (assoc-ref native-inputs "binutils")))
2fecbdbd
LC
82 (out (assoc-ref outputs "out"))
83 (files1 (with-directory-excursion binutils
84 (append (find-files "lib")
85 (find-files "include"))))
86 (files2 (with-directory-excursion out
87 (append (find-files "lib")
88 (find-files "include"))))
89 (common (lset-intersection string=?
90 files1 files2)))
91 (with-directory-excursion out
92 (for-each delete-file common)
93 #t)))))))
fbbb1c0f 94 (inputs
183c9a89 95 `(("expat" ,expat)
fbbb1c0f
LC
96 ("mpfr" ,mpfr)
97 ("gmp" ,gmp)
98 ("readline" ,readline)
99 ("ncurses" ,ncurses)
5b6b1608 100 ("guile" ,guile-3.0)
684a2f59 101 ("python-wrapper" ,python-wrapper)
759883ab 102 ("source-highlight" ,source-highlight)
03f45001
LC
103
104 ;; Allow use of XML-formatted syscall information. This enables 'catch
105 ;; syscall' and similar commands.
76129cd3
JN
106 ("libxml2" ,libxml2)
107
108 ;; The Hurd needs -lshouldbeinlibc.
109 ,@(if (hurd-target?) `(("hurd" ,hurd)) '())))
c4c4cc05 110 (native-inputs
684a2f59 111 `(("texinfo" ,texinfo)
b581dd36 112 ("dejagnu" ,dejagnu)
76129cd3 113 ("pkg-config" ,pkg-config)
02036cdd
LC
114 ,@(if (hurd-target?)
115 ;; When cross-compiling from x86_64-linux, make sure to use a
116 ;; 32-bit MiG because we assume target i586-pc-gnu.
117 `(("mig" ,(if (%current-target-system)
118 mig/32-bit
119 mig)))
120 '())))
caaa715d 121 (home-page "https://www.gnu.org/software/gdb/")
f50d2669 122 (synopsis "The GNU debugger")
fbbb1c0f 123 (description
a22dc0c4
LC
124 "GDB is the GNU debugger. With it, you can monitor what a program is
125doing while it runs or what it was doing just before a crash. It allows you
126to specify the runtime conditions, to define breakpoints, and to change how
127the program is running to try to fix bugs. It can be used to debug programs
128written in C, C++, Ada, Objective-C, Pascal and more.")
fbbb1c0f 129 (license gpl3+)))
a8e7ba75 130
6610e847
MB
131;; This version of GDB is required by some of the Rust compilers, see
132;; <https://bugs.gnu.org/37810>.
5e6d5839 133(define-public gdb-8.2
a81b8dfe 134 (package
5b6b1608 135 (inherit gdb-10)
a81b8dfe
MB
136 (version "8.2.1")
137 (source (origin
138 (method url-fetch)
139 (uri (string-append "mirror://gnu/gdb/gdb-"
140 version ".tar.xz"))
141 (sha256
142 (base32
5b6b1608
MB
143 "00i27xqawjv282a07i73lp1l02n0a3ywzhykma75qg500wll6sha"))))
144 (inputs
145 (alist-replace "guile" (list guile-2.0)
146 (package-inputs gdb-10)))))
6610e847 147
a8e7ba75
LC
148(define-public gdb
149 ;; This is the fixed version that packages depend on. Update it rarely
150 ;; enough to avoid massive rebuilds.
5b6b1608 151 gdb-10)
35691bf5
JN
152
153(define-public gdb-minimal
88dbef3b 154 (package/inherit
5b6b1608 155 gdb
88dbef3b
MB
156 (name "gdb-minimal")
157 (inputs (fold alist-delete (package-inputs gdb)
27bcf151 158 '("libxml2" "ncurses" "python-wrapper" "source-highlight")))))