From patchwork Wed Aug 3 12:04:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "\\(" X-Patchwork-Id: 41126 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id E8D4A27BBEB; Wed, 3 Aug 2022 13:07:57 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 1C68127BBE9 for ; Wed, 3 Aug 2022 13:07:57 +0100 (BST) Received: from localhost ([::1]:33918 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oJDAK-0008AF-7i for patchwork@mira.cbaines.net; Wed, 03 Aug 2022 08:07:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58502) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oJD9X-00087c-Dx for guix-patches@gnu.org; Wed, 03 Aug 2022 08:07:07 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:56694) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oJD9X-0003B9-4H for guix-patches@gnu.org; Wed, 03 Aug 2022 08:07:07 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oJD9X-00035b-0d for guix-patches@gnu.org; Wed, 03 Aug 2022 08:07:07 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#56914] [PATCH 02/41] gnu: Add go-github-com-creack-pty. Resent-From: "(" Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 03 Aug 2022 12:07:06 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 56914 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 56914@debbugs.gnu.org Cc: "\(unmatched-parenthesis" X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.165952839211388 (code B ref -1); Wed, 03 Aug 2022 12:07:06 +0000 Received: (at submit) by debbugs.gnu.org; 3 Aug 2022 12:06:32 +0000 Received: from localhost ([127.0.0.1]:46351 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oJD8x-0002xX-Nr for submit@debbugs.gnu.org; Wed, 03 Aug 2022 08:06:32 -0400 Received: from lists.gnu.org ([209.51.188.17]:49174) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oJD8q-0002vt-HO for submit@debbugs.gnu.org; Wed, 03 Aug 2022 08:06:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57836) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oJD8q-0007p6-CL for guix-patches@gnu.org; Wed, 03 Aug 2022 08:06:24 -0400 Received: from knopi.disroot.org ([178.21.23.139]:44430) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oJD8n-0002yx-R1 for guix-patches@gnu.org; Wed, 03 Aug 2022 08:06:24 -0400 Received: from localhost (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id A3E3B40F38; Wed, 3 Aug 2022 14:06:20 +0200 (CEST) X-Virus-Scanned: SPAM Filter at disroot.org Received: from knopi.disroot.org ([127.0.0.1]) by localhost (disroot.org [127.0.0.1]) (amavisd-new, port 10024) with UTF8SMTP id qNtVnZvawr94; Wed, 3 Aug 2022 14:06:19 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1659528285; bh=paC15r+vccyZeKIKe7mCIvYyLjnsjYVD+VeozWpRtPQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=ZYHXuUlZdg0xsDyVtpZHnIwKSKHmimk/q7GDeP1IgvQAcN7PqE2IfkhZBvtDrjDcv tAEiVBTqI0wJiR0y4LLNdiajSd2pZoEVSUZmBDu5D6D+76gy7C//RespN267yUMcVE tPMUuTTTka0fV/F0wE3dciOl9AqutKHSx/MNI6vUIJgauTs5NOlTTJkapy7B7gnDF7 F7L1ytR8nj2vrfkuXKeSRM0GAWTq/8iFejzcl/ErZJEmlSgfwVucE/u1lj/oqD2qwM dzjeytiRC+7U4+3fSwJBJy/m27Uq1Yw1ipll5p1CJh9Oaj2XwrOCVcRCS3OHS5kL5o fTqf3xa9JD7DA== Date: Wed, 3 Aug 2022 13:04:00 +0100 Message-Id: <20220803120439.5108-2-paren@disroot.org> In-Reply-To: <20220803120439.5108-1-paren@disroot.org> References: <20220803120439.5108-1-paren@disroot.org> Mime-Version: 1.0 Received-SPF: pass client-ip=178.21.23.139; envelope-from=paren@disroot.org; helo=knopi.disroot.org X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" Reply-to: "\(" X-ACL-Warn: , "\( via Guix-patches" X-Patchwork-Original-From: "\( via Guix-patches" via From: "\\(" X-getmail-retrieved-from-mailbox: Patches From: "(unmatched-parenthesis" * 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: