Skip to content

Commit 3feee10

Browse files
committed
Skip sys.prefix paths when cross-compiling
Patch setup.py to avoid adding sys.prefix lib/include directories unconditionally. The sys.prefix paths are now only added when platform guessing is enabled (prevents picking up host headers when cross-compiling). Also includes small comment and whitespace cleanups around environment path handling.
1 parent f601dc9 commit 3feee10

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

recipes/pillow/patches/setup-11.x.patch

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
diff --git a/setup.py b/setup.py
2-
index a85731d..fbbb5b6 100644
32
--- a/setup.py
43
+++ b/setup.py
54
@@ -355,9 +355,7 @@ class pil_build_ext(build_ext):
@@ -13,13 +12,13 @@ index a85731d..fbbb5b6 100644
1312
self.add_imaging_libs = ""
1413
build_ext.initialize_options(self)
1514
for x in self.feature:
16-
@@ -548,8 +546,10 @@ class pil_build_ext(build_ext):
17-
for d in os.environ[k].split(os.path.pathsep):
15+
@@ -550,8 +548,10 @@ class pil_build_ext(build_ext):
16+
for d in os.environ[k].split(os.path.pathsep):
1817
_add_directory(library_dirs, d)
1918

2019
- _add_directory(library_dirs, os.path.join(sys.prefix, "lib"))
2120
- _add_directory(include_dirs, os.path.join(sys.prefix, "include"))
22-
+ # Skip adding sys.prefix paths when cross-compiling to avoid host headers
21+
+ # Skip sys.prefix paths when cross-compiling to avoid host headers
2322
+ if not self.disable_platform_guessing:
2423
+ _add_directory(library_dirs, os.path.join(sys.prefix, "lib"))
2524
+ _add_directory(include_dirs, os.path.join(sys.prefix, "include"))

0 commit comments

Comments
 (0)