[PATCH 12/25] gnu: Add xurls.

  • Done
  • quality assurance status badge
Details
3 participants
  • Katherine Cox-Buday
  • Tobias Geerinckx-Rice
  • (
Owner
unassigned
Submitted by
Katherine Cox-Buday
Severity
normal
Merged with
K
K
Katherine Cox-Buday wrote on 18 Jan 2023 02:44
(address . guix-patches@gnu.org)(name . Katherine Cox-Buday)(address . cox.katherine.e@gmail.com)
20230118014510.19320-13-cox.katherine.e@gmail.com
* gnu/packages/golang.scm (xurls): New variable.
---
gnu/packages/golang.scm | 32 ++++++++++++++++++++++++++++++++
1 file changed, 32 insertions(+)

Toggle diff (45 lines)
diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
index aa5f5ba159..cabc2a4bab 100644
--- a/gnu/packages/golang.scm
+++ b/gnu/packages/golang.scm
@@ -9760,6 +9760,38 @@ (define-public go-go-uber-org-multierr
"@code{multierr} allows combining one or more Go errors together.")
(license license:expat)))
+(define-public xurls
+ (package
+ (name "xurls")
+ (version "2.4.0")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/mvdan/xurls")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "0b040nbk1vwlk1qljavh8w8fn2r243q700n6gr8j2asmnz0xq84p"))))
+ (build-system go-build-system)
+ (arguments
+ `(#:import-path "mvdan.cc/xurls/v2"
+ #:unpack-path "mvdan.cc/xurls/v2"
+ #:phases (modify-phases %standard-phases
+ (replace 'build
+ (lambda arguments
+ (apply (assoc-ref %standard-phases
+ 'build)
+ `(,@arguments #:import-path
+ "mvdan.cc/xurls/v2/cmd/xurls")))))))
+ (inputs (list go-golang-org-x-sync go-github-com-rogpeppe-go-internal))
+ (home-page "https://mvdan.cc/xurls/v2/")
+ (synopsis "Extracts URLs from text")
+ (description
+ "Xurls extracts urls from plain text using regular expressions. It can
+be used as both a binary and a library.")
+ (license license:bsd-3)))
+
(define-public go-golang-org-x-lint
(let ((commit "83fdc39ff7b56453e3793356bcff3070b9b96445")
(revision "0"))
--
2.38.1
T
T
Tobias Geerinckx-Rice wrote on 18 Jan 2023 11:56
(no subject)
(address . control@debbugs.gnu.org)
542e82bcc0f385c117ba662c7dcf1dbf@tobias.gr
merge 60898 60899 60900 60901 60902
merge 60898 60903 60904 60905 60906
merge 60898 60907 60908 60909 60910
merge 60898 60911 60912 60913 60914
merge 60898 60915 60916 60917 60918
merge 60898 60919 60920
T
T
Tobias Geerinckx-Rice wrote on 18 Jan 2023 12:43
(address . control@debbugs.gnu.org)
37de5823441633151229c783f2acfca3@tobias.gr
merge 60898 60921 60922
thanks

Weird: I got ‘Unknown command or malformed arguments to command.’ for
this obviously correct line.

Let's try again.
K
K
Katherine Cox-Buday wrote on 18 Jan 2023 18:07
Merging erroneously opened bugs
(address . control@debbugs.gnu.org)
87zgafrct9.fsf@gmail.com
merge 60899 60904 60907 60908 60917 60920 60921 60919 60910 60903 60915 60914 60922 60909 60918 60913 60900 60899 60905 60901 60912 60898 60906 60902 60916 60911
--
Katherine
(
Re: [bug#60910] [PATCH 12/25] gnu: Add xurls.
CQBU5BSR09DA.YX8I33ULW77G@guix-framework
* gnu/packages/golang.scm (xurls): New variable.

Toggle quote (16 lines)
> --- a/gnu/packages/golang.scm
> +++ b/gnu/packages/golang.scm

> @@ -9760,6 +9760,38 @@ (define-public go-go-uber-org-multierr

> + (arguments
> + `(#:import-path "mvdan.cc/xurls/v2"
> + #:unpack-path "mvdan.cc/xurls/v2"
> + #:phases (modify-phases %standard-phases
> + (replace 'build
> + (lambda arguments
> + (apply (assoc-ref %standard-phases
> + 'build)
> + `(,@arguments #:import-path
> + "mvdan.cc/xurls/v2/cmd/xurls")))))))

I'm not certain what you're trying to accomplish here, but would you be able
to replace this with:

