Skip to content

The agent that grows with you

fix(termux): give pillow-heif libheif in the build container and the payload

ethernetce4ff47aa3b5
diff --git a/scripts/termux/build_wheels.py b/scripts/termux/build_wheels.py
index b6feff92eac..db9fb107e7f 100644
--- a/scripts/termux/build_wheels.py
+++ b/scripts/termux/build_wheels.py
@@ -334,6 +334,11 @@ def import_native_modules(build_set: list[str]) -> None:
modules = {
"ruamel-yaml-clib": "_ruamel_yaml", "cffi": "_cffi_backend",
"pillow": "PIL._imaging", "pyyaml": "yaml._yaml", "firecrawl-anydoc": "anydoc",
+ # import pillow_heif alone never fails on a dead link: its
+ # __init__ swallows the _pillow_heif ImportError into a
+ # DeferredError that only fires on first use. Import the C
+ # extension directly so the dlopen itself is what's proven.
+ "pillow-heif": "_pillow_heif",
}
for name in build_set:
module = modules.get(name, name.replace("-", "_"))
diff --git a/scripts/termux/runtime_libs.json b/scripts/termux/runtime_libs.json
index 81cd9808f3d..12535d53f03 100644
--- a/scripts/termux/runtime_libs.json
+++ b/scripts/termux/runtime_libs.json
@@ -126,6 +126,11 @@
"url": "https://packages.termux.dev/apt/termux-main/pool/main/libd/libdav1d/libdav1d_1.5.4_aarch64.deb",
"version": "1.5.4"
},
+ "libde265": {
+ "sha256": "3c38af85b13a638b377fab1b7389aae2aca5067e21db29c058d5746f52ea7114",
+ "url": "https://packages.termux.dev/apt/termux-main/pool/main/libd/libde265/libde265_1.1.3_aarch64.deb",
+ "version": "1.1.3"
+ },
"libdvdnav": {
"sha256": "fd8509a88b5966cdadf9925b2687e50c31d796e773cb326e651e76c0a3b16958",
"url": "https://packages.termux.dev/apt/termux-main/pool/main/libd/libdvdnav/libdvdnav_7.0.0_aarch64.deb",
@@ -151,6 +156,11 @@
"url": "https://packages.termux.dev/apt/termux-main/pool/main/libg/libgraphite/libgraphite_1.3.15_aarch64.deb",
"version": "1.3.15"
},
+ "libheif": {
+ "sha256": "78c53ef6df843f01abc65d79ea6e4253965b64b918ca6d6b0ba10ce069b56c50",
+ "url": "https://packages.termux.dev/apt/termux-main/pool/main/libh/libheif/libheif_1.23.4_aarch64.deb",
+ "version": "1.23.4"
+ },
"libiconv": {
"sha256": "b19e6f348034bb48d2a5590b5cb242769f682c476717374d134d004cc663dc84",
"url": "https://packages.termux.dev/apt/termux-main/pool/main/libi/libiconv/libiconv_1.18-1_aarch64.deb",
diff --git a/scripts/termux/termux-builder.Dockerfile b/scripts/termux/termux-builder.Dockerfile
index 265d311f8ae..95b0918a2af 100644
--- a/scripts/termux/termux-builder.Dockerfile
+++ b/scripts/termux/termux-builder.Dockerfile
@@ -32,6 +32,7 @@ RUN printf '%s\n' "deb https://packages.termux.dev/apt/termux-main stable main"
autoconf automake libtool \
libandroid-posix-semaphore libandroid-support libbz2 libffi \
libjpeg-turbo libpng freetype libtiff libwebp openjpeg littlecms \
+ libheif \
libyaml openssl readline zlib liblzma libsqlite ncurses
# No /bin/sh link here: uid 1000 cannot write /, and the runtime wheelhouse
diff --git a/scripts/termux/termux_build.sh b/scripts/termux/termux_build.sh
index 7ac7023647a..c089c0552bb 100755
--- a/scripts/termux/termux_build.sh
+++ b/scripts/termux/termux_build.sh
@@ -71,6 +71,7 @@ if [ "${1:-}" = "--in-container" ]; then
apt install -y clang rust make git patchelf binutils pkg-config protobuf cmake ninja autoconf automake libtool \
libandroid-posix-semaphore libandroid-support libbz2 libffi \
libjpeg-turbo libpng freetype libtiff libwebp openjpeg littlecms \
+ libheif \
libyaml openssl readline zlib liblzma libsqlite ncurses \
|| fail "apt install of the build toolchain failed"
fi