summaryrefslogtreecommitdiff
path: root/var/spack/repos/builtin/packages/apple-gl/package.py
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/spack/repos/builtin/packages/apple-gl/package.py
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/spack/repos/builtin/packages/apple-gl/package.py')
-rw-r--r--var/spack/repos/builtin/packages/apple-gl/package.py57
1 files changed, 57 insertions, 0 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)
+ )