summary refs log tree commit diff
path: root/gnu/packages/gdb.scm
diff options
context:
space:
mode:
authorJan (janneke) Nieuwenhuizen <janneke@gnu.org>2021-11-21 22:24:24 +0100
committerJan (janneke) Nieuwenhuizen <janneke@gnu.org>2021-11-21 22:27:14 +0100
commitb1fd9531149b94a7e7cdabc67b08ea6a47b03d3d (patch)
treed0d8532a2f53d8f9fa8be6fdd24be6d8a577cae3 /gnu/packages/gdb.scm
parentddbc3a6f4ca2605d8102aa659389300f97d715ac (diff)
downloadguix-b1fd9531149b94a7e7cdabc67b08ea6a47b03d3d.tar.gz
gnu: gdb: Build fix for the Hurd.
This allows (cross-)building gdb-minimal for the Hurd.

* gnu/packages/patches/gdb-fix-gnu-nat-build.patch: New file, taken from
upstream.
* gnu/local.mk (dist_patch_DATA): Add it.
* gnu/packages/web.scm (gdb)[inputs]: When building for the Hurd, add it.
[arguments]: When building for the Hurd, apply it.
Diffstat (limited to 'gnu/packages/gdb.scm')
-rw-r--r--gnu/packages/gdb.scm14
1 files changed, 12 insertions, 2 deletions
diff --git a/gnu/packages/gdb.scm b/gnu/packages/gdb.scm
index 9036d496a3..aa9e479e46 100644
--- a/gnu/packages/gdb.scm
+++ b/gnu/packages/gdb.scm
@@ -4,7 +4,7 @@
 ;;; Copyright © 2015, 2016, 2019, 2021 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>
+;;; Copyright © 2020, 2021 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
 ;;; Copyright © 2020, 2021 Maxim Cournoyer <maxim.cournoyer@gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
@@ -71,6 +71,12 @@
                                        "gdbsupport/pathstuff.cc")
                           (("\"/bin/sh\"")
                            (format #f "~s" sh))))))
+                  ,@(if (hurd-target?)
+                        '((add-after 'unpack 'patch-gdb/hurd
+                            (lambda* (#:key inputs #:allow-other-keys)
+                              (let ((patch (assoc-ref inputs "hurd-build.patch")))
+                                (invoke "patch" "-p1" "--force" "-i" patch)))))
+                        '())
                   (add-after 'configure 'post-configure
                     (lambda _
                       (for-each patch-makefile-SHELL
@@ -111,7 +117,11 @@
        ("libxml2" ,libxml2)
 
        ;; The Hurd needs -lshouldbeinlibc.
-       ,@(if (hurd-target?) `(("hurd" ,hurd)) '())))
+       ,@(if (hurd-target?)
+             `(("hurd" ,hurd)
+               ("hurd-build.patch"
+                ,(search-patch "gdb-fix-gnu-nat-build.patch")))
+             '())))
     (native-inputs
      `(("texinfo" ,texinfo)
        ("dejagnu" ,dejagnu)