ROOT: default to +aqua~x on macOS (#47792)
This commit is contained in:
parent
741652caa1
commit
83624551e0
@ -12,6 +12,8 @@
|
||||
from spack.package import *
|
||||
from spack.util.environment import is_system_path
|
||||
|
||||
_is_macos = sys.platform == "darwin"
|
||||
|
||||
|
||||
class Root(CMakePackage):
|
||||
"""ROOT is a data analysis framework."""
|
||||
@ -156,7 +158,7 @@ class Root(CMakePackage):
|
||||
when="@6.32.0:6.32.02",
|
||||
)
|
||||
|
||||
if sys.platform == "darwin":
|
||||
if _is_macos:
|
||||
# Resolve non-standard use of uint, _cf_
|
||||
# https://sft.its.cern.ch/jira/browse/ROOT-7886.
|
||||
patch("math_uint.patch", when="@6.06.02")
|
||||
@ -186,7 +188,7 @@ class Root(CMakePackage):
|
||||
# See README.md for specific notes about what ROOT configuration
|
||||
# options are or are not supported, and why.
|
||||
|
||||
variant("aqua", default=False, description="Enable Aqua interface")
|
||||
variant("aqua", default=_is_macos, description="Enable native macOS (Cocoa) interface")
|
||||
variant("arrow", default=False, description="Enable Arrow interface")
|
||||
variant("cuda", when="@6.08.00:", default=False, description="Enable CUDA support")
|
||||
variant("cudnn", when="@6.20.02:", default=False, description="Enable cuDNN support")
|
||||
@ -288,7 +290,7 @@ class Root(CMakePackage):
|
||||
variant(
|
||||
"webgui", default=True, description="Enable web-based UI components of ROOT", when="+root7"
|
||||
)
|
||||
variant("x", default=True, description="Enable set of graphical options")
|
||||
variant("x", default=(not _is_macos), description="Enable set of graphical options")
|
||||
variant("xml", default=True, description="Enable XML parser interface")
|
||||
variant("xrootd", default=False, description="Build xrootd file server and its client")
|
||||
|
||||
@ -429,7 +431,7 @@ class Root(CMakePackage):
|
||||
conflicts("target=ppc64le:", when="@:6.24")
|
||||
|
||||
# Incompatible variants
|
||||
if sys.platform == "darwin":
|
||||
if _is_macos:
|
||||
conflicts("+opengl", when="~x ~aqua", msg="root+opengl requires X or Aqua")
|
||||
# https://github.com/root-project/root/issues/7160
|
||||
conflicts("+aqua", when="~opengl", msg="+aqua requires OpenGL to be enabled")
|
||||
@ -455,15 +457,15 @@ class Root(CMakePackage):
|
||||
conflicts("%clang@16:", when="@:6.26.07", msg="clang 16+ support was added in root 6.26.08")
|
||||
|
||||
# See https://github.com/spack/spack/pull/44826
|
||||
if sys.platform == "darwin" and macos_version() == Version("12"):
|
||||
if _is_macos and macos_version() == Version("12"):
|
||||
conflicts("@:6.27", when="+python", msg="macOS 12 python support for 6.28: only")
|
||||
|
||||
# See https://github.com/root-project/root/issues/11714
|
||||
if sys.platform == "darwin" and macos_version() >= Version("13"):
|
||||
if _is_macos and macos_version() >= Version("13"):
|
||||
conflicts("@:6.26.09", msg="macOS 13 support was added in root 6.26.10")
|
||||
|
||||
# See https://github.com/root-project/root/issues/16219
|
||||
if sys.platform == "darwin" and macos_version() >= Version("15"):
|
||||
if _is_macos and macos_version() >= Version("15"):
|
||||
conflicts("@:6.32.05", msg="macOS 15 support was added in root 6.32.06")
|
||||
|
||||
# ROOT <6.14 is incompatible with Python >=3.7, which is the minimum supported by spack
|
||||
@ -627,8 +629,6 @@ def cmake_args(self):
|
||||
# Options related to ROOT's ability to download and build its own
|
||||
# dependencies. Per Spack convention, this should generally be avoided.
|
||||
|
||||
afterimage_enabled = ("+x" in self.spec) if "platform=darwin" not in self.spec else True
|
||||
|
||||
options += [
|
||||
define("builtin_cfitsio", False),
|
||||
define("builtin_davix", False),
|
||||
@ -655,7 +655,12 @@ def cmake_args(self):
|
||||
]
|
||||
|
||||
if self.spec.satisfies("@:6.32"):
|
||||
options.append(define("builtin_afterimage", afterimage_enabled))
|
||||
options.append(
|
||||
define(
|
||||
"builtin_afterimage",
|
||||
("+x" in self.spec) if "platform=darwin" not in self.spec else True,
|
||||
)
|
||||
)
|
||||
|
||||
# Features
|
||||
options += [
|
||||
@ -764,7 +769,7 @@ def cmake_args(self):
|
||||
|
||||
# #################### Compiler options ####################
|
||||
|
||||
if sys.platform == "darwin" and self.compiler.cc == "gcc":
|
||||
if _is_macos and self.compiler.cc == "gcc":
|
||||
cflags = "-D__builtin_unreachable=__builtin_trap"
|
||||
options.extend([define("CMAKE_C_FLAGS", cflags), define("CMAKE_CXX_FLAGS", cflags)])
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user