diff mbox series

[bug#47539,16/28] gnu: Add go-github-com-gabriel-vasile-mimetype.

Message ID 547d56b310ce40416b8d895b92f461711e5696f4.1617262223.git.public@yoctocell.xyz
State New
Headers show
Series Add gh and dependencies | expand

Checks

Context Check Description
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch success View Laminar job
cbaines/issue success View issue

Commit Message

Xinglu Chen April 1, 2021, 8:02 a.m. UTC
* gnu/packages/golang.scm (go-github-com-gabriel-vasile-mimetype): New variable.
---
 gnu/packages/golang.scm | 47 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 47 insertions(+)
diff mbox series

Patch

diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
index 11eb330d6d..8e942fa955 100644
--- a/gnu/packages/golang.scm
+++ b/gnu/packages/golang.scm
@@ -7420,3 +7420,50 @@  anchor names and links to those anchors.")
 Go.  It lets you use emoji characters in strings.")
     (license license:expat)))
 
+(define-public go-github-com-gabriel-vasile-mimetype
+  (package
+    (name "go-github-com-gabriel-vasile-mimetype")
+    (version "1.2.0")
+    (source
+      (origin
+        (method git-fetch)
+        (uri (git-reference
+               (url "https://github.com/gabriel-vasile/mimetype.git")
+               (commit (string-append "v" version))))
+        (file-name (git-file-name name version))
+        (sha256
+          (base32
+            "0ysb0pjhyr9b7q2y39b5hpwsaidgfl42gd07yj34mgmb9wfjb7ch"))))
+    (build-system go-build-system)
+    (arguments
+     '(#:import-path
+       "github.com/gabriel-vasile/mimetype"
+       ;; FIXME: Cannot open 'supported_mimes.md'
+       #:tests? #f
+       #:phases
+       (modify-phases %standard-phases
+         ;; The files are read-only
+         (add-before 'reset-gzip-timestamps 'make-gz-files-writable
+           (lambda* (#:key outputs #:allow-other-keys)
+             (for-each make-file-writable
+                       (find-files (string-append (assoc-ref outputs "out"))
+                                   ".*\\.gz$"))
+             #t)))))
+
+    (home-page
+      "https://github.com/gabriel-vasile/mimetype")
+    (synopsis "A fast golang library for MIME type and file extension detection")
+    (description "This is a package for detecting MIME types and extensions
+based on magic numbers.  Features include
+
+@itemize
+@item fast and precise MIME type and file extension detection
+@item long list of supported MIME types
+@item common file formats are prioritized
+@item small and simple API
+@item handles MIME type aliases
+@item thread safe
+@item low memory usage, besides the file header
+@end itemize")
+    (license license:expat)))
+