From daaa37c1ff1efb8d746e549838934b136d5e0e95 Mon Sep 17 00:00:00 2001 From: George Hartzell Date: Wed, 17 May 2017 18:57:23 -0700 Subject: Package for bcl2fastq2 (updates libxslt) (#4234) * Add v1.1.26 and make crypto a variant I need 1.1.26 for bcl2fastq2. I also need to build it without crypto support. * Initial support for bcl2fastq2 * Clean up commentary, messages, names No substantial changes intended, just cleanup. * fix flake8 and extra import * The masked grammarian strikes again... * Be normal (messages don't end in periods) * When +crypto, add --with-crypto Add `--with-crypto` to configure args when user hasn't explicitly set `~crypto`. * self.spec.satisfies is unsatisfying, in is in instead See #4135, self.spec.satisfies has issues. @adamjstewart suggests simply using in. --- .../builtin/packages/bcl2fastq2/cmake-macros.patch | 10 +++ .../packages/bcl2fastq2/cxxConfigure-cmake.patch | 12 +++ .../repos/builtin/packages/bcl2fastq2/package.py | 95 ++++++++++++++++++++++ .../repos/builtin/packages/libxslt/package.py | 16 +++- 4 files changed, 131 insertions(+), 2 deletions(-) create mode 100644 var/spack/repos/builtin/packages/bcl2fastq2/cmake-macros.patch create mode 100644 var/spack/repos/builtin/packages/bcl2fastq2/cxxConfigure-cmake.patch create mode 100644 var/spack/repos/builtin/packages/bcl2fastq2/package.py (limited to 'var') diff --git a/var/spack/repos/builtin/packages/bcl2fastq2/cmake-macros.patch b/var/spack/repos/builtin/packages/bcl2fastq2/cmake-macros.patch new file mode 100644 index 0000000000..a799ef68e5 --- /dev/null +++ b/var/spack/repos/builtin/packages/bcl2fastq2/cmake-macros.patch @@ -0,0 +1,10 @@ +--- a/src/cmake/bcl2fastq_redist_macros.cmake 2017-05-11 15:03:27.652495488 -0700 ++++ b/src/cmake/bcl2fastq_redist_macros.cmake 2017-05-11 15:06:38.326745889 -0700 +@@ -30,6 +30,7 @@ + message(" Found: ${libname}, correct version ${version}") + message(" ${${libname}_UPPER}_INCLUDE_DIR = ${${${libname}_UPPER}_INCLUDE_DIR}") + message(" ${${libname}_UPPER}_LIBRARIES = ${${${libname}_UPPER}_LIBRARIES}") ++ set (HAVE_${${libname}_UPPER} true CACHE BOOL "package" FORCE) + else("${${${libname}_UPPER}_VERSION_STRING}" STREQUAL "${version}") + message(" Not found: ${libname}, incorrect version ( ${${${libname}_UPPER}_VERSION} )") + set(${${libname}_UPPER}_FOUND "FALSE") diff --git a/var/spack/repos/builtin/packages/bcl2fastq2/cxxConfigure-cmake.patch b/var/spack/repos/builtin/packages/bcl2fastq2/cxxConfigure-cmake.patch new file mode 100644 index 0000000000..4452bb31c1 --- /dev/null +++ b/var/spack/repos/builtin/packages/bcl2fastq2/cxxConfigure-cmake.patch @@ -0,0 +1,12 @@ +--- a/src/cmake/cxxConfigure.cmake 2017-05-11 16:55:14.745107845 -0700 ++++ b/src/cmake/cxxConfigure.cmake 2017-05-11 17:16:39.355981745 -0700 +@@ -101,6 +101,9 @@ + if((NOT HAVE_LIBXML2) OR (NOT HAVE_LIBXSLT)) + find_package_version(LibXml2 ${BCL2FASTQ_LIBXML2_VERSION}) + find_package_version(LibXslt ${BCL2FASTQ_LIBXSLT_VERSION}) ++ # macro isn't ONLY for redist, see its definition... ++ string(REGEX REPLACE "/include$" "" LIBEXSLT_HINT ${LIBXSLT_INCLUDE_DIR}) ++ find_library_redist(LIBEXSLT ${LIBEXSLT_HINT} libexslt/exslt.h exslt) + endif((NOT HAVE_LIBXML2) OR (NOT HAVE_LIBXSLT)) + + if((NOT HAVE_LIBXML2) OR (NOT HAVE_LIBXSLT)) diff --git a/var/spack/repos/builtin/packages/bcl2fastq2/package.py b/var/spack/repos/builtin/packages/bcl2fastq2/package.py new file mode 100644 index 0000000000..98799a1444 --- /dev/null +++ b/var/spack/repos/builtin/packages/bcl2fastq2/package.py @@ -0,0 +1,95 @@ +############################################################################## +# 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 * +import os +import shutil +import llnl.util.tty as tty + + +# This application uses cmake to build, but they wrap it with a +# configure script that performs dark magic. This package does it +# their way. +class Bcl2fastq2(Package): + """The bcl2fastq2 Conversion Software converts base + call (BCL) files from a sequencing run into FASTQ + files.""" + + homepage = "https://support.illumina.com/downloads/bcl2fastq-conversion-software-v2-18.html" + url = "https://support.illumina.com/content/dam/illumina-support/documents/downloads/software/bcl2fastq/bcl2fastq2-v2-18-0-12-tar.zip" + + version('2-18-0-12', 'fbe06492117f65609c41be0c27e3215c') + + depends_on('boost@1.54.0') + depends_on('cmake@2.8.9:') + depends_on('libxml2@2.7.8') + depends_on('libxslt@1.1.26~crypto') + depends_on('libgcrypt') + depends_on('zlib') + + # Their cmake macros don't set the flag when they find a library + # that makes them happy. + patch('cmake-macros.patch') + # After finding the libxslt bits, cmake still needs to wire in the + # libexslt bits. + patch('cxxConfigure-cmake.patch') + + root_cmakelists_dir = '../src' + + def url_for_version(self, version): + url = "https://support.illumina.com/content/dam/illumina-support/documents/downloads/software/bcl2fastq/bcl2fastq2-v{0}-tar.zip" + return url.format(version.dashed) + + # Illumina tucks the source inside a gzipped tarball inside a zip + # file. We let the normal Spack expansion bit unzip the zip file, + # then follow it with a function untars the tarball after Spack's + # done it's bit. + def do_stage(self, mirror_only=False): + # wrap (decorate) the standard expand_archive step with a + # helper, then call the real do_stage(). + self.stage.expand_archive = self.unpack_it(self.stage.expand_archive) + super(Bcl2fastq2, self).do_stage(mirror_only) + + def unpack_it(self, f): + def wrap(): + f() # call the original expand_archive() + if os.path.isdir('bcl2fastq'): + tty.msg("The tarball has already been unpacked") + else: + tty.msg("Unpacking bcl2fastq2 tarball") + tarball = 'bcl2fastq2-v{0}.tar.gz'.format(self.version.dotted) + shutil.move(join_path('spack-expanded-archive', tarball), '.') + os.rmdir('spack-expanded-archive') + tar = which('tar') + tar('-xf', tarball) + tty.msg("Finished unpacking bcl2fastq2 tarball") + return wrap + + def install(self, spec, prefix): + bash = which('bash') + bash("src/configure", "--prefix={0}".format(prefix), + "--with-cmake={0}".format(join_path(spec['cmake'].prefix.bin, + "cmake"))) + make() + make("install") diff --git a/var/spack/repos/builtin/packages/libxslt/package.py b/var/spack/repos/builtin/packages/libxslt/package.py index 9c5a42bcfb..3396f10242 100644 --- a/var/spack/repos/builtin/packages/libxslt/package.py +++ b/var/spack/repos/builtin/packages/libxslt/package.py @@ -36,10 +36,22 @@ class Libxslt(AutotoolsPackage): homepage = "http://www.xmlsoft.org/XSLT/index.html" url = "http://xmlsoft.org/sources/libxslt-1.1.28.tar.gz" - version('1.1.28', '9667bf6f9310b957254fdcf6596600b7') version('1.1.29', 'a129d3c44c022de3b9dcf6d6f288d72e') + version('1.1.28', '9667bf6f9310b957254fdcf6596600b7') + version('1.1.26', 'e61d0364a30146aaa3001296f853b2b9') + + variant('crypto', default=True, + description='Build libexslt with crypto support') depends_on("libxml2") depends_on("xz") depends_on("zlib") - depends_on("libgcrypt") + depends_on("libgcrypt", when="+crypto") + + def configure_args(self): + args = [] + if '~crypto' in self.spec: + args.append('--without-crypto') + else: + args.append('--with-crypto') + return args -- cgit v1.2.3-70-g09d2