summaryrefslogtreecommitdiff
path: root/var/spack/repos/builtin/packages/libfort/package.py
blob: aeabbd233e2fbfef962dc3545af96fe242f293ad (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
# 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 Libfort(CMakePackage):
    """libfort is a simple crossplatform library to create formatted text tables."""

    homepage = "https://github.com/seleznevae/libfort"
    url = "https://github.com/seleznevae/libfort/archive/refs/tags/v0.4.2.tar.gz"

    license("MIT")

    version("0.4.2", sha256="8f7b03f1aa526e50c9828f09490f3c844b73d5f9ca72493fe81931746f75e489")

    variant("enable_astyle", default=False, description="Enable astyle")
    variant("enable_wchar", default=True, description="Enable wchar support")
    variant("enable_utf8", default=True, description="Enable utf8 support")
    variant("enable_testing", default=True, description="Enables building tests and examples")
    variant("shared", default=False, description="Build shared library")

    depends_on("cmake@3.0.0:", type="build")

    def cmake_args(self):
        args = [
            self.define_from_variant("FORT_ENABLE_ASTYLE", "enable_astyle"),
            self.define_from_variant("FORT_ENABLE_WCHAR", "enable_wchar"),
            self.define_from_variant("FORT_ENABLE_UTF8", "enable_utf8"),
            self.define_from_variant("FORT_ENABLE_TESTING", "enable_testing"),
            self.define_from_variant("BUILD_SHARED_LIBS", "shared"),
        ]

        return args