diff --git a/.github/workflows/appimage-build.yml b/.github/workflows/appimage-build.yml index 3d1bdc7a..dab4c108 100644 --- a/.github/workflows/appimage-build.yml +++ b/.github/workflows/appimage-build.yml @@ -31,11 +31,14 @@ jobs: libcanberra-dev libdbus-glib-1-dev libglib2.0-dev \ libarchive-dev \ libgtk-3-dev \ + libenchant-2-2 enchant-2 \ + libnuspell5 \ libwayland-client0 libwayland-cursor0 libwayland-egl1 \ libxkbcommon0 \ libgtk-3-bin libglib2.0-bin shared-mime-info gsettings-desktop-schemas \ 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 \ + hunspell hunspell-en-us hunspell-en-gb hunspell-en-ca hunspell-es hunspell-fr hunspell-de-de hunspell-it hunspell-pt-br hunspell-ru hunspell-uk hunspell-nl hunspell-pl \ fonts-noto-color-emoji breeze-gtk-theme \ patchelf file curl @@ -125,17 +128,68 @@ jobs: cp -a /usr/lib/gtk-3.0/modules AppDir/usr/lib/gtk-3.0/ fi + 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/libgmodule-2.0.so*' > /dev/null; then + install -d AppDir/usr/lib/x86_64-linux-gnu + cp -a /usr/lib/x86_64-linux-gnu/libgmodule-2.0.so* AppDir/usr/lib/x86_64-linux-gnu/ + fi + + if compgen -G '/usr/lib/x86_64-linux-gnu/libnuspell.so*' > /dev/null; then + install -d AppDir/usr/lib/x86_64-linux-gnu + cp -a /usr/lib/x86_64-linux-gnu/libnuspell.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/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 + + if [ -d "/usr/share/hunspell" ]; then + install -d AppDir/usr/share + cp -a /usr/share/hunspell AppDir/usr/share/ + fi + - name: Verify bundled plugins run: | set -eux - # Include every built-in plugin except the Windows-only update plugin. find AppDir/usr/lib -maxdepth 4 -type f -name '*.so' -path '*/zoitechat/plugins/*' -print | sort for plugin in checksum fishlim lua perl python sysinfo; do find "AppDir/usr/lib" -maxdepth 4 -type f -name "${plugin}.so" -path '*/zoitechat/plugins/*' -print -quit | grep -q . done + find AppDir/usr/lib/x86_64-linux-gnu -maxdepth 1 \( -type f -o -type l \) -name 'libenchant-2.so*' -print -quit | grep -q . + find AppDir/usr/lib/x86_64-linux-gnu -maxdepth 1 \( -type f -o -type l \) -name 'libgmodule-2.0.so*' -print -quit | grep -q . + find AppDir/usr/lib/x86_64-linux-gnu -maxdepth 1 -type f -name 'libhunspell-*.so*' -print -quit | grep -q . + find AppDir/usr/lib/x86_64-linux-gnu/enchant-2 -maxdepth 1 -type f -name '*hunspell*.so*' -print -quit | grep -q . + test -f AppDir/usr/share/hunspell/en_CA.dic + test -f AppDir/usr/share/hunspell/en_CA.aff + test -d AppDir/usr/share/enchant-2 + ldd -r AppDir/usr/lib/x86_64-linux-gnu/libenchant-2.so.2 | tee /tmp/ldd-enchant.txt + if grep -q 'undefined symbol' /tmp/ldd-enchant.txt; then + exit 1 + fi + - name: Build AppImage env: APPIMAGE_EXTRACT_AND_RUN: 1 @@ -167,6 +221,9 @@ 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" + export ENCHANT_PREFIX="$APPDIR/usr" + export DICPATH="$APPDIR/usr/share/hunspell${DICPATH:+:$DICPATH}" + export ENCHANT_CONFIG_DIR="$APPDIR/etc/enchant-2" 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"