Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions repos/spack_repo/builtin/packages/glx/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -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("[email protected]")

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
Expand Down
41 changes: 29 additions & 12 deletions repos/spack_repo/builtin/packages/libxslt/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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")
Expand All @@ -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")
Expand All @@ -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 = []

Expand All @@ -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),
]
Loading