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> |
fbbb1c0f LC |
6 | ;;; |
7 | ;;; This file is part of GNU Guix. | |
8 | ;;; | |
9 | ;;; GNU Guix is free software; you can redistribute it and/or modify it | |
10 | ;;; under the terms of the GNU General Public License as published by | |
11 | ;;; the Free Software Foundation; either version 3 of the License, or (at | |
12 | ;;; your option) any later version. | |
13 | ;;; | |
14 | ;;; GNU Guix is distributed in the hope that it will be useful, but | |
15 | ;;; WITHOUT ANY WARRANTY; without even the implied warranty of | |
16 | ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
17 | ;;; GNU General Public License for more details. | |
18 | ;;; | |
19 | ;;; You should have received a copy of the GNU General Public License | |
20 | ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. | |
21 | ||
1ffa7090 | 22 | (define-module (gnu packages gdb) |
b20441f2 | 23 | #:use-module (gnu packages) |
1ffa7090 LC |
24 | #:use-module (gnu packages ncurses) |
25 | #:use-module (gnu packages readline) | |
26 | #:use-module (gnu packages dejagnu) | |
27 | #:use-module (gnu packages texinfo) | |
28 | #:use-module (gnu packages multiprecision) | |
29 | #:use-module (gnu packages xml) | |
684a2f59 | 30 | #:use-module (gnu packages guile) |
480b3279 | 31 | #:use-module (gnu packages pretty-print) |
1ffa7090 | 32 | #:use-module (gnu packages python) |
684a2f59 | 33 | #:use-module (gnu packages pkg-config) |
183c9a89 | 34 | #:use-module ((guix licenses) #:select (gpl3+)) |
fbbb1c0f LC |
35 | #:use-module (guix packages) |
36 | #:use-module (guix download) | |
480b3279 LC |
37 | #:use-module (guix build-system gnu) |
38 | #:use-module (srfi srfi-1)) | |
fbbb1c0f | 39 | |
4a38ec9e | 40 | (define-public gdb-8.3 |
fbbb1c0f LC |
41 | (package |
42 | (name "gdb") | |
4a38ec9e | 43 | (version "8.3.1") |
fbbb1c0f LC |
44 | (source (origin |
45 | (method url-fetch) | |
46 | (uri (string-append "mirror://gnu/gdb/gdb-" | |
684a2f59 | 47 | version ".tar.xz")) |
fbbb1c0f LC |
48 | (sha256 |
49 | (base32 | |
4a38ec9e | 50 | "1i2pjwaafrlz7wqm40b4znr77ai32rjsxkpl2az38yyarpbv8m8y")))) |
6610e847 MB |
51 | |
52 | ;; Hide this package so that end users get 'gdb/next' below. | |
53 | (properties '((hidden? . #t))) | |
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 | ||
59 | #:modules ((srfi srfi-1) | |
60 | ,@%gnu-build-system-modules) | |
61 | ||
f19b9b96 LC |
62 | #:phases (modify-phases %standard-phases |
63 | (add-after | |
64 | 'configure 'post-configure | |
65 | (lambda _ | |
66 | (for-each patch-makefile-SHELL | |
a3401d64 MW |
67 | (find-files "." "Makefile\\.in")) |
68 | #t)) | |
f19b9b96 | 69 | (add-after |
2fecbdbd LC |
70 | 'install 'remove-libs-already-in-binutils |
71 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
72 | ;; Like Binutils, GDB installs libbfd, libopcodes, etc. | |
f19b9b96 LC |
73 | ;; However, this leads to collisions when both are |
74 | ;; installed, and really is none of its business, | |
75 | ;; conceptually. So remove them. | |
2fecbdbd LC |
76 | (let* ((binutils (assoc-ref inputs "binutils")) |
77 | (out (assoc-ref outputs "out")) | |
78 | (files1 (with-directory-excursion binutils | |
79 | (append (find-files "lib") | |
80 | (find-files "include")))) | |
81 | (files2 (with-directory-excursion out | |
82 | (append (find-files "lib") | |
83 | (find-files "include")))) | |
84 | (common (lset-intersection string=? | |
85 | files1 files2))) | |
86 | (with-directory-excursion out | |
87 | (for-each delete-file common) | |
88 | #t))))))) | |
fbbb1c0f | 89 | (inputs |
183c9a89 | 90 | `(("expat" ,expat) |
fbbb1c0f LC |
91 | ("mpfr" ,mpfr) |
92 | ("gmp" ,gmp) | |
93 | ("readline" ,readline) | |
94 | ("ncurses" ,ncurses) | |
684a2f59 MW |
95 | ("guile" ,guile-2.0) |
96 | ("python" ,python) | |
97 | ("python-wrapper" ,python-wrapper) | |
03f45001 LC |
98 | ("dejagnu" ,dejagnu) |
99 | ||
100 | ;; Allow use of XML-formatted syscall information. This enables 'catch | |
101 | ;; syscall' and similar commands. | |
102 | ("libxml2" ,libxml2))) | |
c4c4cc05 | 103 | (native-inputs |
684a2f59 MW |
104 | `(("texinfo" ,texinfo) |
105 | ("pkg-config" ,pkg-config))) | |
caaa715d | 106 | (home-page "https://www.gnu.org/software/gdb/") |
f50d2669 | 107 | (synopsis "The GNU debugger") |
fbbb1c0f | 108 | (description |
a22dc0c4 LC |
109 | "GDB is the GNU debugger. With it, you can monitor what a program is |
110 | doing while it runs or what it was doing just before a crash. It allows you | |
111 | to specify the runtime conditions, to define breakpoints, and to change how | |
112 | the program is running to try to fix bugs. It can be used to debug programs | |
113 | written in C, C++, Ada, Objective-C, Pascal and more.") | |
fbbb1c0f | 114 | (license gpl3+))) |
a8e7ba75 | 115 | |
6610e847 MB |
116 | ;; This version of GDB is required by some of the Rust compilers, see |
117 | ;; <https://bugs.gnu.org/37810>. | |
47dda6e0 MB |
118 | (define-public gdb-8.2 |
119 | (package/inherit | |
120 | gdb-8.3 | |
121 | (version "8.2.1") | |
122 | (source (origin | |
123 | (method url-fetch) | |
124 | (uri (string-append "mirror://gnu/gdb/gdb-" | |
125 | version ".tar.xz")) | |
126 | (sha256 | |
127 | (base32 | |
6610e847 MB |
128 | "00i27xqawjv282a07i73lp1l02n0a3ywzhykma75qg500wll6sha")))))) |
129 | ||
130 | ;; The "next" version of GDB, to be merged with 'gdb' in the next rebuild cycle. | |
131 | (define-public gdb/next | |
132 | (package/inherit | |
133 | gdb-8.3 | |
ab42204f LC |
134 | (version "9.1") |
135 | (source (origin | |
136 | (method url-fetch) | |
137 | (uri (string-append "mirror://gnu/gdb/gdb-" version ".tar.xz")) | |
138 | (sha256 | |
139 | (base32 | |
140 | "0dqp1p7w836iwijg1zb4a784n0j4pyjiw5v6h8fg5lpx6b40x7k9")))) | |
141 | (arguments | |
142 | `(#:out-of-source? #t | |
143 | ,@(package-arguments gdb-8.3))) | |
6610e847 MB |
144 | (inputs |
145 | `(("source-highlight" ,source-highlight) | |
146 | ,@(package-inputs gdb-8.3))) | |
147 | (properties (alist-delete 'hidden? (package-properties gdb-8.3))))) | |
47dda6e0 | 148 | |
a8e7ba75 LC |
149 | (define-public gdb |
150 | ;; This is the fixed version that packages depend on. Update it rarely | |
151 | ;; enough to avoid massive rebuilds. | |
4a38ec9e | 152 | gdb-8.3) |