From 8977f7377ac798a458928a574b60291e6cc5e5e6 Mon Sep 17 00:00:00 2001 From: t-nojiri <68096132+t-nojiri@users.noreply.github.com> Date: Wed, 5 Aug 2020 02:11:52 +0900 Subject: abyss 2.1.4: fails to build with GCC 8 (#17614) * abyss 2.1.4: fails to build with GCC 8 * abyss 2.1.4: fails to build with GCC 8 * abyss 2.1.4: Revise the points indicated by the review. --- .../builtin/packages/abyss/fix_BloomFilter.hpp.patch | 11 +++++++++++ var/spack/repos/builtin/packages/abyss/package.py | 17 ++++++++++++++--- 2 files changed, 25 insertions(+), 3 deletions(-) create mode 100644 var/spack/repos/builtin/packages/abyss/fix_BloomFilter.hpp.patch diff --git a/var/spack/repos/builtin/packages/abyss/fix_BloomFilter.hpp.patch b/var/spack/repos/builtin/packages/abyss/fix_BloomFilter.hpp.patch new file mode 100644 index 0000000000..b648cb6122 --- /dev/null +++ b/var/spack/repos/builtin/packages/abyss/fix_BloomFilter.hpp.patch @@ -0,0 +1,11 @@ +--- spack-src/lib/bloomfilter/BloomFilter.hpp.org 2018-10-17 07:04:45.000000000 +0900 ++++ spack-src/lib/bloomfilter/BloomFilter.hpp 2020-07-16 15:41:03.607766127 +0900 +@@ -230,7 +230,7 @@ + + void writeHeader(std::ostream& out) const { + FileHeader header; +- strncpy(header.magic, "BlOOMFXX", 8); ++ memcpy(header.magic, "BlOOMFXX", 8); + char magic[9]; + strncpy(magic, header.magic, 8); + magic[8] = '\0'; diff --git a/var/spack/repos/builtin/packages/abyss/package.py b/var/spack/repos/builtin/packages/abyss/package.py index 339441392d..c7eddfd835 100644 --- a/var/spack/repos/builtin/packages/abyss/package.py +++ b/var/spack/repos/builtin/packages/abyss/package.py @@ -3,9 +3,19 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) +import numbers from spack import * +def is_multiple_32(x): + """multiple of 32 """ + try: + return isinstance(int(x), numbers.Integral) and \ + not isinstance(x, bool) and int(x) % 32 == 0 + except ValueError: + return False + + class Abyss(AutotoolsPackage): """ABySS is a de novo, parallel, paired-end sequence assembler that is designed for short reads. The single-processor version @@ -18,9 +28,8 @@ class Abyss(AutotoolsPackage): version('2.0.2', sha256='d87b76edeac3a6fb48f24a1d63f243d8278a324c9a5eb29027b640f7089422df') version('1.5.2', sha256='8a52387f963afb7b63db4c9b81c053ed83956ea0a3981edcad554a895adf84b1') - variant('maxk', values=int, default=0, - description='''set the maximum k-mer length. - This value must be a multiple of 32''') + variant('maxk', default=128, values=is_multiple_32, + description='set the maximum k-mer length.') depends_on('autoconf', type='build') depends_on('automake', type='build') @@ -48,3 +57,5 @@ class Abyss(AutotoolsPackage): if self.spec['mpi'].name == 'mpich': args.append('--enable-mpich') return args + + patch('fix_BloomFilter.hpp.patch', when='@2.0.0:2.1.4') -- cgit v1.2.3-70-g09d2