summary refs log tree commit diff
path: root/gnu/packages/gdb.scm
diff options
context:
space:
mode:
authorMarius Bakke <marius@gnu.org>2020-06-27 10:23:11 +0200
committerMarius Bakke <marius@gnu.org>2020-06-27 10:23:11 +0200
commit425fd7eb6a5f07eb9b854a5a29488e6f0b0acf3c (patch)
tree44479010890dd9aaf8bc52cab73f7c241a2fd9ea /gnu/packages/gdb.scm
parentfe9f2d150019b9fc17f08f5a002d7ca932fc3eb0 (diff)
parent88dbef3b9868a565da1eba37c9d409cce972becc (diff)
downloadguix-425fd7eb6a5f07eb9b854a5a29488e6f0b0acf3c.tar.gz
Merge branch 'master' into staging
Diffstat (limited to 'gnu/packages/gdb.scm')
-rw-r--r--gnu/packages/gdb.scm51
1 files changed, 37 insertions, 14 deletions
diff --git a/gnu/packages/gdb.scm b/gnu/packages/gdb.scm
index b27426c84f..38e45b14e5 100644
--- a/gnu/packages/gdb.scm
+++ b/gnu/packages/gdb.scm
@@ -4,6 +4,7 @@
 ;;; Copyright © 2015, 2016, 2019 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2020 Marius Bakke <mbakke@fastmail.com>
 ;;; Copyright © 2020 Vincent Legoll <vincent.legoll@gmail.com>
+;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -22,6 +23,7 @@
 
 (define-module (gnu packages gdb)
   #:use-module (gnu packages)
+  #:use-module (gnu packages hurd)
   #:use-module (gnu packages ncurses)
   #:use-module (gnu packages readline)
   #:use-module (gnu packages dejagnu)
@@ -68,12 +70,20 @@
                      #t))
                   (add-after
                    'install 'remove-libs-already-in-binutils
-                   (lambda* (#:key inputs outputs #:allow-other-keys)
+                   (lambda* (#:key inputs outputs
+                             ;; TODO: Inline the native-inputs addition and
+                             ;; below usage in the next rebuild cycle.
+                             ,@(if (%current-target-system)
+                                   '(native-inputs)
+                                   '())
+                             #:allow-other-keys)
                      ;; Like Binutils, GDB installs libbfd, libopcodes, etc.
                      ;; However, this leads to collisions when both are
                      ;; installed, and really is none of its business,
                      ;; conceptually.  So remove them.
-                     (let* ((binutils (assoc-ref inputs "binutils"))
+                     (let* ((binutils ,@(if (%current-target-system)
+                                            '((assoc-ref native-inputs "binutils"))
+                                            '((assoc-ref inputs "binutils"))))
                             (out      (assoc-ref outputs "out"))
                             (files1   (with-directory-excursion binutils
                                         (append (find-files "lib")
@@ -98,11 +108,15 @@
 
        ;; Allow use of XML-formatted syscall information.  This enables 'catch
        ;; syscall' and similar commands.
-       ("libxml2" ,libxml2)))
+       ("libxml2" ,libxml2)
+
+       ;; The Hurd needs -lshouldbeinlibc.
+       ,@(if (hurd-target?) `(("hurd" ,hurd)) '())))
     (native-inputs
       `(("texinfo" ,texinfo)
         ("dejagnu" ,dejagnu)
-        ("pkg-config" ,pkg-config)))
+        ("pkg-config" ,pkg-config)
+        ,@(if (hurd-target?) `(("mig" ,mig)) '())))
     (home-page "https://www.gnu.org/software/gdb/")
     (synopsis "The GNU debugger")
     (description
@@ -116,16 +130,16 @@ written in C, C++, Ada, Objective-C, Pascal and more.")
 ;; This version of GDB is required by some of the Rust compilers, see
 ;; <https://bugs.gnu.org/37810>.
 (define-public gdb-8.2
-  (package/inherit
-   gdb-9.1
-   (version "8.2.1")
-   (source (origin
-             (method url-fetch)
-             (uri (string-append "mirror://gnu/gdb/gdb-"
-                                 version ".tar.xz"))
-             (sha256
-              (base32
-               "00i27xqawjv282a07i73lp1l02n0a3ywzhykma75qg500wll6sha"))))))
+  (package
+    (inherit gdb-9.1)
+    (version "8.2.1")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "mirror://gnu/gdb/gdb-"
+                                  version ".tar.xz"))
+              (sha256
+               (base32
+                "00i27xqawjv282a07i73lp1l02n0a3ywzhykma75qg500wll6sha"))))))
 
 (define-public gdb
   ;; This is the fixed version that packages depend on.  Update it rarely
@@ -140,6 +154,15 @@ written in C, C++, Ada, Objective-C, Pascal and more.")
               (method url-fetch)
               (uri (string-append "mirror://gnu/gdb/gdb-"
                                   version ".tar.xz"))
+              (patches (search-patches "gdb-hurd.patch"))
               (sha256
                (base32
                 "0mf5fn8v937qwnal4ykn3ji1y2sxk0fa1yfqi679hxmpg6pdf31n"))))))
+
+(define-public gdb-minimal
+  (package/inherit
+   gdb-9.2
+   (name "gdb-minimal")
+   (inputs (fold alist-delete (package-inputs gdb)
+                 '("guile" "libxml2" "ncurses" "python-wrapper"
+                   "source-highlight")))))