From 29d8aab712b611a6c786aa9b2c47f45e51203ca1 Mon Sep 17 00:00:00 2001 From: Marius Bakke Date: Thu, 22 Sep 2016 14:08:05 +0100 Subject: [PATCH 5/6] gnu: python-pysam: Delete bundled htslib. * gnu/packages/bioinformatics.scm (python-pysam)[source]: Add snippet to delete htslib. [arguments]: Adjust to modify-phases. Add htslib flags in 'set-flags. [propagated-inputs]: New field. Add htslib. --- gnu/packages/bioinformatics.scm | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm index e9ab05f..edfb943 100644 --- a/gnu/packages/bioinformatics.scm +++ b/gnu/packages/bioinformatics.scm @@ -1356,17 +1356,27 @@ multiple sequence alignments.") (uri (pypi-uri "pysam" version)) (sha256 (base32 - "1i1djacqbr88y7w18b4aa78zxnsyr4sz7yqdq2spi7gs0y6pzvjn")))) + "1i1djacqbr88y7w18b4aa78zxnsyr4sz7yqdq2spi7gs0y6pzvjn")) + (modules '((guix build utils))) + (snippet + ;; Drop bundled htslib. TODO: Also remove samtools and bcftools. + '(delete-file-recursively "htslib")))) (build-system python-build-system) (arguments `(#:tests? #f ; tests are excluded in the manifest #:phases - (alist-cons-before - 'build 'set-flags - (lambda _ - (setenv "LDFLAGS" "-lncurses") - (setenv "CFLAGS" "-D_CURSES_LIB=1")) - %standard-phases))) + (modify-phases %standard-phases + (add-before 'build 'set-flags + (lambda* (#:key inputs #:allow-other-keys) + (setenv "LDFLAGS" "-lncurses") + (setenv "HTSLIB_MODE" "external") + (setenv "HTSLIB_LIBRARY_DIR" (string-append + (assoc-ref inputs "htslib") "/lib")) + (setenv "HTSLIB_INCLUDE_DIR" (string-append + (assoc-ref inputs "htslib") "/include")) + (setenv "CFLAGS" "-D_CURSES_LIB=1")))))) + (propagated-inputs + `(("htslib" ,htslib))) (inputs `(("ncurses" ,ncurses) ("zlib" ,zlib))) -- 2.10.0