Subject: bug#56474: closed ([PATCH] gnu: Add goawk.)

From: [email-masked] (GNU bug Tracking System)
Date: Wed, 14 Aug 2024 08:47:02 +0000

Your bug report

#56474: [PATCH] gnu: Add goawk.

which was filed against the guix-patches package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
56474: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=56474
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: [PATCH] gnu: Add goawk.
From: Sharlatan Hellseher <[email-masked]>
To: [email-masked]
Date: Wed, 14 Aug 2024 09:44:41 +0100
List-Id: <debbugs-submit.debbugs.gnu.org>

Hi,

I've picked up some ideas from the recent patch with
<https://issues.guix.gnu.org/72595> and from the way how it's packed in
NixOS
<https://github.com/NixOS/nixpkgs/blob/nixos-24.05/pkgs/tools/text/goawk/default.nix#L37>.

- Copyright for both patches reserved
- Package does not depend on gawk
- Failing tests are silent
- Tests do no change existing files
- All artifacts are removed after check phase

--
Oleg

Subject: [PATCH] gnu: Add goawk.
From: "Paul A. Patience" <[email-masked]>
To: [email-masked]
Cc: "Paul A. Patience" <[email-masked]>
Date: Sun, 10 Jul 2022 01:58:41 +0000
List-Id: <debbugs-submit.debbugs.gnu.org>

* gnu/packages/gawk.scm (goawk): New variable.
---
 gnu/packages/gawk.scm | 41 ++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 40 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/gawk.scm b/gnu/packages/gawk.scm
index 9feaf059fb..9bc96d87e7 100644
--- a/gnu/packages/gawk.scm
+++ b/gnu/packages/gawk.scm
@@ -33,7 +33,8 @@ (define-module (gnu packages gawk)
   #:use-module (guix git-download)
   #:use-module (guix utils)
   #:use-module (guix build-system copy)
-  #:use-module (guix build-system gnu))
+  #:use-module (guix build-system gnu)
+  #:use-module (guix build-system go))

 (define-public gawk
   (package
@@ -245,3 +246,41 @@ (define-public cppawk-egawk
        (delete "gawk-mpfr")
        (prepend egawk-next)))
     (synopsis "cppawk that calls Enhanced GNU Awk by default")))
+
+(define-public goawk
+  (package
+    (name "goawk")
+    (version "1.19.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/benhoyt/goawk")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "12z7nzrqyx0y18bsc95i1vp251jw3ik2xj5g8bc12vybndw5x0j0"))))
+    (build-system go-build-system)
+    (arguments
+     '(#:import-path "github.com/benhoyt/goawk"
+       #:install-source? #f
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'fix-paths
+           (lambda _
+             (substitute* "src/github.com/benhoyt/goawk/interp/interp.go"
+               (("/bin/sh") (which "sh")))
+             (substitute* "src/github.com/benhoyt/goawk/goawk_test.go"
+               (("/bin/sh") (which "sh")))))
+         (add-after 'fix-paths 'fix-tests
+           (lambda _
+             (substitute* "src/github.com/benhoyt/goawk/goawk_test.go"
+               ;; Don't write test output; it is compared with expected
+               ;; results anyway.
+               (("\"writegoawk\", true") "\"writegoawk\", false")))))))
+    (home-page "https://github.com/benhoyt/goawk")
+    (synopsis "Awk interpreter with CSV support")
+    (description
+     "GoAWK is a POSIX-compatible version of Awk that also has a CSV mode for
+reading and writing CSV and TSV files.")
+    (license license:expat)))
--
2.36.1