mirror of
https://github.com/Klipper4FlashForge/firmware.git
synced 2026-10-22 05:12:16 -05:00
Four sections went. Three of them were checks: _sqlite3 by name, which pkgs/3rdparty/python/build.sh already made; libsodium's symlink, which pkgs/3rdparty/libsodium/build.sh already made; and an ABI walk of the whole payload, which bin/build-packages.sh makes over every PKG_ROOT on the way into every .ipk -- from the packaging loop rather than a build.sh, so cached trees are re-read too. The fourth was not a check. config.env's BUSYBOX_BIN was copied into the payload here, which made it the one file no package owned: an allowance in the "every file is owned" test, an ABI gate of its own because the payload-wide one ran before the copy, and a file no `opkg remove` could take away. It is pkgs/3rdparty/busybox now, PKG_WHEN-gated on BUSYBOX_BIN, and it needed a third source verb -- pkg_prebuilt, beside pkg_unpack and pkg_intree -- because a recipe names its source exactly once and this one's source is a path someone typed. Once it was a package, nothing in the payload came from outside the feed, which is what made the payload-wide ABI gate redundant rather than merely duplicated. The "at least twelve extension modules in site-packages" count was the one check with nowhere to go and no duplicate. It is pkg_pynative in the seven python-* recipes that ship a .so: an aggregate could say that a native package had fallen back to a pure-python wheel but never which one, and each of those recipes can say it about itself. What that costs is written into the section it left: a gate inside build.sh does not run on a cache hit, and no python recipe sets PKG_STAMP_EXTRA. That is pkg_stamp's problem, not an argument for a second copy of every check here. Measured: `make packages` builds anvil-busybox_1.31.1-1_mipsel_xburst2.ipk, `make build` assembles a 32-package payload whose bin/busybox is listed in anvil-busybox.list, and qa-static is 265 passed. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011gKRUCqj18TVF1Vz1oMpmC
36 lines
1.4 KiB
Bash
Executable File
36 lines
1.4 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Pillow with zlib and nothing else -- built for the printer's CPython, into its site-packages.
|
|
set -euo pipefail
|
|
. ./bin/common.sh
|
|
. pkgs/lib.sh
|
|
|
|
pkg_begin python-pillow || exit 0
|
|
pkg_toolchain
|
|
pkg_deps
|
|
pkg_buildpython
|
|
pkg_pytarget
|
|
pkg_unpack "$(pypkg_tgz pillow)"
|
|
|
|
# PIP CANNOT DRIVE THIS ONE: the --disable-* flags are build_ext options and
|
|
# PEP 517 offers no way to pass them, so PKG_PY_SETUP_ARGS calls setup.py
|
|
# directly. --disable-platform-guessing is the important one -- without it
|
|
# pillow probes for jpeg, tiff and the rest by trying to LINK against the build
|
|
# machine's copies.
|
|
PKG_PY_SETUP_ARGS="--disable-jpeg --disable-tiff --disable-webp
|
|
--disable-jpeg2000 --disable-imagequant --disable-lcms --disable-freetype
|
|
--disable-xcb --disable-platform-guessing --enable-zlib
|
|
-I$PKG_SYSROOT$MODDIR/include -L$PKG_SYSROOT$MODDIR/lib"
|
|
pkg_pywheel pillow
|
|
|
|
pkg_ship "lib/python$PY_MM/site-packages"
|
|
|
|
# THREE, not one, and not four. Pillow is all extension: _imaging is the
|
|
# codec core, _imagingmath and _imagingmorph the two operations Moonraker's
|
|
# thumbnail path uses, and there is no pure-python anything behind them --
|
|
# a fallback here is not a slow Pillow, it is an ImportError. _imagingtk is
|
|
# built as well and is not counted, because it is the one that legitimately
|
|
# disappears: there is no X11 on the printer and the CPython package drops
|
|
# tkinter.
|
|
pkg_pynative 3
|
|
pkg_end
|