[bug#61946,0/6] gnu: golang: Add minify

Message ID cover.1677883649.git.th.ieong@free.fr
Headers
Series gnu: golang: Add minify |

Message

Thomas Ieong March 3, 2023, 10:55 p.m. UTC
Hello there!

This is a patch series to add the golang minify package, a golang
dependency needed for sourcehut.

Thomas Ieong (6):
  gnu: Add go-github-com-djherbis-atime.
  gnu: Add go-github-com-matryer-try.
  gnu: Add go-github-com-tdewolff-parse-v2.
  gnu: Add go-github-com-tdewolff-test.
  gnu: Add go-github-com-tdewolff-minify-v2.
  gnu: Add minify.

 gnu/packages/golang.scm | 143 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 143 insertions(+)


base-commit: 73cb232442a50aa00104ad739db93f44df9de073
  

Comments

Thomas Ieong March 4, 2023, 9:30 p.m. UTC | #1
Hi,

I forgot to check for generated files in the go packages.
I did just that and there is indeed one file hash.go that is generated
in the parse and minify package.

Taking care of this and resending later.
  
Hilton Chain Aug. 10, 2023, 12:12 p.m. UTC | #2
Hi Thomas,

> I forgot to check for generated files in the go packages.
> I did just that and there is indeed one file hash.go that is generated
> in the parse and minify package.
>
> Taking care of this and resending later.

go-github-com-tdewolff-minify-v2 has been available in Guix for a
while (but not the minify command and its dependency).  I have sent a
patchset [1] to generate hash.go at build time.  Can you update the
series to base on it and current Guix?

And I think dependencies not added to go-github-com-tdewolff-minify-v2
are only required by minify command, so there's no need to touch
definition of the former, inherit and modify is sufficient.  What do
you think?

Thanks

[1]: <https://issues.guix.gnu.org/65204>
  
Sharlatan Hellseher Jan. 30, 2024, 11:17 p.m. UTC | #3
Hi Thomas and Hilton,

I've tried to resolved all highlights which Hilton pointed out and from
some investigation I've left with 3 pushed patches.

- present [3/3]
  - [X] go-github-com-tdewolff-parse-v2
  - [X] go-github-com-tdewolff-test
  - [X] go-github-com-tdewolff-minify-v2

- added to golang-xyz.scm [2/2]
  - [X] go-github-com-djherbis-atime
  - [X] go-github-com-matryer-try

And the minify looks like this with inherit and modification:

--8<---------------cut here---------------start------------->8---
(define-public minify
  (package
    (inherit go-github-com-tdewolff-minify-v2)
    (name "minify")
    (arguments
     (substitute-keyword-arguments
         (package-arguments go-github-com-tdewolff-minify-v2)
       ((#:install-source? _ #t) #f)
       ((#:import-path _ "github.com/tdewolff/minify/v2")
        "github.com/tdewolff/minify/cmd/minify")))
    (inputs
     (list go-github-com-djherbis-atime
           go-github-com-dustin-go-humanize
           go-github-com-fsnotify-fsnotify
           go-github-com-matryer-try
           go-github-com-spf13-pflag))))
--8<---------------cut here---------------end--------------->8---

Maxim or Ricardo, 

Pinging you here as following, I've built it few times locally and
everything passed just fine, for some reason CI feel bad.
https://ci.guix.gnu.org/eval/1086875

Thanks,
Oleg
  
Hilton Chain Feb. 1, 2024, 3:10 a.m. UTC | #4
Hi Sharlatan,

On Wed, 31 Jan 2024 07:17:29 +0800,
Sharlatan Hellseher wrote:
>
> [1  <text/plain (quoted-printable)>]
>
> Hi Thomas and Hilton,
>
> I've tried to resolved all highlights which Hilton pointed out and from
> some investigation I've left with 3 pushed patches.
>
> - present [3/3]
>   - [X] go-github-com-tdewolff-parse-v2
>   - [X] go-github-com-tdewolff-test
>   - [X] go-github-com-tdewolff-minify-v2
>
> - added to golang-xyz.scm [2/2]
>   - [X] go-github-com-djherbis-atime
>   - [X] go-github-com-matryer-try
>
> And the minify looks like this with inherit and modification:
>
> --8<---------------cut here---------------start------------->8---
> (define-public minify
>   (package
>     (inherit go-github-com-tdewolff-minify-v2)
>     (name "minify")
>     (arguments
>      (substitute-keyword-arguments
>          (package-arguments go-github-com-tdewolff-minify-v2)
>        ((#:install-source? _ #t) #f)
>        ((#:import-path _ "github.com/tdewolff/minify/v2")
>         "github.com/tdewolff/minify/cmd/minify")))

I think there's no need to supply a default value to #:import-path
since all Go packages should have it in their arguments list.

>     (inputs
>      (list go-github-com-djherbis-atime
>            go-github-com-dustin-go-humanize
>            go-github-com-fsnotify-fsnotify
>            go-github-com-matryer-try
>            go-github-com-spf13-pflag))))
> --8<---------------cut here---------------end--------------->8---

And we can avoid the inherited propagated-inputs.

I have adjusted the definition to the following, does this look good
to you?

--8<---------------cut here---------------start------------->8---
(define-public minify
  (let ((base go-github-com-tdewolff-minify-v2))
    (package
      (inherit base)
      (name "minify")
      (arguments
       (substitute-keyword-arguments (package-arguments base)
         ((#:install-source? _ #t) #f)
         ((#:import-path _) "github.com/tdewolff/minify/cmd/minify")))
      (inputs
       (modify-inputs (package-propagated-inputs base)
         (prepend go-github-com-djherbis-atime
                  go-github-com-dustin-go-humanize
                  go-github-com-fsnotify-fsnotify
                  go-github-com-matryer-try
                  go-github-com-spf13-pflag)))
      (propagated-inputs '()))))
--8<---------------cut here---------------end--------------->8---

Thanks
  
Sharlatan Hellseher Feb. 1, 2024, 8:54 p.m. UTC | #5
Hi Hilton,

Base on suggestions from <https://issues.guix.gnu.org/68835> I've moved
minifry into golang-web and renamed the package with manner proposed in
<https://issues.guix.gnu.org/68763>.

I image there would be a large verity of packages with name 'minify' in
the future :-).

There is alsoy Python binding we may pack as well
<https://pypi.org/project/tdewolff-minify/>

Pushed to go-minify as df65af45b5f2cc76ce813ca91fab9054fd807bba to master.

Thanks,
Oleg