GNU bug report logs - #56474
[PATCH] gnu: Add goawk.

Previous Next

Package: guix-patches;

Reported by: "Paul A. Patience" <paul <at> apatience.com>

Date: Sun, 10 Jul 2022 02:00:02 UTC

Severity: normal

Tags: moreinfo, patch

Done: Sharlatan Hellseher <sharlatanus <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 56474 in the body.
You can then email your comments to 56474 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#56474; Package guix-patches. (Sun, 10 Jul 2022 02:00:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to "Paul A. Patience" <paul <at> apatience.com>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Sun, 10 Jul 2022 02:00:02 GMT) Full text and rfc822 format available.

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

From: "Paul A. Patience" <paul <at> apatience.com>
To: guix-patches <at> gnu.org
Cc: "Paul A. Patience" <paul <at> apatience.com>
Subject: [PATCH] gnu: Add goawk.
Date: Sun, 10 Jul 2022 01:58:41 +0000
* 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






Information forwarded to guix-patches <at> gnu.org:
bug#56474; Package guix-patches. (Mon, 11 Jul 2022 12:18:01 GMT) Full text and rfc822 format available.

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

From: "Paul A. Patience" <paul <at> apatience.com>
To: 56474 <at> debbugs.gnu.org
Subject: [PATCH] gnu: Add goawk.
Date: Mon, 11 Jul 2022 12:17:36 +0000
Don't merge this yet, I need to apply some changes.

GoAWK also exposes a Go package, so I need to remove the
‘#:install-source #f’ line.
However, how should I go about naming the package (or packages)?

The Go library should be go-github-com-benhoyt-goawk (in
gnu/packages/golang.scm), but should there be an additional package
named just goawk for the command itself that goes in
gnu/packages/gawk.scm?

Thanks,
Paul





Information forwarded to guix-patches <at> gnu.org:
bug#56474; Package guix-patches. (Tue, 19 Jul 2022 21:04:01 GMT) Full text and rfc822 format available.

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

From: Ludovic Courtès <ludo <at> gnu.org>
To: "Paul A. Patience" <paul <at> apatience.com>
Cc: 56474 <at> debbugs.gnu.org
Subject: Re: bug#56474: [PATCH] gnu: Add goawk.
Date: Tue, 19 Jul 2022 23:03:24 +0200
Hi,

"Paul A. Patience" <paul <at> apatience.com> skribis:

> Don't merge this yet, I need to apply some changes.
>
> GoAWK also exposes a Go package, so I need to remove the
> ‘#:install-source #f’ line.
> However, how should I go about naming the package (or packages)?
>
> The Go library should be go-github-com-benhoyt-goawk (in
> gnu/packages/golang.scm), but should there be an additional package
> named just goawk for the command itself that goes in
> gnu/packages/gawk.scm?

Maybe leave ‘goawk’ in golang.scm so that gawk.scm doesn’t pull in all
of Go?

Thanks,
Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#56474; Package guix-patches. (Wed, 20 Jul 2022 13:36:02 GMT) Full text and rfc822 format available.

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

From: Maxime Devos <maximedevos <at> telenet.be>
To: "Paul A. Patience" <paul <at> apatience.com>, 56474 <at> debbugs.gnu.org
Subject: Re: [bug#56474] [PATCH] gnu: Add goawk.
Date: Wed, 20 Jul 2022 15:34:59 +0200
[Message part 1 (text/plain, inline)]
On 10-07-2022 03:58, Paul A. Patience wrote:
> * 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")))

What Ludo wrote about not making the module graph more cyclic than it 
already is with all that entails, and ...

> +(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")))))

... these two can be combined, substitute* accepts a list of files, it's 
not restricted to a single file.

Also, this which seems incorrect when cross-compiling, do 
(search-input-file inputs "bin/sh") instead and add 'bash-minimal' (or 
'bash'?) to inputs, so you get the cross-compiled bash instead of the 
native bash (for the goawk_test.go, it probably doesn't matter, but it's 
important for interp.go).

Greetings,
Maxime.
[OpenPGP_0x49E3EE22191725EE.asc (application/pgp-keys, attachment)]
[OpenPGP_signature (application/pgp-signature, attachment)]

Added tag(s) moreinfo. Request was from Ludovic Courtès <ludo <at> gnu.org> to control <at> debbugs.gnu.org. (Wed, 03 Aug 2022 10:06:02 GMT) Full text and rfc822 format available.

Reply sent to Sharlatan Hellseher <sharlatanus <at> gmail.com>:
You have taken responsibility. (Wed, 14 Aug 2024 08:47:02 GMT) Full text and rfc822 format available.

Notification sent to "Paul A. Patience" <paul <at> apatience.com>:
bug acknowledged by developer. (Wed, 14 Aug 2024 08:47:02 GMT) Full text and rfc822 format available.

Message #21 received at 56474-done <at> debbugs.gnu.org (full text, mbox):

From: Sharlatan Hellseher <sharlatanus <at> gmail.com>
To: 56474-done <at> debbugs.gnu.org
Subject: [PATCH] gnu: Add goawk.
Date: Wed, 14 Aug 2024 09:44:41 +0100
[Message part 1 (text/plain, inline)]
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
[signature.asc (application/pgp-signature, inline)]

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 11 Sep 2024 11:24:12 GMT) Full text and rfc822 format available.

This bug report was last modified 183 days ago.

Previous Next


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