This is an automated email from the git hooks/post-receive script.
guix_mirror_bot pushed a commit to branch master
in repository guix.
The following commit(s) were added to refs/heads/master by this push:
new 20810ace0e Reapply "gnu: gdb: Enable scripting when cross compiling."
20810ace0e is described below
commit 20810ace0e261713457f8718dac990d4c6f9ccae
Author: Yelninei <[email protected]>
AuthorDate: Mon Jan 26 12:41:33 2026 +0000
Reapply "gnu: gdb: Enable scripting when cross compiling."
This reverts commit 64429ac5864d68d3ef066f4533a07ce32adc4f87.
* gnu/packages/gdb.scm (gdb-14)[native-inputs]: Only add guile when
cross-compiling.
(gdb/pinned): Keep old configure-flags to prevent rebuild.
Change-Id: I9c207f1071bbe97b9ca4a86abd77a86f46f84757
Signed-off-by: Efraim Flashner <[email protected]>
---
gnu/packages/gdb.scm | 50 +++++++++++++++++++++++++++++++++++++++++++++++---
1 file changed, 47 insertions(+), 3 deletions(-)
diff --git a/gnu/packages/gdb.scm b/gnu/packages/gdb.scm
index d6757adee0..8d3c26639e 100644
--- a/gnu/packages/gdb.scm
+++ b/gnu/packages/gdb.scm
@@ -48,6 +48,26 @@
#:use-module ((guix build utils) #:select (alist-replace))
#:use-module (srfi srfi-1))
+
+(define (gdb-python-config pkg-config)
+ "Return a script to satisfy gdb to enable python support."
+ ;; based on
https://www.sourceware.org/gdb/wiki/CrossCompilingWithPythonSupport
+ (program-file "gdb-python-config"
+ #~(begin
+ (use-modules (ice-9 match))
+ (let ((pkg-config #$pkg-config))
+ (match (command-line)
+ ((_ _ "--includes")
+ (execlp pkg-config pkg-config
+ "python3-embed" "--cflags"))
+ ((_ _ "--ldflags")
+ (execlp pkg-config pkg-config
+ "python3-embed" "--libs"))
+ ((_ _ "--exec-prefix")
+ (execlp pkg-config pkg-config
+ "python3-embed" "--variable=exec_prefix"))
+ (_ (exit 1)))))))
+
(define-public gdb-14
(package
(name "gdb")
@@ -67,9 +87,16 @@
#:out-of-source? #t
#:modules `((srfi srfi-1)
,@%default-gnu-modules)
- #:configure-flags (if (target-hurd64?)
- #~'("--enable-targets=i586-pc-gnu,x86_64-pc-gnu")
- #~'())
+ #:configure-flags
+ #~(list
+ #$@(if (and (this-package-input "python-wrapper")
+ (%current-target-system))
+ #~((string-append "--with-python="
+ #+(gdb-python-config
(pkg-config-for-target))))
+ #~())
+ #$@(if (target-hurd64?)
+ #~("--enable-targets=i586-pc-gnu,x86_64-pc-gnu")
+ #~()))
#:phases #~(modify-phases %standard-phases
;; The following phase only applies to gdb@12, which
;; inherits from this package. Remove it when removing
@@ -81,6 +108,13 @@
(("aarch64_get_CPSR_bits \\(sim_cpu \\*,
uint32_t\\)")
"aarch64_get_CPSR_bits (sim_cpu *,
FlagMask)")))))
#~())
+ #$@(if (%current-target-system)
+ #~((add-after 'unpack 'enable-guile
+ (lambda* (#:key native-inputs
#:allow-other-keys)
+ (setenv "ac_cv_guild_program_name" (which
"guild"))
+ (setenv "ac_cv_path_pkg_config_prog_path"
+ (which #$(pkg-config-for-target))))))
+ #~())
(add-after 'unpack 'patch-paths
(lambda* (#:key inputs #:allow-other-keys)
(let ((sh (string-append (assoc-ref inputs "bash")
@@ -136,6 +170,9 @@
`(("texinfo" ,texinfo)
("dejagnu" ,dejagnu)
("pkg-config" ,pkg-config)
+ ,@(if (%current-target-system)
+ `(("guile" ,guile-3.0))
+ '())
,@(if (target-hurd?)
;; When cross-compiling from x86_64-linux, make sure to use a
;; 32-bit MiG because we assume target i586-pc-gnu.
@@ -172,6 +209,13 @@ written in C, C++, Ada, Objective-C, Pascal and more.")
(sha256
(base32
"1vczsqcbh5y0gx7qrclpna0qzx26sk7lra6y8qzxam1biyzr65qf"))))
+ ;; TODO: Remove this when updating gdb/pinned.
+ (arguments
+ (substitute-keyword-arguments (package-arguments gdb-14)
+ ((#:configure-flags flags '())
+ (if (target-hurd64?)
+ #~'("--enable-targets=i586-pc-gnu,x86_64-pc-gnu")
+ #~'()))))
(properties `((hidden? . #t)))))
(define-public gdb-15