Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

watermark_hd

macrumors member
Original poster
I wanted a current Python on my Tiger PowerBook for small Flask/Django work,
and 3.12 turned out to be doable on a G4.

There is already danupsher's tiger-ppc-builds
(https://github.com/danupsher/tiger-ppc-builds) with GCC 15, Python 3.13,
curl, git and ffmpeg - but those are cross-compiled with -mcpu=970 and are
G5-only, they won't run on a G3 or G4. This is the G4 side: Python 3.12.11
built natively on the machine itself with tigerbrew's GCC 14.2.0
(tiger_altivec), plus a relocatable prebuilt package, with Flask and Django
verified end to end. It should run on any AltiVec PowerPC (G4 or G5).

Built on an iBook G4 1.2 GHz. Big-endian 32-bit PPC, links only
CoreFoundation + libSystem.

What works:
- pip 26.2.1, OpenSSL 3.5.7, SQLite 3.50.4
- ssl / hashlib / ctypes / sqlite3 / lzma / bz2 / zlib / readline / decimal /
zoneinfo / asyncio / multiprocessing - all import, none fail
- ctypes on big-endian: qsort with a Python callback returns correctly
sorted, so libffi closures are OK
- pip install flask -> Flask 3.1.3 serving 200 (markupsafe's C extension
builds into a native PPC wheel)
- pip install "django<5.3" -> Django 5.2.17, migrations OK, runserver 200

What doesn't: no _tkinter (no Tcl/Tk); anything needing Rust
(cryptography>=3.4, orjson, ruff...) - pin cryptography<3.4, Django core
doesn't need it.

CPython needed four small patches, all the same shape: 3.12 assumes any
__APPLE__ target has an API that only arrived in 10.5 or 10.6.
- pthread_threadid_np() (10.6) -> pthread_mach_thread_np()
- <copyfile.h> / fcopyfile() (10.5) -> disabled
- ttyname_r: Tiger's default (__DARWIN_UNIX03 off) gives the old char*
signature -> use ttyname()
- _scproxy needs CoreServices/CarbonCore headers, and urllib.request imports
it unconditionally on darwin, so it can't just be skipped

My machine also had a stripped /usr/include and no framework headers, so some
of the work was restoring those from the 10.4u SDK. tigerbrew needed a
one-line fix too: os/mac.rb calls pkgutil, which is absent on Tiger, and that
kills every make install.

Repo (scripts, patches, full write-up):

Prebuilt package (dmg + tar.bz2, ~50 MB, relocatable):

Only tested on the one iBook. Reports from a G5 or another G4, or a Leopard
build, would be welcome. Thanks to tigerbrew and everyone here keeping the
toolchain going - and go see danupsher's builds if you're on a G5.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.