From 5c297d8322590356c927eb22690ec16a2e655a02 Mon Sep 17 00:00:00 2001 From: Stephen Nicholas Swatman Date: Tue, 3 Sep 2024 15:32:17 +0200 Subject: root: fix X11 and OpenGL-related issues on macOS (#45632) * root: Add dependency on libglx We have been trying to build the Acts package on MacOS, and in this process we have been running into problems with the ROOT spec on that operating system; the primary issue we are encountering is that the compiler is unable to find the `GL/glx.h` header, which is part of glx. It seems, therefore, that ROOT depends on libglx, but this is not currently encoded in the spec. This commit ensures that ROOT depends on the virtual libglx package when both the OpenCL and X11 variants are enabled. * Enable builtin glew on MacOS * Allow `root+opengl+aqua~x` on macOS --- var/spack/repos/builtin/packages/root/package.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/root/package.py b/var/spack/repos/builtin/packages/root/package.py index e0e49ae867..ed834a4c3f 100644 --- a/var/spack/repos/builtin/packages/root/package.py +++ b/var/spack/repos/builtin/packages/root/package.py @@ -336,6 +336,7 @@ class Root(CMakePackage): depends_on("gl2ps", when="+opengl") depends_on("gl", when="+opengl") depends_on("glu", when="+opengl") + depends_on("libglx", when="+opengl+x") # Qt4 depends_on("qt@:4", when="+qt4") @@ -419,7 +420,9 @@ class Root(CMakePackage): conflicts("target=ppc64le:", when="@:6.24") # Incompatible variants - if sys.platform != "darwin": + if sys.platform == "darwin": + conflicts("+opengl", when="~x ~aqua", msg="root+opengl requires X or Aqua") + else: conflicts("+opengl", when="~x", msg="root+opengl requires X") conflicts("+math", when="~gsl", msg="root+math requires GSL") conflicts("+tmva", when="~gsl", msg="root+tmva requires GSL") @@ -607,7 +610,7 @@ class Root(CMakePackage): define("builtin_freetype", False), define("builtin_ftgl", False), define("builtin_gl2ps", False), - define("builtin_glew", False), + define("builtin_glew", self.spec.satisfies("platform=darwin")), define("builtin_gsl", False), define("builtin_llvm", True), define("builtin_lz4", self.spec.satisfies("@6.12.02:6.12")), -- cgit v1.2.3-70-g09d2