diff options
author | Arun Isaac | 2024-12-03 14:03:28 +0000 |
---|---|---|
committer | Arun Isaac | 2024-12-03 14:03:28 +0000 |
commit | 9d7622cc0d0242422eb506f0b4cee60afa35a49b (patch) | |
tree | c5676a934a6cf57ce318e60d6195cf7d68d22501 /gn/packages/bioinformatics.scm | |
parent | 7aa54350b9a7f4b1ba59fabaf8456f315981a908 (diff) | |
download | guix-bioinformatics-9d7622cc0d0242422eb506f0b4cee60afa35a49b.tar.gz |
gn: vg: Use G-expressions.
* gn/packages/bioinformatics.scm (vg): Use G-expressions.
Diffstat (limited to 'gn/packages/bioinformatics.scm')
-rw-r--r-- | gn/packages/bioinformatics.scm | 281 |
1 files changed, 141 insertions, 140 deletions
diff --git a/gn/packages/bioinformatics.scm b/gn/packages/bioinformatics.scm index e0586fb..3172880 100644 --- a/gn/packages/bioinformatics.scm +++ b/gn/packages/bioinformatics.scm @@ -2353,152 +2353,153 @@ in-memory footprint at the cost of packing and unpacking.") (("-mcx16") "")))))) (build-system gnu-build-system) (arguments - `(#:phases - (modify-phases %standard-phases - (delete 'configure) ; no configure script - (add-after 'unpack 'patch-source - (lambda* (#:key inputs #:allow-other-keys) - ;; Most of these are so that we can skip bootstrapping some of the sources. - (substitute* "Makefile" - ;; PKG_CONFIG_DEPS needs to be substituted to actually link to everything. - (("cairo libzstd") - "cairo htslib libzstd libdw libelf protobuf raptor2 sdsl-lite tabixpp vcflib fastahack libdeflate") - - ;; Skip the part where we link static libraries special. It doesn't like the changes we make - (("-Wl,-B.*") "\n") - - (("\\$\\(CWD\\)/\\$\\(LIB_DIR\\)/libtabixpp\\.a") "$(LIB_DIR)/libtabixpp.a") - ((" \\$\\(LIB_DIR\\)/libtabixpp\\.a") - (string-append " " (search-input-file inputs "/lib/libtabixpp.so"))) - (("\\$\\(LIB_DIR\\)/pkgconfig/tabixpp\\.pc") - (string-append " " (search-input-file inputs "/lib/pkgconfig/tabixpp.pc"))) - - (("\\$\\(CWD\\)/\\$\\(LIB_DIR\\)/libhts\\.a") "$(LIB_DIR)/libhts.a") - ((" \\$\\(LIB_DIR\\)/libhts\\.a") - (string-append " " (search-input-file inputs "/lib/libhts.so"))) - (("\\$\\(LIB_DIR\\)/pkgconfig/htslib\\.pc") - (string-append " " (search-input-file inputs "/lib/pkgconfig/htslib.pc"))) - - (("\\$\\(CWD\\)/\\$\\(LIB_DIR\\)/libdeflate\\.a") "$(LIB_DIR)/libdeflate.a") - ((" \\$\\(LIB_DIR\\)/libdeflate\\.a") - (string-append " " (search-input-file inputs "/lib/libdeflate.so"))) - - ((" \\$\\(LIB_DIR\\)/libvcflib.a") - (string-append " " (search-input-file inputs "/lib/libvcflib.so"))) - ((" \\$\\(BIN_DIR\\)/vcf2tsv") - (string-append " " (search-input-file inputs "/bin/vcf2tsv"))) - - ((" \\$\\(FASTAHACK_DIR\\)/fastahack") - (string-append " " (search-input-file inputs "/bin/fastahack"))) - (("\\+= \\$\\(OBJ_DIR\\)/Fasta\\.o") - (string-append "+= " (search-input-file inputs "/lib/libfastahack.so"))) - - ((" \\$\\(LIB_DIR\\)/libsnappy.a") - (string-append " " (search-input-file inputs "/lib/libsnappy.so"))) - - ;; Only link against the libraries in the elfutils package. - (("-ldwfl -ldw -ldwelf -lelf -lebl") "-ldw -lelf") - ((" \\$\\(LIB_DIR\\)/libelf.a") - (string-append " " (search-input-file inputs "/lib/libelf.so"))) - ((" \\$\\(LIB_DIR\\)/libdw.a") - (string-append " " (search-input-file inputs "/lib/libdw.so"))) - - ((" \\$\\(LIB_DIR\\)/%divsufsort.a") - (string-append " " (dirname + (list + #:phases + #~(modify-phases %standard-phases + (delete 'configure) ; no configure script + (add-after 'unpack 'patch-source + (lambda* (#:key inputs #:allow-other-keys) + ;; Most of these are so that we can skip bootstrapping some of the sources. + (substitute* "Makefile" + ;; PKG_CONFIG_DEPS needs to be substituted to actually link to everything. + (("cairo libzstd") + "cairo htslib libzstd libdw libelf protobuf raptor2 sdsl-lite tabixpp vcflib fastahack libdeflate") + + ;; Skip the part where we link static libraries special. It doesn't like the changes we make + (("-Wl,-B.*") "\n") + + (("\\$\\(CWD\\)/\\$\\(LIB_DIR\\)/libtabixpp\\.a") "$(LIB_DIR)/libtabixpp.a") + ((" \\$\\(LIB_DIR\\)/libtabixpp\\.a") + (string-append " " (search-input-file inputs "/lib/libtabixpp.so"))) + (("\\$\\(LIB_DIR\\)/pkgconfig/tabixpp\\.pc") + (string-append " " (search-input-file inputs "/lib/pkgconfig/tabixpp.pc"))) + + (("\\$\\(CWD\\)/\\$\\(LIB_DIR\\)/libhts\\.a") "$(LIB_DIR)/libhts.a") + ((" \\$\\(LIB_DIR\\)/libhts\\.a") + (string-append " " (search-input-file inputs "/lib/libhts.so"))) + (("\\$\\(LIB_DIR\\)/pkgconfig/htslib\\.pc") + (string-append " " (search-input-file inputs "/lib/pkgconfig/htslib.pc"))) + + (("\\$\\(CWD\\)/\\$\\(LIB_DIR\\)/libdeflate\\.a") "$(LIB_DIR)/libdeflate.a") + ((" \\$\\(LIB_DIR\\)/libdeflate\\.a") + (string-append " " (search-input-file inputs "/lib/libdeflate.so"))) + + ((" \\$\\(LIB_DIR\\)/libvcflib.a") + (string-append " " (search-input-file inputs "/lib/libvcflib.so"))) + ((" \\$\\(BIN_DIR\\)/vcf2tsv") + (string-append " " (search-input-file inputs "/bin/vcf2tsv"))) + + ((" \\$\\(FASTAHACK_DIR\\)/fastahack") + (string-append " " (search-input-file inputs "/bin/fastahack"))) + (("\\+= \\$\\(OBJ_DIR\\)/Fasta\\.o") + (string-append "+= " (search-input-file inputs "/lib/libfastahack.so"))) + + ((" \\$\\(LIB_DIR\\)/libsnappy.a") + (string-append " " (search-input-file inputs "/lib/libsnappy.so"))) + + ;; Only link against the libraries in the elfutils package. + (("-ldwfl -ldw -ldwelf -lelf -lebl") "-ldw -lelf") + ((" \\$\\(LIB_DIR\\)/libelf.a") + (string-append " " (search-input-file inputs "/lib/libelf.so"))) + ((" \\$\\(LIB_DIR\\)/libdw.a") + (string-append " " (search-input-file inputs "/lib/libdw.so"))) + + ((" \\$\\(LIB_DIR\\)/%divsufsort.a") + (string-append " " (dirname (search-input-file inputs "/lib/libdivsufsort.so")) - "%divsufsort.so")) - ((" \\$\\(LIB_DIR\\)/libdivsufsort.a") - (string-append " " (search-input-file inputs "/lib/libdivsufsort.so"))) - ((" \\$\\(LIB_DIR\\)/%divsufsort64.a") - (string-append " " (dirname + "%divsufsort.so")) + ((" \\$\\(LIB_DIR\\)/libdivsufsort.a") + (string-append " " (search-input-file inputs "/lib/libdivsufsort.so"))) + ((" \\$\\(LIB_DIR\\)/%divsufsort64.a") + (string-append " " (dirname (search-input-file inputs "/lib/libdivsufsort64.so")) - "%divsufsort64.so")) - ((" \\$\\(LIB_DIR\\)/libdivsufsort64.a") - (string-append " " (search-input-file inputs "/lib/libdivsufsort64.so"))) - - ((" \\$\\(LIB_DIR\\)/libjemalloc.a") - (string-append " " (search-input-file inputs "/lib/libjemalloc.a"))) - - ((" \\$\\(INC_DIR\\)/sparsehash") - (string-append " " (search-input-directory inputs "/include/sparsehash"))) - - ((" \\$\\(INC_DIR\\)/raptor2") - (string-append " " (search-input-directory inputs "/include/raptor2"))) - ((" \\$\\(LIB_DIR\\)/libraptor2.a") - (string-append " " (search-input-file inputs "/lib/libraptor2.so"))) - ((" \\$\\(BIN_DIR\\)/rapper") - (string-append " " (search-input-file inputs "/bin/rapper")))))) - (add-after 'unpack 'link-with-some-shared-libraries - (lambda* (#:key inputs #:allow-other-keys) - (substitute* '("deps/mmmultimap/CMakeLists.txt" - "deps/xg/CMakeLists.txt" - "deps/xg/deps/mmmulti/CMakeLists.txt") - (("\".*libsdsl\\.a\"") "\"-lsdsl\"") - (("\".*libdivsufsort\\.a\"") "\"-ldivsufsort\"") - (("\".*libdivsufsort64\\.a\"") "\"-ldivsufsort64\"") - (("\\$\\{sdsl-lite_INCLUDE\\}") - (search-input-directory inputs "/include/sdsl")) - (("\\$\\{sdsl-lite-divsufsort_INCLUDE\\}") - (dirname + "%divsufsort64.so")) + ((" \\$\\(LIB_DIR\\)/libdivsufsort64.a") + (string-append " " (search-input-file inputs "/lib/libdivsufsort64.so"))) + + ((" \\$\\(LIB_DIR\\)/libjemalloc.a") + (string-append " " (search-input-file inputs "/lib/libjemalloc.a"))) + + ((" \\$\\(INC_DIR\\)/sparsehash") + (string-append " " (search-input-directory inputs "/include/sparsehash"))) + + ((" \\$\\(INC_DIR\\)/raptor2") + (string-append " " (search-input-directory inputs "/include/raptor2"))) + ((" \\$\\(LIB_DIR\\)/libraptor2.a") + (string-append " " (search-input-file inputs "/lib/libraptor2.so"))) + ((" \\$\\(BIN_DIR\\)/rapper") + (string-append " " (search-input-file inputs "/bin/rapper")))))) + (add-after 'unpack 'link-with-some-shared-libraries + (lambda* (#:key inputs #:allow-other-keys) + (substitute* '("deps/mmmultimap/CMakeLists.txt" + "deps/xg/CMakeLists.txt" + "deps/xg/deps/mmmulti/CMakeLists.txt") + (("\".*libsdsl\\.a\"") "\"-lsdsl\"") + (("\".*libdivsufsort\\.a\"") "\"-ldivsufsort\"") + (("\".*libdivsufsort64\\.a\"") "\"-ldivsufsort64\"") + (("\\$\\{sdsl-lite_INCLUDE\\}") + (search-input-directory inputs "/include/sdsl")) + (("\\$\\{sdsl-lite-divsufsort_INCLUDE\\}") + (dirname (search-input-file inputs "/include/divsufsort.h")))))) - (add-after 'unpack 'dont-build-shared-vgio - (lambda _ - ;; vg will link with libvgio and fail the 'validate-runpath phase. - (substitute* "deps/libvgio/CMakeLists.txt" - (("TARGETS vgio vgio_static") "TARGETS vgio_static")))) - (add-after 'unpack 'fix-fastahack-dependency - (lambda _ - (substitute* (append (list "src/aligner.hpp" - "src/vg.hpp") - (find-files "deps/vcflib/src" "\\.cpp$")) - (("Fasta.h") "fastahack/Fasta.h")) - (substitute* '("deps/vcflib/src/Variant.h" - "src/constructor.hpp" - "src/index_registry.cpp") - (("<Fasta.h>") "\"fastahack/Fasta.h\"")))) - (add-after 'unpack 'adjust-tests - (lambda* (#:key inputs #:allow-other-keys) - (let ((bash-tap (assoc-ref inputs "bash-tap"))) - (substitute* (find-files "test/t") - (("BASH_TAP_ROOT.*") - (string-append "BASH_TAP_ROOT=" bash-tap "/bin\n")) - ((".*bash-tap-bootstrap") - (string-append ". " bash-tap "/bin/bash-tap-bootstrap"))) - (substitute* "test/t/02_vg_construct.t" - (("../deps/fastahack/fastahack") (which "fastahack")) - (("../bin/vcf2tsv") (which "vcf2tsv"))) - ;; Lets skip the 9 failing tests for now. They fail with our - ;; bash-tap and the bundled one. - (substitute* "test/t/02_vg_construct.t" - ((".*self-inconsistent.*") "is $(true) \"\" \"\"\n")) - (substitute* "test/t/07_vg_map.t" - ;; Change in fasta's output - (("identity\\) 1 \"") "identity) 1.0 \"")) - (substitute* '("test/t/07_vg_map.t" - "test/t/33_vg_mpmap.t") - ((".*node id.*") "is $(true) \"\" \"\"\n")) - (substitute* "test/t/48_vg_convert.t" - (("true \"vg.*") "true \"true\"\n")) - (substitute* "test/t/50_vg_giraffe.t" - ((".*A long read can.*") "is $(true) \"\" \"\"\n") - ((".*A long read has.*") "is $(true) \"\" \"\"\n") - ((".*Long read minimizer.*") "is $(true) \"\" \"\"\n")) - ;; Don't test the docs, we're not providing npm - (substitute* "Makefile" - ((".*test-docs.*") ""))))) - (add-after 'build 'build-manpages - (lambda* (#:key inputs #:allow-other-keys) - (when (assoc-ref inputs "asciidoctor") - (invoke "make" "man")))) - (replace 'install - (lambda* (#:key outputs #:allow-other-keys) - (let ((out (assoc-ref outputs "out"))) - (install-file "bin/vg" (string-append out "/bin")) - (for-each + (add-after 'unpack 'dont-build-shared-vgio + (lambda _ + ;; vg will link with libvgio and fail the 'validate-runpath phase. + (substitute* "deps/libvgio/CMakeLists.txt" + (("TARGETS vgio vgio_static") "TARGETS vgio_static")))) + (add-after 'unpack 'fix-fastahack-dependency + (lambda _ + (substitute* (append (list "src/aligner.hpp" + "src/vg.hpp") + (find-files "deps/vcflib/src" "\\.cpp$")) + (("Fasta.h") "fastahack/Fasta.h")) + (substitute* '("deps/vcflib/src/Variant.h" + "src/constructor.hpp" + "src/index_registry.cpp") + (("<Fasta.h>") "\"fastahack/Fasta.h\"")))) + (add-after 'unpack 'adjust-tests + (lambda* (#:key inputs #:allow-other-keys) + (let ((bash-tap (assoc-ref inputs "bash-tap"))) + (substitute* (find-files "test/t") + (("BASH_TAP_ROOT.*") + (string-append "BASH_TAP_ROOT=" bash-tap "/bin\n")) + ((".*bash-tap-bootstrap") + (string-append ". " bash-tap "/bin/bash-tap-bootstrap"))) + (substitute* "test/t/02_vg_construct.t" + (("../deps/fastahack/fastahack") (which "fastahack")) + (("../bin/vcf2tsv") (which "vcf2tsv"))) + ;; Lets skip the 9 failing tests for now. They fail with our + ;; bash-tap and the bundled one. + (substitute* "test/t/02_vg_construct.t" + ((".*self-inconsistent.*") "is $(true) \"\" \"\"\n")) + (substitute* "test/t/07_vg_map.t" + ;; Change in fasta's output + (("identity\\) 1 \"") "identity) 1.0 \"")) + (substitute* '("test/t/07_vg_map.t" + "test/t/33_vg_mpmap.t") + ((".*node id.*") "is $(true) \"\" \"\"\n")) + (substitute* "test/t/48_vg_convert.t" + (("true \"vg.*") "true \"true\"\n")) + (substitute* "test/t/50_vg_giraffe.t" + ((".*A long read can.*") "is $(true) \"\" \"\"\n") + ((".*A long read has.*") "is $(true) \"\" \"\"\n") + ((".*Long read minimizer.*") "is $(true) \"\" \"\"\n")) + ;; Don't test the docs, we're not providing npm + (substitute* "Makefile" + ((".*test-docs.*") ""))))) + (add-after 'build 'build-manpages + (lambda* (#:key inputs #:allow-other-keys) + (when (assoc-ref inputs "asciidoctor") + (invoke "make" "man")))) + (replace 'install + (lambda* (#:key outputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out"))) + (install-file "bin/vg" (string-append out "/bin")) + (for-each (lambda (file) (install-file file (string-append out "/share/man/man1"))) (find-files "doc/man" "\\.1$")))))) - #:test-target "test")) + #:test-target "test")) (native-inputs (append (if (supported-package? ruby-asciidoctor) |