diff options
author | Seth R. Johnson <johnsonsr@ornl.gov> | 2021-06-03 05:22:06 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-03 11:22:06 +0200 |
commit | a478a8cf9ad0e1d627c841e6e43db75d5eed302c (patch) | |
tree | cf5af17ceb6918a3346c95dd822b24231f19b031 /var | |
parent | f7c9e497f1ff6466c5c2d1a4c8f604892c292dcd (diff) | |
download | spack-a478a8cf9ad0e1d627c841e6e43db75d5eed302c.tar.gz spack-a478a8cf9ad0e1d627c841e6e43db75d5eed302c.tar.bz2 spack-a478a8cf9ad0e1d627c841e6e43db75d5eed302c.tar.xz spack-a478a8cf9ad0e1d627c841e6e43db75d5eed302c.zip |
flibcpp: add v1.0.1 and smoke test (#24050)
Diffstat (limited to 'var')
-rw-r--r-- | var/spack/repos/builtin/packages/flibcpp/package.py | 40 |
1 files changed, 35 insertions, 5 deletions
diff --git a/var/spack/repos/builtin/packages/flibcpp/package.py b/var/spack/repos/builtin/packages/flibcpp/package.py index f0b0551c6c..56f0ac4ed4 100644 --- a/var/spack/repos/builtin/packages/flibcpp/package.py +++ b/var/spack/repos/builtin/packages/flibcpp/package.py @@ -12,8 +12,9 @@ class Flibcpp(CMakePackage): 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.1.tar.gz" + url = "https://github.com/swig-fortran/flibcpp/archive/v1.0.1.tar.gz" + version('1.0.1', sha256='8569c71eab0257097a6aa666a6d86bdcb6cd6e31244d32cc5b2478d0e936ca7a') version('0.5.2', sha256='b9b4eb6431d5b56a54c37f658df7455eafd3d204a5534903b127e0c8a1c9b827') version('0.5.1', sha256='76db24ce7893f19ab97ea7260c39490ae1bd1e08a4cc5111ad7e70525a916993') version('0.5.0', sha256='94204198304ba4187815431859e5958479fa651a6f06f460b099badbf50f16b2') @@ -40,11 +41,40 @@ class Flibcpp(CMakePackage): raise InstallError('Flibcpp requires a Fortran compiler') def cmake_args(self): + from_variant = self.define_from_variant + fstd_key = ('FLIBCPP_Fortran_STANDARD' if self.version > Version('1.0.0') + else 'FLIBCPP_FORTRAN_STD') 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_from_variant('FLIBCPP_USE_SWIG', 'swig'), + from_variant('BUILD_SHARED_LIBS', 'shared'), + from_variant('FLIBCPP_BUILD_DOCS', 'doc'), + from_variant(fstd_key, 'fstd'), + from_variant('FLIBCPP_USE_SWIG', 'swig'), self.define('FLIBCPP_BUILD_TESTS', bool(self.run_tests)), self.define('FLIBCPP_BUILD_EXAMPLES', bool(self.run_tests)), ] + + examples_src_dir = 'example' + + @run_after('install') + def setup_smoke_tests(self): + """Copy the example source files after the package is installed to an + install test subdirectory for use during `spack test run`.""" + self.cache_extra_test_sources([self.examples_src_dir]) + + def test(self): + example_src_dir = join_path(self.install_test_root, + self.examples_src_dir) + test_build_dir = join_path(self.test_suite.stage, + 'build_example') + + cmake_args = [ + self.define('CMAKE_PREFIX_PATH', self.prefix), + self.define('CMAKE_Fortran_COMPILER', self.compiler.fc), + ] + cmake_args.append(example_src_dir) + with working_dir(test_build_dir, create=True): + cmake(*cmake_args) + make() + self.run_test(join_path(example_src_dir, 'run-examples.sh'), + [], [], installed=False, + purpose='test: installation') |