Ship the manual with the Arch package, the Windows installer and the APK

The rendered manual was in the repository and nowhere else, so an
installed application still had nothing to open.

Each packager now carries docs/manual/index.html and its pictures, to
where the application will look for them: /usr/share/darkroom/manual on
Arch, manual\ beside darkroom.exe on Windows (where the models already
are, and where dr_plat::system_data_dirs points), and assets/manual in
the APK, stored rather than deflated since a GIF or PNG is already
compressed. The manual is about 27 MB, which the APK and the installer
both grow by; the pictures are 1600x1100 screenshots and short GIFs,
and against an APK that already carries 170 MB of inference runtime and
70 MB of models they are not worth re-encoding for.

The pictures are LFS objects, so each packager refuses a pointer where a
picture should be, as it already does for the models: shipped, a pointer
is a manual of broken images that nothing reports. The Android and
Windows CI legs therefore fetch docs/manual/media, which they excluded
while nothing they built read it, and the installer smoke test checks
that the page and every picture were installed.
This commit is contained in:
2026-09-24 22:33:41 -04:00
parent 10216355c1
commit d8f26fb5cd
7 changed files with 86 additions and 6 deletions
+23
View File
@@ -332,6 +332,29 @@ else
echo " assets: no models found (face indexing and the scene tab will be off on the device)"
fi
# The manual: the rendered page and its pictures, read in place by
# ManualActivity's WebView as file:///android_asset/manual/index.html. Not
# unpacked like the models: a WebView reads an asset straight out of the APK,
# and relative links to media/ resolve inside the same asset tree, so the page
# costs no first-launch copy and no second copy on /data.
#
# About 27 MB, stored below like the models — a GIF or PNG is already
# compressed, and deflating it again buys nothing. The pictures are LFS
# objects, and unlike a missing model a pointer would not fail loudly: it
# ships as a manual full of broken images. So it stops the build here.
rm -rf "${OUT}/staging/assets/manual"
mkdir -p "${OUT}/staging/assets/manual/media"
cp "${REPO}/docs/manual/index.html" "${OUT}/staging/assets/manual/"
for f in "${REPO}/docs/manual/media"/*; do
if head -c 40 "${f}" | grep -q '^version https://git-lfs'; then
echo "error: $(basename "${f}") is an LFS pointer, not a picture." >&2
echo " run: git lfs pull --include='docs/manual/media/**'" >&2
exit 1
fi
cp "${f}" "${OUT}/staging/assets/manual/media/"
done
echo " manual: index.html and $(ls "${OUT}/staging/assets/manual/media" | wc -l) picture(s), $(du -sh "${OUT}/staging/assets/manual" | cut -f1)"
# -0 "" stores the .so without compression so Android can mmap it directly
# (extractNativeLibs=false territory); for a 37 MB library that also keeps
# install times sane.