diff --git a/repos/spack_repo/builtin/packages/glx/package.py b/repos/spack_repo/builtin/packages/glx/package.py index 0caaf0646d9..bd161ea7d7a 100644 --- a/repos/spack_repo/builtin/packages/glx/package.py +++ b/repos/spack_repo/builtin/packages/glx/package.py @@ -14,9 +14,18 @@ class Glx(BundlePackage): version("1.4") + # GLX is only supported on Linux-like platforms + conflicts("platform=windows") + conflicts("platform=darwin") + depends_on("libglx") provides("gl@4.5") + def setup_dependent_build_environment( + self, env: EnvironmentModifications, dependent_spec: Spec + ): + env.prepend_path("OpenGL_ROOT", self.home) + @property def home(self): return self.spec["libglx"].home diff --git a/repos/spack_repo/builtin/packages/libxslt/package.py b/repos/spack_repo/builtin/packages/libxslt/package.py index 210731d0b0c..ee95e0c6904 100644 --- a/repos/spack_repo/builtin/packages/libxslt/package.py +++ b/repos/spack_repo/builtin/packages/libxslt/package.py @@ -2,12 +2,13 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) -from spack_repo.builtin.build_systems.autotools import AutotoolsPackage +from spack_repo.builtin.build_systems.autotools import AutotoolsBuilder, AutotoolsPackage +from spack_repo.builtin.build_systems.cmake import CMakeBuilder, CMakePackage from spack.package import * -class Libxslt(AutotoolsPackage): +class Libxslt(CMakePackage, AutotoolsPackage): """Libxslt is the XSLT C library developed for the GNOME project. XSLT itself is a an XML language to define transformation for XML. Libxslt is based on libxml2 the XML C library developed for the GNOME project. It also @@ -22,6 +23,8 @@ class Libxslt(AutotoolsPackage): license("X11", checked_by="wdconinc") + build_system(conditional("cmake", when="@1.1.35:"), "autotools", default="cmake") + version("1.1.42", sha256="85ca62cac0d41fc77d3f6033da9df6fd73d20ea2fc18b0a3609ffb4110e1baeb") version("1.1.41", sha256="3ad392af91115b7740f7b50d228cc1c5fc13afc1da7f16cb0213917a37f71bda") version("1.1.40", sha256="194715db023035f65fb566402f2ad2b5eab4c29d541f511305c40b29b1f48d13") @@ -48,7 +51,9 @@ class Libxslt(AutotoolsPackage): depends_on("libxml2+python", when="+python") depends_on("xz") depends_on("zlib-api") + depends_on("libgcrypt", when="+crypto") + conflicts("+crypto", when="platform=windows") depends_on("python+shared", when="+python") extends("python", when="+python") @@ -59,6 +64,20 @@ def url_for_version(self, v): else: return f"http://xmlsoft.org/sources/libxslt-{v}.tar.gz" + @run_after("install") + @on_package_attributes(run_tests=True) + def import_module_test(self): + if self.spec.satisfies("+python"): + with working_dir("spack-test", create=True): + python("-c", "import libxslt") + + def patch(self): + # Remove flags not recognized by the NVIDIA compiler + if self.spec.satisfies("build_system=autotools %nvhpc"): + filter_file("-Wmissing-format-attribute", "", "configure") + + +class AutotoolsBuilder(AutotoolsBuilder): def configure_args(self): args = [] @@ -74,14 +93,12 @@ def configure_args(self): return args - @run_after("install") - @on_package_attributes(run_tests=True) - def import_module_test(self): - if self.spec.satisfies("+python"): - with working_dir("spack-test", create=True): - python("-c", "import libxslt") - def patch(self): - # Remove flags not recognized by the NVIDIA compiler - if self.spec.satisfies("%nvhpc"): - filter_file("-Wmissing-format-attribute", "", "configure") +class CMakeBuilder(CMakeBuilder): + def cmake_args(self): + return [ + self.define_from_variant("LIBXSLT_WITH_PYTHON", "python"), + self.define_from_variant("LIBXSLT_WITH_CRYPTO", "crypto"), + self.define("LIBXSLT_WITH_MODULES", False), + self.define("LIBXSLT_WITH_TESTS", False), + ]