From a280edd7ddc6229f0472b7f654ee69b06daa873a Mon Sep 17 00:00:00 2001 From: Erwan Leboucher Date: Mon, 20 Jul 2026 16:04:48 +0200 Subject: [PATCH] perf(cef): strip binaries and trim locales strip -s on libcef.so (1.3GB to 241MB), libEGL.so, libGLESv2.so. Ship only en-US locale (49MB to 570KB) per CEF README.redistrib.txt. Package sizes: .deb 151MB, .rpm 150MB, AppImage 141MB (was 322MB). --- scripts/cef-copy-libs.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/scripts/cef-copy-libs.sh b/scripts/cef-copy-libs.sh index 881d75d48..99e026126 100644 --- a/scripts/cef-copy-libs.sh +++ b/scripts/cef-copy-libs.sh @@ -23,7 +23,16 @@ echo "→ copying CEF runtime from $CEF_DIR to $DEST" cp -f "$CEF_DIR"/*.so* "$DEST/" 2>/dev/null || true cp -f "$CEF_DIR"/chrome_crashpad_handler "$DEST/" 2>/dev/null || true cp -f "$CEF_DIR"/*.pak "$CEF_DIR"/*.dat "$CEF_DIR"/*.bin "$CEF_DIR"/*.json "$DEST/" 2>/dev/null || true -cp -rf "$CEF_DIR"/locales "$DEST/" 2>/dev/null || true + +# Strip debug symbols: CEF ships libcef.so unstripped (~1.3 GB → 241 MB). +# Same approach as OutSystems cef.redist.linux and Spotify's desktop client. +for lib in "$DEST"/libcef.so "$DEST"/libEGL.so "$DEST"/libGLESv2.so; do + [ -f "$lib" ] && strip -s "$lib" 2>/dev/null || true +done + +# Only ship en-US locale (49 MB → 570 KB); see CEF README.redistrib.txt. +mkdir -p "$DEST/locales" +cp -f "$CEF_DIR"/locales/en-US.pak "$DEST/locales/" 2>/dev/null || true # The setuid sandbox helper only works when installed as root (deb/rpm). In a # nosuid context such as an AppImage, drop chrome-sandbox and let Chromium use