Subject: [bug#65107] [PATCH] gnu: Add gf.

From: dan <[email-masked]>
Date: Sun, 6 Aug 2023 13:52:12 +0800

---
 gnu/packages/debug.scm | 56 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 56 insertions(+)

diff --git a/gnu/packages/debug.scm b/gnu/packages/debug.scm
index e2a29a3ae9..104ecc3091 100644
--- a/gnu/packages/debug.scm
+++ b/gnu/packages/debug.scm
@@ -13,6 +13,7 @@
 ;;; Copyright © 2022 Matthew James Kraai <[email-masked]>
 ;;; Copyright © 2023 Andy Tai <[email-masked]>
 ;;; Copyright © 2023 Ricardo Wurmus <[email-masked]>
+;;; Copyright © 2023 dan <[email-masked]>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -50,6 +51,7 @@ (define-module (gnu packages debug)
   #:use-module (gnu packages code)
   #:use-module (gnu packages compression)
   #:use-module (gnu packages flex)
+  #:use-module (gnu packages fontutils)
   #:use-module (gnu packages gdb)
   #:use-module (gnu packages glib)
   #:use-module (gnu packages gtk)
@@ -918,3 +920,57 @@ (define-public delve
     (synopsis "Debugger for the Go programming language")
     (description "Delve is a debugger for the Go programming language.")
     (license license:expat)))
+
+(define-public gf
+  (let ((commit "77a1f69204ceca5e62936976f97c62085a705126")
+        (revision "0"))
+    (package
+      (name "gf")
+      (version (git-version "0.0.0" revision commit))
+      (source (origin
+                (method git-fetch)
+                (uri (git-reference
+                      (url "https://github.com/nakst/gf")
+                      (commit commit)))
+                (sha256
+                 (base32
+                  "167ykfv7vf5vajxd5m3ggw4avpcim0i0bfmbxb495n8rgpaiizdy"))
+                (file-name (git-file-name name version))))
+      (build-system gnu-build-system)
+      (arguments
+       (list #:tests? #f ; no test
+             #:phases #~(modify-phases %standard-phases
+                          (delete 'configure)
+                          (replace 'build
+                            (lambda* _
+                              (invoke "g++"
+                                      "gf2.cpp"
+                                      "-o"
+                                      "gf2"
+                                      "-g"
+                                      "-O2"
+                                      "-lX11"
+                                      "-lfreetype"
+                                      "-pthread"
+                                      (string-append "-I"
+                                                     #$freetype
+                                                     "/include/freetype2")
+                                      "-DUI_FREETYPE"
+                                      "-DUI_NO_COLOR_PICKER"
+                                      "-DUI_SSE2"
+                                      "-Wall"
+                                      "-Wextra"
+                                      "-Wno-unused-parameter"
+                                      "-Wno-unused-result"
+                                      "-Wno-missing-field-initializers"
+                                      "-Wno-format-truncation")))
+                          (replace 'install
+                            (lambda* _
+                              (install-file "gf2"
+                                            (string-append #$output "/bin")))))))
+      (inputs (list libx11 libxext libxcursor freetype))
+      (propagated-inputs (list gdb))
+      (home-page "https://github.com/nakst/gf")
+      (synopsis "GDB frontend")
+      (description "A graphical GDB frontend for Linux.")
+      (license license:expat))))

base-commit: c4b9f726e3a1889b92a4b14a2af1c25f10798469
-- 
2.41.0