summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorToyohisa Kameyama <kameyama@riken.jp>2020-11-30 22:19:47 +0900
committerGitHub <noreply@github.com>2020-11-30 14:19:47 +0100
commit87adda1bad543ed5137485151597a60c983c677c (patch)
treef0f417d9657012a9613c01532c7d3e03668d43f9
parent8c8e9b71a7907bea60fe5473acae1318c8f7d679 (diff)
downloadspack-87adda1bad543ed5137485151597a60c983c677c.tar.gz
spack-87adda1bad543ed5137485151597a60c983c677c.tar.bz2
spack-87adda1bad543ed5137485151597a60c983c677c.tar.xz
spack-87adda1bad543ed5137485151597a60c983c677c.zip
bowtie2: change to MakefilePackage and add simde dependency. (#20166)
-rw-r--r--var/spack/repos/builtin/packages/bowtie2/package.py60
1 files changed, 28 insertions, 32 deletions
diff --git a/var/spack/repos/builtin/packages/bowtie2/package.py b/var/spack/repos/builtin/packages/bowtie2/package.py
index e09ea00e50..0eab7a3068 100644
--- a/var/spack/repos/builtin/packages/bowtie2/package.py
+++ b/var/spack/repos/builtin/packages/bowtie2/package.py
@@ -4,7 +4,7 @@
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
-class Bowtie2(Package):
+class Bowtie2(MakefilePackage):
"""Bowtie 2 is an ultrafast and memory-efficient tool for aligning
sequencing reads to long reference sequences"""
@@ -25,49 +25,45 @@ class Bowtie2(Package):
depends_on('perl', type='run')
depends_on('python', type='run')
depends_on('zlib', when='@2.3.1:')
+ depends_on('simde', type='link')
patch('bowtie2-2.2.5.patch', when='@2.2.5', level=0)
patch('bowtie2-2.3.1.patch', when='@2.3.1', level=0)
patch('bowtie2-2.3.0.patch', when='@2.3.0', level=0)
- resource(name='simde', git="https://github.com/nemequ/simde",
- destination='.', when='target=aarch64:')
# seems to have trouble with 6's -std=gnu++14
conflicts('%gcc@6:', when='@:2.3.1')
conflicts('@:2.3.5.0', when='target=aarch64:')
conflicts('@2.4.1', when='target=aarch64:')
- def patch(self):
- if self.spec.target.family == 'aarch64':
- copy_tree('simde', 'third_party/simde')
- if self.spec.satisfies('%gcc@:4.8.9'):
- filter_file('-fopenmp-simd', '', 'Makefile')
+ def edit(self, spec, prefix):
+ kwargs = {'ignore_absent': True, 'backup': False, 'string': False}
- @run_before('install')
- def filter_sbang(self):
- """Run before install so that the standard Spack sbang install hook
- can fix up the path to the perl|python binary.
- """
+ match = '^#!/usr/bin/env perl'
+ perl = spec['perl'].command
+ substitute = "#!{perl}".format(perl=perl)
+ files = ['bowtie2', ]
+ filter_file(match, substitute, *files, **kwargs)
- with working_dir(self.stage.source_path):
- kwargs = {'ignore_absent': True, 'backup': False, 'string': False}
+ match = '^#!/usr/bin/env python'
+ python = spec['python'].command
+ substitute = "#!{python}".format(python=python)
+ files = ['bowtie2-build', 'bowtie2-inspect']
+ filter_file(match, substitute, *files, **kwargs)
- match = '^#!/usr/bin/env perl'
- perl = self.spec['perl'].command
- substitute = "#!{perl}".format(perl=perl)
- files = ['bowtie2', ]
- filter_file(match, substitute, *files, **kwargs)
+ match = '-Ithird_party/simde'
+ simdepath = spec['simde'].prefix.include
+ substitute = "-I{simdepath}".format(simdepath=simdepath)
+ files = ['Makefile']
+ filter_file(match, substitute, *files, **kwargs)
- match = '^#!/usr/bin/env python'
- python = self.spec['python'].command
- substitute = "#!{python}".format(python=python)
- files = ['bowtie2-build', 'bowtie2-inspect']
- filter_file(match, substitute, *files, **kwargs)
-
- def install(self, spec, prefix):
- make_arg = []
- if self.spec.target.family == 'aarch64':
+ @property
+ def build_targets(self):
+ make_arg = ['PREFIX={0}'.format(self.prefix)]
+ if self.spec.satisfies('target=aarch64:'):
make_arg.append('POPCNT_CAPABILITY=0')
- make(*make_arg)
- mkdirp(prefix.bin)
- install('bowtie2*', prefix.bin)
+ return make_arg
+
+ @property
+ def install_targets(self):
+ return ['PREFIX={0}'.format(self.prefix), 'install']