summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorSeth R. Johnson <johnsonsr@ornl.gov>2019-09-25 22:25:24 -0400
committerPeter Scheibel <scheibel1@llnl.gov>2019-09-25 19:25:24 -0700
commitf2967b6c16effd26ce007cf86cadbb645c574f50 (patch)
tree0a9168d131421bf92fda857eb41159a8286475b9 /var
parentb384504218b47facd885bad3e9933e945a7de6a4 (diff)
downloadspack-f2967b6c16effd26ce007cf86cadbb645c574f50.tar.gz
spack-f2967b6c16effd26ce007cf86cadbb645c574f50.tar.bz2
spack-f2967b6c16effd26ce007cf86cadbb645c574f50.tar.xz
spack-f2967b6c16effd26ce007cf86cadbb645c574f50.zip
New package: flibcpp (Fortran bindings to C++ standard library) (#12926)
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/flibcpp/package.py44
1 files changed, 44 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/flibcpp/package.py b/var/spack/repos/builtin/packages/flibcpp/package.py
new file mode 100644
index 0000000000..b03fa79cbb
--- /dev/null
+++ b/var/spack/repos/builtin/packages/flibcpp/package.py
@@ -0,0 +1,44 @@
+# Copyright 2013-2019 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 import *
+
+
+class Flibcpp(CMakePackage):
+ """Fortran bindings to the C++ Standard Library.
+ """
+
+ homepage = "https://flibcpp.readthedocs.io/en/latest"
+ git = "https://github.com/swig-fortran/flibcpp.git"
+ url = "https://github.com/swig-fortran/flibcpp/archive/v0.3.0.tar.gz"
+
+ version('master', branch='master')
+ version('0.3.1', sha256='871570124122c18018478275d5040b4b787d1966e50ee95b634b0b5e0cd27e91')
+
+ variant('doc', default=False, description='Build and install documentation')
+ variant('shared', default=True, description='Build shared libraries')
+ variant('swig', default=False,
+ description='Regenerate source files using SWIG')
+ variant('fstd', default='03', values=('none', '03', '08', '15', '18'),
+ multi=False, description='Build with this Fortran standard')
+
+ depends_on('swig@fortran', type='build', when="+swig")
+ depends_on('py-sphinx', type='build', when="+doc")
+
+ 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]