(arguments
`(#:import-path "mvdan.cc/xurls/v2"
#:unpack-path "mvdan.cc/xurls/v2/cmd/xurls"))

?

Toggle quote (2 lines)
> + (inputs (list go-golang-org-x-sync go-github-com-rogpeppe-go-internal))

Add newlines after the ``inputs'' symbol and between the inputs :)

Toggle quote (4 lines)
> + (description
> + "Xurls extracts urls from plain text using regular expressions. It can
> +be used as both a binary and a library.")

s/Xurls extracts/This package provides a Go library for extracting/

-- (
-----BEGIN PGP SIGNATURE-----

iQGzBAABCgAdFiEE6Vh10NblKE5doNlW7ImHg/nqI20FAmPhgBgACgkQ7ImHg/nq
I23sUAv+KueIjpvDd/x6z6+TisRwcxsSnobTH2I962r6PCC/19T2BB7Y7HfEG5T9
v4iGzZ5RWSqbOd/4yn/ryoAFHPx8R2+oQXxestqWd06yUdPytli7MUYLVowrwwI7
cwzTq33ZsMPDIvYz2E2a19CywVgVzDkkHMHFqq4mtj569yp1Ybqi9/mDAopzabPB
IEgkCesX7wQVPiJO9t8/WmXPqNW2B5FCuhfQDVqWm0FJGUYu5zKbYY0K3F/nyzqx
namW+mw9h3q4WXXFn9qF6AGdvWBJZGu+pgHZIKj9bqK+0rJKGnY27PFY45STI0oE
2aJMBVgZOLjpp4KPYtuAxe2IirsYvw8MQrKRZ84KNOaHLLNgbkIdKaLoLMeFbmsQ
IsrtdI/1I7eSROutEyLP9pjr1zA0RqO38VlSlhsHVkkaB873EN4Bnuyj00Qo2D4H
2yBQ7eI41Bv8ZA8u3WzqCZxpt5idHG/WF/pta3MtdQjKMINqxi5iQv50WG0FfHBM
2sO04/ls
=JMjt
-----END PGP SIGNATURE-----


K
K
Katherine Cox-Buday wrote on 7 Feb 2023 18:51
(name . ( via Guix-patches via)(address . guix-patches@gnu.org)
87357hxt2l.fsf@gmail.com
"( via Guix-patches" via <guix-patches@gnu.org> writes:

Toggle quote (27 lines)
> * gnu/packages/golang.scm (xurls): New variable.
>
>> --- a/gnu/packages/golang.scm
>> +++ b/gnu/packages/golang.scm
>
>> @@ -9760,6 +9760,38 @@ (define-public go-go-uber-org-multierr
>
>> + (arguments
>> + `(#:import-path "mvdan.cc/xurls/v2"
>> + #:unpack-path "mvdan.cc/xurls/v2"
>> + #:phases (modify-phases %standard-phases
>> + (replace 'build
>> + (lambda arguments
>> + (apply (assoc-ref %standard-phases
>> + 'build)
>> + `(,@arguments #:import-path
>> + "mvdan.cc/xurls/v2/cmd/xurls")))))))
>
> I'm not certain what you're trying to accomplish here, but would you be able
> to replace this with:
>
> (arguments
> `(#:import-path "mvdan.cc/xurls/v2"
> #:unpack-path "mvdan.cc/xurls/v2/cmd/xurls"))
>
> ?

Hm, I'm sure I would have tried that, but I'll check and see if I can
condense this per your suggestion. Thanks!

Toggle quote (4 lines)
>> + (inputs (list go-golang-org-x-sync go-github-com-rogpeppe-go-internal))
>
> Add newlines after the ``inputs'' symbol and between the inputs :)

Why wouldn't `guix style` and `guix lint` correct this? I want to meet
the style guidelines, and I don't mean this as a contrarian statement,
but I'll never get this right unless a tool tells me it's wrong (or
ideally fixes it for me).

Toggle quote (6 lines)
>> + (description
>> + "Xurls extracts urls from plain text using regular expressions. It can
>> +be used as both a binary and a library.")
>
> s/Xurls extracts/This package provides a Go library for extracting/


[Synopses] must not start with “a” or “the”, which usually does not
bring anything; for instance, prefer “File-frobbing tool” over “A
tool that frobs files”. The synopsis should say what the package
is—e.g., “Core GNU utilities (file, text, shell)”—or what it is used
for—e.g., the synopsis for GNU grep is “Print lines matching a
pattern”.

The manual is speaking of synopses, but does it apply to descriptions
too? It seems to me like beginning the description with the name of the
binary is more correct than a self-referential "This package", which I
think meets the manual's qualifier for "does not bring anything".

Also, `Xurls` is both a library and an executable. This package is for
the executable, and a separate one was provided for the library. I think
it's probably better to keep it in the style of "$BINARY (thing that it
does)".

WDYT? These are just my opinions, and I'm open to learning! Please
include the "why" so I can have better judgment in the future.

--
Katherine
?