GNU bug report logs - #56914
[PATCH 02/41] gnu: Add go-github-com-creack-pty.

Previous Next

Package: guix-patches;

Reported by: "(" <paren <at> disroot.org>

Date: Wed, 3 Aug 2022 12:07:06 UTC

Severity: normal

Tags: patch

Merged with 56909, 56910, 56911, 56912, 56913, 56915, 56916, 56917, 56918, 56919, 56920, 56921, 56922, 56923, 56924, 56925, 56926, 56927, 56928, 56929, 56930, 56931, 56932, 56933, 56934, 56935, 56936, 56937, 56938, 56939, 56940, 56941, 56942, 56943, 56944, 56945, 56946, 56947, 56948, 56949

Fixed in versions 56914, 56910, 56911, 56912, 56913, 56915, 56916, 56917, 56918, 56919, 56920, 56921, 56922, 56923, 56924, 56925, 56926, 56927, 56928, 56934, 56930, 56929, 56931, 56933, 56936, 56935, 56932, 56941, 56938, 56939, 56937, 56942, 56940, 56943, 56944, 56945, 56946, 56947, 56948, 56949

Done: "(" <paren <at> disroot.org>

Bug is archived. No further changes may be made.

Full log


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: "(" <paren <at> disroot.org>
To: guix-patches <at> gnu.org
Cc: "\(unmatched-parenthesis" <paren <at> disroot.org>
Subject: [PATCH 02/41] gnu: Add go-github-com-creack-pty.
Date: Wed,  3 Aug 2022 13:04:00 +0100
From: "(unmatched-parenthesis" <paren <at> disroot.org>

* gnu/packages/golang.scm (go-github-com-creack-pty): New variable.
* guix/build-system/go.scm (go-target): Add to exported variables.
---
 gnu/packages/golang.scm  | 48 ++++++++++++++++++++++++++++++++++++++++
 guix/build-system/go.scm |  1 +
 2 files changed, 49 insertions(+)

diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
index 2842c7f481..ed6632a20d 100644
--- a/gnu/packages/golang.scm
+++ b/gnu/packages/golang.scm
@@ -58,6 +58,7 @@ (define-module (gnu packages golang)
   #:use-module (guix memoization)
   #:use-module ((guix build utils) #:select (alist-replace))
   #:use-module (guix download)
+  #:use-module (guix gexp)
   #:use-module (guix git-download)
   #:use-module (guix packages)
   #:use-module (guix build-system gnu)
@@ -9939,3 +9940,50 @@ (define-public go-github-com-zenhack-go-notmuch
      "The notmuch package provides a Go language binding to the notmuch
 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)))
diff --git a/guix/build-system/go.scm b/guix/build-system/go.scm
index 5e0e5bbad3..9e5f972c84 100644
--- a/guix/build-system/go.scm
+++ b/guix/build-system/go.scm
@@ -38,6 +38,7 @@ (define-module (guix build-system go)
             go-build-system
 
             go-pseudo-version?
+            go-target
             go-version->git-ref))
 
 ;; Commentary:
-- 
2.37.1





This bug report was last modified 2 years and 292 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.