summaryrefslogtreecommitdiff
path: root/var/spack/repos/builtin/packages/openlibm/package.py
blob: 5bbfe9be6ff46ff316a53a14657191d4a7e7c89c (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-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 Openlibm(MakefilePackage):
    """OpenLibm is an effort to have a high quality, portable, standalone C
    mathematical library"""

    homepage = "https://github.com/JuliaMath/openlibm"
    url = "https://github.com/JuliaMath/openlibm/archive/refs/tags/v0.8.0.tar.gz"

    maintainers("haampie")

    license("MIT AND BSD-2-Clause AND ISC AND LGPL-2.1-or-later")

    version("0.8.1", sha256="ba8a282ecd92d0033f5656bb20dfc6ea3fb83f90ba69291ac8f7beba42dcffcf")
    version("0.8.0", sha256="03620768df4ca526a63dd675c6de95a5c9d167ff59555ce57a61c6bf49e400ee")
    version("0.7.5", sha256="be983b9e1e40e696e8bbb7eb8f6376d3ca0ae675ae6d82936540385b0eeec15b")

    def make(self, spec, prefix):
        args = [
            "prefix={0}".format(prefix),
            "USE_GCC={0}".format("1" if self.compiler.name == "gcc" else "0"),
            "USE_CLANG={0}".format("1" if self.compiler.name == "clang" else "0"),
        ]
        make(*args)

    def install(self, spec, prefix):
        args = ["prefix={0}".format(prefix)]
        make("install", *args)