unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Brendan Tildesley <brendan.tildesley@openmailbox.org>
To: 29472@debbugs.gnu.org
Subject: [bug#29472] [PATCH 3/4] gnu: Add perl-file-mimeinfo.
Date: Mon, 27 Nov 2017 23:54:33 +1100	[thread overview]
Message-ID: <20171127125434.10609-3-brendan.tildesley@openmailbox.org> (raw)
In-Reply-To: <20171127125434.10609-1-brendan.tildesley@openmailbox.org>

* gnu/packages/perl.scm (perl-file-mimeinfo): New variable.
---
 gnu/packages/perl.scm | 48 ++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 48 insertions(+)

diff --git a/gnu/packages/perl.scm b/gnu/packages/perl.scm
index bacaaf38a..f658b9177 100644
--- a/gnu/packages/perl.scm
+++ b/gnu/packages/perl.scm
@@ -46,6 +46,7 @@
   #:use-module (gnu packages perl-web)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages freedesktop)
+  #:use-module (gnu packages gnome)
   #:use-module (gnu packages web))
 
 ;;;
@@ -3477,6 +3478,53 @@ data.")
 those files.")
     (license (package-license perl))))
 
+(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
+     "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:
+@itemize
+@item mimetype: Determine a file's mimetype.
+@item mimeopen: Open files in an appropriate program according to their mimetype.
+@end itemize")
+    (license (package-license perl))))
+
 (define-public perl-file-sharedir
   (package
     (name "perl-file-sharedir")
-- 
2.15.0

  parent reply	other threads:[~2017-11-27 12:56 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-27 12:50 [bug#29472] [patch 0/4] Add perl-file-mimeinfo and dependencies; add it as an input to xdg-utils brendan.tildesley
2017-11-27 12:54 ` [bug#29472] [PATCH 1/4] gnu: Add perl-file-basedir Brendan Tildesley
2017-11-27 12:54   ` [bug#29472] [PATCH 2/4] gnu: Add perl-file-desktopentry Brendan Tildesley
2017-11-27 12:54   ` Brendan Tildesley [this message]
2017-11-27 12:54   ` [bug#29472] [PATCH 4/4] gnu: xdg-utils: Add perl-file-mimeinfo as an input Brendan Tildesley
2017-11-28  9:44   ` bug#29472: [PATCH 1/4] gnu: Add perl-file-basedir Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171127125434.10609-3-brendan.tildesley@openmailbox.org \
    --to=brendan.tildesley@openmailbox.org \
    --cc=29472@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).