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 (srfi srfi-1))
43 (define-public gdb-9.1
49 (uri (string-append "mirror://gnu/gdb/gdb-"
53 "0dqp1p7w836iwijg1zb4a784n0j4pyjiw5v6h8fg5lpx6b40x7k9"))))
55 (build-system gnu-build-system)
57 `(#:tests? #f ; FIXME "make check" fails on single-processor systems.
61 #:modules ((srfi srfi-1)
62 ,@%gnu-build-system-modules)
64 #:phases (modify-phases %standard-phases
66 'configure 'post-configure
68 (for-each patch-makefile-SHELL
69 (find-files "." "Makefile\\.in"))
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)
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=?
96 (with-directory-excursion out
97 (for-each delete-file common)
103 ("readline" ,readline)
106 ("python-wrapper" ,python-wrapper)
107 ("source-highlight" ,source-highlight)
109 ;; Allow use of XML-formatted syscall information. This enables 'catch
110 ;; syscall' and similar commands.
113 ;; The Hurd needs -lshouldbeinlibc.
114 ,@(if (hurd-target?) `(("hurd" ,hurd)) '())))
116 `(("texinfo" ,texinfo)
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")
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.")
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
138 (uri (string-append "mirror://gnu/gdb/gdb-"
142 "00i27xqawjv282a07i73lp1l02n0a3ywzhykma75qg500wll6sha"))))))
145 ;; This is the fixed version that packages depend on. Update it rarely
146 ;; enough to avoid massive rebuilds.
149 (define-public gdb-9.2
155 (uri (string-append "mirror://gnu/gdb/gdb-"
157 (patches (search-patches "gdb-hurd.patch"))
160 "0mf5fn8v937qwnal4ykn3ji1y2sxk0fa1yfqi679hxmpg6pdf31n"))))))
162 (define-public gdb-minimal
166 (inputs (fold alist-delete (package-inputs gdb)
167 '("libxml2" "ncurses" "python-wrapper" "source-highlight")))))