summaryrefslogtreecommitdiff
path: root/var/spack/repos/builtin/packages/esys-particle/package.py
blob: 75cc699b9641eed14035ec77412c2f5fcce5f4b1 (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
# Copyright 2013-2023 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.package import *


class EsysParticle(CMakePackage):
    """ESyS-Particle is Open Source software for particle-based numerical
    modelling. The software implements the Discrete Element Method (DEM),
    a widely used technique for modelling processes involving large
    deformations, granular flow and/or fragmentation."""

    homepage = "https://launchpad.net/esys-particle"
    url = "https://launchpadlibrarian.net/539636757/esys-particle-3.0-alpha.tar.gz"

    maintainers("snehring")

    license("Apache-2.0")

    version("3.0-alpha", sha256="4fba856a95c93991cacb904e6a54a7ded93558f7adc8c3e6da99bc347843a434")

    depends_on("mpi")
    depends_on("boost@1.71.0+python")
    depends_on("python@3.6:")
    depends_on("py-setuptools", type="build")

    @when("@3.0-alpha")
    def patch(self):
        files = find(".", "CMakeLists.txt")
        for file in files:
            filter_file("PYTHON_LIBRARIES", "Python_LIBRARIES", file, string=True)

    def setup_run_environment(self, env):
        pylibpath = join_path(
            self.prefix.lib, "python{0}".format(self.spec["python"].version.up_to(2))
        )
        env.prepend_path("PYTHONPATH", join_path(pylibpath, "dist-packages"))