gnu: ruby-pandoc-ruby: Use pandoc instead of ghc-pandoc.
[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 ;;; Copyright © 2020 Vincent Legoll <vincent.legoll@gmail.com>
7 ;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
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
24 (define-module (gnu packages gdb)
25 #:use-module (gnu packages)
26 #:use-module (gnu packages hurd)
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)
33 #:use-module (gnu packages guile)
34 #:use-module (gnu packages pretty-print)
35 #:use-module (gnu packages python)
36 #:use-module (gnu packages pkg-config)
37 #:use-module ((guix licenses) #:select (gpl3+))
38 #:use-module (guix packages)
39 #:use-module (guix download)
40 #:use-module (guix build-system gnu)
41 #:use-module (srfi srfi-1))
42
43 (define-public gdb-9.1
44 (package
45 (name "gdb")
46 (version "9.1")
47 (source (origin
48 (method url-fetch)
49 (uri (string-append "mirror://gnu/gdb/gdb-"
50 version ".tar.xz"))
51 (sha256
52 (base32
53 "0dqp1p7w836iwijg1zb4a784n0j4pyjiw5v6h8fg5lpx6b40x7k9"))))
54
55 (build-system gnu-build-system)
56 (arguments
57 `(#:tests? #f ; FIXME "make check" fails on single-processor systems.
58
59 #:out-of-source? #t
60
61 #:modules ((srfi srfi-1)
62 ,@%gnu-build-system-modules)
63
64 #:phases (modify-phases %standard-phases
65 (add-after
66 'configure 'post-configure
67 (lambda _
68 (for-each patch-makefile-SHELL
69 (find-files "." "Makefile\\.in"))
70 #t))
71 (add-after
72 'install 'remove-libs-already-in-binutils
73 (lambda* (#:key inputs outputs
74 ;; TODO: Inline the native-inputs addition and
75 ;; below usage in the next rebuild cycle.
76 ,@(if (%current-target-system)
77 '(native-inputs)
78 '())
79 #:allow-other-keys)
80 ;; Like Binutils, GDB installs libbfd, libopcodes, etc.
81 ;; However, this leads to collisions when both are
82 ;; installed, and really is none of its business,
83 ;; conceptually. So remove them.
84 (let* ((binutils ,@(if (%current-target-system)
85 '((assoc-ref native-inputs "binutils"))
86 '((assoc-ref inputs "binutils"))))
87 (out (assoc-ref outputs "out"))
88 (files1 (with-directory-excursion binutils
89 (append (find-files "lib")
90 (find-files "include"))))
91 (files2 (with-directory-excursion out
92 (append (find-files "lib")
93 (find-files "include"))))
94 (common (lset-intersection string=?
95 files1 files2)))
96 (with-directory-excursion out
97 (for-each delete-file common)
98 #t)))))))
99 (inputs
100 `(("expat" ,expat)
101 ("mpfr" ,mpfr)
102 ("gmp" ,gmp)
103 ("readline" ,readline)
104 ("ncurses" ,ncurses)
105 ("guile" ,guile-2.0)
106 ("python-wrapper" ,python-wrapper)
107 ("source-highlight" ,source-highlight)
108
109 ;; Allow use of XML-formatted syscall information. This enables 'catch
110 ;; syscall' and similar commands.
111 ("libxml2" ,libxml2)
112
113 ;; The Hurd needs -lshouldbeinlibc.
114 ,@(if (hurd-target?) `(("hurd" ,hurd)) '())))
115 (native-inputs
116 `(("texinfo" ,texinfo)
117 ("dejagnu" ,dejagnu)
118 ("pkg-config" ,pkg-config)
119 ,@(if (hurd-target?) `(("mig" ,mig)) '())))
120 (home-page "https://www.gnu.org/software/gdb/")
121 (synopsis "The GNU debugger")
122 (description
123 "GDB is the GNU debugger. With it, you can monitor what a program is
124 doing while it runs or what it was doing just before a crash. It allows you
125 to specify the runtime conditions, to define breakpoints, and to change how
126 the program is running to try to fix bugs. It can be used to debug programs
127 written in C, C++, Ada, Objective-C, Pascal and more.")
128 (license gpl3+)))
129
130 ;; This version of GDB is required by some of the Rust compilers, see
131 ;; <https://bugs.gnu.org/37810>.
132 (define-public gdb-8.2
133 (package
134 (inherit gdb-9.1)
135 (version "8.2.1")
136 (source (origin
137 (method url-fetch)
138 (uri (string-append "mirror://gnu/gdb/gdb-"
139 version ".tar.xz"))
140 (sha256
141 (base32
142 "00i27xqawjv282a07i73lp1l02n0a3ywzhykma75qg500wll6sha"))))))
143
144 (define-public gdb
145 ;; This is the fixed version that packages depend on. Update it rarely
146 ;; enough to avoid massive rebuilds.
147 gdb-9.1)
148
149 (define-public gdb-9.2
150 (package
151 (inherit gdb)
152 (version "9.2")
153 (source (origin
154 (method url-fetch)
155 (uri (string-append "mirror://gnu/gdb/gdb-"
156 version ".tar.xz"))
157 (patches (search-patches "gdb-hurd.patch"))
158 (sha256
159 (base32
160 "0mf5fn8v937qwnal4ykn3ji1y2sxk0fa1yfqi679hxmpg6pdf31n"))))))
161
162 (define-public gdb-minimal
163 (package/inherit
164 gdb-9.2
165 (name "gdb-minimal")
166 (inputs (fold alist-delete (package-inputs gdb)
167 '("libxml2" "ncurses" "python-wrapper" "source-highlight")))))