[PATCH] gnu: Add go-github-com-gabriel-vasile-mimetype.

  • Done
  • quality assurance status badge
Details
2 participants
  • Artyom V. Poptsov
  • Sharlatan Hellseher
Owner
unassigned
Submitted by
Artyom V. Poptsov
Severity
normal

Debbugs page

Artyom V. Poptsov wrote 1 years ago
(address . guix-patches@gnu.org)
87msszev23.fsf@gmail.com
Hello,

this patch adds "go-github-com-gabriel-vasile-mimetype"[1]
From 140d517610c3e9be4c5fb74e354f411c51d25cdc Mon Sep 17 00:00:00 2001
Message-ID: <140d517610c3e9be4c5fb74e354f411c51d25cdc.1705774054.git.poptsov.artyom@gmail.com>
From: "Artyom V. Poptsov" <poptsov.artyom@gmail.com>
Date: Sat, 20 Jan 2024 21:07:27 +0300
Subject: [PATCH] gnu: Add go-github-com-gabriel-vasile-mimetype.

* gnu/packages/golang.scm (go-github-com-gabriel-vasile-mimetype): New
variable.

Change-Id: Icb1624eb9a890b6f711dacf5ff80f15b041f3b7d
---
gnu/packages/golang.scm | 36 ++++++++++++++++++++++++++++++++++++
1 file changed, 36 insertions(+)

