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>
9 ;;; This file is part of GNU Guix.
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.
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.
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/>.
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))
50 (uri (string-append "mirror://gnu/gdb/gdb-"
54 "1h32dckz1y8fnyxh22iyw8h3hnhxr79v1ng85px3ljn1xv71wbzq"))))
56 (build-system gnu-build-system)
58 `(#:tests? #f ; FIXME "make check" fails on single-processor systems.
62 #:modules ((srfi srfi-1)
63 ,@%gnu-build-system-modules)
65 #:phases (modify-phases %standard-phases
67 'configure 'post-configure
69 (for-each patch-makefile-SHELL
70 (find-files "." "Makefile\\.in"))
73 'install 'remove-libs-already-in-binutils
74 (lambda* (#:key native-inputs inputs outputs
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=?
91 (with-directory-excursion out
92 (for-each delete-file common)
98 ("readline" ,readline)
101 ("python-wrapper" ,python-wrapper)
102 ("source-highlight" ,source-highlight)
104 ;; Allow use of XML-formatted syscall information. This enables 'catch
105 ;; syscall' and similar commands.
108 ;; The Hurd needs -lshouldbeinlibc.
109 ,@(if (hurd-target?) `(("hurd" ,hurd)) '())))
111 `(("texinfo" ,texinfo)
113 ("pkg-config" ,pkg-config)
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)
121 (home-page "https://www.gnu.org/software/gdb/")
122 (synopsis "The GNU debugger")
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.")
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
139 (uri (string-append "mirror://gnu/gdb/gdb-"
143 "00i27xqawjv282a07i73lp1l02n0a3ywzhykma75qg500wll6sha"))))
145 (alist-replace "guile" (list guile-2.0)
146 (package-inputs gdb-10)))))
149 ;; This is the fixed version that packages depend on. Update it rarely
150 ;; enough to avoid massive rebuilds.
153 (define-public gdb-minimal
157 (inputs (fold alist-delete (package-inputs gdb)
158 '("libxml2" "ncurses" "python-wrapper" "source-highlight")))))