Files
firmware/pkgs/moonraker/pkg.conf
Oleksandr ShyshatskyiandClaude Opus 5 3dc50ad187 moonraker-timelapse ships as a package
The Moonraker component and the Klipper macros behind Mainsail's Timelapse
tab, pinned by commit because upstream has never cut a tag.

Upstream's scripts/install.sh is not used: it clones into a home directory,
symlinks into a Moonraker checkout, appends to live config and registers an
update_manager entry that re-clones itself over the network. All of those are
things this repo does differently, so the tarball is a source like any other
and the two files it contributes are placed by hand. timelapse.py lands
inside anvil-moonraker's directory because Moonraker resolves a component
with import_module(".components.<name>", "moonraker") and looks nowhere else.

No BUILD_TIMELAPSE flag, unlike every other optional piece here.
moonraker.conf carries a [timelapse] section and printer.base.cfg an
[include timelapse.cfg]; Moonraker dies on a section with no component behind
it and Klipper on an include it cannot find, so the off position of that flag
would not be a printer without timelapses -- it would be a printer that does
not come up.

The dependency arrow runs one way on purpose. anvil-timelapse does NOT depend
on anvil-moonraker, though it plainly needs it: anvil-moonraker already
depends on this package for the config section above, and declaring both
would be a cycle. Only the direction that is a hard failure is written down.

frame_path is /usr/data/anvil-timelapse rather than the default
/tmp/timelapse/: /tmp here is tmpfs, so a tall print's frames would be
hundreds of megabytes of RAM on the machine running that print.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TSmXJv47Wwq2J7FfgCgpCe
2026-08-30 15:47:46 +03:00

61 lines
3.0 KiB
Plaintext

# anvil-moonraker -- the Klipper API server.
#
# ARCHITECTURE all. Moonraker is pure python; every native module it imports
# comes from the interpreter's site-packages, which is a different package.
# See bin/payload.sh section 4 for why the stock 2022 build is not good enough
# and why this rides on the data partition instead of over /usr/prog.
PKG_NAME=anvil-moonraker
PKG_ARCH=all
# THE PIN IS A RELEASE TAG now, so the version is just the release. It used to
# be a commit -- 0.8.0+git<sha> -- because no release had both lmdb and the
# webcam "enabled" flag Mainsail filters on, and this repo could not ship the
# sqlite the releases after it wanted. It builds its own CPython now, so it
# can. opkg orders 0.11.0 after every 0.8.0+git string that shipped.
PKG_VERSION="${MOONRAKER_VERSION#v}"
PKG_RELEASE=1
PKG_SECTION=net
PKG_EXCLUDE=".version"
# Moonraker runs on the CPython 3.13 this repo builds and imports twelve
# third-party packages, each its own .ipk.
#
# THE LIST IS moonraker-requirements.txt MINUS WHAT MOONRAKER DOES NOT IMPORT.
# Not on it: anvil-python-pillow, which only the metadata SUBPROCESS uses, so
# a printer without it serves fine and shows no gcode thumbnails; and
# anvil-python-preprocess-cancellation, imported lazily in that same
# subprocess. Both are Recommends in spirit, and opkg has no such field.
# anvil-libsodium is not here either: libnacl declares it, which is where a
# ctypes dependency belongs. Neither are the requirements 0.11.0 grew for
# components this printer does not enable -- paho-mqtt, zeroconf, apprise,
# ldap3, python-periphery -- nor its msgspec and uvloop speedups, both of
# which Moonraker imports under contextlib.suppress(ImportError).
#
# WHAT 0.11.0 CHANGED HERE: dbus-next became dbus-fast, importlib-metadata
# (and its zipp) is new, and pyserial-asyncio is gone -- nothing imports it
# any more. anvil-python-lmdb STAYS, and versions.env says why: it is what
# reads the old database during the one-time conversion to sqlite.
#
# anvil-timelapse is on the list for a different reason than any of those: it
# is not imported but CONFIGURED. The [timelapse] section moonraker.conf ships
# names its component, and Moonraker treats a section with nothing behind it
# as fatal.
PKG_DEPENDS="anvil-python, anvil-python-tornado, anvil-python-lmdb,
anvil-timelapse,
anvil-python-streaming-form-data, anvil-python-distro,
anvil-python-inotify-simple, anvil-python-libnacl,
anvil-python-dbus-fast, anvil-python-jinja2,
anvil-python-pyserial, anvil-python-importlib-metadata,
anvil-python-smart-open, anvil-python-setuptools"
PKG_BUILD_DEPENDS=""
# moonraker.conf is edited in this repo and MOONRAKER_VERSION says nothing
# about it, so the recipe needs a key over its own files -- without one, an
# edit to the config reads as "already current".
PKG_STAMP_EXTRA="$(pkg_payload_hash)"
PKG_WHEN='[ "${BUILD_MOONRAKER:-1}" = "1" ]'
PKG_DESCRIPTION="Moonraker, the Klipper API server. Runs on the interpreter this mod ships, from /usr/data/anvil/moonraker."