guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

branch master updated: gnu: Add go-github-com-gabriel-vasile-mimetype.


From: guix-commits
Subject: branch master updated: gnu: Add go-github-com-gabriel-vasile-mimetype.
Date: Mon, 05 Feb 2024 10:50:08 -0500

This is an automated email from the git hooks/post-receive script.

sharlatan pushed a commit to branch master
in repository guix.

The following commit(s) were added to refs/heads/master by this push:
     new 317d9840d3 gnu: Add go-github-com-gabriel-vasile-mimetype.
317d9840d3 is described below

commit 317d9840d371469daa23d13ac7c62477ed347b54
Author: Artyom V. Poptsov <poptsov.artyom@gmail.com>
AuthorDate: Sat Jan 20 21:07:27 2024 +0300

    gnu: Add go-github-com-gabriel-vasile-mimetype.
    
    * gnu/packages/golang.scm (go-github-com-gabriel-vasile-mimetype): New
      variable.
    
    Change-Id: Icb1624eb9a890b6f711dacf5ff80f15b041f3b7d
    Signed-off-by: Sharlatan Hellseher <sharlatanus@gmail.com>
---
 gnu/packages/golang-xyz.scm | 53 +++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 53 insertions(+)

diff --git a/gnu/packages/golang-xyz.scm b/gnu/packages/golang-xyz.scm
index c58228ec44..48f56c4244 100644
--- a/gnu/packages/golang-xyz.scm
+++ b/gnu/packages/golang-xyz.scm
@@ -1,5 +1,6 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2023 Thomas Ieong <th.ieong@free.fr>
+;;; Copyright © 2024 Artyom V. Poptsov <poptsov.artyom@gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -24,6 +25,7 @@
   #:use-module (guix packages)
   #:use-module (guix utils)
   #:use-module (gnu packages)
+  #:use-module (gnu packages golang)
   #:use-module (gnu packages golang-check))
 
 ;;; Commentary:
@@ -56,6 +58,57 @@
 atimes for files.")
     (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
+     "This package provides a Golang module 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-matryer-try
   (package
     (name "go-github-com-matryer-try")



reply via email to

[Prev in Thread] Current Thread [Next in Thread]