apple-framework-System: fix System.tbd dangling symbolic link

Contrarily to the other frameworks, System framework's TBD file
is a symlink pointing to `${MacOSX-SDK}/usr/lib/libSystem.B.tbd`.

This produces an error when using the framework, as:

  1. The original file is not copied into the output directory
  2. Even if it was copied, the relative path wouldn't match

Resulting in the symlink being broken and the linker failing when
trying to link `-framework System`.

The fix applied consists in replacing the symbolic link with the
actual file, as this is easier than fixing the link and doesn't
seem to produce any side effects.
This commit is contained in:
netfox 2023-04-09 12:37:24 +02:00
parent 7486a74d9f
commit 815d6c0d3e
No known key found for this signature in database
GPG key ID: BAB62D4094F783E5

View file

@ -233,6 +233,19 @@ in rec {
$out/Library/Frameworks/CoreVideo.framework/Headers/CVBase.h
'';
});
System = lib.overrideDerivation super.System (drv: {
installPhase = drv.installPhase + ''
# Contrarily to the other frameworks, System framework's TBD file
# is a symlink pointing to ${MacOSX-SDK}/usr/lib/libSystem.B.tbd.
# This produces an error when installing the framework as:
# 1. The original file is not copied into the output directory
# 2. Even if it was copied, the relative path wouldn't match
# Thus, it is easier to replace the file than to fix the symlink.
cp --remove-destination ${MacOSX-SDK}/usr/lib/libSystem.B.tbd \
$out/Library/Frameworks/System.framework/Versions/B/System.tbd
'';
});
};
# Merge extraDeps into generatedDeps.