gnu: Add ronn-ng
[jackhill/guix/guix.git] / gnu / packages / gdb.scm
index e9df33e..8301217 100644 (file)
@@ -1,7 +1,10 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2013, 2014, 2015, 2019, 2020 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
-;;; Copyright © 2015, 2016 Efraim Flashner <efraim@flashner.co.il>
+;;; 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.
 ;;;
@@ -20,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)
   #:use-module (gnu packages multiprecision)
   #:use-module (gnu packages xml)
   #:use-module (gnu packages guile)
+  #:use-module (gnu packages pretty-print)
   #:use-module (gnu packages python)
   #:use-module (gnu packages pkg-config)
   #:use-module ((guix licenses) #:select (gpl3+))
   #:use-module (guix packages)
   #:use-module (guix download)
-  #:use-module (guix build-system gnu))
+  #:use-module (guix build-system gnu)
+  #:use-module (srfi srfi-1))
 
-(define-public gdb
+(define-public gdb-9.1
   (package
     (name "gdb")
-    (version "8.2.1")
+    (version "9.1")
     (source (origin
              (method url-fetch)
              (uri (string-append "mirror://gnu/gdb/gdb-"
                                  version ".tar.xz"))
              (sha256
               (base32
-               "00i27xqawjv282a07i73lp1l02n0a3ywzhykma75qg500wll6sha"))))
+               "0dqp1p7w836iwijg1zb4a784n0j4pyjiw5v6h8fg5lpx6b40x7k9"))))
+
     (build-system gnu-build-system)
     (arguments
      `(#:tests? #f ; FIXME "make check" fails on single-processor systems.
 
+       #:out-of-source? #t
+
        #:modules ((srfi srfi-1)
                   ,@%gnu-build-system-modules)
 
                      #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")
        ("readline" ,readline)
        ("ncurses" ,ncurses)
        ("guile" ,guile-2.0)
-       ("python" ,python)
        ("python-wrapper" ,python-wrapper)
-       ("dejagnu" ,dejagnu)
+       ("source-highlight" ,source-highlight)
 
        ;; 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)
-        ("pkg-config" ,pkg-config)))
+        ("dejagnu" ,dejagnu)
+        ("pkg-config" ,pkg-config)
+        ,@(if (hurd-target?) `(("mig" ,mig)) '())))
     (home-page "https://www.gnu.org/software/gdb/")
     (synopsis "The GNU debugger")
     (description
@@ -105,3 +126,42 @@ to specify the runtime conditions, to define breakpoints, and to change how
 the program is running to try to fix bugs.  It can be used to debug programs
 written in C, C++, Ada, Objective-C, Pascal and more.")
     (license gpl3+)))
+
+;; 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"))))))
+
+(define-public gdb
+  ;; This is the fixed version that packages depend on.  Update it rarely
+  ;; enough to avoid massive rebuilds.
+  gdb-9.1)
+
+(define-public gdb-9.2
+  (package
+    (inherit gdb)
+    (version "9.2")
+    (source (origin
+              (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)
+                 '("libxml2" "ncurses" "python-wrapper" "source-highlight")))))