@@ -16,18 +16,16 @@ DL="$PWD/dl"
1616PACKAGE=" $PWD /package"
1717RELEASES=" $PWD /releases"
1818RELEASES_DEV=" $PWD /releases-dev"
19+ PYTHON_FWORK=" $PACKAGE /Frameworks/Python.framework"
20+ PYTHON_FWORK_VERSION=" $PYTHON_FWORK /Versions/Current"
1921
2022rm -rf " $PACKAGE "
2123
22- mkdir -p " $DL " " $PACKAGE " " $RELEASES " " $RELEASES_DEV "
23- mkdir -p " $PACKAGE /bin"
24+ mkdir -p " $DL " " $PACKAGE /bin" " $PACKAGE /boot" " $RELEASES " " $RELEASES_DEV "
2425
2526echo " Determining version..."
2627
2728VER=$( git describe --always --dirty --tags)
28-
29- echo " Version: $VER "
30-
3129if [ -z " $VER " ]; then
3230 if [ -e version.tag ]; then
3331 VER=" $( cat version.tag) "
@@ -37,53 +35,44 @@ if [ -z "$VER" ]; then
3735 fi
3836fi
3937
40- echo " Downloading installer components..."
41-
42- cd " $DL "
38+ echo " Version: $VER "
4339
44- wget -Nc " $PYTHON_URI "
40+ echo " Downloading installer components..."
41+ wget -Nc " $DL " " $PYTHON_URI "
4542
4643echo " Building m1n1..."
47-
4844make -C " $M1N1 " RELEASE=1 CHAINLOADING=1 -j4
4945
5046echo " Copying files..."
51-
5247cp -r " $SRC " /* " $PACKAGE /"
5348cp " $ARTWORK /logos/icns/AsahiLinux_logomark.icns" " $PACKAGE /logo.icns"
54- mkdir -p " $PACKAGE /boot"
5549cp " $M1N1 /build/m1n1.bin" " $PACKAGE /boot"
5650
5751echo " Extracting Python framework..."
58-
59- mkdir -p " $PACKAGE /Frameworks/Python.framework"
52+ mkdir -p " $PYTHON_FWORK "
6053
61547z x -so " $DL /$PYTHON_PKG " Python_Framework.pkg/Payload | zcat | \
62- cpio -i -D " $PACKAGE /Frameworks/Python.framework "
55+ cpio -i -D " $PYTHON_FWORK "
6356
6457echo " Slimming down Python..."
58+ (
59+ cd " $PYTHON_FWORK_VERSION "
60+ rm -rf include share
61+ cd lib
62+ rm -rf -- tdb* tk* Tk* libtk* * tcl*
63+ cd python3.*
64+ rm -rf test ensurepip idlelib
65+ cd lib-dynload
66+ rm -f _test* _tkinter*
67+ )
6568
66- cd " $PACKAGE /Frameworks/Python.framework/Versions/Current"
67-
68- rm -rf include share
69- cd lib
70- rm -rf -- tdb* tk* Tk* libtk* * tcl*
71- cd python3.*
72- rm -rf test ensurepip idlelib
73- cd lib-dynload
74- rm -f _test* _tkinter*
75-
7669echo " Copying certificates..."
77-
7870certs=" $( python3 -c ' import certifi; print(certifi.where())' ) "
79- cp " $certs " " $PACKAGE /Frameworks/Python.framework/Versions/Current /etc/openssl/cert.pem"
71+ cp " $certs " " $PYTHON_FWORK_VERSION /etc/openssl/cert.pem"
8072
8173echo " Packaging installer..."
82-
8374cd " $PACKAGE "
8475
85- echo " $VER " > version.tag
86-
8776if [ " $1 " == " prod" ]; then
8877 PKGFILE=" $RELEASES /installer-$VER .tar.gz"
8978 LATEST=" $RELEASES /latest"
9584 LATEST=" ../latest"
9685fi
9786
87+ echo " $VER " > version.tag
9888tar czf " $PKGFILE " .
9989echo " $VER " > " $LATEST "
10090
0 commit comments