summaryrefslogtreecommitdiff
path: root/var/spack/repos/builtin/packages/msmc/package.py
blob: 3caf431c3f6420dda383bbbb542c75898f2f954e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# Copyright 2013-2019 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)

from spack import *


class Msmc(MakefilePackage):
    """This software implements MSMC, a method to infer population size
       and gene flow from multiple genome sequences"""

    homepage = "https://github.com/stschiff/msmc"
    url      = "https://github.com/stschiff/msmc/archive/v1.1.0.tar.gz"

    version('1.1.0', sha256='989064400fe392ca3d2ac1a253ce7edf1801b6a7eeb77bbf2ff7bf67910216c4')

    depends_on('gsl', type=('build', 'run'))
    depends_on('dmd', type='build')

    def edit(self, spec, prefix):
        filter_file('dmd',
                    join_path(self.spec['dmd'].prefix.linux.bin64, 'dmd'),
                    'Makefile', string=True)

    def build(self, spec, prefix):
        gsllibdir = self.spec['gsl'].prefix.lib
        libgsl = join_path(gsllibdir, 'libgsl.a')
        libgslcblas = join_path(gsllibdir, 'libgslcblas.a')
        make('GSL={0} {1}'.format(libgsl, libgslcblas))

    def install(self, spec, prefix):
        mkdirp(prefix.bin)
        install_tree('build', prefix.bin)