aboutsummaryrefslogtreecommitdiff
path: root/gn/packages/bioinformatics.scm
diff options
context:
space:
mode:
authorEfraim Flashner2020-03-12 05:46:04 -0500
committerEfraim Flashner2020-03-12 05:46:04 -0500
commit7e7a8a4c59ba52bea1ecd285361dae89cf29376b (patch)
tree51e55ae64d1eb0b45cc4a9fe7b0f067007a42399 /gn/packages/bioinformatics.scm
parent165e12f94388ee02f7924c39681ffacb81d23f68 (diff)
downloadguix-bioinformatics-7e7a8a4c59ba52bea1ecd285361dae89cf29376b.tar.gz
gn: edirect-gn: Build go packages from source.
Diffstat (limited to 'gn/packages/bioinformatics.scm')
-rw-r--r--gn/packages/bioinformatics.scm56
1 files changed, 56 insertions, 0 deletions
diff --git a/gn/packages/bioinformatics.scm b/gn/packages/bioinformatics.scm
index 86e2657..6a38499 100644
--- a/gn/packages/bioinformatics.scm
+++ b/gn/packages/bioinformatics.scm
@@ -10,10 +10,12 @@
#:use-module (guix build-system ant)
#:use-module (guix build-system cmake)
#:use-module (guix build-system gnu)
+ #:use-module (guix build-system go)
#:use-module (guix build-system python)
#:use-module (guix build-system trivial)
#:use-module (guix build-system waf)
#:use-module (gnu packages)
+ #:use-module (gn packages golang)
#:use-module (gn packages python)
#:use-module (gnu packages bioconductor)
#:use-module (gnu packages bioinformatics)
@@ -24,6 +26,7 @@
#:use-module (gnu packages datastructures)
#:use-module (gnu packages fontutils)
#:use-module (gnu packages gcc)
+ #:use-module (gnu packages golang)
#:use-module (gnu packages graphviz)
#:use-module (gnu packages imagemagick)
#:use-module (gnu packages jemalloc)
@@ -510,6 +513,59 @@ reads.")
;; Due to the precompiled binaries we download:
(supported-systems '("x86_64-linux"))))
+(define-public edirect-go-programs
+ (package
+ (inherit edirect)
+ (name "edirect-go-programs")
+ (build-system go-build-system)
+ (arguments
+ `(#:install-source? #f
+ #:tests? #f ; No tests.
+ #:import-path "ncbi.nlm.nih.gov/entrez/edirect"
+ #:phases
+ (modify-phases %standard-phases
+ (add-after 'unpack 'replace-go-dependency
+ ;; This go library does not have any license.
+ ;; TODO: This should move to a source snippet.
+ (lambda* (#:key import-path #:allow-other-keys)
+ (with-directory-excursion (string-append "src/" import-path)
+ (substitute* "rchive.go"
+ (("github.com/fiam/gounidecode/unidecode")
+ "golang.org/rainycape/unidecode"))
+ #t)))
+ (replace 'build
+ (lambda* (#:key import-path #:allow-other-keys)
+ (with-directory-excursion (string-append "src/" import-path)
+ (invoke "go" "build" "-v" "-x" "j2x.go")
+ (invoke "go" "build" "-v" "-x" "t2x.go")
+ (invoke "go" "build" "-v" "-x" "-o"
+ "xtract.Linux" "xtract.go" "common.go")
+ (invoke "go" "build" "-v" "-x" "-o"
+ "rchive.Linux" "rchive.go" "common.go")
+ (invoke "go" "build" "-v" "-x" "-o" "symbols.Linux" "s2p.go"))))
+ (replace 'install
+ (lambda* (#:key outputs import-path #:allow-other-keys)
+ (let ((dest (string-append (assoc-ref outputs "out") "/bin"))
+ (source (string-append "src/" import-path "/")))
+ (for-each (lambda (file)
+ (format #t "installing ~a~%" file)
+ (install-file (string-append source file) dest))
+ '("j2x" "t2x" "symbols.Linux" "xtract.Linux" "rchive.Linux"))
+ #t))))))
+ (native-inputs '())
+ (propagated-inputs '())
+ (inputs
+ `(("go-github-com-fatih-color" ,go-github-com-fatih-color)
+ ("go-github-com-fogleman-gg" ,go-github-com-fogleman-gg)
+ ("go-github-com-gedex-inflector" ,go-github-com-gedex-inflector)
+ ("go-github-com-golang-freetype" ,go-github-com-golang-freetype)
+ ("go-github-com-klauspost-cpuid" ,go-github-com-klauspost-cpuid)
+ ("go-github-com-pbnjay-memory" ,go-github-com-pbnjay-memory)
+ ("go-github-com-surgebase-porter2" ,go-github-com-surgebase-porter2)
+ ("go-golang-org-rainycape-unidecode" ,go-golang-org-rainycape-unidecode)
+ ("go-golang-org-x-image" ,go-golang-org-x-image)
+ ("go-golang-org-x-text" ,go-golang-org-x-text)))))
+
;; TODO: Unbundle zlib, bamtools, tclap
(define-public sniffles
(package