summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorOlivier Cessenat <cessenat@gmail.com>2024-02-02 18:58:27 +0100
committerGitHub <noreply@github.com>2024-02-02 18:58:27 +0100
commit714590426fc5c68bd7f30ab3424cd2b5dbff6cd5 (patch)
treeeaa574a63f9d1aa315e66447bc302d9000ee1a3d /var
parent9ffe1799346fce7615eb03483545a08d7023b2ce (diff)
downloadspack-714590426fc5c68bd7f30ab3424cd2b5dbff6cd5.tar.gz
spack-714590426fc5c68bd7f30ab3424cd2b5dbff6cd5.tar.bz2
spack-714590426fc5c68bd7f30ab3424cd2b5dbff6cd5.tar.xz
spack-714590426fc5c68bd7f30ab3424cd2b5dbff6cd5.zip
astyle: new version 4.1.11 and build using cmake (#42390)
Co-authored-by: Massimiliano Culpo <massimiliano.culpo@gmail.com>
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/astyle/package.py33
1 files changed, 27 insertions, 6 deletions
diff --git a/var/spack/repos/builtin/packages/astyle/package.py b/var/spack/repos/builtin/packages/astyle/package.py
index 8c0e6a11cc..716a5f7c1e 100644
--- a/var/spack/repos/builtin/packages/astyle/package.py
+++ b/var/spack/repos/builtin/packages/astyle/package.py
@@ -3,34 +3,55 @@
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
+from spack.build_systems import makefile
from spack.package import *
-class Astyle(MakefilePackage):
+class Astyle(CMakePackage, MakefilePackage):
"""A Free, Fast, and Small Automatic Formatter for C, C++, C++/CLI,
Objective-C, C#, and Java Source Code.
"""
homepage = "http://astyle.sourceforge.net/"
- url = "https://sourceforge.net/projects/astyle/files/astyle/astyle%203.0.1/astyle_3.0.1_linux.tar.gz"
- # Gentoo alternative
- # url = "https://distfiles.gentoo.org/distfiles/astyle_3.0.1_linux.tar.gz"
+ url = "https://sourceforge.net/projects/astyle/files/astyle/astyle%204.1.11/astyle-4.1.11.tar.bz2"
+ list_url = "https://sourceforge.net/projects/astyle/files/astyle"
+ list_depth = 1
+
+ maintainers("cessenat")
license("MIT")
+ version("3.4.11", sha256="15b22bc6cbc038ccd8cef3804efec02f35c6f2538b75c93bc7f76e4de98aba92")
+ version("3.3.1", sha256="246979db8ba82948d2925f823293321617e4a51dcac8719b370b670782e9c57d")
+ version("3.2.1", sha256="191576fbd1f4abe55a25769c176da78294ec590f96f27037a4746bda0f84fe60")
version("3.1", sha256="cbcc4cf996294534bb56f025d6f199ebfde81aa4c271ccbd5ee1c1a3192745d7")
version("3.0.1", sha256="6c3ab029e0e4a75e2e603d449014374aa8269218fdd03a4aaa46ab743b1912fd")
version("2.06", sha256="3b7212210dc139e8f648e004b758c0be1b3ceb1694b22a879202d2b833db7c7e")
version("2.05.1", sha256="fbdfc6f1966a972d19a215927266c76d4183eee235ed1e2bd7ec551c2a270eac")
version("2.04", sha256="70b37f4853c418d1e2632612967eebf1bdb93dfbe558c51d7d013c9b4e116b60")
+ depends_on("cmake@3.8.0:", type="build", when="@3.2.0:")
+
+ build_system(conditional("cmake", when="@3.2.0:"), "makefile", default="cmake")
+
parallel = False
+ conflicts("%oneapi", when="@:3.1.99")
+
+ def url_for_version(self, version):
+ root = self.url.rsplit("/", 2)[0]
+ url = f"{root}/astyle%20{version.up_to(2)}/astyle-{version}.tar.bz2"
+ if version < Version("3.2.0"):
+ url = f"{root}/astyle%20{version.up_to(2)}/astyle_{version}_linux.tar.gz"
+ return url
+
+
+class MakefileBuilder(makefile.MakefileBuilder):
@property
def build_directory(self):
- return join_path(self.stage.source_path, "build", self.compiler.name)
+ return join_path(self.stage.source_path, "build", self.pkg.compiler.name)
- def edit(self, spec, prefix):
+ def edit(self, pkg, spec, prefix):
makefile = join_path(self.build_directory, "Makefile")
filter_file(r"^CXX\s*=.*", f"CXX={spack_cxx}", makefile)
# If the group is not a user account, the installation will fail,