Commit | Line | Data |
---|---|---|
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 LC |
40 | #:use-module (guix build-system gnu) |
41 | #:use-module (srfi srfi-1)) | |
fbbb1c0f | 42 | |
759883ab | 43 | (define-public gdb-9.1 |
fbbb1c0f LC |
44 | (package |
45 | (name "gdb") | |
759883ab | 46 | (version "9.1") |
fbbb1c0f LC |
47 | (source (origin |
48 | (method url-fetch) | |
49 | (uri (string-append "mirror://gnu/gdb/gdb-" | |
684a2f59 | 50 | version ".tar.xz")) |
fbbb1c0f LC |
51 | (sha256 |
52 | (base32 | |
759883ab | 53 | "0dqp1p7w836iwijg1zb4a784n0j4pyjiw5v6h8fg5lpx6b40x7k9")))) |
6610e847 | 54 | |
fbbb1c0f LC |
55 | (build-system gnu-build-system) |
56 | (arguments | |
2fecbdbd LC |
57 | `(#:tests? #f ; FIXME "make check" fails on single-processor systems. |
58 | ||
759883ab MB |
59 | #:out-of-source? #t |
60 | ||
2fecbdbd LC |
61 | #:modules ((srfi srfi-1) |
62 | ,@%gnu-build-system-modules) | |
63 | ||
f19b9b96 LC |
64 | #:phases (modify-phases %standard-phases |
65 | (add-after | |
66 | 'configure 'post-configure | |
67 | (lambda _ | |
68 | (for-each patch-makefile-SHELL | |
a3401d64 MW |
69 | (find-files "." "Makefile\\.in")) |
70 | #t)) | |
f19b9b96 | 71 | (add-after |
2fecbdbd | 72 | 'install 'remove-libs-already-in-binutils |
361541d4 MB |
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 | '()) | |
76129cd3 | 79 | #:allow-other-keys) |
2fecbdbd | 80 | ;; Like Binutils, GDB installs libbfd, libopcodes, etc. |
f19b9b96 LC |
81 | ;; However, this leads to collisions when both are |
82 | ;; installed, and really is none of its business, | |
83 | ;; conceptually. So remove them. | |
361541d4 MB |
84 | (let* ((binutils ,@(if (%current-target-system) |
85 | '((assoc-ref native-inputs "binutils")) | |
86 | '((assoc-ref inputs "binutils")))) | |
2fecbdbd LC |
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))))))) | |
fbbb1c0f | 99 | (inputs |
183c9a89 | 100 | `(("expat" ,expat) |
fbbb1c0f LC |
101 | ("mpfr" ,mpfr) |
102 | ("gmp" ,gmp) | |
103 | ("readline" ,readline) | |
104 | ("ncurses" ,ncurses) | |
684a2f59 | 105 | ("guile" ,guile-2.0) |
684a2f59 | 106 | ("python-wrapper" ,python-wrapper) |
759883ab | 107 | ("source-highlight" ,source-highlight) |
03f45001 LC |
108 | |
109 | ;; Allow use of XML-formatted syscall information. This enables 'catch | |
110 | ;; syscall' and similar commands. | |
76129cd3 JN |
111 | ("libxml2" ,libxml2) |
112 | ||
113 | ;; The Hurd needs -lshouldbeinlibc. | |
114 | ,@(if (hurd-target?) `(("hurd" ,hurd)) '()))) | |
c4c4cc05 | 115 | (native-inputs |
684a2f59 | 116 | `(("texinfo" ,texinfo) |
b581dd36 | 117 | ("dejagnu" ,dejagnu) |
76129cd3 JN |
118 | ("pkg-config" ,pkg-config) |
119 | ,@(if (hurd-target?) `(("mig" ,mig)) '()))) | |
caaa715d | 120 | (home-page "https://www.gnu.org/software/gdb/") |
f50d2669 | 121 | (synopsis "The GNU debugger") |
fbbb1c0f | 122 | (description |
a22dc0c4 LC |
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.") | |
fbbb1c0f | 128 | (license gpl3+))) |
a8e7ba75 | 129 | |
6610e847 MB |
130 | ;; This version of GDB is required by some of the Rust compilers, see |
131 | ;; <https://bugs.gnu.org/37810>. | |
47dda6e0 | 132 | (define-public gdb-8.2 |
a81b8dfe MB |
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")))))) | |
6610e847 | 143 | |
a8e7ba75 LC |
144 | (define-public gdb |
145 | ;; This is the fixed version that packages depend on. Update it rarely | |
146 | ;; enough to avoid massive rebuilds. | |
759883ab | 147 | gdb-9.1) |
060e44b1 LC |
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")) | |
76129cd3 | 157 | (patches (search-patches "gdb-hurd.patch")) |
060e44b1 LC |
158 | (sha256 |
159 | (base32 | |
160 | "0mf5fn8v937qwnal4ykn3ji1y2sxk0fa1yfqi679hxmpg6pdf31n")))))) | |
35691bf5 JN |
161 | |
162 | (define-public gdb-minimal | |
88dbef3b MB |
163 | (package/inherit |
164 | gdb-9.2 | |
165 | (name "gdb-minimal") | |
166 | (inputs (fold alist-delete (package-inputs gdb) | |
27bcf151 | 167 | '("libxml2" "ncurses" "python-wrapper" "source-highlight"))))) |