#!/bin/bash # ============================================================================ # DarkForge Linux — Phase 3, Chapter 8.52-53: Python (Final) # ============================================================================ # Purpose: Build Python 3 (full install, not temporary). Provides the # Python interpreter and standard library. # Inputs: /sources/Python-3.13.3.tar.xz # /sources/sqlite-autoconf-3490100.tar.gz (for SQLite support) # Outputs: Python interpreter and modules in /usr/ # Assumes: Running inside chroot, libffi already built # Ref: LFS 13.0 §8.52-53 # ============================================================================ set -euo pipefail source /sources/toolchain-scripts/100-chroot-env.sh PACKAGE="Python" VERSION="3.13.3" echo "=== Building SQLite (dependency for Python) ===" cd "${SRCDIR}" tar -xf sqlite-autoconf-3490100.tar.gz cd sqlite-autoconf-3490100 ./configure \ --prefix=/usr \ --disable-static \ --enable-fts5 make make install cd "${SRCDIR}" rm -rf sqlite-autoconf-3490100 echo "=== Building ${PACKAGE}-${VERSION} (Final) ===" pkg_extract "${PACKAGE}-${VERSION}.tar.xz" cd "${PACKAGE}-${VERSION}" ./configure \ --prefix=/usr \ --enable-optimizations \ --enable-loadable-sqlite-extensions \ --with-system-libmpdec make make install # Create symlinks for compatibility cd /usr/bin ln -sfv python3 python 2>/dev/null || true pkg_cleanup "${PACKAGE}-${VERSION}" echo "=== ${PACKAGE}-${VERSION} complete ==="