Files
nixpkgs/pkgs/development/compilers/swift/swiftpm/patches/nix-pkgconfig-vars.patch
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

29 lines
1.3 KiB
Diff

Swift parses .pc files manually, but this means it bypasses our pkg-config
wrapper. That wrapper normally takes care of introducing the correct
PKG_CONFIG_PATH for cross compiling.
--- a/Sources/PackageLoading/PkgConfig.swift
+++ b/Sources/PackageLoading/PkgConfig.swift
@@ -123,14 +123,17 @@ public struct PkgConfig {
private static var envSearchPaths: [AbsolutePath] {
get throws {
- if let configPath = ProcessEnv.vars["PKG_CONFIG_PATH"] {
+ var result: [AbsolutePath] = []
+ for envVar in ["PKG_CONFIG_PATH", "PKG_CONFIG_PATH_FOR_TARGET"] {
+ if let configPath = ProcessEnv.vars[envVar] {
#if os(Windows)
- return try configPath.split(separator: ";").map({ try AbsolutePath(validating: String($0)) })
+ result += try configPath.split(separator: ";").map({ try AbsolutePath(validating: String($0)) })
#else
- return try configPath.split(separator: ":").map({ try AbsolutePath(validating: String($0)) })
+ result += try configPath.split(separator: ":").map({ try AbsolutePath(validating: String($0)) })
#endif
}
- return []
+ }
+ return result
}
}
}