2021-01-02 15:10:28 +08:00
|
|
|
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
|
2018-10-08 04:52:23 +08:00
|
|
|
# Spack Project Developers. See the top-level COPYRIGHT file for details.
|
2016-05-12 12:22:25 +08:00
|
|
|
#
|
2018-10-08 04:52:23 +08:00
|
|
|
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
|
|
|
|
2016-03-22 05:36:31 +08:00
|
|
|
from spack import *
|
2016-05-10 23:46:11 +08:00
|
|
|
|
2016-03-22 05:36:31 +08:00
|
|
|
|
2016-10-25 07:41:20 +08:00
|
|
|
class Astyle(MakefilePackage):
|
2016-08-24 23:32:29 +08:00
|
|
|
"""A Free, Fast, and Small Automatic Formatter for C, C++, C++/CLI,
|
2016-05-10 23:46:11 +08:00
|
|
|
Objective-C, C#, and Java Source Code.
|
|
|
|
"""
|
2016-08-24 23:32:29 +08:00
|
|
|
|
2016-03-22 05:36:31 +08:00
|
|
|
homepage = "http://astyle.sourceforge.net/"
|
2018-01-09 23:40:27 +08:00
|
|
|
url = "https://sourceforge.net/projects/astyle/files/astyle/astyle%203.0.1/astyle_3.0.1_linux.tar.gz"
|
|
|
|
# Gentoo alternative
|
|
|
|
# url = "http://distfiles.gentoo.org/distfiles/astyle_3.0.1_linux.tar.gz"
|
2016-03-22 05:36:31 +08:00
|
|
|
|
2019-10-11 13:44:41 +08:00
|
|
|
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')
|
2016-03-22 05:36:31 +08:00
|
|
|
|
2016-07-11 16:08:19 +08:00
|
|
|
parallel = False
|
2016-03-22 05:36:31 +08:00
|
|
|
|
2017-01-26 18:27:15 +08:00
|
|
|
@property
|
2016-10-24 04:38:19 +08:00
|
|
|
def build_directory(self):
|
2016-07-11 16:08:19 +08:00
|
|
|
return join_path(self.stage.source_path, 'build', self.compiler.name)
|
2016-05-10 19:37:57 +08:00
|
|
|
|
2016-07-11 16:08:19 +08:00
|
|
|
def edit(self, spec, prefix):
|
2017-02-08 10:22:52 +08:00
|
|
|
makefile = join_path(self.build_directory, 'Makefile')
|
2016-07-11 16:08:19 +08:00
|
|
|
filter_file(r'^CXX\s*=.*', 'CXX=%s' % spack_cxx, makefile)
|
2021-01-15 01:56:24 +08:00
|
|
|
# If the group is not a user account, the installation will fail,
|
|
|
|
# so remove the -o $ (USER) -g $ (USER) parameter.
|
|
|
|
filter_file(r'^INSTALL=.*', 'INSTALL=install', makefile)
|
2016-05-10 19:37:57 +08:00
|
|
|
|
2016-12-16 02:15:52 +08:00
|
|
|
@property
|
|
|
|
def install_targets(self):
|
|
|
|
return ['install', 'prefix={0}'.format(self.prefix)]
|