Skip to content

Commit 279df3a

Browse files
committed
unix: more cpython build script tweaks
We can now build on macOS. I have no clue if the distro is good though.
1 parent d33b1fc commit 279df3a

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

cpython-unix/build-cpython.sh

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -212,20 +212,24 @@ for d in Modules Objects Parser Programs Python; do
212212
done
213213

214214
# Also copy extension variant metadata files.
215-
cp -av Modules/VARIANT-*.data ${ROOT}/out/python/build/Modules/
215+
if [ "${PYBUILD_PLATFORM}" != "macos" ]; then
216+
cp -av Modules/VARIANT-*.data ${ROOT}/out/python/build/Modules/
217+
fi
216218

217219
# The object files need to be linked against library dependencies. So copy
218220
# library files as well.
219221
mkdir ${ROOT}/out/python/build/lib
220-
cp -av ${ROOT}/deps/lib/*.a ${ROOT}/out/python/build/lib/
221-
cp -av ${ROOT}/deps/libedit/lib/*.a ${ROOT}/out/python/build/lib/
222+
cp -av ${TOOLS_PATH}/deps/lib/*.a ${ROOT}/out/python/build/lib/
223+
cp -av ${TOOLS_PATH}/deps/libedit/lib/*.a ${ROOT}/out/python/build/lib/
222224

223225
# And prune libraries we never reference.
224-
rm ${ROOT}/out/python/build/lib/{libdb-6.0,libxcb-*,libX11-xcb}.a
226+
rm -f ${ROOT}/out/python/build/lib/{libdb-6.0,libxcb-*,libX11-xcb}.a
225227

226228
# Copy tcl/tk/tix resources needed by tkinter.
227-
mkdir ${ROOT}/out/python/install/lib/tcl
228-
cp -av ${TOOLS_PATH}/deps/lib/{tcl8,tcl8.6,thread2.8.4,Tix8.4.3,tk8.6}/ ${ROOT}/out/python/install/lib/tcl/
229+
if [ "${PYBUILD_PLATFORM}" != "macos" ]; then
230+
mkdir ${ROOT}/out/python/install/lib/tcl
231+
cp -av ${TOOLS_PATH}/deps/lib/{tcl8,tcl8.6,thread2.8.4,Tix8.4.3,tk8.6}/ ${ROOT}/out/python/install/lib/tcl/
232+
fi
229233

230234
# config.c defines _PyImport_Inittab and extern references to modules, which
231235
# downstream consumers may want to strip. We bundle config.c and config.c.in so

0 commit comments

Comments
 (0)