Toggle diff (51 lines)
diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
index 8fea581248..c2154ca675 100644
--- a/gnu/packages/golang.scm
+++ b/gnu/packages/golang.scm
@@ -4410,6 +4410,42 @@ (define-public go-github-com-technoweenie-multipartstreamer
without reading the entire content into memory.")
(license license:expat)))
+(define-public go-github-com-gabriel-vasile-mimetype
+ (package
+ (name "go-github-com-gabriel-vasile-mimetype")
+ (version "1.4.3")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/gabriel-vasile/mimetype")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "11swnjczhrza0xi8q2wlk056nnbcghm44vqs52zfv6rwqvy6imhj"))))
+ (build-system go-build-system)
+ (arguments
+ (list
+ #:go go-1.20
+ #:import-path "github.com/gabriel-vasile/mimetype"
+ #:phases
+ #~(modify-phases %standard-phases
+ (add-before 'check 'add-supported-mimes-md
+ (lambda* (#:key inputs #:allow-other-keys #:rest args)
+ ;; This file needs to be available for writing during the
+ ;; tests otherwise they will fail.
+ (let ((file
+ "src/github.com/gabriel-vasile/mimetype/supported_mimes.md"))
+ (invoke "touch" file)
+ (chmod file #o644)))))))
+ (propagated-inputs (list go-golang-org-x-net))
+ (home-page "https://github.com/gabriel-vasile/mimetype")
+ (synopsis "Golang library for media type and file extension detection")
+ (description
+ "A fast Golang library for media type and file extension detection, based on
+magic numbers .")
+ (license license:expat)))
+
(define-public go-github-com-tevino-abool
(let ((commit
"3c25f2fe7cd0ef3eabefce1d90efd69a65d35b12")

base-commit: 9c367ee1967b213b507a8bf041ea6c2623ceea96
--
2.41.0
Thanks,
- avp

References:

--
Artyom "avp" Poptsov <poptsov.artyom@gmail.com>
CADR Hackerspace co-founder: https://cadrspace.ru/
GPG: D0C2 EAC1 3310 822D 98DE B57C E9C5 A2D9 0898 A02F
-----BEGIN PGP SIGNATURE-----

iQJNBAEBCgA3FiEEAf2F9Bp7f4IFgwalk16+BzbchX4FAmWsDEQZHHBvcHRzb3Yu
YXJ0eW9tQGdtYWlsLmNvbQAKCRCTXr4HNtyFflQSD/9jZfIuwwmQOYuhj4F1N6oh
n82BywyLHImlY2AqklAKCcj6NCuhiKUK9Vs/l5N3HeyUNfYFHOHi21HuwQTRi6Uh
Ct/yZUEr1jaghDc05SWyRtkttSXmRnOBUZOm6r71jycRqIFs+ok4tbtZRD6hoaem
3gpvlQf9CCZBYCQVJ/YCwlQYfJq+1tiAZB8prJgCGuHllU+VyQ8vh2Ys8CbiuoUo
rxujDpCuhj0jIPj0SAgBveWRnF6gR9HDOdunu+983+R40MpzMDJCLIwuiyP41Bku
KJfuwmYzcgafX1i2AvNFbUvlBU+irfbIi/V0rMLz7FrAnJ/cBKHbCsR008DnVMDj
Iz0+M5jP1iPjm5oTfly6bsPbafmBUIRgPVnDiNoB/Kbw9l8zBbN1iaXIPJRPZ66N
XQnbnSuDtTbeUxYbdWtLHZ7KNM11+BNYOI5/qi6/MYd7lPUtrb3jXmYE+mLXVh/C
/Wlh5cvhxQsmeMp7jhkeJJQRNTdTYQOWbxQn34nh4b3DuuXxlxdFDfpfOsDVlBok
fJ93Zmxr05VSyjWJqQr8d1qo+a71Lm6xda0VrZAdoavEvwIO+VeiNpHc6pJ6zrBH
ZiLMgIukJUMFxNVm4Tq4u1pkCnm3aaYrN6N3pNa6L1LPgxUlXBFFIRvo86oWRlhF
D2sK+zZbRKuQXI60oO68hQ==
=zwRq
-----END PGP SIGNATURE-----

Sharlatan Hellseher wrote 1 years ago
(address . 68617@debbugs.gnu.org)(address . poptsov.artyom@gmail.com)
CAO+9K5qvoD4FGBK7Or8Vh_OduMvuYqAWnF8o7hkWEG=vLG5UyQ@mail.gmail.com
Hi,

Thank you for the patch!

Toggle quote (3 lines)
> + (add-before 'check 'add-supported-mimes-md
> + (lambda* (#:key inputs #:allow-other-keys #:rest args)
> + ;; This file needs to be available for writing during the
Instead of path string you may use import-path (change inputs in
lambda to use it. Check for examples in golang.scm.

Toggle quote (3 lines)
> + ;; tests otherwise they will fail.
> + (let ((file
> + "src/
github.com/gabriel-vasile/mimetype/supported_mimes.md"))
It would be something like this (invoke "touch" (string-append import-path
"supported_mimes.md"). Or check if the code
depends on HOME envar.

Toggle quote (2 lines)
>+ (description
> + "A fast Golang library for media type and file extension detection,
based on
Toggle quote (1 lines)
> +magic numbers .")
Trailing space in the end of the sentence. Try to add more detail,
I've checked github page there is a link to a little bit detailed doc.

Apply common steps: guix lint, guix style.

Looking forward for v2.

Thanks,
Oleg
Attachment: file
Artyom V. Poptsov wrote 1 years ago
(address . guix-patches@gnu.org)
878r404sxu.fsf@gmail.com
Hello,

I took into account the comments from Sharlatan Hellseher and updated
the patch.
From c090118a564bd6c3b2672f5422490b765efcc56e Mon Sep 17 00:00:00 2001
Message-ID: <c090118a564bd6c3b2672f5422490b765efcc56e.1707029680.git.poptsov.artyom@gmail.com>
From: "Artyom V. Poptsov" <poptsov.artyom@gmail.com>
Date: Sat, 20 Jan 2024 21:07:27 +0300
Subject: [PATCH] gnu: Add go-github-com-gabriel-vasile-mimetype.

* gnu/packages/golang.scm (go-github-com-gabriel-vasile-mimetype): New
variable.

Change-Id: Icb1624eb9a890b6f711dacf5ff80f15b041f3b7d
---
gnu/packages/golang.scm | 36 ++++++++++++++++++++++++++++++++++++
1 file changed, 36 insertions(+)

Toggle diff (51 lines)
diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
index 014ca01602..966a8b0eaa 100644
--- a/gnu/packages/golang.scm
+++ b/gnu/packages/golang.scm
@@ -4112,6 +4112,42 @@ (define-public go-github-com-technoweenie-multipartstreamer
without reading the entire content into memory.")
(license license:expat)))
+(define-public go-github-com-gabriel-vasile-mimetype
+ (package
+ (name "go-github-com-gabriel-vasile-mimetype")
+ (version "1.4.3")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/gabriel-vasile/mimetype")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "11swnjczhrza0xi8q2wlk056nnbcghm44vqs52zfv6rwqvy6imhj"))))
+ (build-system go-build-system)
+ (arguments
+ (list
+ #:go go-1.20
+ #:import-path "github.com/gabriel-vasile/mimetype"
+ #:phases
+ #~(modify-phases %standard-phases
+ (add-before 'check 'add-supported-mimes-md
+ (lambda* (#:key inputs #:allow-other-keys #:rest args)
+ ;; This file needs to be available for writing during the
+ ;; tests otherwise they will fail.
+ (let ((file
+ "src/github.com/gabriel-vasile/mimetype/supported_mimes.md"))
+ (invoke "touch" file)
+ (chmod file #o644)))))))
+ (propagated-inputs (list go-golang-org-x-net))
+ (home-page "https://github.com/gabriel-vasile/mimetype")
+ (synopsis "Golang library for media type and file extension detection")
+ (description
+ "A fast Golang library for media type and file extension detection, based on
+magic numbers .")
+ (license license:expat)))
+
(define-public go-github-com-tevino-abool
(let ((commit
"3c25f2fe7cd0ef3eabefce1d90efd69a65d35b12")

base-commit: abeffc82379c4f9bd2e6226ea27453b22cb4e0c8
--
2.41.0
Thanks,
- avp

--
Artyom "avp" Poptsov <poptsov.artyom@gmail.com>
CADR Hackerspace co-founder: https://cadrspace.ru/
GPG: D0C2 EAC1 3310 822D 98DE B57C E9C5 A2D9 0898 A02F
-----BEGIN PGP SIGNATURE-----

iQJNBAEBCgA3FiEEAf2F9Bp7f4IFgwalk16+BzbchX4FAmW/NX0ZHHBvcHRzb3Yu
YXJ0eW9tQGdtYWlsLmNvbQAKCRCTXr4HNtyFfmNFD/93Fgj80HRItPpfGQ5fhEML
doVopG4lLE7aCAFpdEEDtqaH/1fazc1AX5bIUDuJWnfACc0qcGAvv2fFd/KOlU2R
KF+NeU31uSysWQtXUvKYsEc1sR8bj6XZTvWUi8B80hdLJzNs3seHJYzHodxQxhth
Gm5XjznhJCfnxUQDzAu3EkEzQ9o+sIN5Kvo+JdNV2mNUo7Ir0VTw+vl3yVCkbxtq
1OsdjHSlUFo2Bba7kFIIBt2yC9GZ3uNp3Ye6zt3Z+59CeHQbjamXrYXHGblaZKKl
Cf6oJNRCFnV4CfmX76gyS7dPjrw9w7kyw1DPz3jj7uV9T64X8MHIejJO5t8s0BUu
Pzx6s1ZuYJchx4Yi58kE5RB7neVgW4kuyEoifrDMXxtAesXOSmP1G0DNKAFEIwA5
EOLOjEalQn8Tm0Vk4nK2SjNUN8lSaYNuugOjhNXM/bZOSix97/24ahK7lpPWjsnF
r1A/vgSBvbneow0NfteUUoTmIBIG+mxsU+iEuTsUaVQTr9rrsIsOhWHe2QR1kKNA
oBQsv2xnpwoaJYHPdte5jJQbWvAR4btiWrX67P4jXn9yR/MRZwnJkjsqDQCU/fto
g0Mq3+dNpNFPyXdkgXn5GhmdKak0TcEYxi3f+e7Vt78GX5FFLDm5v2zIH4x74Wqc
3dym9UDZD9bQdzC9vy5C9Q==
=h+sA
-----END PGP SIGNATURE-----

Artyom V. Poptsov wrote 1 years ago
(address . guix-patches@gnu.org)
874jeo40e4.fsf@gmail.com
Hello,

I attached the old version of the patch by mistake to the previous
email.

Here's the right version.
From c6cc2c6c04019a10717bc19c80a4d4f18013e793 Mon Sep 17 00:00:00 2001
Message-ID: <c6cc2c6c04019a10717bc19c80a4d4f18013e793.1707066776.git.poptsov.artyom@gmail.com>
From: "Artyom V. Poptsov" <poptsov.artyom@gmail.com>
Date: Sat, 20 Jan 2024 21:07:27 +0300
Subject: [PATCH] gnu: Add go-github-com-gabriel-vasile-mimetype.

* gnu/packages/golang.scm (go-github-com-gabriel-vasile-mimetype): New
variable.

Change-Id: Icb1624eb9a890b6f711dacf5ff80f15b041f3b7d
---
gnu/packages/golang.scm | 51 +++++++++++++++++++++++++++++++++++++++++
1 file changed, 51 insertions(+)

Toggle diff (66 lines)
diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
index 014ca01602..ab92cec4e4 100644
--- a/gnu/packages/golang.scm
+++ b/gnu/packages/golang.scm
@@ -4112,6 +4112,57 @@ (define-public go-github-com-technoweenie-multipartstreamer
without reading the entire content into memory.")
(license license:expat)))
+(define-public go-github-com-gabriel-vasile-mimetype
+ (package
+ (name "go-github-com-gabriel-vasile-mimetype")
+ (version "1.4.3")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/gabriel-vasile/mimetype")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "11swnjczhrza0xi8q2wlk056nnbcghm44vqs52zfv6rwqvy6imhj"))))
+ (build-system go-build-system)
+ (arguments
+ (list
+ #:go go-1.20
+ #:import-path "github.com/gabriel-vasile/mimetype"
+ #:phases #~(modify-phases %standard-phases
+ (add-before 'check 'add-supported-mimes-md
+ (lambda* (#:key import-path #:allow-other-keys)
+ ;; This file needs to be available for writing during the
+ ;; tests otherwise they will fail.
+ (let ((file (format #f "src/~a/supported_mimes.md"
+ import-path)))
+ (invoke "touch" file)
+ (chmod file #o644)))))))
+ (propagated-inputs (list go-golang-org-x-net))
+ (home-page "https://github.com/gabriel-vasile/mimetype")
+ (synopsis "Golang library for media type and file extension detection")
+ (description
+ "A Golang package that uses magic number signatures to detect the MIME type of a
+file.
+
+Main features:
+@itemize
+@item Fast and precise MIME type and file extension detection.
+@item Supports
+@url{https://github.com/gabriel-vasile/mimetype/blob/master/supported_mimes.md,
+many MIME types}.
+@item Allows to
+@url{https://pkg.go.dev/github.com/gabriel-vasile/mimetype#example-package-Extend,
+extend} with other file formats.
+@item Common file formats are prioritized.
+@item
+@url{https://pkg.go.dev/github.com/gabriel-vasile/mimetype#example-package-TextVsBinary,
+Differentiation between text and binary files}.
+@item Safe for concurrent usage.
+@end itemize")
+ (license license:expat)))
+
(define-public go-github-com-tevino-abool
(let ((commit
"3c25f2fe7cd0ef3eabefce1d90efd69a65d35b12")

base-commit: abeffc82379c4f9bd2e6226ea27453b22cb4e0c8
--
2.41.0
Thanks,
- avp

--
Artyom "avp" Poptsov <poptsov.artyom@gmail.com>
CADR Hackerspace co-founder: https://cadrspace.ru/
GPG: D0C2 EAC1 3310 822D 98DE B57C E9C5 A2D9 0898 A02F
-----BEGIN PGP SIGNATURE-----

iQJNBAEBCgA3FiEEAf2F9Bp7f4IFgwalk16+BzbchX4FAmW/xgMZHHBvcHRzb3Yu
YXJ0eW9tQGdtYWlsLmNvbQAKCRCTXr4HNtyFfgmEEACUlS1vmQoszSkGyFTy59mM
jN8HTQy2R6hjD58ERrLUBTeObAJXVDs2FhUd8RpRsAj6mxRHTXTZxZtRiRAJnd7x
A10XPtJeB9y0qFPxhepLVt69AzqAqSzTGNmOqKAjgcSwtf4B3flBDjxM9RRZsuQz
GrydumwcWXdv2JMVj8naLLoAwKd9GKuOI7hvGQFs9z82ThhFpD+dkp2/tN/uIf+x
B190LU7RGyKcFZEGhcvqcF2RWA6o/Y8l6kQEpU1/le/QU4KjXIfgCEa3P/pjg3pN
BlqnYn1sOkobgBx6rgkXsEF+quoH1QjCdzlzUW0LVQTCMVCj7bt4d+C6HB7Y3GiP
DknIQ25T4dreqsoRTOQaldl7njZAYk5yJQQsZ+AnAbF2OKMOCgDMHpbnoawFt2Nq
ha3aIOQO3RAhjYKCqkj70uYjcRCCPs22lEherskasLFMMOq7YpDvZhflnIGzaQLx
Sku2UhYiPjr0NCgDj/jEByqvXTrTvvJhKWDc1e32g7E1OAdYRN76smAJdlXoAMD7
pY/73FFMQVrdvQQIp6Zg9r943fmbGtiyeeLDtaZWjwgtpJIci8zUCVK6amLBj0Ix
CfWCNoWJrsvMoD3ccl3xWJtqNo4YaRoxJHsoX3qhQmCSXPbuBfxDcM0dCkJW8c/G
HSzGp/BcRI+VS+z+eoWXCQ==
=r+9l
-----END PGP SIGNATURE-----

Sharlatan Hellseher wrote 1 years ago
[PATCH] gnu: Add go-github-com-gabriel-vasile-mimetype.
(address . 68617-done@debbugs.gnu.org)
87a5oex630.fsf@gmail.com
Hi,

Modification applied
- package placed in golang-xyz.scm, as golang.scm in a process of split into logical modules,
- [description]: Append "This package provides a"

Pushed as 317d9840d371469daa23d13ac7c62477ed347b54 to master.

Thanks,
Oleg
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEmEeB3micIcJkGAhndtcnv/Ys0rUFAmXBA/MACgkQdtcnv/Ys
0rWCHg/9HEVh3ByZZ198jeI1LjgOvFkvgcxQuw89k+dsx8PUFnIK1K73BDWiWcKM
0CZ7yJ7WsTZAQgBBDwv14yYvvNC/wP9pWnB00oeDfNnowvUu4NYfJrVKYQ5HQYM4
QqtE7XMW+NlI2ENpM4+6bHuwE5v1Q8Q5kdvn0QvYBFq6WA+qEysKHCQ8ZNTkeskP
b18ZqVR3U/Z0zd2q238nbnrMSF33yKpfYi2orFWCE0vuEu8dYHSse7qiuolUelB2
2nrctaAe7PdCBF/cVUKNpiQII6tA762MX/juHVq0R8atdsEcg3nu69AzUl+kYCe/
jkF63d3phZxZ5lawfHyL2IXkGxOqmcC/YOzqELVV3t+3mTNm9DcmGP5xX3Ttbysn
XYmkmB1vin5sU4ybUjuTEnbRH5/JoFAToJT7bwu6Nv63WWLxRcsvPCuUaA/PwyGq
YAgLxlcqzN8jvxWvIn+etkQuFKBkrDHm3KpUHyqz1raZaUv9z/HSuYfRE8cweQ9Z
LSJrNvW2Dwfq1DsxmFualSrPb3NSVL/kNS92k5Zgo0NgtxZhfJS50TQTnA1HlrpB
eBs/R6AuxI+ZKkDIt7CvSuBmTVnI5WWjg6zguxH8utKXAZ52AeAqBCIOlF/bV+CV
kXbs5/7Pm6cNzxlCw7nEWJmisgNmkJvxVnNanJ0DsBblvNRIJ7I=
=A4wd
-----END PGP SIGNATURE-----

Closed
?
Your comment

This issue is archived.

To comment on this conversation send an email to 68617@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 68617
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch
You may also tag this issue. See list of standard tags. For example, to set the confirmed and easy tags
mumi command -t +confirmed -t +easy
Or, remove the moreinfo tag and set the help tag
mumi command -t -moreinfo -t +help