@@ -15,68 +15,57 @@ ARTWORK="$PWD/artwork"
1515SRC=" $PWD /src"
1616DL=" $PWD /dl"
1717PACKAGE=" $PWD /package"
18+ PYTHON_FWORK=" $PACKAGE /Frameworks/Python.framework"
19+ PYTHON_FWORK_VERSION=" $PYTHON_FWORK /Versions/Current"
1820
1921rm -rf " $PACKAGE "
2022
21- mkdir -p " $DL " " $PACKAGE "
22- mkdir -p " $PACKAGE /bin"
23+ mkdir -p " $DL " " $PACKAGE /bin" " $PACKAGE /boot"
2324
2425echo " Updating submodules..."
25-
2626git submodule update --init --recursive
2727
2828echo " Downloading installer components..."
29-
30- cd " $DL "
31-
32- wget -Nc " $PYTHON_URI "
29+ wget -P " $DL " -Nc " $PYTHON_URI "
3330
3431echo " Building m1n1..."
35-
3632make -C " $M1N1 " RELEASE=1 -j4
3733
3834echo " Building u-boot..."
39-
4035make -C " $UBOOT " CROSS_COMPILE=aarch64-linux-gnu- -j4 apple_m1_defconfig all
4136
4237echo " Copying files..."
43-
4438cp -r " $SRC " /* " $PACKAGE /"
4539cp " $ARTWORK /logos/icns/AsahiLinux_logomark.icns" " $PACKAGE /logo.icns"
46- mkdir -p " $PACKAGE /boot"
4740cp " $M1N1 /build/m1n1.bin" " $PACKAGE /boot"
4841cat " $M1N1 /build/m1n1.bin" \
4942 " $UBOOT /arch/arm/dts/" t[86]* .dtb \
5043 " $UBOOT /u-boot-nodtb.bin" \
5144 > " $PACKAGE /boot/m1n1-uboot.bin"
5245
53- echo " Extracting Python framework..."
54-
55- mkdir -p " $PACKAGE /Frameworks/Python.framework"
5646
47+ echo " Extracting Python framework..."
48+ mkdir -p " $PYTHON_FWORK "
57497z x -so " $DL /$PYTHON_PKG " Python_Framework.pkg/Payload | zcat | \
58- cpio -i -D " $PACKAGE /Frameworks/Python.framework "
50+ cpio -i -D " $PYTHON_FWORK "
5951
60- echo " Slimming down Python..."
6152
62- cd " $PACKAGE /Frameworks/Python.framework/Versions/Current"
53+ echo " Slimming down Python..."
54+ (
55+ cd " $PYTHON_FWORK_VERSION "
56+ rm -rf include share
57+ cd lib
58+ rm -rf -- tdb* tk* Tk* libtk* * tcl*
59+ cd python3.*
60+ rm -rf test ensurepip idlelib
61+ cd lib-dynload
62+ rm -f _test* _tkinter*
63+ )
6364
64- rm -rf include share
65- cd lib
66- rm -rf -- tdb* tk* Tk* libtk* * tcl*
67- cd python3.*
68- rm -rf test ensurepip idlelib
69- cd lib-dynload
70- rm -f _test* _tkinter*
71-
7265echo " Copying certificates..."
73-
7466certs=" $( python3 -c ' import certifi; print(certifi.where())' ) "
75- cp " $certs " " $PACKAGE /Frameworks/Python.framework/Versions/Current /etc/openssl/cert.pem"
67+ cp " $certs " " $PYTHON_FWORK_VERSION /etc/openssl/cert.pem"
7668
7769echo " Packaging installer..."
78-
7970cd " $PACKAGE "
80-
8171tar czf ../installer.tar.gz .
82-
0 commit comments