nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1diff --git a/apple-catalog-parsing/build.rs b/apple-catalog-parsing/build.rs
2index 2ab4c71b59..6bcf003c0a 100644
3--- a/apple-catalog-parsing/build.rs
4+++ b/apple-catalog-parsing/build.rs
5@@ -30,7 +30,7 @@
6 // Add necessary libraries to the linker search path. Without this line, compiling fails
7 // on systems without Xcode installed (xcode-select is still required).
8 println!(
9- "cargo:rustc-link-search=native=/Library/Developer/CommandLineTools/usr/lib/swift/macosx"
10+ "cargo:rustc-link-search=native=/usr/lib/swift/macosx"
11 );
12
13 let out_dir = env::var("OUT_DIR").expect("OUT_DIR is set for build scripts");
14@@ -87,17 +87,14 @@
15 println!("cargo:rustc-link-search=framework=/System/Library/PrivateFrameworks");
16 println!("cargo:rustc-link-lib=framework=CoreUI");
17
18- // Link to swift macOS support libraries for Swift runtime support on older macOS versions
19- let developer_dir = Command::new("xcode-select")
20- .args(["-p"])
21- .output()
22- .expect("Failed to get developer directory, please ensure Xcode is installed.");
23- let developer_dir_path = String::from_utf8(developer_dir.stdout)
24- .expect("Failed to convert developer directory to UTF-8")
25- .trim()
26- .to_owned();
27-
28- println!(
29- "cargo:rustc-link-search={developer_dir_path}/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx"
30+ // Link libobjc to avoid the following error: ld: can't find ordinal for imported symbol '___objc_personality_v0'
31+ println!("cargo:rustc-link-lib=objc");
32+
33+ println!(
34+ "cargo:rustc-link-search=/usr/lib/swift"
35+ );
36+
37+ println!(
38+ "cargo:rustc-link-search=@swiftLib@/lib/swift/macosx"
39 );
40 }