forked from Xpra-org/gtk-osx-build
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix pyobjc-core XCode version check.
- Loading branch information
Showing
2 changed files
with
47 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
commit 58ab8df6a0548fb070080f39ded837658823312f | ||
Author: Catalin Patulea <[email protected]> | ||
Date: Sat Jan 13 10:15:52 2024 +0200 | ||
|
||
Fix XCode version check with only CommandLineTools. | ||
|
||
https://github.com/ronaldoussoren/pyobjc/issues/569#issuecomment-1880015695 | ||
|
||
diff --git a/pyobjc-core/setup.py b/pyobjc-core/setup.py | ||
index ecd3934..cde5621 100644 | ||
--- a/pyobjc-core/setup.py | ||
+++ b/pyobjc-core/setup.py | ||
@@ -594,15 +594,24 @@ class oc_build_ext(build_ext.build_ext): | ||
CFLAGS.append("-DNO_OBJC2_RUNTIME") | ||
EXT_CFLAGS.append("-DNO_OBJC2_RUNTIME") | ||
|
||
- lines = subprocess.check_output( | ||
- ["xcodebuild", "-version"], text=True | ||
- ).splitlines() | ||
- if lines[0].startswith("Xcode"): | ||
- xcode_vers = int(lines[0].split()[-1].split(".")[0]) | ||
- if xcode_vers >= 15: | ||
- for var in (OBJC_LDFLAGS,): | ||
- print("Use old linker with Xcode 15 or later") | ||
- var.append("-Wl,-ld_classic") | ||
+ xcode_vers = None | ||
+ try: | ||
+ lines = subprocess.check_output( | ||
+ ["xcodebuild", "-version"], text=True | ||
+ ).splitlines() | ||
+ if lines[0].startswith("Xcode"): | ||
+ xcode_vers = int(lines[0].split()[-1].split(".")[0]) | ||
+ except subprocess.CalledProcessError: | ||
+ lines = subprocess.check_output( | ||
+ ["pkgutil", "--pkg-info=com.apple.pkg.CLTools_Executables"], | ||
+ text=True).splitlines() | ||
+ version, = [l.split()[1] for l in lines | ||
+ if l.startswith('version: ')] | ||
+ xcode_vers = int(version.split(".")[0]) | ||
+ if xcode_vers >= 15: | ||
+ for var in (OBJC_LDFLAGS,): | ||
+ print("Use old linker with Xcode 15 or later") | ||
+ var.append("-Wl,-ld_classic") | ||
|
||
def run(self): | ||
verify_platform() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters