From ee7cdb8a684c481ef8ff592c527d6a7f0a71dee4 Mon Sep 17 00:00:00 2001 From: "Adam J. Stewart" Date: Thu, 27 Apr 2023 21:54:48 -0500 Subject: [PATCH] macOS: use Apple GL/GLU by default (#36618) * macOS: use Apple GL/GLU by default * Use CLT instead * Use CLT instead * Undo change to libuuid --- etc/spack/defaults/darwin/packages.yaml | 12 ++++++++++++ .../repos/builtin/packages/apple-gl/package.py | 13 +++---------- .../repos/builtin/packages/apple-glu/package.py | 15 ++++----------- 3 files changed, 19 insertions(+), 21 deletions(-) diff --git a/etc/spack/defaults/darwin/packages.yaml b/etc/spack/defaults/darwin/packages.yaml index cd3dca60a3..63f85bbbd9 100644 --- a/etc/spack/defaults/darwin/packages.yaml +++ b/etc/spack/defaults/darwin/packages.yaml @@ -23,8 +23,20 @@ packages: providers: elf: [libelf] fuse: [macfuse] + gl: [apple-gl] + glu: [apple-glu] unwind: [apple-libunwind] uuid: [apple-libuuid] + apple-gl: + buildable: false + externals: + - spec: apple-gl@4.1.0 + prefix: /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk + apple-glu: + buildable: false + externals: + - spec: apple-glu@1.3.0 + prefix: /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk apple-libunwind: buildable: false externals: diff --git a/var/spack/repos/builtin/packages/apple-gl/package.py b/var/spack/repos/builtin/packages/apple-gl/package.py index f2eb325284..49c764cbb3 100644 --- a/var/spack/repos/builtin/packages/apple-gl/package.py +++ b/var/spack/repos/builtin/packages/apple-gl/package.py @@ -30,11 +30,6 @@ class AppleGl(Package): 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 @@ -44,16 +39,14 @@ def setup_dependent_build_environment(self, env, dependent_spec): # - 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) + env.prepend_path("C_INCLUDE_PATH", self.prefix[:-4]) @property def headers(self): return HeaderList( - "{}.sdk/System/Library/Frameworks/OpenGL.framework/Headers".format(self.sdk_base) + join_path(self.prefix, "System/Library/Frameworks/OpenGL.framework/Headers") ) @property def libs(self): - return LibraryList( - "{}.sdk/System/Library/Frameworks/OpenGL.framework".format(self.sdk_base) - ) + return LibraryList(join_path(self.prefix, "System/Library/Frameworks/OpenGL.framework")) diff --git a/var/spack/repos/builtin/packages/apple-glu/package.py b/var/spack/repos/builtin/packages/apple-glu/package.py index 26fd8fba54..ba20061d3f 100644 --- a/var/spack/repos/builtin/packages/apple-glu/package.py +++ b/var/spack/repos/builtin/packages/apple-glu/package.py @@ -10,7 +10,7 @@ class AppleGlu(Package): """Shim package for Apple implementation of OpenGL Utility Libray (GLU)""" - homepage = "" + homepage = "https://developer.apple.com/library/archive/documentation/GraphicsImaging/Conceptual/OpenGL-MacProgGuide/opengl_intro/opengl_intro.html" maintainers("aphecetche") @@ -28,11 +28,6 @@ class AppleGlu(Package): 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 @@ -42,16 +37,14 @@ def setup_dependent_build_environment(self, env, dependent_spec): # - 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) + env.prepend_path("C_INCLUDE_PATH", self.prefix[:-4]) @property def headers(self): return HeaderList( - "{}.sdk/System/Library/Frameworks/OpenGL.framework/Headers".format(self.sdk_base) + join_path(self.prefix, "System/Library/Frameworks/OpenGL.framework/Headers") ) @property def libs(self): - return LibraryList( - "{}.sdk/System/Library/Frameworks/OpenGL.framework".format(self.sdk_base) - ) + return LibraryList(join_path(self.prefix, "System/Library/Frameworks/OpenGL.framework"))