# anvil-python -- CPython, cross-compiled for the printer. # # WHY THERE IS A SECOND PYTHON ON THIS MACHINE: FlashForge built its 3.8.2 # without _sqlite3, and that single omission is what pins MOONRAKER_VERSION to # a 2023 commit. # # THE PREFIX IS COMPILED IN, exactly as for s6: sys.prefix and the stdlib # search that follows are baked in at configure time, so moving the directory # on the printer breaks the interpreter -- it has to be rebuilt, not renamed. # # ONLY bin/python3.13 SHIPS, and the name matters: anvil-env.sh PREPENDS # $MODDIR/bin to PATH, so a bin/python3 of ours would sit AHEAD of # FlashForge's for every process that sources it, and anything saying # `python3` rather than "$FF_PYTHON" would silently change interpreter. PKG_NAME=anvil-python PKG_VERSION="$PY_VERSION" PKG_RELEASE=1 PKG_EXCLUDE=".version" # NO Depends, AND THAT IS A MEASURED CLAIM. Every C library this interpreter # uses is linked in STATICALLY, so the only shared objects it needs are the # printer's own libc, libm, libdl, libpthread and libatomic.so.1, all on the # stock rootfs. PKG_DEPENDS="" # SEVEN LIBRARIES, EACH EXACTLY ONE stdlib MODULE: openssl is _ssl and # _hashlib, sqlite _sqlite3, zlib zlib, libffi _ctypes, xz _lzma, bzip2 _bz2, # expat pyexpat. build.sh gates all seven by name, because CPython's answer to # a library it cannot link is to record the module absent and CARRY ON. PKG_BUILD_DEPENDS="openssl sqlite zlib libffi xz bzip2 expat" # THE HEADERS ARE THE POINT OF THE DEV SPLIT. The eighteen python-* recipes # cross-compile C extensions against them; before this package existed they # reached them by building inside bin/payload.sh at the one moment an untrimmed # staging tree happened to be on disk. A -dev package makes that durable, and # a printer installs none of it. # # config-3.13-* comes along because sysconfig's LIBPL points into it. # libpython3.13.a is deleted in build.sh: 35MB of archive nothing links. PKG_DEV_FILES="include lib/pkgconfig lib/python$PY_MM/config-$PY_MM-*" PKG_DEV_DESCRIPTION="CPython headers and build configuration for mipsel. This is what the pkgs/3rdparty/python-* recipes compile their C extensions against; nothing installs it on a printer." PKG_DESCRIPTION="CPython $PY_VERSION for the printer, with sqlite3, ssl, lzma, bz2, ctypes and expat linked in statically. Installs as bin/python3.13 -- never as python3, which would shadow the stock interpreter on PATH."