[PATCH 0/6] gnu: golang: Add minify

  • Open
  • quality assurance status badge
Details
One participant
  • Thomas Ieong
Owner
unassigned
Submitted by
Thomas Ieong
Severity
normal
T
T
Thomas Ieong wrote on 3 Mar 23:55 +0100
(address . guix-patches@gnu.org)(name . Thomas Ieong)(address . th.ieong@free.fr)
cover.1677883649.git.th.ieong@free.fr
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
--
2.39.1
T
T
Thomas Ieong wrote on 4 Mar 00:01 +0100
[PATCH 1/6] gnu: Add go-github-com-djherbis-atime.
(address . 61946@debbugs.gnu.org)(name . Thomas Ieong)(address . th.ieong@free.fr)
d37dc078ad4058efa4e74ce98fa2b9db38e5dfd5.1677883649.git.th.ieong@free.fr
* gnu/packages/golang.scm (go-github-com-djherbis-atime): New variable.
---
gnu/packages/golang.scm | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)

Toggle diff (43 lines)
diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
index 465e0fd4c7..e213ce6cb6 100644
--- a/gnu/packages/golang.scm
+++ b/gnu/packages/golang.scm
@@ -40,6 +40,7 @@
;;; Copyright © 2022 ( <paren@disroot.org>
;;; Copyright © 2023 Hilton Chain <hako@ultrarare.space>
;;; Copyright © 2023 Timo Wilken <guix@twilken.net>
+;;; Copyright © 2023 Thomas Ieong <th.ieong@free.fr>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -9614,6 +9615,28 @@ (define-public go-github-com-bep-golibsass
"This package provides SCSS compiler support for Go applications.")
(license license:expat)))
+(define-public go-github-com-djherbis-atime
+ (package
+ (name "go-github-com-djherbis-atime")
+ (version "1.1.0")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/djherbis/atime")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "0xsz55zpihd9wyrj6qvm3miqzb6x3mnp5apzs0dx1byndhb8adpq"))))
+ (build-system go-build-system)
+ (arguments
+ '(#:import-path "github.com/djherbis/atime"))
+ (home-page "https://github.com/djherbis/atime")
+ (synopsis "Access Times for files")
+ (description
+ "Package atime provides a platform-independent way to get atimes for files.")
+ (license license:expat)))
+
(define-public go-github-com-hashicorp-go-syslog
(package
(name "go-github-com-hashicorp-go-syslog")
--
2.39.1
T
T
Thomas Ieong wrote on 4 Mar 00:01 +0100
[PATCH 2/6] gnu: Add go-github-com-matryer-try.
(address . 61946@debbugs.gnu.org)(name . Thomas Ieong)(address . th.ieong@free.fr)
18e0e057247ef14681c3131b52a83a16dac485dd.1677883649.git.th.ieong@free.fr
* gnu/packages/golang.scm (go-github-com-matryer-try): New variable.
---
gnu/packages/golang.scm | 31 +++++++++++++++++++++++++++++++
1 file changed, 31 insertions(+)

Toggle diff (44 lines)
diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
index e213ce6cb6..1bd2a51d8d 100644
--- a/gnu/packages/golang.scm
+++ b/gnu/packages/golang.scm
@@ -9637,6 +9637,37 @@ (define-public go-github-com-djherbis-atime
"Package atime provides a platform-independent way to get atimes for files.")
(license license:expat)))
+(define-public go-github-com-matryer-try
+ (package
+ (name "go-github-com-matryer-try")
+ (version "1")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/matryer/try")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "15f0m5ywihivnvwzcw0mh0sg27aky9rkywvxqszxka9q051qvsmy"))))
+ (build-system go-build-system)
+ (native-inputs (list go-github-com-cheekybits-is))
+ (arguments
+ (list #:import-path "github.com/matryer/try"
+ #:phases #~(modify-phases %standard-phases
+ (add-after 'unpack 'fix-tests
+ (lambda* (#:key import-path #:allow-other-keys)
+ (substitute* (string-append "src/" import-path
+ "/try_test.go")
+ (("var value string")
+ "")
+ (("value, err = SomeFunction\\(\\)")
+ "_, err = SomeFunction()")))))))
+ (home-page "https://github.com/matryer/try")
+ (synopsis "Simple idiomatic retry package for Go")
+ (description "Package try provides retry functionality.")
+ (license license:expat)))
+
(define-public go-github-com-hashicorp-go-syslog
(package
(name "go-github-com-hashicorp-go-syslog")
--
2.39.1
T
T
Thomas Ieong wrote on 4 Mar 00:01 +0100
[PATCH 3/6] gnu: Add go-github-com-tdewolff-parse-v2.
(address . 61946@debbugs.gnu.org)(name . Thomas Ieong)(address . th.ieong@free.fr)
27da1dcb05ba4189960ec4d190c803c4e65b1277.1677883649.git.th.ieong@free.fr
* gnu/packages/golang.scm (go-github-com-tdewolff-parse-v2): New variable.
---
gnu/packages/golang.scm | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)

Toggle diff (37 lines)
diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
index 1bd2a51d8d..a331331546 100644
--- a/gnu/packages/golang.scm
+++ b/gnu/packages/golang.scm
@@ -9668,6 +9668,30 @@ (define-public go-github-com-matryer-try
(description "Package try provides retry functionality.")
(license license:expat)))
+(define-public go-github-com-tdewolff-parse-v2
+ (package
+ (name "go-github-com-tdewolff-parse-v2")
+ (version "2.6.5")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/tdewolff/parse")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "0wmyylml2b1fy735qfpwavjnhfn2ihjgna2yab433mg1ikgl6wxl"))))
+ (build-system go-build-system)
+ (arguments
+ '(#:import-path "github.com/tdewolff/parse/v2"))
+ (propagated-inputs `(("go-github-com-tdewolff-test" ,go-github-com-tdewolff-test)))
+ (home-page "https://github.com/tdewolff/parse")
+ (synopsis "Go parsers for web formats")
+ (description
+ "Package parse contains a collection of parsers for various formats in its
+subpackages.")
+ (license license:expat)))
+
(define-public go-github-com-hashicorp-go-syslog
(package
(name "go-github-com-hashicorp-go-syslog")
--
2.39.1
T
T
Thomas Ieong wrote on 4 Mar 00:01 +0100
[PATCH 4/6] gnu: Add go-github-com-tdewolff-test.
(address . 61946@debbugs.gnu.org)(name . Thomas Ieong)(address . th.ieong@free.fr)
b49bde37e178fd889a3283e5d86302473c6098c9.1677883649.git.th.ieong@free.fr
* gnu/packages/golang.scm (go-github-com-tdewolff-test): New variable.
---
gnu/packages/golang.scm | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)

Toggle diff (37 lines)
diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
index a331331546..c4426d2a4f 100644
--- a/gnu/packages/golang.scm
+++ b/gnu/packages/golang.scm
@@ -9692,6 +9692,30 @@ (define-public go-github-com-tdewolff-parse-v2
subpackages.")
(license license:expat)))
+(define-public go-github-com-tdewolff-test
+ (package
+ (name "go-github-com-tdewolff-test")
+ (version "1.0.7")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/tdewolff/test")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "0k1yk2y2mryps0klsbcdxvn7acaxqxkl9mdi2cm6zgl29n3l5gi0"))))
+ (build-system go-build-system)
+ (arguments
+ '(#:import-path "github.com/tdewolff/test"))
+ (home-page "https://github.com/tdewolff/test")
+ (synopsis "Go test helper functions")
+ (description
+ "Test is a helper package written in @@url{http://golang.org/,Go}. It implements
+a few functions that are useful for io testing, such as readers and writers that
+fail after N consecutive reads/writes.")
+ (license license:expat)))
+
(define-public go-github-com-hashicorp-go-syslog
(package
(name "go-github-com-hashicorp-go-syslog")
--
2.39.1
T
T
Thomas Ieong wrote on 4 Mar 00:01 +0100
[PATCH 5/6] gnu: Add go-github-com-tdewolff-minify-v2.
(address . 61946@debbugs.gnu.org)(name . Thomas Ieong)(address . th.ieong@free.fr)
3b1c104b18eb5144de2ad545ddc28557e802198b.1677883649.git.th.ieong@free.fr
* gnu/packages/golang.scm (go-github-com-tdewolff-minify-v2): New variable.
---
gnu/packages/golang.scm | 31 +++++++++++++++++++++++++++++++
1 file changed, 31 insertions(+)

Toggle diff (44 lines)
diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
index c4426d2a4f..de5c0847f6 100644
--- a/gnu/packages/golang.scm
+++ b/gnu/packages/golang.scm
@@ -9716,6 +9716,37 @@ (define-public go-github-com-tdewolff-test
fail after N consecutive reads/writes.")
(license license:expat)))
+(define-public go-github-com-tdewolff-minify-v2
+ (package
+ (name "go-github-com-tdewolff-minify-v2")
+ (version "2.12.4")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/tdewolff/minify")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "1bbygm8x68xxgqgjzqfwak06212lalsz4aq4dg9z5yjq1c3hp3ji"))))
+ (build-system go-build-system)
+ (arguments
+ '(#:import-path "github.com/tdewolff/minify/v2"))
+ (propagated-inputs (list go-github-com-tdewolff-test
+ go-github-com-tdewolff-parse-v2
+ go-github-com-spf13-pflag
+ go-github-com-matryer-try
+ go-github-com-fsnotify-fsnotify
+ go-github-com-dustin-go-humanize
+ go-github-com-djherbis-atime
+ go-github-com-cheekybits-is))
+ (home-page "https://github.com/tdewolff/minify")
+ (synopsis "Go minifiers for web formats")
+ (description
+ "Package minify relates MIME type to minifiers. Several minifiers are provided
+in the subpackages.")
+ (license license:expat)))
+
(define-public go-github-com-hashicorp-go-syslog
(package
(name "go-github-com-hashicorp-go-syslog")
--
2.39.1
T
T
Thomas Ieong wrote on 4 Mar 00:01 +0100
[PATCH 6/6] gnu: Add minify.
(address . 61946@debbugs.gnu.org)(name . Thomas Ieong)(address . th.ieong@free.fr)
a1b048fab605e90e0302145c1010b6e3010867d4.1677883649.git.th.ieong@free.fr
* gnu/packages/golang.scm (minify): New variable.
---
gnu/packages/golang.scm | 10 ++++++++++
1 file changed, 10 insertions(+)

Toggle diff (23 lines)
diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
index de5c0847f6..85c3d4e893 100644
--- a/gnu/packages/golang.scm
+++ b/gnu/packages/golang.scm
@@ -9747,6 +9747,16 @@ (define-public go-github-com-tdewolff-minify-v2
in the subpackages.")
(license license:expat)))
+(define-public minify
+ (package
+ (inherit go-github-com-tdewolff-minify-v2)
+ (name "minify")
+ (arguments
+ `(#:import-path "github.com/tdewolff/minify/cmd/minify"
+ #:unpack-path "github.com/tdewolff/minify"
+ #:install-source? #f))))
+
+
(define-public go-github-com-hashicorp-go-syslog
(package
(name "go-github-com-hashicorp-go-syslog")
--
2.39.1
T
T
Thomas Ieong wrote on 4 Mar 22:30 +0100
Go generated files
(address . 61946@debbugs.gnu.org)
87mt4sjjbo.fsf@free.fr
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.
--
Thomas Ieong
?