Skip to content
This repository was archived by the owner on Jan 30, 2023. It is now read-only.

Commit 4592331

Browse files
committed
remove obsolete patch, replace it with one for #32207
1 parent 7c61eb9 commit 4592331

File tree

1 file changed

+25
-20
lines changed

1 file changed

+25
-20
lines changed
+25-20
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,29 @@
11
diff --git a/setup.py b/setup.py
2-
index 15d81e4..5893d3d 100755
2+
index cbc2641..1a0abb3 100755
33
--- a/setup.py
44
+++ b/setup.py
5-
@@ -15,6 +15,7 @@ import re
6-
import struct
7-
import subprocess
8-
import sys
9-
+import sysconfig
10-
import warnings
11-
from distutils import ccompiler, sysconfig
12-
from distutils.command.build_ext import build_ext
13-
@@ -311,6 +312,11 @@ class pil_build_ext(build_ext):
14-
# darwin ports installation directories
15-
_add_directory(library_dirs, "/opt/local/lib")
16-
_add_directory(include_dirs, "/opt/local/include")
17-
+ # Check variable introduced in #27631.
18-
+ sysroot = sysconfig.get_config_var('Py_MACOS_SYSROOT')
19-
+ if sysroot is not None:
20-
+ _add_directory(library_dirs, sysroot+"/usr/lib")
21-
+ _add_directory(include_dirs, sysroot+"/usr/include")
5+
@@ -480,14 +480,16 @@ class pil_build_ext(build_ext):
6+
_add_directory(include_dirs, "/usr/X11/include")
227

23-
# if Homebrew is installed, use its lib and include directories
24-
try:
8+
# SDK install path
9+
- try:
10+
- sdk_path = (
11+
- subprocess.check_output(["xcrun", "--show-sdk-path"])
12+
- .strip()
13+
- .decode("latin1")
14+
- )
15+
- except Exception:
16+
- sdk_path = None
17+
+ sdk_path = "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk"
18+
+ if not os.path.exists(sdk_path):
19+
+ try:
20+
+ sdk_path = (
21+
+ subprocess.check_output(["xcrun", "--show-sdk-path"])
22+
+ .strip()
23+
+ .decode("latin1")
24+
+ )
25+
+ except Exception:
26+
+ sdk_path = None
27+
if sdk_path:
28+
_add_directory(library_dirs, os.path.join(sdk_path, "usr", "lib"))
29+
_add_directory(include_dirs, os.path.join(sdk_path, "usr", "include"))

0 commit comments

Comments
 (0)