guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

376/401: gnu: Add go-github-com-knz-go-libedit.


From: guix-commits
Subject: 376/401: gnu: Add go-github-com-knz-go-libedit.
Date: Thu, 26 Dec 2024 19:31:29 -0500 (EST)

sharlatan pushed a commit to branch go-team
in repository guix.

commit 837dc970775d0d2172db3310a846fdd34ff0728d
Author: Sharlatan Hellseher <sharlatanus@gmail.com>
AuthorDate: Thu Dec 26 17:45:40 2024 +0000

    gnu: Add go-github-com-knz-go-libedit.
    
    * gnu/packages/golang-xyz.scm (go-github-com-knz-go-libedit): New variable.
    
    Change-Id: I4c482205e86035f21552dbbd2a2e7f39e543fd50
---
 gnu/packages/golang-xyz.scm | 39 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 39 insertions(+)

diff --git a/gnu/packages/golang-xyz.scm b/gnu/packages/golang-xyz.scm
index de2eb02af4..f17f97a539 100644
--- a/gnu/packages/golang-xyz.scm
+++ b/gnu/packages/golang-xyz.scm
@@ -91,6 +91,7 @@
   #:use-module (gnu packages golang-crypto)
   #:use-module (gnu packages golang-maths)
   #:use-module (gnu packages golang-web)
+  #:use-module (gnu packages libedit)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages specifications)
   #:use-module (gnu packages xdisorg)
@@ -6657,6 +6658,44 @@ very eas to use.")
      (list
       #:import-path "github.com/klauspost/cpuid/v2"))))
 
+(define-public go-github-com-knz-go-libedit
+  (package
+    (name "go-github-com-knz-go-libedit")
+    (version "1.10.1")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/knz/go-libedit";)
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "04a5ryzldsk7agybcz4rpd7g1v5vh7smawlky58bwj0341083p44"))))
+    (build-system go-build-system)
+    (arguments
+     (list
+      #:import-path "github.com/knz/go-libedit"
+      #:phases
+      #~(modify-phases %standard-phases
+          ;; These steps are taken from the project's README.
+          (add-after 'unpack 'use-system-wide-libedit
+            (lambda* (#:key tests? import-path #:allow-other-keys)
+              (with-directory-excursion (string-append "src/" import-path)
+                (substitute* "unix/editline_unix.go"
+                  ((".*#cgo linux CFLAGS.*") "")
+                  (("#cgo linux CPPFLAGS.*")
+                   (string-append "#cgo linux CPPFLAGS: -I"
+                                  #$(this-package-input "libedit")
+                                  "/include -Ishim\n"))
+                  (("#cgo linux LDFLAGS.*") "#cgo linux LDFLAGS: 
-ledit\n"))))))))
+    (inputs
+     (list libedit))
+    (home-page "https://github.com/knz/go-libedit";)
+    (synopsis "Go wrapper around @code{libedit}")
+    (description
+     "This packae provides a wrapper around @code{libedit} for Golang.")
+     (license license:asl2.0)))
+
 (define-public go-github-com-kpango-glg
   (package
     (name "go-github-com-kpango-glg")



reply via email to

[Prev in Thread] Current Thread [Next in Thread]