guix-commits
[Top][All Lists]
Advanced

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

05/10: gnu: Add perl-file-mimeinfo.


From: Ludovic Courtès
Subject: 05/10: gnu: Add perl-file-mimeinfo.
Date: Tue, 28 Nov 2017 05:25:48 -0500 (EST)

civodul pushed a commit to branch master
in repository guix.

commit d0ce96bc17e4eff616c8a1c8cd07c00c396b58d9
Author: Brendan Tildesley <address@hidden>
Date:   Mon Nov 27 23:54:33 2017 +1100

    gnu: Add perl-file-mimeinfo.
    
    * gnu/packages/freedesktop.scm (perl-file-mimeinfo): New variable.
    
    Signed-off-by: Ludovic Courtès <address@hidden>
---
 gnu/packages/freedesktop.scm | 50 ++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 50 insertions(+)

diff --git a/gnu/packages/freedesktop.scm b/gnu/packages/freedesktop.scm
index e1beee4..ee108bb 100644
--- a/gnu/packages/freedesktop.scm
+++ b/gnu/packages/freedesktop.scm
@@ -1177,3 +1177,53 @@ application data and cache data.")
 Freedesktop.org @dfn{Desktop Entry} specification.  It can also run the
 applications define in those files.")
     (license license:perl-license)))
+
+(define-public perl-file-mimeinfo
+  (package
+    (name "perl-file-mimeinfo")
+    (version "0.28")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append "mirror://cpan/authors/id/M/MI/MICHIELB/"
+                           "File-MimeInfo-" version ".tar.gz"))
+       (sha256
+        (base32
+         "1ipbh63bkh1r2gy5g7q4bzhki8j29mm1jkhbv60p9vwsdys5s91a"))))
+    (build-system perl-build-system)
+    ;; If the tests are fixed, add perl-test-pod, perl-test-pod-coverage, and
+    ;; perl-test-tiny as native-inputs.
+    (propagated-inputs
+     `(("shared-mime-info" ,shared-mime-info)
+       ("perl-file-desktopentry" ,perl-file-desktopentry)))
+    (arguments
+     ;; Some tests fail due to requiring the mimetype of perl files to be
+     ;; text/plain when they are actually application/x-perl.
+     `(#:tests? #f
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'install 'wrap-programs
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let ((out (assoc-ref outputs "out")))
+               (for-each (lambda (prog)
+                           (wrap-program (string-append out "/bin/" prog)
+                             `("PERL5LIB" ":" prefix
+                               (,(string-append (getenv "PERL5LIB") ":" out
+                                                "/lib/perl5/site_perl")))))
+                         '("mimeopen" "mimetype")))
+             #t)))))
+    (home-page "http://search.cpan.org/dist/File-MimeInfo/";)
+    (synopsis "Determine file type from the file name")
+    (description
+     "@code{File::Mimeinfo} can be used to determine the MIME type of a file.
+It tries to implement the Freedesktop specification for a shared MIME
+database.
+
+This package also contains two related utilities:
+
address@hidden
address@hidden @command{mimetype} determines a file's MIME type;
address@hidden @command{mimeopen} opens files in an appropriate program 
according to
+their MIME type.
address@hidden itemize")
+    (license license:perl-license)))



reply via email to

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