mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-01-15 17:34:04 +00:00
24 lines
1018 B
Diff
24 lines
1018 B
Diff
Swiftpm looks for the Swift stdlib relative to the swift compiler, but that's a
|
|
wrapper in our case. It wants to add the stdlib to the rpath, which is
|
|
necessary for back-deployment of some features.
|
|
|
|
--- a/Sources/PackageModel/Toolchain.swift
|
|
+++ b/Sources/PackageModel/Toolchain.swift
|
|
@@ -43,10 +43,16 @@ extension Toolchain {
|
|
}
|
|
|
|
public var macosSwiftStdlib: AbsolutePath {
|
|
+ if swiftCompilerPath.pathString.starts(with: "@storeDir@") {
|
|
+ return AbsolutePath("@swiftLib@/lib/swift/macosx")
|
|
+ }
|
|
return AbsolutePath("../../lib/swift/macosx", relativeTo: resolveSymlinks(swiftCompilerPath))
|
|
}
|
|
|
|
public var toolchainLibDir: AbsolutePath {
|
|
+ if swiftCompilerPath.pathString.starts(with: "@storeDir@") {
|
|
+ return AbsolutePath("@swiftLib@/lib")
|
|
+ }
|
|
// FIXME: Not sure if it's better to base this off of Swift compiler or our own binary.
|
|
return AbsolutePath("../../lib", relativeTo: resolveSymlinks(swiftCompilerPath))
|
|
}
|