From 5e2b410e4ee6d98b0e88509e82153e46203d3f6d Mon Sep 17 00:00:00 2001 From: deepend-tildeclub Date: Thu, 2 Apr 2026 10:13:34 -0600 Subject: [PATCH] CI: Fixes for Spellcheck on Appimage --- .github/workflows/appimage-build.yml | 85 +++++++++++++++++++++++++++- 1 file changed, 83 insertions(+), 2 deletions(-) diff --git a/.github/workflows/appimage-build.yml b/.github/workflows/appimage-build.yml index 3d1bdc7a..0ff4c64d 100644 --- a/.github/workflows/appimage-build.yml +++ b/.github/workflows/appimage-build.yml @@ -37,7 +37,8 @@ jobs: libluajit-5.1-dev libpci-dev libperl-dev libssl-dev libayatana-appindicator3-dev \ perl python3 python3-minimal python3-dev python3-cffi mono-devel desktop-file-utils \ fonts-noto-color-emoji breeze-gtk-theme \ - patchelf file curl + patchelf file curl \ + libenchant-2-dev enchant-2 hunspell hunspell-en-us - name: Configure run: | @@ -100,6 +101,7 @@ jobs: install -d AppDir/usr/share cp -a /usr/share/perl5 AppDir/usr/share/ fi + if compgen -G '/usr/lib/x86_64-linux-gnu/libpython3*.so*' > /dev/null; then install -d AppDir/usr/lib/x86_64-linux-gnu cp -a /usr/lib/x86_64-linux-gnu/libpython3*.so* AppDir/usr/lib/x86_64-linux-gnu/ @@ -125,6 +127,70 @@ jobs: cp -a /usr/lib/gtk-3.0/modules AppDir/usr/lib/gtk-3.0/ fi + # Spellcheck runtime: Enchant libraries and provider modules + if compgen -G '/usr/lib/x86_64-linux-gnu/libenchant-2.so*' > /dev/null; then + install -d AppDir/usr/lib/x86_64-linux-gnu + cp -a /usr/lib/x86_64-linux-gnu/libenchant-2.so* AppDir/usr/lib/x86_64-linux-gnu/ + fi + + if compgen -G '/usr/lib/x86_64-linux-gnu/libhunspell-*.so*' > /dev/null; then + install -d AppDir/usr/lib/x86_64-linux-gnu + cp -a /usr/lib/x86_64-linux-gnu/libhunspell-*.so* AppDir/usr/lib/x86_64-linux-gnu/ + fi + + if [ -d "/usr/lib/x86_64-linux-gnu/enchant-2" ]; then + install -d AppDir/usr/lib/x86_64-linux-gnu + cp -a /usr/lib/x86_64-linux-gnu/enchant-2 AppDir/usr/lib/x86_64-linux-gnu/ + fi + + if [ -d "/usr/lib/enchant-2" ]; then + install -d AppDir/usr/lib + cp -a /usr/lib/enchant-2 AppDir/usr/lib/ + fi + + # Enchant config / ordering + if [ -d "/usr/share/enchant-2" ]; then + install -d AppDir/usr/share + cp -a /usr/share/enchant-2 AppDir/usr/share/ + fi + + if [ -d "/etc/enchant-2" ]; then + install -d AppDir/etc + cp -a /etc/enchant-2 AppDir/etc/ + fi + + # Dictionaries in normal distro locations + if [ -d "/usr/share/hunspell" ]; then + install -d AppDir/usr/share + cp -a /usr/share/hunspell AppDir/usr/share/ + fi + + if [ -d "/usr/share/myspell" ]; then + install -d AppDir/usr/share + cp -a /usr/share/myspell AppDir/usr/share/ + fi + + # Dictionaries in Enchant-relative locations for relocatable runtime + install -d AppDir/usr/share/enchant-2 + + if [ -d "/usr/share/hunspell" ]; then + cp -a /usr/share/hunspell AppDir/usr/share/enchant-2/ + fi + + if [ -d "/usr/share/myspell/dicts" ]; then + install -d AppDir/usr/share/enchant-2/myspell + cp -a /usr/share/myspell/dicts/. AppDir/usr/share/enchant-2/myspell/ + fi + + # Bundle enchant helper binaries for diagnostics if available + if [ -x "/usr/bin/enchant-2" ]; then + install -Dm755 /usr/bin/enchant-2 AppDir/usr/bin/enchant-2 + fi + + if [ -x "/usr/bin/enchant-lsmod-2" ]; then + install -Dm755 /usr/bin/enchant-lsmod-2 AppDir/usr/bin/enchant-lsmod-2 + fi + - name: Verify bundled plugins run: | set -eux @@ -136,6 +202,16 @@ jobs: find "AppDir/usr/lib" -maxdepth 4 -type f -name "${plugin}.so" -path '*/zoitechat/plugins/*' -print -quit | grep -q . done + - name: Verify bundled spellcheck payload + run: | + set -eux + + find AppDir/usr/lib AppDir/usr/lib/x86_64-linux-gnu \ + -type f -path '*/enchant-2/enchant_hunspell.so' -print -quit | grep -q . + + find AppDir/usr/share -type f -name 'en_US.aff' -print -quit | grep -q . + find AppDir/usr/share -type f -name 'en_US.dic' -print -quit | grep -q . + - name: Build AppImage env: APPIMAGE_EXTRACT_AND_RUN: 1 @@ -167,6 +243,7 @@ jobs: export XDG_DATA_DIRS="$APPDIR/usr/share:${XDG_DATA_DIRS:-/usr/local/share:/usr/share}" export GTK_EXE_PREFIX="$APPDIR/usr" export GTK_DATA_PREFIX="$APPDIR/usr" + gtk_path_entries="" if [ -d "$APPDIR/usr/lib/x86_64-linux-gnu/gtk-3.0" ]; then gtk_path_entries="$APPDIR/usr/lib/x86_64-linux-gnu/gtk-3.0" @@ -232,6 +309,11 @@ jobs: export SSL_CERT_DIR="${SSL_CERT_DIR:-$APPDIR/etc/ssl/certs}" export CURL_CA_BUNDLE="${CURL_CA_BUNDLE:-$SSL_CERT_FILE}" + # Enchant config for relocatable spellcheck + if [ -d "$APPDIR/usr/share/enchant-2" ]; then + export ENCHANT_CONFIG_DIR="$APPDIR/usr/share/enchant-2" + fi + # Prefer Wayland if the session provides it, but keep X11 fallback. # Don't override if the user already set GDK_BACKEND explicitly. if [ -z "${GDK_BACKEND:-}" ]; then @@ -256,7 +338,6 @@ jobs: EOF chmod +x AppRun - VERSION="$(git describe --tags --always)" ./linuxdeploy-x86_64.AppImage \