@@ -50,56 +50,69 @@ jobs:
50
50
51
51
build-pornfetch-cli-linux-32 :
52
52
runs-on : ubuntu-latest
53
+ env :
54
+ PY311_VERSION : " 3.11.5"
55
+ PY32_PREFIX : " /opt/python-32"
56
+ LD_LIBRARY_PATH : " /opt/python-32/lib:/usr/lib/i386-linux-gnu"
57
+ CC : " gcc -m32"
58
+ CXX : " g++ -m32"
59
+ CFLAGS : " -m32"
60
+ LDFLAGS : " -m32"
53
61
steps :
54
- - uses : actions/checkout@v3
62
+ - uses : actions/checkout@v4
55
63
56
- - name : Install dependencies for building Python
64
+ - name : Enable i386 & install minimal 32-bit toolchain
57
65
run : |
58
- sudo apt-get update
59
66
sudo dpkg --add-architecture i386
60
67
sudo apt-get update
61
- sudo apt-get install -y build-essential gcc-multilib libffi-dev zlib1g-dev libbz2-dev libsqlite3-dev binutils-dev libsqlite3-dev libgdbm-dev libc6-dev libbz2-dev
62
- sudo apt-get install -y libfl-dev zlib1g:i386 zlib1g-dev:i386 openssl libssl-dev libbz2-dev:i386 libgdbm-compat-dev:i386 libgdbm-dev:i386 libssl-dev:i386 libsqlite3-dev:i386 tk-dev:i386 libx11-dev:i386 libreadline-dev:i386 libffi-dev:i386 libncurses5-dev:i386 libncursesw5-dev:i386 liblzma-dev:i386 uuid-dev:i386
63
-
64
- - name : Download and build Python 3.11 for x32
68
+ sudo apt-get install -y \
69
+ build-essential gcc-multilib make pkg-config wget xz-utils ca-certificates \
70
+ libffi-dev:i386 zlib1g-dev:i386 libbz2-dev:i386 libsqlite3-dev:i386 \
71
+ libgdbm-dev:i386 libgdbm-compat-dev:i386 libncurses5-dev:i386 libncursesw5-dev:i386 \
72
+ libreadline-dev:i386 libssl-dev:i386 liblzma-dev:i386 uuid-dev:i386 \
73
+ libcrypt-dev:i386
74
+
75
+ - name : Build Python ${{ env.PY311_VERSION }} (32-bit)
65
76
run : |
66
- wget https://www.python.org/ftp/python/3.11.5 /Python-3.11.5 .tgz
67
- tar -xzf Python-3.11.5 .tgz
68
- cd Python-3.11.5
69
- CFLAGS="-m32" LDFLAGS="-m32" ./configure --prefix=/usr/local/python-32 --with-ensurepip=install --enable-shared
70
- make -j $(nproc)
77
+ wget https://www.python.org/ftp/python/${PY311_VERSION} /Python-${PY311_VERSION} .tgz
78
+ tar -xzf Python-${PY311_VERSION} .tgz
79
+ cd Python-${PY311_VERSION}
80
+ ./configure --prefix="${PY32_PREFIX}" --with-ensurepip=install --enable-shared
81
+ make -j" $(nproc)"
71
82
sudo make altinstall
72
- env :
73
- LD_LIBRARY_PATH : /usr/local/lib
83
+ echo "${PY32_PREFIX}/bin" >> "$GITHUB_PATH"
74
84
75
- - name : Install Python packages
85
+ - name : Create 32-bit venv & install deps (no av)
86
+ shell : bash
76
87
run : |
77
- export LD_LIBRARY_PATH=/usr/local/python-32/lib:$LD_LIBRARY_PATH
78
- /usr/local/python-32/bin/python3.11 -m venv venv
88
+ python3.11 -m venv venv
79
89
source venv/bin/activate
80
- pip install --upgrade pip
81
- pip install pyinstaller
90
+ python -m pip install --upgrade pip wheel setuptools
91
+ # Build PyInstaller from source so its bootloader is compiled for i686
92
+ pip install --no-binary=:all: pyinstaller
82
93
pip install -r requirements_cli.txt
83
94
84
- - name : Build Porn Fetch (CLI) (PyInstaller - Termux)
95
+ - name : Build Porn Fetch (CLI) (PyInstaller - x32)
96
+ shell : bash
85
97
run : |
86
- export LD_LIBRARY_PATH=/usr/local/python-32/lib:$LD_LIBRARY_PATH
87
98
source venv/bin/activate
88
- pyinstaller -F Porn_Fetch_CLI.py && cd dist && mv Porn_Fetch_CLI PornFetch_Linux_CLI_x32 && chmod +x PornFetch_Linux_CLI_x32
89
-
90
- - name : Generate SHA256 Checksum
91
- run : |
92
- sha256sum dist/PornFetch_Linux_CLI_x32 > dist/PornFetch_Linux_CLI_x32.sha256
93
-
94
- - name : Publish SHA256 to GitHub Actions Summary
95
- run : |
96
- echo "### SHA256 Checksum for PornFetch_Linux_CLI_x32" >> $GITHUB_STEP_SUMMARY
97
- echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
98
- cat dist/PornFetch_Linux_CLI_x32.sha256 >> $GITHUB_STEP_SUMMARY
99
- echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
100
-
101
- - name : Archive Porn Fetch CLI (Linux_32) build
102
- uses : actions/upload-artifact@v4
103
- with :
104
- name : PornFetch_Linux_CLI_x32
105
- path : dist/PornFetch_Linux_CLI_x32
99
+ pyinstaller -F Porn_Fetch_CLI.py
100
+ cd dist && mv Porn_Fetch_CLI PornFetch_Linux_CLI_x32 && chmod +x PornFetch_Linux_CLI_x32
101
+
102
+ - name: Generate SHA256 Checksum
103
+ run: sha256sum dist/PornFetch_Linux_CLI_x32 > dist/PornFetch_Linux_CLI_x32.sha256
104
+
105
+ - name: Publish SHA256 to GitHub Actions Summary
106
+ run: |
107
+ {
108
+ echo "### SHA256 Checksum for PornFetch_Linux_CLI_x32";
109
+ echo '```';
110
+ cat dist/PornFetch_Linux_CLI_x32.sha256;
111
+ echo '```';
112
+ } >> "$GITHUB_STEP_SUMMARY"
113
+
114
+ - name: Archive Porn Fetch CLI (Linux_32) build
115
+ uses: actions/upload-artifact@v4
116
+ with:
117
+ name: PornFetch_Linux_CLI_x32
118
+ path: dist/PornFetch_Linux_CLI_x32
0 commit comments