summaryrefslogtreecommitdiff
path: root/var/spack/repos/builtin/packages/octa/package.py
blob: 4ae34b8f9abdfd6887f1fdbad37892147a33a5cb (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
54
55
56
57
58
59
60
61
62
63
# Copyright 2013-2024 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 Octa(AutotoolsPackage):
    """OCTA is an integrated simulation system for soft materials."""

    homepage = "https://octa.jp"
    url = (
        "http://49.212.191.63/phpBB/download/file.php?id=3454&sid=3dfae182c664d1f5960d9ca63c40798a"
    )

    version(
        "8.4",
        sha256="b76d25f333fef76601bfe8262e9a748154280d5408ea823fa6530a6f3f86b51b",
        extension="tar.gz",
    )

    depends_on("autoconf", type="build")
    depends_on("automake", type="build")
    depends_on("libtool", type="build")
    depends_on("libjpeg", type="link")
    depends_on("libpng", type="link")
    depends_on("zlib-api", type="link")
    depends_on("jogl")
    depends_on("python")
    depends_on("gnuplot", type="run")
    depends_on("py-numpy")
    depends_on("py-scipy")
    depends_on("py-numba")

    # specify for linux_aarch64
    patch("aarch64.patch", when="target=aarch64:")
    # For jogl 2.3.2 or later
    patch("jogl.patch")
    # patch for non-constant-expression cannot be narrowed error.
    patch("narrowed-initialize.patch")

    configure_directory = join_path("GOURMET", "src")

    def patch(self):
        with working_dir(self.configure_directory):
            copy("jogltest.java_v232", "jogltest.java")

    def configure_args(self):
        spec = self.spec
        args = [
            "--with-python={0}".format(spec["python"].command),
            "--with-java-home={0}".format(spec["java"].prefix),
            "--with-jogl-jar={0}".format(spec["jogl"].prefix.lib),
            "--with-jogl-lib={0}".format(spec["jogl"].prefix.lib),
        ]
        return args

    def install(self, spec, prefix):
        mkdirp(prefix.bin)
        install(join_path("GOURMET", "bin", "*.sh"), prefix.bin)
        with working_dir(self.configure_directory):
            make("install", parallel=False)