Skip to content

Commit

Permalink
apple-libuuid: update installation directory (spack#40416)
Browse files Browse the repository at this point in the history
* apple-libuuid: update installation directory

Copy design of Apple GL
  • Loading branch information
adamjstewart authored Nov 28, 2023
1 parent 430b2df commit b719c90
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 22 deletions.
2 changes: 1 addition & 1 deletion etc/spack/defaults/darwin/packages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,4 @@ packages:
# Apple bundles libuuid in libsystem_c version 1353.100.2,
# although the version number used here isn't critical
- spec: [email protected]
prefix: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk
prefix: /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
28 changes: 7 additions & 21 deletions var/spack/repos/builtin/packages/apple-libuuid/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,28 +18,14 @@ class AppleLibuuid(BundlePackage):
# Only supported on 'platform=darwin'
conflicts("platform=linux")
conflicts("platform=cray")
conflicts("platform=windows")

@property
def libs(self):
"""Export the Apple libuuid library.
According to https://bugs.freedesktop.org/show_bug.cgi?id=105366,
libuuid is provided as part of libsystem_c. The Apple libsystem_c
library cannot be linked to directly using an absolute path; doing so
will cause the linker to throw an error 'cannot link directly with
/usr/lib/system/libsystem_c.dylib' and the linker will suggest linking
with System.framework instead. Linking to this framework is equivalent
to linking with libSystem.dylib, which can be confirmed on a macOS
system by executing at a terminal the command `ls -l
/System/Library/Frameworks/System.Framework` -- the file "System" is a
symlink to `/usr/lib/libSystem.B.dylib`, and `/usr/lib/libSystem.dylib`
also symlinks to this file. Running `otool -L /usr/lib/libSystem.dylib`
confirms that it will link dynamically to
`/usr/lib/system/libsystem_c.dylib`."""

return LibraryList("/usr/lib/libSystem.dylib")
def headers(self):
return HeaderList(
join_path(self.prefix, "System/Library/Frameworks/Kernel.framework/Headers")
)

@property
def headers(self):
"""Export the Apple libuuid header."""
return HeaderList(self.prefix.include.uuid.join("uuid.h"))
def libs(self):
return LibraryList(join_path(self.prefix, "System/Library/Frameworks/Kernel.framework"))

0 comments on commit b719c90

Please sign in to comment.