diff options
author | Pjotr Prins | 2016-02-25 11:59:32 +0100 |
---|---|---|
committer | Pjotr Prins | 2016-02-25 11:59:32 +0100 |
commit | 99eaee3ee57ab8ba6ef8d333778c472c0ab61cc6 (patch) | |
tree | f549552f2081180b68d11492a9dda30d765c801f | |
parent | 609d1a24c9700b8de72ddba4d5b8f091e4bd0828 (diff) | |
parent | c594b866b37fc38d33a87395ca8b1ef7615e2702 (diff) | |
download | guix-bioinformatics-99eaee3ee57ab8ba6ef8d333778c472c0ab61cc6.tar.gz |
Merge pull request #5 from roelj/master
Working Sambamba package.
-rw-r--r-- | gn/packages/bioinformatics.scm | 61 | ||||
-rw-r--r-- | htslib-add-cram_to_bam.patch | 27 |
2 files changed, 50 insertions, 38 deletions
diff --git a/gn/packages/bioinformatics.scm b/gn/packages/bioinformatics.scm index 3363ea2..bf39935 100644 --- a/gn/packages/bioinformatics.scm +++ b/gn/packages/bioinformatics.scm @@ -325,39 +325,23 @@ and freshness without requiring additional information from the user.") (base32 "1f14wn9aaxwjkmla6pzq3s28741carbr2v0fd2v2mm1dcpwnrqz5")))) (build-system gnu-build-system) - ;; (inputs - ;; `(("ldc" ,ldc) - ;; ;; These are currently included in "ldc". - ;; ;;("druntime-ldc" ,druntime-ldc) - ;; ;;("phobos2-ldc" ,phobos2-ldc) - ;; ("lz4" ,lz4))) (native-inputs `(("ldc" ,ldc) - ;;("druntime-ldc" ,druntime-ldc) - ;;("phobos2-ldc" ,phobos2-ldc) ("lz4" ,lz4) ("rdmd" ,rdmd) ("zlib" ,zlib) - ("perl" ,perl) ; Needed for htslib - ("ruby" ,ruby) ; Needed for htslib - ("python" ,python) ; Needed for htslib + ("perl" ,perl) ; Needed for htslib tests? + ("ruby" ,ruby) ; Needed for htslib tests? + ("python" ,python) ; Needed for htslib tests? ("gcc" ,gcc) - ("lz4-src" - ,(origin - (method url-fetch) - (uri (string-append - "https://github.com/Cyan4973/lz4/archive/r131.tar.gz")) - (file-name "lz4-r131.tar.gz") - (sha256 - (base32 "1vfg305zvj50hwscad24wan9jar6nqj14gdk2hqyr7bb9mhh0kcx")))) ("htslib-src" ,(origin (method url-fetch) - (uri (string-append - "https://github.com/lomereiter/htslib/archive/0.2.0-rc10.tar.gz")) - (file-name "htslib-0.2.0-rc10.tar.gz") + (uri "https://github.com/samtools/htslib/archive/1.3.tar.gz") + (file-name "htslib-1.3.tar.gz") (sha256 - (base32 "1k6dlf6m8yayhcp7b4yisgw1xqdy1xg2xyrllss6ld0wg00hfcbs")))) + (base32 "1bqkif7yrqmiqak5yb74kgpb2lsdlg7y344qa1xkdg7k1l4m86i9")) + (patches (list (search-patch "htslib-add-cram_to_bam.patch"))))) ("biod-src" ,(origin (method git-fetch) @@ -369,33 +353,34 @@ and freshness without requiring additional information from the user.") (base32 "09icc2bjsg9y4hxjim4ql275izadf0kh1nnmapg8manyz6bc8svf")))))) (arguments `(#:tests? #f - ;;#:make-flags + #:make-flags (list "-f" "Makefile.guix") #:phases (modify-phases %standard-phases (delete 'configure) (delete 'check) (add-after 'unpack 'unpack-htslib-sources (lambda* (#:key inputs #:allow-other-keys) - ;; Unfortunately, the current build compiles htslib statically - ;; into the executable. Instead of patching the build files - ;; for Guix, this should be resolved on Sambamba upstream. For - ;; now, just extract the source code to the desired directory. + ;; The current build compiles htslib statically into the + ;; executable. On top of that, we need to patch the latest + ;; version of htslib to have it working with Sambamba. (and (with-directory-excursion "htslib" (zero? (system* "tar" "xvf" (assoc-ref inputs "htslib-src") "--strip-components=1"))) - (with-directory-excursion "lz4" - (zero? (system* "tar" "xvf" (assoc-ref inputs "lz4-src") - "--strip-components=1"))) - (and (zero? (system* "rm" "-r" "BioD")) - (zero? (system* "ln" "--symbolic" "--no-target-directory" - (assoc-ref inputs "biod-src") "BioD")))))) - ;; Building a production-quality executable is done with a - ;; non-default make target. Adding it with #:make-flags breaks - ;; building tests. Therefore, the default make got replaced by this. + (zero? (system* "rm" "-r" "BioD")) + (zero? (system* "ln" "--symbolic" "--no-target-directory" + (assoc-ref inputs "biod-src") "BioD"))))) (replace 'build (lambda* (#:key inputs make-flags #:allow-other-keys) - (zero? (system* "make" "-f" "Makefile.guix" "CC=gcc" "D_COMPILER=ldc2"))))))) + (zero? (system* "make" "-f" "Makefile.guix" + (string-append "LDC_LIB_PATH=" + (assoc-ref inputs "ldc") + "/lib"))))) + (replace + 'install + (lambda* (#:key outputs #:allow-other-keys) + (let ((bin (string-append (assoc-ref outputs "out") "/bin"))) + (install-file "build/sambamba" bin))))))) (home-page "https://github.com/lomereiter/sambamba") (synopsis "A tool for working with SAM and BAM files written in D.") (description diff --git a/htslib-add-cram_to_bam.patch b/htslib-add-cram_to_bam.patch new file mode 100644 index 0000000..c90f7aa --- /dev/null +++ b/htslib-add-cram_to_bam.patch @@ -0,0 +1,27 @@ +This patch adds the cram_to_bam function to the public interface of htslib, +because it is used by code in Sambamba. + +by Roel Janssen <roel@gnu.org> +--- a/cram/cram_decode.c 2015-12-15 17:34:33.000000000 +0100 ++++ b/cram/cram_decode.c 2016-02-24 11:16:10.491808702 +0100 +@@ -2730,7 +2730,7 @@ + * Returns the used size of the bam record on success + * -1 on failure. + */ +-static int cram_to_bam(SAM_hdr *bfd, cram_fd *fd, cram_slice *s, ++int cram_to_bam(SAM_hdr *bfd, cram_fd *fd, cram_slice *s, + cram_record *cr, int rec, bam_seq_t **bam) { + int bam_idx, rg_len; + char name_a[1024], *name; +diff -Naur htslib-1.3/cram/cram_decode.h htslib-1.3-patched/cram/cram_decode.h +--- a/cram/cram_decode.h 2015-12-15 17:34:33.000000000 +0100 ++++ b/cram/cram_decode.h 2016-02-24 11:15:04.556809864 +0100 +@@ -104,6 +104,8 @@ + int cram_decode_slice(cram_fd *fd, cram_container *c, cram_slice *s, + SAM_hdr *hdr); + ++int cram_to_bam(SAM_hdr *bfd, cram_fd *fd, cram_slice *s, ++ cram_record *cr, int rec, bam_seq_t **bam); + + #ifdef __cplusplus + } |