Skip to content

Commit 97e7693

Browse files
committed
Only apply Apple cross-compile patches on macOS
1 parent 2ac4fd6 commit 97e7693

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

cpython-unix/build-cpython.sh

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,14 @@ cat Makefile.extra
7070
pushd Python-${PYTHON_VERSION}
7171

7272
# configure doesn't support cross-compiling on Apple. Teach it.
73-
if [ "${PYTHON_MAJMIN_VERSION}" = "3.13" ]; then
74-
patch -p1 -i ${ROOT}/patch-apple-cross-3.13.patch
75-
elif [ "${PYTHON_MAJMIN_VERSION}" = "3.12" ]; then
76-
patch -p1 -i ${ROOT}/patch-apple-cross-3.12.patch
77-
else
78-
patch -p1 -i ${ROOT}/patch-apple-cross.patch
73+
if [ "${PYBUILD_PLATFORM}" = "macos" ]; then
74+
if [ "${PYTHON_MAJMIN_VERSION}" = "3.13" ]; then
75+
patch -p1 -i ${ROOT}/patch-apple-cross-3.13.patch
76+
elif [ "${PYTHON_MAJMIN_VERSION}" = "3.12" ]; then
77+
patch -p1 -i ${ROOT}/patch-apple-cross-3.12.patch
78+
else
79+
patch -p1 -i ${ROOT}/patch-apple-cross.patch
80+
fi
7981
fi
8082

8183
# This patch is slightly different on Python 3.10+.

0 commit comments

Comments
 (0)