all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [bug#56474] [PATCH] gnu: Add goawk.
@ 2022-07-10  1:58 Paul A. Patience
  2022-07-11 12:17 ` Paul A. Patience
  2022-07-20 13:34 ` Maxime Devos
  0 siblings, 2 replies; 4+ messages in thread
From: Paul A. Patience @ 2022-07-10  1:58 UTC (permalink / raw)
  To: 56474; +Cc: Paul A. Patience

* 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






^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [bug#56474] [PATCH] gnu: Add goawk.
  2022-07-10  1:58 [bug#56474] [PATCH] gnu: Add goawk Paul A. Patience
@ 2022-07-11 12:17 ` Paul A. Patience
  2022-07-19 21:03   ` Ludovic Courtès
  2022-07-20 13:34 ` Maxime Devos
  1 sibling, 1 reply; 4+ messages in thread
From: Paul A. Patience @ 2022-07-11 12:17 UTC (permalink / raw)
  To: 56474


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





^ permalink raw reply	[flat|nested] 4+ messages in thread

* [bug#56474] [PATCH] gnu: Add goawk.
  2022-07-11 12:17 ` Paul A. Patience
@ 2022-07-19 21:03   ` Ludovic Courtès
  0 siblings, 0 replies; 4+ messages in thread
From: Ludovic Courtès @ 2022-07-19 21:03 UTC (permalink / raw)
  To: Paul A. Patience; +Cc: 56474

Hi,

"Paul A. Patience" <paul@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’.




^ permalink raw reply	[flat|nested] 4+ messages in thread

* [bug#56474] [PATCH] gnu: Add goawk.
  2022-07-10  1:58 [bug#56474] [PATCH] gnu: Add goawk Paul A. Patience
  2022-07-11 12:17 ` Paul A. Patience
@ 2022-07-20 13:34 ` Maxime Devos
  1 sibling, 0 replies; 4+ messages in thread
From: Maxime Devos @ 2022-07-20 13:34 UTC (permalink / raw)
  To: Paul A. Patience, 56474


[-- Attachment #1.1.1: Type: text/plain, Size: 2468 bytes --]


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.

[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 929 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 236 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-07-20 13:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-10  1:58 [bug#56474] [PATCH] gnu: Add goawk Paul A. Patience
2022-07-11 12:17 ` Paul A. Patience
2022-07-19 21:03   ` Ludovic Courtès
2022-07-20 13:34 ` Maxime Devos

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.