Compare commits

..

17 Commits

Author SHA1 Message Date
Wouter Deconinck
026521132f cairo: import spack.build_systems 2025-01-08 12:23:03 -06:00
Wouter Deconinck
649d6f901c cairo: depends_on pixman@0.40: when @1.18.2: 2025-01-08 12:23:03 -06:00
Wouter Deconinck
ff9d763de5 cairo: add v1.18.2 2025-01-08 12:23:03 -06:00
Wouter Deconinck
3e466a5d66 cairo: depends_on lzo 2025-01-08 12:23:03 -06:00
Wouter Deconinck
ec9d3f799e cairo: depends_on freetype@2.10: for FT_Color 2025-01-08 12:23:03 -06:00
Wouter Deconinck
4928acf3a4 cairo: add 1.17.6 for continuity; doc lines 2025-01-08 12:23:03 -06:00
wdconinc
248b99c1d4 [@spackbot] updating style on behalf of wdconinc 2025-01-08 12:23:03 -06:00
Wouter Deconinck
340a7a564c cairo: fix variant in spec syntax 2025-01-08 12:23:03 -06:00
Wouter Deconinck
384afd559b cairo: "new" version 1.18.0 (now also MesonPackage) 2025-01-08 12:23:03 -06:00
Harmen Stoppels
c424611010 directory_layout.py: remove dependency on global spack.store.STORE (#48460) 2025-01-08 17:44:32 +01:00
Xuefeng Ding
35963d7d7d geant4-data: support G4TENDL (#48310)
* add parse tool, json, and load json

bug fix

add variants and conflictions for g4tendl

* correct format

* correct format

* update version mapping

* remove 1.0

* Update var/spack/repos/builtin/packages/geant4-data/package.py

Co-authored-by: Seth R. Johnson <johnsonsr@ornl.gov>

* add options

* depends on it

* fix typo

---------

Co-authored-by: Seth R. Johnson <johnsonsr@ornl.gov>
2025-01-08 10:40:06 -06:00
Wouter Deconinck
7e62ca864a ninja: support tests for 1.12 and later (#48385)
* ninja: support tests for 1.12:

* ninja: fix style
2025-01-08 16:57:25 +01:00
Harmen Stoppels
fa9ef0ac89 config.py: deprecate config:install_path_scheme (#48463) 2025-01-08 16:02:11 +01:00
Harmen Stoppels
55d9fe20e5 warnings.showwarning: set earlier (#48462)
Co-authored-by: haampie <haampie@users.noreply.github.com>
2025-01-08 07:27:22 -07:00
Harmen Stoppels
434a8d54d4 directory_layout: types and remove kwargs (#48459) 2025-01-08 14:09:36 +01:00
Adrien Bernede
7328c64fc7 CachedCMakePackage: set CMAKE_*_RPATH with implicit and extra rpaths (#48067)
This is useful when CachedCMakePackage is used without the Spack compiler wrapper.
2025-01-08 04:18:44 -07:00
Massimiliano Culpo
4be7b98fd2 Perl build system: add a dependency on gmake (#48437) 2025-01-08 09:10:22 +01:00
17 changed files with 212 additions and 149 deletions

View File

@@ -206,7 +206,6 @@ def setup(sphinx):
("py:class", "TextIO"),
("py:class", "hashlib._Hash"),
("py:class", "concurrent.futures._base.Executor"),
("py:class", "jsonschema.exceptions.ValidationError"),
# Spack classes that are private and we don't want to expose
("py:class", "spack.provider_index._IndexBase"),
("py:class", "spack.repo._PrependFileLoader"),

View File

@@ -25,14 +25,23 @@ These settings can be overridden in ``etc/spack/config.yaml`` or
The location where Spack will install packages and their dependencies.
Default is ``$spack/opt/spack``.
---------------------------------------------------
``install_hash_length`` and ``install_path_scheme``
---------------------------------------------------
---------------
``projections``
---------------
The default Spack installation path can be very long and can create problems
for scripts with hardcoded shebangs. Additionally, when using the Intel
compiler, and if there is also a long list of dependencies, the compiler may
segfault. If you see the following:
.. warning::
Modifying projections of the install tree is strongly discouraged.
By default Spack installs all packages into a unique directory relative to the install
tree root with the following layout:
.. code-block::
{architecture}/{compiler.name}-{compiler.version}/{name}-{version}-{hash}
In very rare cases, it may be necessary to reduce the length of this path. For example,
very old versions of the Intel compiler are known to segfault when input paths are too long:
.. code-block:: console
@@ -40,36 +49,25 @@ segfault. If you see the following:
** Segmentation violation signal raised. **
Access violation or stack overflow. Please contact Intel Support for assistance.
it may be because variables containing dependency specs may be too long. There
are two parameters to help with long path names. Firstly, the
``install_hash_length`` parameter can set the length of the hash in the
installation path from 1 to 32. The default path uses the full 32 characters.
Another case is Python and R packages with many runtime dependencies, which can result
in very large ``PYTHONPATH`` and ``R_LIBS`` environment variables. This can cause the
``execve`` system call to fail with ``E2BIG``, preventing processes from starting.
Secondly, it is also possible to modify the entire installation
scheme. By default Spack uses
``{architecture}/{compiler.name}-{compiler.version}/{name}-{version}-{hash}``
where the tokens that are available for use in this directive are the
same as those understood by the :meth:`~spack.spec.Spec.format`
method. Using this parameter it is possible to use a different package
layout or reduce the depth of the installation paths. For example
For this reason, Spack allows users to modify the installation layout through custom
projections. For example
.. code-block:: yaml
config:
install_path_scheme: '{name}/{version}/{hash:7}'
install_tree:
root: $spack/opt/spack
projections:
all: "{name}/{version}/{hash:16}"
would install packages into sub-directories using only the package
name, version and a hash length of 7 characters.
would install packages into sub-directories using only the package name, version and a
hash length of 16 characters.
When using either parameter to set the hash length it only affects the
representation of the hash in the installation directory. You
should be aware that the smaller the hash length the more likely
naming conflicts will occur. These parameters are independent of those
used to configure module names.
.. warning:: Modifying the installation hash length or path scheme after
packages have been installed will prevent Spack from being
able to find the old installation directories.
Notice that reducing the hash length increases the likelihood of hash collisions.
--------------------
``build_stage``

View File

@@ -298,7 +298,14 @@ def initconfig_hardware_entries(self):
def std_initconfig_entries(self):
cmake_prefix_path_env = os.environ["CMAKE_PREFIX_PATH"]
cmake_prefix_path = cmake_prefix_path_env.replace(os.pathsep, ";")
complete_rpath_list = ";".join(
[
self.pkg.spec.prefix.lib,
self.pkg.spec.prefix.lib64,
*os.environ.get("SPACK_COMPILER_EXTRA_RPATHS", "").split(":"),
*os.environ.get("SPACK_COMPILER_IMPLICIT_RPATHS", "").split(":"),
]
)
return [
"#------------------{0}".format("-" * 60),
"# !!!! This is a generated file, edit at own risk !!!!",
@@ -307,6 +314,8 @@ def std_initconfig_entries(self):
"#------------------{0}\n".format("-" * 60),
cmake_cache_string("CMAKE_PREFIX_PATH", cmake_prefix_path),
cmake_cache_string("CMAKE_INSTALL_RPATH_USE_LINK_PATH", "ON"),
cmake_cache_string("CMAKE_BUILD_RPATH", complete_rpath_list),
cmake_cache_string("CMAKE_INSTALL_RPATH", complete_rpath_list),
self.define_cmake_cache_from_variant("CMAKE_BUILD_TYPE", "build_type"),
]

View File

@@ -10,8 +10,9 @@
import spack.builder
import spack.package_base
import spack.phase_callbacks
from spack.directives import build_system, extends
from spack.directives import build_system, depends_on, extends
from spack.install_test import SkipTest, test_part
from spack.multimethod import when
from spack.util.executable import Executable
from ._checks import BuilderWithDefaults, execute_build_time_tests
@@ -28,7 +29,9 @@ class PerlPackage(spack.package_base.PackageBase):
build_system("perl")
extends("perl", when="build_system=perl")
with when("build_system=perl"):
extends("perl")
depends_on("gmake", type="build")
@property
@memoized

View File

@@ -34,11 +34,8 @@
import os
import re
import sys
import warnings
from typing import Any, Callable, Dict, Generator, List, Optional, Tuple, Union
import jsonschema
from llnl.util import filesystem, lang, tty
import spack.error
@@ -1051,6 +1048,7 @@ def validate(
This leverages the line information (start_mark, end_mark) stored
on Spack YAML structures.
"""
import jsonschema
try:
spack.schema.Validator(schema).validate(data)
@@ -1059,12 +1057,7 @@ def validate(
line_number = e.instance.lc.line + 1
else:
line_number = None
exception = ConfigFormatError(e, data, filename, line_number)
if isinstance(e, spack.schema.NonFatalValidationError):
warnings.warn(str(exception))
else:
raise exception from e
raise ConfigFormatError(e, data, filename, line_number) from e
# return the validated data so that we can access the raw data
# mostly relevant for environments
return data

View File

@@ -6,8 +6,6 @@
"""
import warnings
import jsonschema
import spack.environment as ev
import spack.schema.env as env
import spack.util.spack_yaml as syaml
@@ -32,6 +30,7 @@ def validate(configuration_file):
Returns:
A sanitized copy of the configuration stored in the input file
"""
import jsonschema
with open(configuration_file, encoding="utf-8") as f:
config = syaml.load(f)

View File

@@ -8,7 +8,7 @@
import shutil
import sys
from pathlib import Path
from typing import List, Optional, Tuple
from typing import Dict, List, Optional, Tuple
import llnl.util.filesystem as fs
from llnl.util.symlink import readlink
@@ -17,7 +17,6 @@
import spack.hash_types as ht
import spack.projections
import spack.spec
import spack.store
import spack.util.spack_json as sjson
from spack.error import SpackError
@@ -69,10 +68,9 @@ def specs_from_metadata_dirs(root: str) -> List["spack.spec.Spec"]:
class DirectoryLayout:
"""A directory layout is used to associate unique paths with specs.
Different installations are going to want different layouts for their
install, and they can use this to customize the nesting structure of
spack installs. The default layout is:
"""A directory layout is used to associate unique paths with specs. Different installations are
going to want different layouts for their install, and they can use this to customize the
nesting structure of spack installs. The default layout is:
* <install root>/
@@ -82,35 +80,30 @@ class DirectoryLayout:
* <name>-<version>-<hash>
The hash here is a SHA-1 hash for the full DAG plus the build
spec.
The installation directory projections can be modified with the projections argument."""
The installation directory projections can be modified with the
projections argument.
"""
def __init__(self, root, **kwargs):
def __init__(
self,
root,
*,
projections: Optional[Dict[str, str]] = None,
hash_length: Optional[int] = None,
) -> None:
self.root = root
self.check_upstream = True
projections = kwargs.get("projections") or default_projections
self.projections = dict(
(key, projection.lower()) for key, projection in projections.items()
)
projections = projections or default_projections
self.projections = {key: projection.lower() for key, projection in projections.items()}
# apply hash length as appropriate
self.hash_length = kwargs.get("hash_length", None)
self.hash_length = hash_length
if self.hash_length is not None:
for when_spec, projection in self.projections.items():
if "{hash}" not in projection:
if "{hash" in projection:
raise InvalidDirectoryLayoutParametersError(
"Conflicting options for installation layout hash" " length"
)
else:
raise InvalidDirectoryLayoutParametersError(
"Cannot specify hash length when the hash is not"
" part of all install_tree projections"
)
raise InvalidDirectoryLayoutParametersError(
"Conflicting options for installation layout hash length"
if "{hash" in projection
else "Cannot specify hash length when the hash is not part of all "
"install_tree projections"
)
self.projections[when_spec] = projection.replace(
"{hash}", "{hash:%d}" % self.hash_length
)
@@ -279,13 +272,6 @@ def path_for_spec(self, spec):
if spec.external:
return spec.external_path
if self.check_upstream:
upstream, record = spack.store.STORE.db.query_by_spec_hash(spec.dag_hash())
if upstream:
raise SpackError(
"Internal error: attempted to call path_for_spec on"
" upstream-installed package."
)
path = self.relative_path_for_spec(spec)
assert not path.startswith(self.root)

View File

@@ -503,7 +503,7 @@ def make_argument_parser(**kwargs):
return parser
def send_warning_to_tty(message, category, filename, lineno, file=None, line=None):
def showwarning(message, category, filename, lineno, file=None, line=None):
"""Redirects messages to tty.warn."""
if category is spack.error.SpackAPIWarning:
tty.warn(f"{filename}:{lineno}: {message}")
@@ -513,9 +513,6 @@ def send_warning_to_tty(message, category, filename, lineno, file=None, line=Non
def setup_main_options(args):
"""Configure spack globals based on the basic options."""
# Assign a custom function to show warnings
warnings.showwarning = send_warning_to_tty
# Set up environment based on args.
tty.set_verbose(args.verbose)
tty.set_debug(args.debug)
@@ -906,9 +903,10 @@ def _main(argv=None):
# main() is tricky to get right, so be careful where you put things.
#
# Things in this first part of `main()` should *not* require any
# configuration. This doesn't include much -- setting up th parser,
# configuration. This doesn't include much -- setting up the parser,
# restoring some key environment variables, very simple CLI options, etc.
# ------------------------------------------------------------------------
warnings.showwarning = showwarning
# Create a parser with a simple positional argument first. We'll
# lazily load the subcommand(s) we need later. This allows us to

View File

@@ -4,10 +4,7 @@
"""This module contains jsonschema files for all of Spack's YAML formats."""
import copy
import typing
import jsonschema
import jsonschema.exceptions
import jsonschema.validators
import warnings
import llnl.util.lang
@@ -19,14 +16,14 @@ class DeprecationMessage(typing.NamedTuple):
error: bool
class NonFatalValidationError(jsonschema.exceptions.ValidationError):
"""A validation error that should only produce a warning."""
# jsonschema is imported lazily as it is heavy to import
# and increases the start-up time
def _make_validator():
import jsonschema
def _validate_spec(validator, is_spec, instance, schema):
"""Check if the attributes on instance are valid specs."""
import jsonschema
import spack.spec_parser
@@ -59,18 +56,15 @@ def _deprecated_properties(validator, deprecated, instance, schema):
# Process issues
errors = []
warnings = []
for name in issues:
msg = deprecations[name].message.format(name=name)
if deprecations[name].error:
errors.append(msg)
else:
warnings.append(msg)
warnings.warn(msg)
if errors:
yield jsonschema.ValidationError("\n".join(errors))
if warnings:
yield NonFatalValidationError("\n".join(warnings))
return jsonschema.validators.extend(
jsonschema.Draft4Validator,

View File

@@ -106,10 +106,17 @@
{
"names": ["install_missing_compilers"],
"message": "The config:install_missing_compilers option has been deprecated in "
"Spack v0.23, and is currently ignored. It will be removed from config after "
"Spack v0.23, and is currently ignored. It will be removed from config in "
"Spack v1.0.",
"error": False,
},
{
"names": ["install_path_scheme"],
"message": "The config:install_path_scheme option was deprecated in Spack v0.16 "
"in favor of config:install_tree:projections:all. It will be removed in Spack "
"v1.0.",
"error": False,
},
],
}
}

View File

@@ -9,8 +9,6 @@
"""
from typing import Any, Dict
import jsonschema
#: Common properties for connection specification
connection = {
"url": {"type": "string"},
@@ -104,6 +102,7 @@
def update(data):
import jsonschema
errors = []

View File

@@ -43,7 +43,6 @@
import spack.util.url as url_util
import spack.util.web as web_util
from spack.binary_distribution import CannotListKeys, GenerateIndexError
from spack.directory_layout import DirectoryLayout
from spack.paths import test_path
from spack.spec import Spec
@@ -136,35 +135,28 @@ def default_config(tmp_path, config_directory, monkeypatch, install_mockery):
@pytest.fixture(scope="function")
def install_dir_default_layout(tmpdir):
"""Hooks a fake install directory with a default layout"""
scheme = os.path.join(
"${architecture}", "${compiler.name}-${compiler.version}", "${name}-${version}-${hash}"
)
real_store, real_layout = spack.store.STORE, spack.store.STORE.layout
opt_dir = tmpdir.join("opt")
spack.store.STORE = spack.store.Store(str(opt_dir))
spack.store.STORE.layout = DirectoryLayout(str(opt_dir), path_scheme=scheme)
original_store, spack.store.STORE = spack.store.STORE, spack.store.Store(str(opt_dir))
try:
yield spack.store
finally:
spack.store.STORE = real_store
spack.store.STORE.layout = real_layout
spack.store.STORE = original_store
@pytest.fixture(scope="function")
def install_dir_non_default_layout(tmpdir):
"""Hooks a fake install directory with a non-default layout"""
scheme = os.path.join(
"${name}", "${version}", "${architecture}-${compiler.name}-${compiler.version}-${hash}"
)
real_store, real_layout = spack.store.STORE, spack.store.STORE.layout
opt_dir = tmpdir.join("opt")
spack.store.STORE = spack.store.Store(str(opt_dir))
spack.store.STORE.layout = DirectoryLayout(str(opt_dir), path_scheme=scheme)
original_store, spack.store.STORE = spack.store.STORE, spack.store.Store(
str(opt_dir),
projections={
"all": "{name}/{version}/{architecture}-{compiler.name}-{compiler.version}-{hash}"
},
)
try:
yield spack.store
finally:
spack.store.STORE = real_store
spack.store.STORE.layout = real_layout
spack.store.STORE = original_store
@pytest.fixture(scope="function")

View File

@@ -105,22 +105,25 @@ def test_schema_validation(meta_schema, config_name):
def test_deprecated_properties(module_suffixes_schema):
# Test that an error is reported when 'error: True'
msg_fmt = r"{name} is deprecated"
module_suffixes_schema["deprecatedProperties"] = [
{"names": ["tcl"], "message": r"{name} is deprecated", "error": True}
{"names": ["tcl"], "message": msg_fmt, "error": True}
]
v = spack.schema.Validator(module_suffixes_schema)
data = {"tcl": {"all": {"suffixes": {"^python": "py"}}}}
with pytest.raises(jsonschema.ValidationError, match="tcl is deprecated") as e:
assert not isinstance(e, spack.schema.NonFatalValidationError)
spack.schema.Validator(module_suffixes_schema).validate(data)
expected_match = "tcl is deprecated"
with pytest.raises(jsonschema.ValidationError, match=expected_match):
v.validate(data)
# Test that just a non fatal error is reported when 'error: False'
# Test that just a warning is reported when 'error: False'
module_suffixes_schema["deprecatedProperties"] = [
{"names": ["tcl"], "message": r"{name} is deprecated", "error": False}
{"names": ["tcl"], "message": msg_fmt, "error": False}
]
with pytest.raises(spack.schema.NonFatalValidationError, match="tcl is deprecated"):
spack.schema.Validator(module_suffixes_schema).validate(data)
v = spack.schema.Validator(module_suffixes_schema)
data = {"tcl": {"all": {"suffixes": {"^python": "py"}}}}
# The next validation doesn't raise anymore
v.validate(data)
def test_ordereddict_merge_order():

View File

@@ -13,6 +13,7 @@ spack:
- openjpeg # CMakePackage
- r-rcpp # RPackage
- ruby-rake # RubyPackage
- perl-data-dumper # PerlPackage
- arch:
- '%gcc'

View File

@@ -2,34 +2,47 @@
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import spack.build_systems.autotools
import spack.build_systems.meson
from spack.package import *
class Cairo(AutotoolsPackage):
class Cairo(MesonPackage, AutotoolsPackage):
"""Cairo is a 2D graphics library with support for multiple output
devices."""
homepage = "https://www.cairographics.org/"
url = "https://www.cairographics.org/releases/cairo-1.16.0.tar.xz"
git = "https://gitlab.freedesktop.org/cairo/cairo.git"
license("LGPL-2.1-or-later OR MPL-1.1", checked_by="tgamblin")
# Cairo has meson.build @1.17.4:, but we only support @1.17.8: here
build_system(
conditional("autotools", when="@:1.17.6"),
conditional("meson", when="@1.17.8:"),
default="meson",
)
version("1.18.2", sha256="a62b9bb42425e844cc3d6ddde043ff39dbabedd1542eba57a2eb79f85889d45a")
version("1.18.0", sha256="243a0736b978a33dee29f9cca7521733b78a65b5418206fef7bd1c3d4cf10b64")
# 1.17.8: https://gitlab.freedesktop.org/cairo/cairo/-/issues/646 (we enable tee by default)
version(
"1.17.6",
sha256="4eebc4c2bad0402bc3f501db184417094657d111fb6c06f076a82ea191fe1faf",
url="https://cairographics.org/snapshots/cairo-1.17.6.tar.xz",
)
version(
"1.17.4",
sha256="74b24c1ed436bbe87499179a3b27c43f4143b8676d8ad237a6fa787401959705",
url="https://cairographics.org/snapshots/cairo-1.17.4.tar.xz",
) # Snapshot
)
version(
"1.17.2",
sha256="6b70d4655e2a47a22b101c666f4b29ba746eda4aa8a0f7255b32b2e9408801df",
url="https://cairographics.org/snapshots/cairo-1.17.2.tar.xz",
) # Snapshot
version(
"1.16.0",
sha256="5e7b29b3f113ef870d1e3ecf8adf21f923396401604bda16d44be45e66052331",
preferred=True,
)
version("1.16.0", sha256="5e7b29b3f113ef870d1e3ecf8adf21f923396401604bda16d44be45e66052331")
version("1.14.12", sha256="8c90f00c500b2299c0a323dd9beead2a00353752b2092ead558139bd67f7bf16")
version("1.14.8", sha256="d1f2d98ae9a4111564f6de4e013d639cf77155baf2556582295a0f00a9bc5e20")
version("1.14.0", sha256="2cf5f81432e77ea4359af9dcd0f4faf37d015934501391c311bfd2d19a0134b7")
@@ -47,6 +60,15 @@ class Cairo(AutotoolsPackage):
variant("shared", default=True, description="Build shared libraries")
variant("pic", default=True, description="Enable position-independent code (PIC)")
with when("build_system=autotools"):
depends_on("autoconf", type="build")
depends_on("automake", type="build")
depends_on("libtool", type="build")
depends_on("m4", type="build")
with when("build_system=meson"):
depends_on("meson@0.59:")
depends_on("libx11", when="+X")
depends_on("libxext", when="+X")
depends_on("libxrender", when="+X")
@@ -54,16 +76,21 @@ class Cairo(AutotoolsPackage):
depends_on("python", when="+X", type="build")
depends_on("libpng", when="+png")
depends_on("glib")
depends_on("pixman@0.40.0:", when="@1.18.2:")
depends_on("pixman@0.36.0:", when="@1.17.2:")
depends_on("pixman")
depends_on("automake", type="build")
depends_on("autoconf", type="build")
depends_on("libtool", type="build")
depends_on("m4", type="build")
depends_on("freetype build_system=autotools", when="+ft")
# Require freetype with FT_Color
# https://gitlab.freedesktop.org/cairo/cairo/-/issues/792
depends_on("freetype@2.10:", when="@1.18.0: +ft")
depends_on("pkgconfig", type="build")
depends_on("fontconfig@2.10.91:", when="+fc") # Require newer version of fontconfig.
depends_on("which", type="build")
depends_on("zlib", when="+pdf")
# lzo is not strictly required, but cannot be disabled and may be pulled in accidentally
# https://github.com/mesonbuild/meson/issues/8224
# https://github.com/microsoft/vcpkg/pull/38313
depends_on("lzo", when="@1.18: build_system=meson")
conflicts("+png", when="platform=darwin")
conflicts("+svg", when="platform=darwin")
@@ -71,10 +98,37 @@ class Cairo(AutotoolsPackage):
# patch from https://gitlab.freedesktop.org/cairo/cairo/issues/346
patch("fontconfig.patch", when="@1.16.0:1.17.2")
# Don't regenerate docs to avoid a dependency on gtk-doc
patch("disable-gtk-docs.patch", when="^autoconf@2.70:")
# Patch autogen.sh to not regenerate docs to avoid a dependency on gtk-doc
patch("disable-gtk-docs.patch", when="build_system=autotools ^autoconf@2.70:")
def autoreconf(self, spec, prefix):
def check(self):
"""The checks are only for the cairo devs: They write others shouldn't bother"""
pass
class MesonBuilder(spack.build_systems.meson.MesonBuilder):
def meson_args(self):
args = ["-Dtee=enabled"]
if "+X" in self.spec:
args.extend(["-Dxlib=enabled", "-Dxcb=enabled"])
else:
args.extend(["-Dxlib=disabled", "-Dxcb=disabled"])
args.append("-Dzlib=" + ("enabled" if "+pdf" in self.spec else "disabled"))
args.append(
"-Dpng=" + ("enabled" if ("+png" in self.spec or "+svg" in self.spec) else "disabled")
)
args.append("-Dfreetype=" + ("enabled" if "+ft" in self.spec else "disabled"))
args.append("-Dfontconfig=" + ("enabled" if "+fc" in self.spec else "disabled"))
args.append("-Ddefault_library=" + ("shared" if "+shared" in self.spec else "static"))
args.append("-Db_staticpic=" + ("true" if "+pic" in self.spec else "false"))
return args
class AutotoolsBuilder(spack.build_systems.autotools.AutotoolsBuilder):
def autoreconf(self, pkg, spec, prefix):
# Regenerate, directing the script *not* to call configure before Spack
# does
which("sh")("./autogen.sh", extra_env={"NOCONFIGURE": "1"})
@@ -102,7 +156,3 @@ def configure_args(self):
args.append(f"LIBS={libs}")
return args
def check(self):
"""The checks are only for the cairo devs: They write others shouldn't bother"""
pass

View File

@@ -56,8 +56,6 @@ class Geant4Data(BundlePackage):
"g4incl@1.2",
"g4ensdfstate@3.0",
"g4channeling@1.0",
"g4nudexlib@1.0",
"g4urrpt@1.1",
],
"11.2.2:11.2": [
"g4ndl@4.7.1",
@@ -195,6 +193,23 @@ class Geant4Data(BundlePackage):
for _d in _dsets:
depends_on(_d, type=("build", "run"), when=_vers)
_datasets_tendl = {
"11.0:11.3": "g4tendl@1.4",
"10.4:10.7": "g4tendl@1.3.2",
"10.3:10.3": "g4tendl@1.3",
}
variant("tendl", default=True, when="@10.3:", description="Enable G4TENDL")
with when("+tendl"):
for _vers, _d in _datasets_tendl.items():
depends_on(_d, type=("build", "run"), when="@" + _vers)
variant("nudexlib", default=True, when="@11.3.0:11.3", description="Enable G4NUDEXLIB")
with when("+nudexlib"):
depends_on("g4nudexlib@1.0", type=("build", "run"))
variant("urrpt", default=True, when="@11.3.0:11.3", description="Enable G4URRPT")
with when("+urrpt"):
depends_on("g4urrpt@1.1", type=("build", "run"))
@property
def datadir(self):
spec = self.spec

View File

@@ -36,13 +36,27 @@ class Ninja(Package):
version("1.7.2", sha256="2edda0a5421ace3cf428309211270772dd35a91af60c96f93f90df6bc41b16d9")
version("1.6.0", sha256="b43e88fb068fe4d92a3dfd9eb4d19755dae5c33415db2e9b7b61b4659009cde7")
depends_on("c", type="build") # generated
depends_on("cxx", type="build") # generated
# ninja@1.12: needs googletest source, but 1.12 itself needs a patch to use it
resource(
name="googletest",
url="https://github.com/google/googletest/archive/refs/tags/release-1.12.1.tar.gz",
sha256="81964fe578e9bd7c94dfdb09c8e4d6e6759e19967e397dbea48d1c10e45d0df2",
placement="gtest",
when="@1.12:",
)
patch(
"https://github.com/ninja-build/ninja/commit/f14a949534d673f847c407644441c8f37e130ce9.patch?full_index=1",
sha256="93f4bb3234c3af04e2454c6f0ef2eca3107edd4537a70151ea66f1a1d4c22dad",
when="@1.12",
)
variant(
"re2c", default=not sys.platform == "win32", description="Enable buidling Ninja with re2c"
)
depends_on("c", type="build") # generated
depends_on("cxx", type="build") # generated
depends_on("python", type="build")
depends_on("re2c@0.11.3:", type="build", when="+re2c")
@@ -54,7 +68,10 @@ def determine_version(cls, exe):
return output.strip()
def configure(self, spec, prefix):
python("configure.py", "--bootstrap")
if self.run_tests and spec.satisfies("@1.12:"):
python("configure.py", "--bootstrap", "--gtest-source-dir=gtest")
else:
python("configure.py", "--bootstrap")
@run_after("configure")
@on_package_attributes(run_tests=True)