apple_sdk_11_0: install swift modules
This commit is contained in:
parent
f5fb6e5755
commit
d69453559a
|
@ -45,12 +45,20 @@ let
|
|||
|
||||
cp -r ${MacOSX-SDK}${standardFrameworkPath name private} $out/Library/Frameworks
|
||||
|
||||
if [[ -d ${MacOSX-SDK}/usr/lib/swift/${name}.swiftmodule ]]; then
|
||||
mkdir -p $out/lib/swift
|
||||
cp -r -t $out/lib/swift \
|
||||
${MacOSX-SDK}/usr/lib/swift/${name}.swiftmodule \
|
||||
${MacOSX-SDK}/usr/lib/swift/libswift${name}.tbd
|
||||
fi
|
||||
|
||||
# Fix and check tbd re-export references
|
||||
chmod u+w -R $out
|
||||
find $out -name '*.tbd' -type f | while read tbd; do
|
||||
echo "Fixing re-exports in $tbd"
|
||||
rewrite-tbd \
|
||||
-p ${standardFrameworkPath name private}/:$out/Library/Frameworks/${name}.framework/ \
|
||||
-p /usr/lib/swift/:$out/lib/swift/ \
|
||||
${mkDepsRewrites deps} \
|
||||
-r ${builtins.storeDir} \
|
||||
"$tbd"
|
||||
|
|
|
@ -26,7 +26,7 @@ stdenvNoCC.mkDerivation {
|
|||
];
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/{include,lib}
|
||||
mkdir -p $out/{include,lib/swift}
|
||||
|
||||
for dir in $includeDirs; do
|
||||
from=${MacOSX-SDK}/usr/include/$dir
|
||||
|
@ -57,6 +57,13 @@ stdenvNoCC.mkDerivation {
|
|||
$out/lib
|
||||
done
|
||||
|
||||
for name in os Dispatch; do
|
||||
cp -dr \
|
||||
${MacOSX-SDK}/usr/lib/swift/$name.swiftmodule \
|
||||
${MacOSX-SDK}/usr/lib/swift/libswift$name.tbd \
|
||||
$out/lib/swift
|
||||
done
|
||||
|
||||
for f in $csu; do
|
||||
from=${MacOSX-SDK}/usr/lib/$f
|
||||
if [ -e "$from" ]; then
|
||||
|
@ -71,6 +78,7 @@ stdenvNoCC.mkDerivation {
|
|||
rewrite-tbd \
|
||||
-c /usr/lib/libsystem.dylib:$out/lib/libsystem.dylib \
|
||||
-p /usr/lib/system/:$out/lib/system/ \
|
||||
-p /usr/lib/swift/:$out/lib/swift/ \
|
||||
-r ${builtins.storeDir} \
|
||||
"$tbd"
|
||||
done
|
||||
|
|
|
@ -8,14 +8,17 @@ let self = stdenvNoCC.mkDerivation {
|
|||
dontBuild = true;
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/{include,lib}
|
||||
mkdir -p $out/{include,lib/swift}
|
||||
cp -r ${MacOSX-SDK}/usr/include/objc $out/include
|
||||
cp ${MacOSX-SDK}/usr/lib/libobjc* $out/lib
|
||||
cp -r ${MacOSX-SDK}/usr/lib/swift/ObjectiveC.swiftmodule $out/lib/swift
|
||||
cp ${MacOSX-SDK}/usr/lib/swift/libswiftObjectiveC.tbd $out/lib/swift
|
||||
'';
|
||||
|
||||
passthru = {
|
||||
tbdRewrites = {
|
||||
const."/usr/lib/libobjc.A.dylib" = "${self}/lib/libobjc.A.dylib";
|
||||
const."/usr/lib/swift/libswiftObjectiveC.dylib" = "${self}/lib/swift/libswiftObjectiveC.dylib";
|
||||
};
|
||||
};
|
||||
}; in self
|
||||
|
|
Loading…
Reference in a new issue