gnu: libretro-lowresnx: Update to 1.2.
[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 ((guix build utils) #:select (alist-replace))
42 #:use-module (srfi srfi-1))
43
44 (define-public gdb-10
45 (package
46 (name "gdb")
47 (version "10.1")
48 (source (origin
49 (method url-fetch)
50 (uri (string-append "mirror://gnu/gdb/gdb-"
51 version ".tar.xz"))
52 (sha256
53 (base32
54 "1h32dckz1y8fnyxh22iyw8h3hnhxr79v1ng85px3ljn1xv71wbzq"))))
55
56 (build-system gnu-build-system)
57 (arguments
58 `(#:tests? #f ; FIXME "make check" fails on single-processor systems.
59
60 #:out-of-source? #t
61
62 #:modules ((srfi srfi-1)
63 ,@%gnu-build-system-modules)
64
65 #:phases (modify-phases %standard-phases
66 (add-after
67 'configure 'post-configure
68 (lambda _
69 (for-each patch-makefile-SHELL
70 (find-files "." "Makefile\\.in"))
71 #t))
72 (add-after
73 'install 'remove-libs-already-in-binutils
74 (lambda* (#:key native-inputs inputs outputs
75 #:allow-other-keys)
76 ;; Like Binutils, GDB installs libbfd, libopcodes, etc.
77 ;; However, this leads to collisions when both are
78 ;; installed, and really is none of its business,
79 ;; conceptually. So remove them.
80 (let* ((binutils (or (assoc-ref inputs "binutils")
81 (assoc-ref native-inputs "binutils")))
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)))))))
94 (inputs
95 `(("expat" ,expat)
96 ("mpfr" ,mpfr)
97 ("gmp" ,gmp)
98 ("readline" ,readline)
99 ("ncurses" ,ncurses)
100 ("guile" ,guile-3.0)
101 ("python-wrapper" ,python-wrapper)
102 ("source-highlight" ,source-highlight)
103
104 ;; Allow use of XML-formatted syscall information. This enables 'catch
105 ;; syscall' and similar commands.
106 ("libxml2" ,libxml2)
107
108 ;; The Hurd needs -lshouldbeinlibc.
109 ,@(if (hurd-target?) `(("hurd" ,hurd)) '())))
110 (native-inputs
111 `(("texinfo" ,texinfo)
112 ("dejagnu" ,dejagnu)
113 ("pkg-config" ,pkg-config)
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 '())))
121 (home-page "https://www.gnu.org/software/gdb/")
122 (synopsis "The GNU debugger")
123 (description
124 "GDB is the GNU debugger. With it, you can monitor what a program is
125 doing while it runs or what it was doing just before a crash. It allows you
126 to specify the runtime conditions, to define breakpoints, and to change how
127 the program is running to try to fix bugs. It can be used to debug programs
128 written in C, C++, Ada, Objective-C, Pascal and more.")
129 (license gpl3+)))
130
131 ;; This version of GDB is required by some of the Rust compilers, see
132 ;; <https://bugs.gnu.org/37810>.
133 (define-public gdb-8.2
134 (package
135 (inherit gdb-10)
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
143 "00i27xqawjv282a07i73lp1l02n0a3ywzhykma75qg500wll6sha"))))
144 (inputs
145 (alist-replace "guile" (list guile-2.0)
146 (package-inputs gdb-10)))))
147
148 (define-public gdb
149 ;; This is the fixed version that packages depend on. Update it rarely
150 ;; enough to avoid massive rebuilds.
151 gdb-10)
152
153 (define-public gdb-minimal
154 (package/inherit
155 gdb
156 (name "gdb-minimal")
157 (inputs (fold alist-delete (package-inputs gdb)
158 '("libxml2" "ncurses" "python-wrapper" "source-highlight")))))