summaryrefslogtreecommitdiff
path: root/var/spack/repos/builtin/packages/py-pycortex/package.py
blob: 5f9a25892f2403876459470c6839425d6e6e85f3 (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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# Copyright 2013-2022 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 PyPycortex(PythonPackage):
    """Python Cortical mapping software for fMRI data."""

    # When pycortex is started it creates a user config file (on linux located
    # in ~/.config/pycortex) which can be problematic when reinstalling a newer
    # version with spack due to hardscoded absolute paths of the pycortex module

    homepage = "https://github.com/gallantlab/pycortex"
    pypi = "pycortex/pycortex-1.2.2.tar.gz"

    version('1.2.2', sha256='ac46ed6a1dc727c3126c2b5d7916fc0ac21a6510c32a5edcd3b8cfb7b2128414')

    depends_on('py-setuptools', type='build')
    depends_on('py-cython', type='build')
    depends_on('py-future', type=('build', 'run'))
    depends_on('py-numpy', type=('build', 'run'))
    depends_on('py-scipy', type=('build', 'run'))
    depends_on('py-tornado@4.3:', type=('build', 'run'))
    depends_on('py-shapely', type=('build', 'run'))
    depends_on('py-lxml', type=('build', 'run'))
    depends_on('py-html5lib', type=('build', 'run'))
    depends_on('py-h5py', type=('build', 'run'))
    depends_on('py-numexpr', type=('build', 'run'))
    depends_on('py-cython', type=('build', 'run'))  # is in install_requires
    depends_on('py-matplotlib', type=('build', 'run'))
    depends_on('pil', type=('build', 'run'))
    depends_on('py-nibabel', type=('build', 'run'))
    depends_on('py-networkx@2.1:', type=('build', 'run'))
    depends_on('py-imageio', type=('build', 'run'))
    depends_on('py-wget', type=('build', 'run'))

    # inkscape is not in spack
    # TODO remove this patch and add inkscape dependency once it is in
    def patch(self):
        # remove inkscape dependency
        filter_file('from .testing_utils import INKSCAPE_VERSION', '',
                    'cortex/utils.py',
                    string=True)
        filter_file('open_inkscape=True', 'open_inkscape=False',
                    'cortex/utils.py',
                    string=True)
        filter_file('from .testing_utils import INKSCAPE_VERSION',
                    'INKSCAPE_VERSION = None',
                    'cortex/svgoverlay.py',
                    string=True)