From ef1369c365cb6d8ebaba2dd6b4ebc2f06acdf0ba Mon Sep 17 00:00:00 2001 From: George Hartzell Date: Wed, 27 Jul 2016 13:19:17 -0400 Subject: Add package for htslib Htslib was pulled out of samtools and made into a standalone thing. This commit adds a packag for it, in support of the samtools package. --- var/spack/repos/builtin/packages/htslib/package.py | 41 ++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 var/spack/repos/builtin/packages/htslib/package.py diff --git a/var/spack/repos/builtin/packages/htslib/package.py b/var/spack/repos/builtin/packages/htslib/package.py new file mode 100644 index 0000000000..1a8b8fd2f5 --- /dev/null +++ b/var/spack/repos/builtin/packages/htslib/package.py @@ -0,0 +1,41 @@ +############################################################################## +# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC. +# Produced at the Lawrence Livermore National Laboratory. +# +# This file is part of Spack. +# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. +# LLNL-CODE-647188 +# +# For details, see https://github.com/llnl/spack +# Please also see the LICENSE file for our notice and the LGPL. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License (as +# published by the Free Software Foundation) version 2.1, February 1999. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and +# conditions of the GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +############################################################################## +from spack import * + + +class Htslib(Package): + """C library for high-throughput sequencing data formats.""" + + homepage = "https://github.com/samtools/htslib" + url = "https://github.com/samtools/htslib/releases/download/1.3.1/htslib-1.3.1.tar.bz2" + + version('1.3.1', '16d78f90b72f29971b042e8da8be6843') + + depends_on('zlib') + + def install(self, spec, prefix): + configure('--prefix={0}'.format(prefix)) + make() + make('install') -- cgit v1.2.3-60-g2f50 From ba0577dc96597d35aaa75472e8ce014c307a03da Mon Sep 17 00:00:00 2001 From: George Hartzell Date: Wed, 27 Jul 2016 13:20:49 -0400 Subject: Update samtools to support v1.3.1 Update the samtools package to support v1.3.1, which - now uses configure script; and - now depends on external htslib package. The dependency on mpc seems to have been bogus, it's never linked in, nor is it mentioned in the source tree. I *do* have a version in /usr/lib64, but ldd does not sure it being linked in either.... By depending on 'ncurses' I can do away with the need for the patch. --- .../repos/builtin/packages/samtools/package.py | 25 ++++++++++++++-------- .../builtin/packages/samtools/samtools1.2.patch | 20 ----------------- 2 files changed, 16 insertions(+), 29 deletions(-) delete mode 100644 var/spack/repos/builtin/packages/samtools/samtools1.2.patch diff --git a/var/spack/repos/builtin/packages/samtools/package.py b/var/spack/repos/builtin/packages/samtools/package.py index f5c7f4431f..7df3f5bcf8 100644 --- a/var/spack/repos/builtin/packages/samtools/package.py +++ b/var/spack/repos/builtin/packages/samtools/package.py @@ -25,18 +25,25 @@ from spack import * class Samtools(Package): - """SAM Tools provide various utilities for manipulating alignments in the SAM format, - including sorting, merging, indexing and generating + """SAM Tools provide various utilities for manipulating alignments in + the SAM format, including sorting, merging, indexing and generating alignments in a per-position format""" homepage = "www.htslib.org" - version('1.2','988ec4c3058a6ceda36503eebecd4122',url = "https://github.com/samtools/samtools/releases/download/1.2/samtools-1.2.tar.bz2") + url = "https://github.com/samtools/samtools/releases/download/1.3.1/samtools-1.3.1.tar.bz2" - depends_on("zlib") - depends_on("mpc") - parallel=False - patch("samtools1.2.patch",level=0) + version('1.3.1','a7471aa5a1eb7fc9cc4c6491d73c2d88') + version('1.2','988ec4c3058a6ceda36503eebecd4122') - def install(self, spec, prefix): - make("prefix=%s" % prefix, "install") + depends_on("ncurses") + depends_on("htslib", when='@1.3.1') # htslib became standalone + depends_on('zlib', when='@1.2') # needed for builtin htslib + def install(self, spec, prefix): + if self.spec.version >= Version('1.3.1'): + configure('--prefix={0}'.format(prefix), '--with-ncurses') + make() + make('install') + else: + make("prefix=%s" % prefix) + make("prefix=%s" % prefix, "install") diff --git a/var/spack/repos/builtin/packages/samtools/samtools1.2.patch b/var/spack/repos/builtin/packages/samtools/samtools1.2.patch deleted file mode 100644 index ead3ab4e2c..0000000000 --- a/var/spack/repos/builtin/packages/samtools/samtools1.2.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- Makefile 2015-02-03 08:27:34.000000000 -0800 -+++ Makefile.new 2015-07-21 10:38:27.881406892 -0700 -@@ -26,7 +26,7 @@ - CFLAGS = -g -Wall -O2 - LDFLAGS = - LDLIBS = --DFLAGS= -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_CURSES_LIB=1 -+DFLAGS= -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_CURSES_LIB=0 - LOBJS= bam_aux.o bam.o bam_import.o sam.o \ - sam_header.o bam_plbuf.o - AOBJS= bam_index.o bam_plcmd.o sam_view.o \ -@@ -37,7 +37,7 @@ - faidx.o stats.o stats_isize.o bam_flags.o bam_split.o \ - bam_tview.o bam_tview_curses.o bam_tview_html.o bam_lpileup.o - INCLUDES= -I. -I$(HTSDIR) --LIBCURSES= -lcurses # -lXCurses -+#LIBCURSES= -lcurses # -lXCurses - - prefix = /usr/local - exec_prefix = $(prefix) -- cgit v1.2.3-60-g2f50 From fd11db92e16475d370dd7ac8a39d9c35fc261e63 Mon Sep 17 00:00:00 2001 From: George Hartzell Date: Wed, 27 Jul 2016 13:25:11 -0400 Subject: Add package for bcftools --- .../repos/builtin/packages/bcftools/package.py | 43 ++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 var/spack/repos/builtin/packages/bcftools/package.py diff --git a/var/spack/repos/builtin/packages/bcftools/package.py b/var/spack/repos/builtin/packages/bcftools/package.py new file mode 100644 index 0000000000..a1b4a06dbb --- /dev/null +++ b/var/spack/repos/builtin/packages/bcftools/package.py @@ -0,0 +1,43 @@ +############################################################################## +# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC. +# Produced at the Lawrence Livermore National Laboratory. +# +# This file is part of Spack. +# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. +# LLNL-CODE-647188 +# +# For details, see https://github.com/llnl/spack +# Please also see the LICENSE file for our notice and the LGPL. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License (as +# published by the Free Software Foundation) version 2.1, February 1999. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and +# conditions of the GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +############################################################################## +from spack import * + + +class Bcftools(Package): + """BCFtools is a set of utilities that manipulate variant calls in the + Variant Call Format (VCF) and its binary counterpart BCF. All + commands work transparently with both VCFs and BCFs, both + uncompressed and BGZF-compressed.""" + + homepage = "http://samtools.github.io/bcftools/" + url = "https://github.com/samtools/bcftools/releases/download/1.3.1/bcftools-1.3.1.tar.bz2" + + version('1.3.1', '575001e9fca37cab0c7a7287ad4b1cdb') + + depends_on('zlib') + + def install(self, spec, prefix): + make("prefix=%s" % prefix, "all") + make("prefix=%s" % prefix, "install") -- cgit v1.2.3-60-g2f50 From d6dedee6ff9c31c31705e3fdfba1c4e07954b477 Mon Sep 17 00:00:00 2001 From: George Hartzell Date: Thu, 4 Aug 2016 15:23:04 -0400 Subject: Flake8 cleanup --- var/spack/repos/builtin/packages/samtools/package.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/var/spack/repos/builtin/packages/samtools/package.py b/var/spack/repos/builtin/packages/samtools/package.py index 7df3f5bcf8..aafda8ce3c 100644 --- a/var/spack/repos/builtin/packages/samtools/package.py +++ b/var/spack/repos/builtin/packages/samtools/package.py @@ -24,6 +24,7 @@ ############################################################################## from spack import * + class Samtools(Package): """SAM Tools provide various utilities for manipulating alignments in the SAM format, including sorting, merging, indexing and generating @@ -32,12 +33,12 @@ class Samtools(Package): homepage = "www.htslib.org" url = "https://github.com/samtools/samtools/releases/download/1.3.1/samtools-1.3.1.tar.bz2" - version('1.3.1','a7471aa5a1eb7fc9cc4c6491d73c2d88') - version('1.2','988ec4c3058a6ceda36503eebecd4122') + version('1.3.1', 'a7471aa5a1eb7fc9cc4c6491d73c2d88') + version('1.2', '988ec4c3058a6ceda36503eebecd4122') depends_on("ncurses") - depends_on("htslib", when='@1.3.1') # htslib became standalone - depends_on('zlib', when='@1.2') # needed for builtin htslib + depends_on("htslib", when='@1.3.1') # htslib became standalone + depends_on('zlib', when='@1.2') # needed for builtin htslib def install(self, spec, prefix): if self.spec.version >= Version('1.3.1'): -- cgit v1.2.3-60-g2f50 From 769408130a6dcf0c6ae44570a7577c2000bffe4f Mon Sep 17 00:00:00 2001 From: George Hartzell Date: Fri, 5 Aug 2016 17:47:11 -0400 Subject: Samtools depends on htslib from 1.3.1 onward Samtools used to (before 1.3.1) include it's own copy of htslib. Going forward, it needs to use the standalone htslib. --- var/spack/repos/builtin/packages/samtools/package.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/var/spack/repos/builtin/packages/samtools/package.py b/var/spack/repos/builtin/packages/samtools/package.py index aafda8ce3c..6b0b224785 100644 --- a/var/spack/repos/builtin/packages/samtools/package.py +++ b/var/spack/repos/builtin/packages/samtools/package.py @@ -37,8 +37,8 @@ class Samtools(Package): version('1.2', '988ec4c3058a6ceda36503eebecd4122') depends_on("ncurses") - depends_on("htslib", when='@1.3.1') # htslib became standalone - depends_on('zlib', when='@1.2') # needed for builtin htslib + depends_on("htslib", when='@1.3.1:') # htslib became standalone + depends_on('zlib', when='@1.2') # needed for builtin htslib def install(self, spec, prefix): if self.spec.version >= Version('1.3.1'): -- cgit v1.2.3-60-g2f50