Azathothas / Toolpacks

Official (pkgforge-edge) Repo 📦📀 & The Largest Collection of Pre-Compiled (+ UPXed) Linux Static Binaries (incl. Build Scripts) & Package Manager (rust) :: https://github.com/pkgforge/soar
https://bin.pkgforge.dev/
MIT License
151 stars 16 forks source link

Request: Python3 static binaries for Android #24

Closed RohitVerma882 closed 4 months ago

RohitVerma882 commented 4 months ago

Please add python3 static binaries & build scripts

Azathothas commented 4 months ago

[+] https://github.com/Azathothas/Toolpacks/blob/main/.github/scripts/aarch64_Linux/bins/python3.sh [+] https://github.com/Azathothas/Toolpacks/blob/main/.github/scripts/x86_64_Linux/bins/python3.sh

https://bin.ajam.dev/x86_64_Linux/Baseutils/python3/

❯ readelf -R '.dynamic' "./python3"
readelf: Warning: Section '.dynamic' was not dumped because it does not exist

❯ file "./python3"
python3: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, BuildID[sha1]=fe46e49e692bb8a2a53ac1986009fee068d46e8b, stripped

❯ du -sh "./python3"
5.1M    python3

❯ "./python3" -V
Python 3.11.9
RohitVerma882 commented 4 months ago

I want for Android

Azathothas commented 4 months ago

You should have specified that in your original comment. Regardless, I tried compiling for android as well, but python is a dynamic language, requiring lots of libs (lib, libexec, share) in addition to the binary. The way, nix or other scripts have a functioning static binary in the first place is lots of patching, which either don't exist for android, or are too hard to implement. You can compile a dynamic python3 for android quite easily, but to run it you will need a termux environment along with all other dependencies, that is to say, even dynamic python won't work in vanilla Android.

ofc, if you know a way how to make it, better yet, send me a pull request, I would be happy to add it.