guix-commits
[Top][All Lists]
Advanced

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

branch master updated: gnu: Add go-github-com-creack-pty.


From: guix-commits
Subject: branch master updated: gnu: Add go-github-com-creack-pty.
Date: Thu, 10 Nov 2022 23:18:09 -0500

This is an automated email from the git hooks/post-receive script.

raghavgururajan pushed a commit to branch master
in repository guix.

The following commit(s) were added to refs/heads/master by this push:
     new a6d2ae431a gnu: Add go-github-com-creack-pty.
a6d2ae431a is described below

commit a6d2ae431a900b986eb87cfafb4465269504c211
Author: (unmatched-parenthesis <paren@disroot.org>
AuthorDate: Fri Oct 21 22:10:57 2022 +0100

    gnu: Add go-github-com-creack-pty.
    
    * gnu/packages/golang.scm (go-github-com-creack-pty): New variable.
    * guix/build-system/go.scm (go-target): Add to exported variables.
    
    Signed-off-by: Raghav Gururajan <rg@raghavgururajan.name>
---
 gnu/packages/golang.scm  | 47 +++++++++++++++++++++++++++++++++++++++++++++++
 guix/build-system/go.scm |  1 +
 2 files changed, 48 insertions(+)

diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
index e52161228e..2d842cf7be 100644
--- a/gnu/packages/golang.scm
+++ b/gnu/packages/golang.scm
@@ -10382,6 +10382,53 @@ using shell-style rules for quoting and commenting.")
 email library.")
     (license license:gpl3+)))
 
+(define-public go-github-com-creack-pty
+  (package
+    (name "go-github-com-creack-pty")
+    (version "1.1.18")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/creack/pty";)
+                    (commit (string-append "v" version))))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "1qqhcgfym0napz8damj7dhfw28g2qn2f5h3lr93i0sxawq926yzc"))))
+    (build-system go-build-system)
+    (arguments
+     (list #:import-path "github.com/creack/pty"
+           #:modules '((ice-9 popen)
+                       (ice-9 textual-ports)
+                       (guix build go-build-system)
+                       (guix build utils))
+           #:phases
+           #~(modify-phases %standard-phases
+               (add-after 'unpack 'regenerate-types
+                 (lambda* (#:key import-path #:allow-other-keys)
+                   ;; Generated files are included (ztypes_*). We need to 
remake
+                   ;; them with Cgo.
+                   (with-directory-excursion (string-append "src/" import-path)
+                     (let* ((go-arch
+                             #$(car (go-target
+                                     (or (%current-target-system)
+                                         (nix-system->gnu-triplet 
(%current-system))))))
+                            (file (string-append "ztypes_" go-arch ".go"))
+                            (pipe (open-input-pipe "go tool cgo -godefs 
types.go"))
+                            (text (get-string-all pipe)))
+                       (close-pipe pipe)
+                       (for-each delete-file
+                         (find-files (getcwd) (file-name-predicate
+                                               "ztypes_[a-zA-Z0-9_]+.go")))
+                       (call-with-output-file file
+                         (lambda (port)
+                           (display text port))))))))))
+    (home-page "https://github.com/creack/pty";)
+    (synopsis "Pseudoterminal handling in Go")
+    (description
+     "The pty package provides functions for working with Unix 
pseudoterminals.")
+    (license license:expat)))
+
 ;;;
 ;;; Avoid adding new packages to the end of this file. To reduce the chances
 ;;; of a merge conflict, place them above by existing packages with similar
diff --git a/guix/build-system/go.scm b/guix/build-system/go.scm
index 4b3b67b08f..0a9761aac7 100644
--- a/guix/build-system/go.scm
+++ b/guix/build-system/go.scm
@@ -38,6 +38,7 @@
             go-build-system
 
             go-pseudo-version?
+            go-target
             go-version->git-ref))
 
 ;; Commentary:



reply via email to

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