Flibcpp: update version (#18448)
Update available versions and add Fortran check
This commit is contained in:
parent
1b78a010d8
commit
d904c57d2b
1 changed files with 19 additions and 14 deletions
|
@ -15,6 +15,10 @@ class Flibcpp(CMakePackage):
|
|||
url = "https://github.com/swig-fortran/flibcpp/archive/v0.3.1.tar.gz"
|
||||
|
||||
version('master', branch='master')
|
||||
version('0.5.1', sha256='76db24ce7893f19ab97ea7260c39490ae1bd1e08a4cc5111ad7e70525a916993')
|
||||
version('0.5.0', sha256='94204198304ba4187815431859e5958479fa651a6f06f460b099badbf50f16b2')
|
||||
version('0.4.1', sha256='5c9a11af391fcfc95dd11b95338cff19ed8104df66d42b00ae54f6cde4da5bdf')
|
||||
version('0.4.0', sha256='ccb0acf58a4480977fdb3c62a0bd267297c1dfa687a142ea8822474c38aa322b')
|
||||
version('0.3.1', sha256='871570124122c18018478275d5040b4b787d1966e50ee95b634b0b5e0cd27e91')
|
||||
|
||||
variant('doc', default=False, description='Build and install documentation')
|
||||
|
@ -27,18 +31,19 @@ class Flibcpp(CMakePackage):
|
|||
depends_on('swig@fortran', type='build', when="+swig")
|
||||
depends_on('py-sphinx', type='build', when="+doc")
|
||||
|
||||
@run_before('cmake')
|
||||
def die_without_fortran(self):
|
||||
# Until we can pass compiler requirements through virtual
|
||||
# dependencies, explicitly check for Fortran compiler instead of
|
||||
# waiting for configure error.
|
||||
if (self.compiler.f77 is None) or (self.compiler.fc is None):
|
||||
raise InstallError('Flibcpp requires a Fortran compiler')
|
||||
|
||||
def cmake_args(self):
|
||||
spec = self.spec
|
||||
|
||||
def hasopt(key):
|
||||
return "ON" if ("+" + key) in spec else "OFF"
|
||||
|
||||
testopt = "ON" if self.run_tests else "OFF"
|
||||
opts = [('BUILD_SHARED_LIBS', hasopt('shared')),
|
||||
('BUILD_TESTING', testopt),
|
||||
('FLIBCPP_BUILD_DOCS', hasopt('doc')),
|
||||
('FLIBCPP_BUILD_EXAMPLES', testopt)]
|
||||
fstd = spec.variants['fstd'].value
|
||||
opts.append(('FLIBCPP_FORTRAN_STD', fstd))
|
||||
|
||||
return ['-D{0}={1}'.format(k, v) for (k, v) in opts]
|
||||
return [
|
||||
self.define_from_variant('BUILD_SHARED_LIBS', 'shared'),
|
||||
self.define_from_variant('FLIBCPP_BUILD_DOCS', 'doc'),
|
||||
self.define_from_variant('FLIBCPP_FORTRAN_STD', 'fstd'),
|
||||
self.define('BUILD_TESTING', bool(self.run_tests)),
|
||||
self.define('FLIBCPP_BUILD_EXAMPLES', bool(self.run_tests)),
|
||||
]
|
||||
|
|
Loading…
Reference in a new issue