diff options
author | James Smillie <83249606+jamessmillie@users.noreply.github.com> | 2024-06-14 14:43:20 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-14 13:43:20 -0700 |
commit | e092026eb8680473db4aa88053f353a8662aac85 (patch) | |
tree | 41795e529c6a7b90eacec7e76ccc898a134bf344 /var | |
parent | e5f5749d676d0cc4e247dd41c73bc31ff6b6945e (diff) | |
download | spack-e092026eb8680473db4aa88053f353a8662aac85.tar.gz spack-e092026eb8680473db4aa88053f353a8662aac85.tar.bz2 spack-e092026eb8680473db4aa88053f353a8662aac85.tar.xz spack-e092026eb8680473db4aa88053f353a8662aac85.zip |
muparser: refactor to use new multi-build-system logic (#44552)
Diffstat (limited to 'var')
-rw-r--r-- | var/spack/repos/builtin/packages/muparser/package.py | 38 |
1 files changed, 23 insertions, 15 deletions
diff --git a/var/spack/repos/builtin/packages/muparser/package.py b/var/spack/repos/builtin/packages/muparser/package.py index 3364f50a33..98742ddd83 100644 --- a/var/spack/repos/builtin/packages/muparser/package.py +++ b/var/spack/repos/builtin/packages/muparser/package.py @@ -6,7 +6,7 @@ from spack.package import * -class Muparser(Package): +class Muparser(CMakePackage, Package): """C++ math expression parser library.""" homepage = "https://beltoforion.de/en/muparser/" @@ -22,21 +22,29 @@ class Muparser(Package): # https://github.com/beltoforion/muparser/pull/46 patch("auto_ptr.patch", when="@2.2.5") - depends_on("cmake@3.1.0:", when="@2.2.6:", type="build") - - # Cmake build since 2.2.6 - @when("@2.2.6:") - def install(self, spec, prefix): - cmake_args = ["-DENABLE_SAMPLES=OFF", "-DENABLE_OPENMP=OFF", "-DBUILD_SHARED_LIBS=ON"] - - cmake_args.extend(std_cmake_args) - - with working_dir("spack-build", create=True): - cmake("..", *cmake_args) - make() - make("install") + variant("samples", default=True, description="enable samples", when="build_system=cmake") + variant("openmp", default=True, description="enable OpenMP support", when="build_system=cmake") + variant( + "wide_char", + default=False, + description="enable wide character strings in place of ASCII", + when="build_system=cmake", + ) + variant("shared", default=True, description="enable shared libs", when="build_system=cmake") + + # Non-CMake build system is not supported by windows + conflicts("platform=windows", when="@:2.2.5") + build_system(conditional("cmake", when="@2.2.6:"), "generic", default="cmake") + + def cmake_args(self): + return [ + self.define_from_variant("ENABLE_SAMPLES", "samples"), + self.define_from_variant("ENABLE_OPENMP", "openmp"), + self.define_from_variant("BUILD_SHARED_LIBS", "shared"), + self.define_from_variant("ENABLE_WIDE_CHAR", "wide_char"), + ] - @when("@2.2.5") + @when("@:2.2.5") def install(self, spec, prefix): options = [ "--disable-debug", |