guix-devel
[Top][All Lists]
Advanced

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

[PATCH] gnu: Add krona-tools.


From: Ben Woodcroft
Subject: [PATCH] gnu: Add krona-tools.
Date: Mon, 25 Apr 2016 13:23:06 +1000

* gnu/packages/web.scm (krona-tools): New variable.
---
 gnu/packages/web.scm | 96 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 96 insertions(+)

diff --git a/gnu/packages/web.scm b/gnu/packages/web.scm
index 58de65c..a6279c8 100644
--- a/gnu/packages/web.scm
+++ b/gnu/packages/web.scm
@@ -10,6 +10,7 @@
 ;;; Copyright © 2016 Sou Bunnbu <address@hidden>
 ;;; Copyright © 2016 Jelle Licht <address@hidden>
 ;;; Copyright © 2016 Efraim Flashner <address@hidden>
+;;; Copyright © 2016 Ben Woodcroft <address@hidden>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -52,6 +53,7 @@
   #:use-module (gnu packages icu4c)
   #:use-module (gnu packages lua)
   #:use-module (gnu packages base)
+  #:use-module (gnu packages perl)
   #:use-module (gnu packages python)
   #:use-module (gnu packages pcre)
   #:use-module (gnu packages pkg-config)
@@ -270,6 +272,100 @@ easily construct JSON objects in C, output them as JSON 
formatted strings and
 parse JSON formatted strings back into the C representation of JSON objects.")
     (license l:x11)))
 
+(define-public krona-tools
+  (package
+   (name "krona-tools")
+   (version "2.6.1")
+   (source (origin
+             (method url-fetch)
+             (uri (string-append
+                   "https://github.com/marbl/Krona/releases/download/v";
+                   version "/KronaTools-" version ".tar"))
+             (sha256
+              (base32
+               "1fj5mf6wbwz7v74n2safbw7fpw32fik19vf0wdbc2srn82i8fiwz"))))
+   (build-system perl-build-system)
+   (arguments
+     `(#:tests? #f ; no tests
+       #:phases
+       (modify-phases %standard-phases
+         ;; There is no configure or build steps.
+         (delete 'configure)
+         (replace 'build
+           ;; Remove 'use lib' statements from scripts as PERL5LIB is set
+           ;; correctly during installation.
+           (lambda _
+             (for-each
+              (lambda (executable)
+                (display executable)(display "\n")
+                (substitute* executable
+                  (("use lib \\(`ktGetLibPath`\\);") "")))
+              (find-files "scripts/" ".*"))
+             #t))
+         ;; Install script "install.pl" expects the build directory to remain
+         ;; after installation, creating symlinks etc., so re-implement it
+         ;; here.
+         (replace 'install
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let ((bin   (string-append (assoc-ref outputs "out") "/bin"))
+                   (perl  (string-append (assoc-ref outputs "out")
+                                         "/lib/perl5/site_perl"))
+                   (share (string-append
+                           (assoc-ref outputs "out") "/share/krona-tools")))
+               (mkdir-p bin)
+               (for-each
+                (lambda (script)
+                  (let* ((executable (string-append "scripts/" script ".pl")))
+                    ;; Prefix executables with 'kt' as install script does.
+                    (copy-file executable (string-append bin "/kt" script))))
+                '("ClassifyBLAST"
+                  "GetContigMagnitudes"
+                  "GetTaxIDFromGI"
+                  "ImportBLAST"
+                  "ImportDiskUsage"
+                  "ImportEC"
+                  "ImportFCP"
+                  "ImportGalaxy"
+                  "ImportKrona"
+                  "ImportMETAREP-BLAST"
+                  "ImportMETAREP-EC"
+                  "ImportMGRAST"
+                  "ImportPhymmBL"
+                  "ImportRDP"
+                  "ImportRDPComparison"
+                  "ImportTaxonomy" ; 
+                  "ImportText"
+                  "ImportXML"))
+               (mkdir-p share)
+               (copy-recursively "data" (string-append share "/data"))
+               (copy-recursively "img" (string-append share "/img"))
+               (copy-recursively "taxonomy" (string-append share "/taxonomy"))
+               (substitute* '("lib/KronaTools.pm")
+                 (("taxonomyDir = \".libPath/../taxonomy\"")
+                  (string-append "taxonomyDir = \"" share "/taxonomy\"")))
+               (install-file "lib/KronaTools.pm" perl))))
+         (add-after 'install 'wrap-program
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (path (getenv "PERL5LIB")))
+               (for-each
+                (lambda (executable)
+                  (wrap-program executable
+                    `("PERL5LIB" ":" prefix
+                      (,(string-append out "/lib/perl5/site_perl")))))
+                (find-files (string-append out "/bin/") ".*"))))))))
+   (inputs
+    `(("perl" ,perl)))
+   (home-page "https://github.com/marbl/Krona/wiki";)
+   (synopsis "Hierarchical data exploration with zoomable HTML5 pie charts")
+   (description
+    "Krona is a flexible tool for exploring the relative proportions of
+hierarchical data, such as metagenomic classifications, using a radial,
+space-filling display.  It is implemented using HTML5 and JavaScript, allowing
+charts to be explored locally or served over the Internet, requiring only a
+current version of any major web browser.")
+   (license l:bsd-3)))
+
 (define-public rapidjson
   (package
     (name "rapidjson")
-- 
2.5.0




reply via email to

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