@@ -39,6 +39,7 @@ Pod::Spec.new do |s|
3939 tar -xzf $PYTHON_DIST_FILE
4040 rm $PYTHON_DIST_FILE
4141 fi
42+ ROOT=`pwd`
4243 rm -rf #{ python_framework }
4344 mkdir -p #{ python_framework }
4445 cp -R pod_templates/Python.xcframework/* #{ python_framework }
@@ -47,17 +48,29 @@ Pod::Spec.new do |s|
4748 cp -R dist/root/python3/include/python3.10/* #{ python_framework } /ios-arm64/Headers
4849 cp -R dist/root/python3/include/python3.10/* #{ python_framework } /ios-arm64_x86_64-simulator/Headers
4950
51+ # compile python310.zip
52+ PYTHON310_ZIP=$ROOT/dist/root/python3/lib/python310.zip
53+ unzip $PYTHON310_ZIP -d python310_temp
54+ rm $PYTHON310_ZIP
55+ pushd python310_temp
56+ $ROOT/dist/hostpython3/bin/python -m compileall -b .
57+ find . \\ ( -name '*.so' -or -name '*.py' -or -name '*.typed' \\ ) -type f -delete
58+ zip -r $PYTHON310_ZIP .
59+ popd
60+ rm -rf python310_temp
61+
5062 # fix import subprocess, asyncio
5163 cp -R pod_templates/site-packages/* dist/root/python3/lib/python3.10/site-packages
5264
5365 # zip site-packages
5466 pushd dist/root/python3/lib/python3.10/site-packages
55- zip -r ../../site-packages.zip .
67+ $ROOT/dist/hostpython3/bin/python -m compileall -b .
68+ find . \\ ( -name '*.so' -or -name '*.py' -or -name '*.typed' \\ ) -type f -delete
69+ zip -r $ROOT/dist/root/python3/lib/site-packages.zip .
5670 popd
57- rm -rf dist/root/python3/lib/python3.10
58-
71+
5972 # remove junk
60- rm -rf dist/root/python3/lib/python3.10/config-3.10-darwin
73+ rm -rf dist/root/python3/lib/python3.10
6174CMD
6275
6376 s . libraries = 'z' , 'bz2' , 'c++' , 'sqlite3'
0 commit comments