diff mbox series

[bug#54052] gnu: cgdb: Reference gdb

Message ID 20220306062434.17898-1-chadwainholness@gmail.com
State Accepted
Headers show
Series [bug#54052] gnu: cgdb: Reference gdb | expand

Checks

Context Check Description
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch success View Laminar job
cbaines/issue success View issue

Commit Message

Chadwain Holness March 6, 2022, 6:24 a.m. UTC
Hello Ludovic,

I was able to compile cgdb natively and cross with the following patch.

Cheers,
Chadwain

* gnu/packages/debug.scm (cgdb)[inputs]: Add gdb, bash-minimal
[arguments]: Add phase to fix hardcoded gdb and sh paths
Add configure flags for cross-compilation
---
 gnu/packages/debug.scm | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

Comments

Ludovic Courtès March 6, 2022, 9:13 p.m. UTC | #1
Hi Chadwain,

Chadwain Holness <chadwainholness@gmail.com> skribis:

> Hello Ludovic,
>
> I was able to compile cgdb natively and cross with the following patch.
>
> Cheers,
> Chadwain
>
> * gnu/packages/debug.scm (cgdb)[inputs]: Add gdb, bash-minimal
> [arguments]: Add phase to fix hardcoded gdb and sh paths
> Add configure flags for cross-compilation

Perfect, applied!

Thanks,
Ludo’.
diff mbox series

Patch

diff --git a/gnu/packages/debug.scm b/gnu/packages/debug.scm
index 24d17d95b0..63e5553484 100644
--- a/gnu/packages/debug.scm
+++ b/gnu/packages/debug.scm
@@ -760,9 +760,25 @@  (define-public cgdb
         (base32 "1w8ib2vg3pg68d9hh97fw5042c73i9nqavdddc87n9bpscjbaf0d"))))
     (build-system gnu-build-system)
     (inputs
-     (list ncurses readline))
+     (list bash-minimal ncurses readline gdb))
     (native-inputs
      (list flex texinfo))
+    (arguments
+     `(#:configure-flags
+        (list
+          (string-append "ac_cv_rl_version=" ,(package-version readline))
+          "ac_cv_file__dev_ptmx=no"
+          "ac_cv_file__proc_self_status=no"
+          "ac_cv_func_setpgrp_void=no")
+       #:phases
+       (modify-phases %standard-phases
+        (add-after 'unpack 'fix-paths
+         (lambda* (#:key inputs #:allow-other-keys)
+          (let ((gdb (search-input-file inputs "bin/gdb"))
+                (sh (search-input-file inputs "bin/sh")))
+           (substitute* "lib/util/fork_util.cpp"
+            (("GDB = \"gdb\"") (string-append "GDB = \"" gdb "\"")))
+           (substitute* "cgdb/cgdb.cpp" (("/bin/sh") sh))))))))
     (home-page "https://cgdb.github.io")
     (synopsis "Console front-end to the GNU debugger")
     (description