#!/bin/bash # Package pre-built chromium-fourier artifacts into a .deb. # # Chromium can't be compiled natively on any available aarch64 runner # (clang version wall — chromium requires its internal clang fork). # The build is cross-compiled on CT 220 (data, x86_64 Ryzen 7). # This script expects the build artifacts to exist at BUILD_DIR # (default: fetched from CT 220 via SSH). # # Sibling Arch package: ../../arch/chromium-fourier/PKGBUILD set -euo pipefail PKGVER=148.0.7778.178 EPOCH=1 PKGREL=1 ARCH=arm64 HERE=$(dirname "$(readlink -f "$0")") export SOURCE_DATE_EPOCH=1779854400 # 2026-05-24 09:00 UTC BUILD_DIR="${BUILD_DIR:-}" work=$(mktemp -d) trap "rm -rf $work" EXIT if [ -z "$BUILD_DIR" ]; then echo "BUILD_DIR not set — fetching artifacts from CT 220 on data..." BUILD_DIR="$work/artifacts" mkdir -p "$BUILD_DIR" ssh root@data "pct exec 220 -- tar -cf - -C /build/chromium/src/out/Default \ chrome chrome_crashpad_handler \ libEGL.so libGLESv2.so libvk_swiftshader.so libvulkan.so.1 \ vk_swiftshader_icd.json \ chrome_100_percent.pak chrome_200_percent.pak resources.pak \ v8_context_snapshot.bin snapshot_blob.bin icudtl.dat \ locales/" | tar -xf - -C "$BUILD_DIR" fi ROOT="$work/pkgroot" install -Dm755 "$BUILD_DIR/chrome" "$ROOT/usr/lib/chromium/chromium" install -Dm755 "$BUILD_DIR/chrome_crashpad_handler" "$ROOT/usr/lib/chromium/chrome_crashpad_handler" for so in libEGL.so libGLESv2.so libvk_swiftshader.so libvulkan.so.1; do [ -f "$BUILD_DIR/$so" ] && install -Dm755 "$BUILD_DIR/$so" "$ROOT/usr/lib/chromium/$so" done for icd in "$BUILD_DIR"/*_icd.json; do [ -f "$icd" ] && install -Dm644 "$icd" "$ROOT/usr/lib/chromium/$(basename "$icd")" done for f in chrome_100_percent.pak chrome_200_percent.pak resources.pak \ v8_context_snapshot.bin snapshot_blob.bin icudtl.dat; do [ -f "$BUILD_DIR/$f" ] && install -Dm644 "$BUILD_DIR/$f" "$ROOT/usr/lib/chromium/$f" done if [ -d "$BUILD_DIR/locales" ]; then install -dm755 "$ROOT/usr/lib/chromium/locales" cp -r "$BUILD_DIR/locales/"* "$ROOT/usr/lib/chromium/locales/" fi install -dm755 "$ROOT/usr/bin" cat > "$ROOT/usr/bin/chromium-fourier" <<'LAUNCHER' #!/bin/bash USER_HANDLES_VULKAN=0 for arg in "$@"; do case "$arg" in --use-vulkan*|--enable-features=*Vulkan*|--disable-features=*Vulkan*|--use-angle=vulkan*) USER_HANDLES_VULKAN=1 break ;; esac done vulkan_default=() if [ "$USER_HANDLES_VULKAN" = 0 ]; then vulkan_default=(--disable-features=Vulkan) fi exec /usr/lib/chromium/chromium \ --ozone-platform=wayland \ --use-gl=angle --use-angle=gles \ --enable-features=AcceleratedVideoDecoder \ "${vulkan_default[@]}" \ "$@" LAUNCHER chmod 0755 "$ROOT/usr/bin/chromium-fourier" mkdir -p "$ROOT/usr/share/doc/chromium-fourier" "$ROOT/DEBIAN" install -Dm644 "$HERE/debian/copyright" \ "$ROOT/usr/share/doc/chromium-fourier/copyright" install -Dm644 "$HERE/debian/changelog" \ "$ROOT/usr/share/doc/chromium-fourier/changelog.Debian" gzip -9 -n "$ROOT/usr/share/doc/chromium-fourier/changelog.Debian" ISIZE=$(du -sk "$ROOT" | awk '{print $1}') cat > "$ROOT/DEBIAN/control" < Homepage: https://www.chromium.org/ Description: Chromium with V4L2 HW video decode for Rockchip (Wayland + mainline) Chromium ${PKGVER} with three patches enabling V4L2 hardware video decoding on mainline Linux / Wayland for Rockchip SoCs (RK3566 hantro, RK3588 VDPU381). . Cross-compiled from x86_64 using chromium's bundled clang (upstream LLVM cannot compile chromium). Runtime target is aarch64. . Patches: enable-v4l2-decoder-default, wayland-allow-direct-egl-gles2, nv12-external-oes-on-modifier-external-only. . Launcher at /usr/bin/chromium-fourier defaults to Wayland + ANGLE/GLES with Vulkan disabled (panvk on RK3566 breaks V4L2 dispatch). EOF DEB_OUT="chromium-fourier_${EPOCH}%3a${PKGVER}-${PKGREL}_${ARCH}.deb" dpkg-deb --root-owner-group --build "$ROOT" "$HERE/$DEB_OUT" echo "built: $HERE/$DEB_OUT"