[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug#55903] [PATCH v2 02/35] gnu: Add go-github-com-creack-pty.
From: |
( |
Subject: |
[bug#55903] [PATCH v2 02/35] gnu: Add go-github-com-creack-pty. |
Date: |
Mon, 13 Jun 2022 07:56:01 +0100 |
From: "(unmatched-parenthesis" <paren@disroot.org>
* gnu/packages/golang.scm (go-github-com-creack-pty): New variable.
---
gnu/packages/golang.scm | 63 +++++++++++++++++++++++++++++++++++++++++
1 file changed, 63 insertions(+)
diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
index 6f1ed9eda2..50b7ac2e23 100644
--- a/gnu/packages/golang.scm
+++ b/gnu/packages/golang.scm
@@ -86,6 +86,23 @@ (define-module (gnu packages golang)
#:use-module (ice-9 match)
#:use-module (srfi srfi-1))
+(define (gnu-triplet->go-architecture target)
+ (letrec-syntax
+ ((matches (syntax-rules (=>)
+ ((_ (target-prefix => architecture) rest ...)
+ (if (string-prefix? target-prefix target)
+ architecture
+ (matches rest ...)))
+ ((_) (error "unsupported target" target)))))
+ (matches ("x86_64" => "amd64")
+ ("i686" => "386")
+ ("aarch64" => "arm64")
+ ("arm" => "arm")
+ ("powerpc64le" => "ppc64le")
+ ("powerpc" => "ppc")
+ ("mips64el" => "mips64le")
+ ("riscv64" => "riscv64"))))
+
;; According to https://golang.org/doc/install/gccgo, gccgo-4.8.2 includes a
;; complete go-1.1.2 implementation, gccgo-4.9 includes a complete go-1.2
;; implementation, and gccgo-5 a complete implementation of go-1.4. Ultimately
@@ -9862,3 +9879,49 @@ (define-public go-github-com-zenhack-go-notmuch
(description "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
+ #$(gnu-triplet->go-architecture
+ (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")))
+ (with-output-to-file file
+ (lambda () (display text))))))))))
+ (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)))
--
2.36.1
- [bug#55903] [PATCH 39/41] gnu: Add go-github-com-emersion-go-milter., (continued)
- [bug#55903] [PATCH 39/41] gnu: Add go-github-com-emersion-go-milter., (unmatched-parenthesis, 2022/06/11
- [bug#55903] [PATCH 40/41] gnu: Add go-github-com-emersion-go-msgauth-authres., (unmatched-parenthesis, 2022/06/11
- [bug#55903] [PATCH 30/41] gnu: Add go-github-com-protonmail-go-crypto-ocb., (unmatched-parenthesis, 2022/06/11
- [bug#55903] [PATCH 31/41] gnu: Add go-github-com-emersion-go-pgpmail., (unmatched-parenthesis, 2022/06/11
- [bug#55903] [PATCH 32/41] gnu: Add go-github-com-emersion-go-smtp., (unmatched-parenthesis, 2022/06/11
- [bug#55903] [PATCH 34/41] gnu: Add go-github-com-arran4-golang-ical., (unmatched-parenthesis, 2022/06/11
- [bug#55903] Fwd: Re: [PATCHSET] Adding aerc, (, 2022/06/11
- [bug#55903] [PATCHSET] Adding aerc, Maxime Devos, 2022/06/11
- [bug#55903] [PATCH v2 01/35] gnu: Add go-github-com-zenhack-go-notmuch., (, 2022/06/13
- [bug#55903] [PATCH v2 02/35] gnu: Add go-github-com-creack-pty.,
( <=
- [bug#55903] [PATCH v2 04/35] gnu: Add go-github-com-xo-terminfo., (, 2022/06/13
- [bug#55903] [PATCH v2 03/35] gnu: Add go-google-golang-org-protobuf., (, 2022/06/13
- [bug#55903] [PATCH v2 06/35] gnu: Add go-github-com-miolini-datacounter., (, 2022/06/13
- [bug#55903] [PATCH v2 11/35] gnu: Add go-github-com-rivo-tview., (, 2022/06/13
- [bug#55903] [PATCH v2 07/35] gnu: Add go-github-com-kyoh86-xdg., (, 2022/06/13
- [bug#55903] [PATCH v2 10/35] gnu: Add go-github-com-rivo-uniseg., (, 2022/06/13
- [bug#55903] [PATCH v2 09/35] gnu: Add go-github-com-lucasb-eyer-go-colorful., (, 2022/06/13
- [bug#55903] [PATCH v2 08/35] gnu: Add go-github-com-go-ini-ini., (, 2022/06/13