@@ -39,6 +39,7 @@ Pod::Spec.new do |s|
39
39
tar -xzf $PYTHON_DIST_FILE
40
40
rm $PYTHON_DIST_FILE
41
41
fi
42
+ ROOT=`pwd`
42
43
rm -rf #{ python_framework }
43
44
mkdir -p #{ python_framework }
44
45
cp -R pod_templates/Python.xcframework/* #{ python_framework }
@@ -47,17 +48,29 @@ Pod::Spec.new do |s|
47
48
cp -R dist/root/python3/include/python3.10/* #{ python_framework } /ios-arm64/Headers
48
49
cp -R dist/root/python3/include/python3.10/* #{ python_framework } /ios-arm64_x86_64-simulator/Headers
49
50
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
+
50
62
# fix import subprocess, asyncio
51
63
cp -R pod_templates/site-packages/* dist/root/python3/lib/python3.10/site-packages
52
64
53
65
# zip site-packages
54
66
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 .
56
70
popd
57
- rm -rf dist/root/python3/lib/python3.10
58
-
71
+
59
72
# remove junk
60
- rm -rf dist/root/python3/lib/python3.10/config-3.10-darwin
73
+ rm -rf dist/root/python3/lib/python3.10
61
74
CMD
62
75
63
76
s . libraries = 'z' , 'bz2' , 'c++' , 'sqlite3'
0 commit comments