From f621e0bd5cfecdbe26293d5a7a54a5752ba6e420 Mon Sep 17 00:00:00 2001 From: lrnselfreliance <33263708+lrnselfreliance@users.noreply.github.com> Date: Wed, 15 Jul 2026 15:48:25 -0600 Subject: [PATCH] Bake tippecanoe into the Raspberry Pi image (#537) The Debian Live image builds tippecanoe at image time, but pi-gen did not, so a fresh Pi compiled it on first boot/upgrade via install_protomaps.sh -- a multi-minute, CPU-heavy C++ build on the weakest hardware WROLPi targets. This is the same "Debian bakes it, pi-gen doesn't" gap recently fixed for the React app build. Build tippecanoe 2.79.0 in the stage2 chroot, mirroring the Debian hook (SHA-pinned source tarball, which is arch-independent). Add the two missing build deps (libsqlite3-dev, zlib1g-dev) to the package list; build-essential was already present. With tippecanoe present at the pinned version, install_protomaps.sh's version guard skips the build on first boot and on upgrades, so the on-device compile only recurs when the pinned version actually bumps. Co-authored-by: Claude Opus 4.8 --- pi-gen/stage2/04-wrolpi/01-packages-nr | 2 ++ pi-gen/stage2/04-wrolpi/03-run-chroot.sh | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/pi-gen/stage2/04-wrolpi/01-packages-nr b/pi-gen/stage2/04-wrolpi/01-packages-nr index 400fb0a6..1348c0e6 100644 --- a/pi-gen/stage2/04-wrolpi/01-packages-nr +++ b/pi-gen/stage2/04-wrolpi/01-packages-nr @@ -42,6 +42,7 @@ libgeos++-dev libgeos-dev libicu-dev libproj-dev +libsqlite3-dev libssl-dev libtiff-dev libtool @@ -73,3 +74,4 @@ vim vlc wget zim-tools +zlib1g-dev diff --git a/pi-gen/stage2/04-wrolpi/03-run-chroot.sh b/pi-gen/stage2/04-wrolpi/03-run-chroot.sh index e19ac69c..56bfbc16 100755 --- a/pi-gen/stage2/04-wrolpi/03-run-chroot.sh +++ b/pi-gen/stage2/04-wrolpi/03-run-chroot.sh @@ -32,6 +32,24 @@ chmod +x /usr/local/bin/deno rm /tmp/deno.zip deno --version +# Build and bake in tippecanoe (used to build map search indexes). Without this +# the Pi compiles it on first boot/upgrade via scripts/install_protomaps.sh -- a +# multi-minute, CPU-heavy C++ build on weak hardware. The Debian Live image +# already bakes it in; this brings the Pi image to parity. Build deps +# (build-essential, libsqlite3-dev, zlib1g-dev) come from 01-packages-nr. Hash +# pinned to the source tarball (arch-independent) to detect upstream tampering. +TIPPECANOE_VERSION="2.79.0" +TIPPECANOE_SHA256="b0fd9df49b6efc988288ea48774822c6de19eb48428017f27ee0b3b01d44f05d" +TIPPECANOE_BUILD_DIR=$(mktemp -d) +curl -fsSL "https://github.com/felt/tippecanoe/archive/refs/tags/${TIPPECANOE_VERSION}.tar.gz" \ + -o /tmp/tippecanoe.tar.gz +echo "${TIPPECANOE_SHA256} /tmp/tippecanoe.tar.gz" | sha256sum -c - +tar -xz -C "${TIPPECANOE_BUILD_DIR}" --strip-components=1 -f /tmp/tippecanoe.tar.gz +rm /tmp/tippecanoe.tar.gz +(cd "${TIPPECANOE_BUILD_DIR}" && make -j"$(nproc)" && make install) +rm -rf "${TIPPECANOE_BUILD_DIR}" +tippecanoe --version + # Put the latest WROLPi in /opt/wrolpi. git clone -b "${WROLPI_BRANCH:-release}" https://github.com/lrnselfreliance/wrolpi.git /opt/wrolpi # `git config --global` needs HOME, which is empty when the build runs under