summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorLaurent Aphecetche <laurent.aphecetche@gmail.com>2022-09-26 17:37:21 +0200
committerGitHub <noreply@github.com>2022-09-26 08:37:21 -0700
commita5bf7f458d6bad2f4875f4d5c5d427de22d8c8f6 (patch)
tree73ee1c7d2aa08a8b5a51558ea63b696706543609 /var
parentb961cfa8d6d26263510f7d164d3d2e7c31fe1cb1 (diff)
downloadspack-a5bf7f458d6bad2f4875f4d5c5d427de22d8c8f6.tar.gz
spack-a5bf7f458d6bad2f4875f4d5c5d427de22d8c8f6.tar.bz2
spack-a5bf7f458d6bad2f4875f4d5c5d427de22d8c8f6.tar.xz
spack-a5bf7f458d6bad2f4875f4d5c5d427de22d8c8f6.zip
root: make X11 really optional on macOS (#32661)
* root: make X11 really optional on macOS * Update var/spack/repos/builtin/packages/root/package.py * remove when clauses in provides Co-authored-by: Hadrien G. <knights_of_ni@gmx.com>
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/apple-gl/package.py57
-rw-r--r--var/spack/repos/builtin/packages/apple-glu/package.py57
-rw-r--r--var/spack/repos/builtin/packages/root/package.py20
3 files changed, 126 insertions, 8 deletions
diff --git a/var/spack/repos/builtin/packages/apple-gl/package.py b/var/spack/repos/builtin/packages/apple-gl/package.py
new file mode 100644
index 0000000000..4f30d11b3d
--- /dev/null
+++ b/var/spack/repos/builtin/packages/apple-gl/package.py
@@ -0,0 +1,57 @@
+# Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
+# Spack Project Developers. See the top-level COPYRIGHT file for details.
+#
+# SPDX-License-Identifier: (Apache-2.0 OR MIT)
+
+
+from spack.package import *
+
+
+class AppleGl(Package):
+ """Shim package for the core OpenGL library from Apple"""
+
+ homepage = "https://developer.apple.com/library/archive/documentation/GraphicsImaging/Conceptual/OpenGL-MacProgGuide/opengl_intro/opengl_intro.html"
+
+ maintainers = ["aphecetche"]
+
+ has_code = False
+
+ version("4.1.0")
+
+ provides("gl@4.1")
+
+ # Only supported on 'platform=darwin' and compiler=apple-clang
+ conflicts("platform=linux")
+ conflicts("platform=cray")
+ conflicts("%gcc")
+ conflicts("%clang")
+
+ phases = []
+
+ sdk_base = (
+ "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/"
+ "Developer/SDKs/MacOSX"
+ )
+
+ def setup_dependent_build_environment(self, env, dependent_spec):
+ # we try to setup a build environment with enough hints
+ # for the build system to pick up on the Apple framework version
+ # of OpenGL.
+ # - for a cmake build we actually needs nothing at all as
+ # find_package(OpenGL) will do the right thing
+ # - for the rest of the build systems we'll assume that
+ # setting the C_INCLUDE_PATH will be enough for the compilation phase
+ # and *** for the link phase.
+ env.prepend_path("C_INCLUDE_PATH", self.sdk_base)
+
+ @property
+ def headers(self):
+ return HeaderList(
+ "{}.sdk/System/Library/Frameworks/OpenGL.framework/Headers".format(self.sdk_base)
+ )
+
+ @property
+ def libs(self):
+ return LibraryList(
+ "{}.sdk/System/Library/Frameworks/OpenGL.framework".format(self.sdk_base)
+ )
diff --git a/var/spack/repos/builtin/packages/apple-glu/package.py b/var/spack/repos/builtin/packages/apple-glu/package.py
new file mode 100644
index 0000000000..38f0527d21
--- /dev/null
+++ b/var/spack/repos/builtin/packages/apple-glu/package.py
@@ -0,0 +1,57 @@
+# Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
+# Spack Project Developers. See the top-level COPYRIGHT file for details.
+#
+# SPDX-License-Identifier: (Apache-2.0 OR MIT)
+
+
+from spack.package import *
+
+
+class AppleGlu(Package):
+ """Shim package for Apple implementation of OpenGL Utility Libray (GLU)"""
+
+ homepage = ""
+
+ maintainers = ["aphecetche"]
+
+ has_code = False
+
+ version("1.3.0")
+
+ provides("glu@1.3")
+
+ # Only supported on 'platform=darwin' and compiler=apple-clang
+ conflicts("platform=linux")
+ conflicts("platform=cray")
+ conflicts("%gcc")
+ conflicts("%clang")
+
+ phases = []
+
+ sdk_base = (
+ "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/"
+ "Developer/SDKs/MacOSX"
+ )
+
+ def setup_dependent_build_environment(self, env, dependent_spec):
+ # we try to setup a build environment with enough hints
+ # for the build system to pick up on the Apple framework version
+ # of OpenGL.
+ # - for a cmake build we actually needs nothing at all as
+ # find_package(OpenGL) will do the right thing
+ # - for the rest of the build systems we'll assume that
+ # setting the C_INCLUDE_PATH will be enough for the compilation phase
+ # and *** for the link phase.
+ env.prepend_path("C_INCLUDE_PATH", self.sdk_base)
+
+ @property
+ def headers(self):
+ return HeaderList(
+ "{}.sdk/System/Library/Frameworks/OpenGL.framework/Headers".format(self.sdk_base)
+ )
+
+ @property
+ def libs(self):
+ return LibraryList(
+ "{}.sdk/System/Library/Frameworks/OpenGL.framework".format(self.sdk_base)
+ )
diff --git a/var/spack/repos/builtin/packages/root/package.py b/var/spack/repos/builtin/packages/root/package.py
index 4b421b04f4..5de2917a64 100644
--- a/var/spack/repos/builtin/packages/root/package.py
+++ b/var/spack/repos/builtin/packages/root/package.py
@@ -211,11 +211,11 @@ class Root(CMakePackage):
depends_on("libsm", when="+x")
# OpenGL
- depends_on("ftgl@2.4.0:", when="+x+opengl")
- depends_on("glew", when="+x+opengl")
- depends_on("gl", when="+x+opengl")
- depends_on("glu", when="+x+opengl")
- depends_on("gl2ps", when="+x+opengl")
+ depends_on("ftgl@2.4.0:", when="+opengl")
+ depends_on("glew", when="+opengl")
+ depends_on("gl2ps", when="+opengl")
+ depends_on("gl", when="+opengl")
+ depends_on("glu", when="+opengl")
# Qt4
depends_on("qt@:4", when="+qt4")
@@ -287,7 +287,8 @@ class Root(CMakePackage):
conflicts("target=ppc64le:", when="@:6.24")
# Incompatible variants
- conflicts("+opengl", when="~x", msg="OpenGL requires X")
+ if sys.platform != "darwin":
+ conflicts("+opengl", when="~x", msg="OpenGL requires X")
conflicts("+tmva", when="~gsl", msg="TVMA requires GSL")
conflicts("+tmva", when="~mlp", msg="TVMA requires MLP")
conflicts("cxxstd=11", when="+root7", msg="root7 requires at least C++14")
@@ -430,8 +431,11 @@ class Root(CMakePackage):
# 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_from_variant("builtin_afterimage", "x"),
+ define("builtin_afterimage", afterimage_enabled),
define("builtin_cfitsio", False),
define("builtin_davix", False),
define("builtin_fftw3", False),
@@ -604,7 +608,7 @@ class Root(CMakePackage):
add_include_path("fontconfig")
add_include_path("libx11")
add_include_path("xproto")
- if "+opengl" in spec:
+ if "+opengl" in spec and "platform=darwin" not in spec:
add_include_path("glew")
add_include_path("mesa-glu")
if "platform=darwin" in spec: