[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
02/03: gnu: krona-tools: Install download scripts.
From: |
guix-commits |
Subject: |
02/03: gnu: krona-tools: Install download scripts. |
Date: |
Wed, 28 Apr 2021 04:19:19 -0400 (EDT) |
rekado pushed a commit to branch master
in repository guix.
commit ffd5bc9600db50d5ffa7347f1aee8ee106db732d
Author: Ricardo Wurmus <rekado@elephly.net>
AuthorDate: Wed Apr 28 10:15:43 2021 +0200
gnu: krona-tools: Install download scripts.
* gnu/packages/web.scm (krona-tools)[inputs]: Add curl and make.
[arguments]: Patch and install update scripts to /share.
---
gnu/packages/web.scm | 37 +++++++++++++++++++++++++++++++++----
1 file changed, 33 insertions(+), 4 deletions(-)
diff --git a/gnu/packages/web.scm b/gnu/packages/web.scm
index 663ca41..35558b6 100644
--- a/gnu/packages/web.scm
+++ b/gnu/packages/web.scm
@@ -1198,11 +1198,13 @@ efficiently. It gives the application developer no
more than 4 methods.")
(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/krona-tools/lib")))
+
"/lib/perl5/site_perl/krona-tools/lib"))
+ (share (string-append (assoc-ref outputs "out")
+ "/share/krona-tools")))
(mkdir-p bin)
(for-each
(lambda (script)
- (let* ((executable (string-append "scripts/" script ".pl")))
+ (let ((executable (string-append "scripts/" script ".pl")))
;; Prefix executables with 'kt' as install script does.
(copy-file executable (string-append bin "/kt" script))))
'("ClassifyBLAST"
@@ -1230,7 +1232,32 @@ efficiently. It gives the application developer no more
than 4 methods.")
(copy-recursively directory
(string-append perl "/../" directory)))
(list "data" "img" "taxonomy" "src"))
- (install-file "lib/KronaTools.pm" perl))))
+ (install-file "lib/KronaTools.pm" perl)
+
+ ;; Install downloaders
+ (substitute* "updateAccessions.sh"
+ (("ktPath=.*") (string-append "ktPath=" share "\n")))
+ (substitute* "updateTaxonomy.sh"
+ (("ktPath=.*") (string-append "ktPath=" share "\n"))
+ (("command -v curl")
+ (string-append "command -v " (which "curl")))
+ (("curl -s")
+ (string-append (which "curl") " -s"))
+ (("curl\\$timestring")
+ (string-append (which "curl") "$timestring"))
+ (("perl -M")
+ (string-append (which "perl") " -M"))
+ (("make ")
+ (string-append (which "make") " ")))
+ (for-each (lambda (file)
+ (install-file file (string-append share
"/scripts")))
+ '("scripts/extractTaxonomy.pl"
+ "scripts/accession2taxid.make"
+ "scripts/taxonomy.make"))
+ (for-each (lambda (file)
+ (install-file file share))
+ '("updateAccessions.sh"
+ "updateTaxonomy.sh")))))
(add-after 'install 'wrap-program
(lambda* (#:key inputs outputs #:allow-other-keys)
(let* ((out (assoc-ref outputs "out"))
@@ -1248,7 +1275,9 @@ efficiently. It gives the application developer no more
than 4 methods.")
(invoke (string-append (assoc-ref outputs "out")
"/bin/ktImportText")
"ec.tsv")))))))
(inputs
- `(("perl" ,perl)))
+ `(("curl" ,curl)
+ ("make" ,gnu-make)
+ ("perl" ,perl)))
(home-page "https://github.com/marbl/Krona/wiki")
(synopsis "Hierarchical data exploration with zoomable HTML5 pie charts")
(description