Merge pull request #771 from kiwix/kiwix-desktop_jammy_appimage

Kiwix desktop jammy appimage
This commit is contained in:
Kelson 2024-12-02 20:21:57 +01:00 committed by GitHub
commit a14970bc43
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 48 additions and 109 deletions

View File

@ -38,32 +38,33 @@ BUILD_DEF = """
| macos | macOS_x86_64 | B | B | | | | | | | macos | macOS_x86_64 | B | B | | | | | |
| macos | apple_all_static | | BP | | | | xcframework | | | macos | apple_all_static | | BP | | | | xcframework | |
---------------------------------------------------------------------------------------------------------------------------------------------- ----------------------------------------------------------------------------------------------------------------------------------------------
| | flatpak | | | | | BP | | | | focal | flatpak | | | | | BP | | |
| | native_static | d | d | dBPSD | dBPSD | | linux-x86_64 | linux-x86_64-static | | focal | native_static | d | d | dBPSD | dBPSD | | linux-x86_64 | linux-x86_64-static |
| | native_mixed | BPS | BPS | | | | linux-x86_64 | | | focal | native_mixed | BPS | BPS | | | | linux-x86_64 | |
| | native_dyn | d | d | dB | dB | dBPS | | linux-x86_64-dyn | | focal | native_dyn | d | d | dB | dB | | | linux-x86_64-dyn |
| jammy | native_dyn | d | d | | | dBPS | | linux-x86_64-dyn |
# libzim CI is building alpine_dyn but not us # libzim CI is building alpine_dyn but not us
| | android_arm | dBP | dBP | | | | android-arm | android-arm | | focal | android_arm | dBP | dBP | | | | android-arm | android-arm |
| | android_arm64 | dBP | dBP | | | | android-arm64 | android-arm64 | | focal | android_arm64 | dBP | dBP | | | | android-arm64 | android-arm64 |
| | android_x86 | BP | BP | | | | android-x86 | | | focal | android_x86 | BP | BP | | | | android-x86 | |
| | android_x86_64 | BP | BP | | | | android-x86_64 | | | focal | android_x86_64 | BP | BP | | | | android-x86_64 | |
| | armv6_static | | | BP | BP | | linux-armv6 | | | focal | armv6_static | | | BP | BP | | linux-armv6 | |
| | armv6_mixed | BP | | | | | linux-armv6 | | | focal | armv6_mixed | BP | | | | | linux-armv6 | |
| | armv6_dyn | | | B | B | | | | | focal | armv6_dyn | | | B | B | | | |
| | armv8_static | | | BP | BP | | linux-armv8 | | | focal | armv8_static | | | BP | BP | | linux-armv8 | |
| | armv8_mixed | BP | | | | | linux-armv8 | | | focal | armv8_mixed | BP | | | | | linux-armv8 | |
| | armv8_dyn | | | B | B | | | | | focal | armv8_dyn | | | B | B | | | |
| | aarch64_static | | | BP | BP | | linux-aarch64 | | | focal | aarch64_static | | | BP | BP | | linux-aarch64 | |
| | aarch64_mixed | BP | | | | | linux-aarch64 | | | focal | aarch64_mixed | BP | | | | | linux-aarch64 | |
| | aarch64_dyn | d | | B | B | | | linux-aarch64-dyn | | focal | aarch64_dyn | d | | B | B | | | linux-aarch64-dyn |
| | aarch64_musl_static| | | BP | BP | | linux-aarch64-musl | | | focal | aarch64_musl_static| | | BP | BP | | linux-aarch64-musl | |
| | aarch64_musl_mixed | BP | | | | | linux-aarch64-musl | | | focal | aarch64_musl_mixed | BP | | | | | linux-aarch64-musl | |
| | aarch64_musl_dyn | d | | B | B | | | linux-aarch64-musl-dyn | | focal | aarch64_musl_dyn | d | | B | B | | | linux-aarch64-musl-dyn |
| | x86-64_musl_static | | | BP | BP | | linux-x86_64-musl | | | focal | x86-64_musl_static | | | BP | BP | | linux-x86_64-musl | |
| | x86-64_musl_mixed | BP | | | | | linux-x86_64-musl | | | focal | x86-64_musl_mixed | BP | | | | | linux-x86_64-musl | |
| | i586_static | | | BP | BP | | linux-i586 | | | focal | i586_static | | | BP | BP | | linux-i586 | |
| | i586_dyn | | | B | B | | | | | focal | i586_dyn | | | B | B | | | |
| | wasm | dBP | | | | | wasm-emscripten | wasm | | focal | wasm | dBP | | | | | wasm-emscripten | wasm |
""" """

View File

@ -131,12 +131,14 @@ jobs:
image_variant: manylinux image_variant: manylinux
- config: aarch64_mixed - config: aarch64_mixed
image_variant: manylinux image_variant: manylinux
- config: native_dyn
image_variant: jammy
env: env:
HOME: /home/runner HOME: /home/runner
SSH_KEY: /tmp/id_rsa SSH_KEY: /tmp/id_rsa
runs-on: ubuntu-22.04 runs-on: ubuntu-22.04
container: container:
image: "ghcr.io/kiwix/kiwix-build_ci_${{matrix.image_variant}}:2024-06-03" image: "ghcr.io/kiwix/kiwix-build_ci_${{matrix.image_variant}}:2024-11-30"
options: "--device /dev/fuse --privileged" options: "--device /dev/fuse --privileged"
steps: steps:
- name: Checkout code - name: Checkout code

View File

@ -107,12 +107,15 @@ jobs:
image_variant: manylinux image_variant: manylinux
- config: aarch64_mixed - config: aarch64_mixed
image_variant: manylinux image_variant: manylinux
- config: native_dyn
image_variant: jammy
env: env:
HOME: /home/runner HOME: /home/runner
SSH_KEY: /tmp/id_rsa SSH_KEY: /tmp/id_rsa
OS_NAME: ${{matrix.image_variant}}
runs-on: ubuntu-22.04 runs-on: ubuntu-22.04
container: container:
image: "ghcr.io/kiwix/kiwix-build_ci_${{matrix.image_variant}}:2024-06-03" image: "ghcr.io/kiwix/kiwix-build_ci_${{matrix.image_variant}}:2024-11-30"
options: "--device /dev/fuse --privileged" options: "--device /dev/fuse --privileged"
steps: steps:
- name: Checkout code - name: Checkout code

View File

@ -14,98 +14,31 @@ fi
ICONFILE=$SOURCEDIR/resources/icons/kiwix/scalable/kiwix-desktop.svg ICONFILE=$SOURCEDIR/resources/icons/kiwix/scalable/kiwix-desktop.svg
DESKTOPFILE=$SOURCEDIR/resources/org.kiwix.desktop.desktop DESKTOPFILE=$SOURCEDIR/resources/org.kiwix.desktop.desktop
# Create structure # Get linuxdeploy
mkdir -p $APPDIR/usr/{bin,lib,share} $APPDIR/usr/share/applications $APPDIR/usr/share/icons/hicolor/48x48/apps wget --continue https://github.com/linuxdeploy/linuxdeploy/releases/download/1-alpha-20240109-1/linuxdeploy-x86_64.AppImage
# Copy our files chmod u+x linuxdeploy-x86_64.AppImage
cp $INSTALLDIR/bin/kiwix-desktop $APPDIR/usr/bin/ wget --continue https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/1-alpha-20240109-1/linuxdeploy-plugin-qt-x86_64.AppImage
cp $INSTALLDIR/$SYSTEMLIBDIR/*.so* $APPDIR/usr/lib chmod u+x linuxdeploy-plugin-qt-x86_64.AppImage
# Remove it as it break with linuxdeployqt (should we compile without it) ?
rm -f $APPDIR/usr/lib/libmagic.so*
# Copy nss lib (to not conflict with host's ones)
cp -a /usr/$SYSTEMLIBDIR/nss $APPDIR/usr/lib
# Copy libthai.so (see kiwix-desktop issue#1016)
cp -a /usr/$SYSTEMLIBDIR/libthai.so* $APPDIR/usr/lib
# Copy ssl libs so that the appimage runs on newer systems # Fill with all deps libs and so
# that use a backward incompatible version of openssl LD_LIBRARY_PATH=$INSTALLDIR/lib/x86_64-linux-gnu ./linuxdeploy-x86_64.AppImage \
cp /usr/$SYSTEMLIBDIR/lib{crypto,ssl}.so.1.1 $APPDIR/usr/lib --plugin=qt \
--appdir="$APPDIR" \
patch_rodata() --executable=$INSTALLDIR/bin/kiwix-desktop \
{ --desktop-file=$DESKTOPFILE \
local elffile=$1 --icon-file=$ICONFILE \
local sedscript=$2 --library=/usr/lib/x86_64-linux-gnu/libthai.so.0 \
local rodatafile=$elffile.rodata
objcopy --dump-section .rodata="$rodatafile" "$elffile"
sed -i "$sedscript" "$rodatafile"
objcopy --update-section .rodata="$rodatafile" "$elffile"
rm $rodatafile
}
# copy and patch a couple of libs depending on ssl functionalty before
# linuxdeployqt copies and modifies them whereupon the patch_rodata procedure
# stops working on them correctly
cp -rL /usr/$SYSTEMLIBDIR/{libgnutls.so.30,libQt5Network.so.5} $APPDIR/usr/lib
# patch libQt5Network.so so that if it fails to load certificates from
# system paths the last path that it tries points to the certificate bundle
# included with the appimage
# !!! crt_bundle_new_path must have the same length as crt_bundle_old_path
crt_bundle_old_path=/usr/local/share/certs/ca-root-nss.crt
crt_bundle_new_path=/tmp/cert_bundle_provided_by_kiwix.crt
# !!! crt_bundle_new_path must have the same length as crt_bundle_old_path
libQtNetworkPatchingSedScript="s|$crt_bundle_old_path|$crt_bundle_new_path|"
patch_rodata $APPDIR/usr/lib/libQt5Network.so.5 "$libQtNetworkPatchingSedScript"
cp $ICONFILE $APPDIR/usr/share/icons/hicolor/48x48/apps/kiwix-desktop.svg
mkdir -p $APPDIR/usr/share/applications
cp $DESKTOPFILE $APPDIR/usr/share/applications/kiwix-desktop.desktop
# get the aria2 # get the aria2
wget --continue https://github.com/q3aql/aria2-static-builds/releases/download/v1.36.0/aria2-1.36.0-linux-gnu-64bit-build1.tar.bz2 wget --continue https://github.com/q3aql/aria2-static-builds/releases/download/v1.36.0/aria2-1.36.0-linux-gnu-64bit-build1.tar.bz2
mkdir -p $APPDIR/usr/bin/ && tar -C $APPDIR/usr/bin/ -xf aria2-1.36.0-linux-gnu-64bit-build1.tar.bz2 aria2-1.36.0-linux-gnu-64bit-build1/aria2c --strip-components=1 mkdir -p $APPDIR/usr/bin/ && tar -C $APPDIR/usr/bin/ -xf aria2-1.36.0-linux-gnu-64bit-build1.tar.bz2 aria2-1.36.0-linux-gnu-64bit-build1/aria2c --strip-components=1
mkdir -p $APPDIR/etc/ssl/certs/ && tar -C $APPDIR/etc/ssl/certs/ -xf aria2-1.36.0-linux-gnu-64bit-build1.tar.bz2 aria2-1.36.0-linux-gnu-64bit-build1/ca-certificates.crt --strip-components=1 mkdir -p $APPDIR/etc/ssl/certs/ && tar -C $APPDIR/etc/ssl/certs/ -xf aria2-1.36.0-linux-gnu-64bit-build1.tar.bz2 aria2-1.36.0-linux-gnu-64bit-build1/ca-certificates.crt --strip-components=1
# Get linuxdeployqt
# Dispite the 'continuous' in the file name, it IS release 8
wget --continue https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage -O linuxdeployqt
chmod u+x linuxdeployqt
# Fill with all deps libs and so
./linuxdeployqt $APPDIR/usr/bin/kiwix-desktop -bundle-non-qt-libs -extra-plugins=imageformats,iconengines
# Fix the RPATH of QtWebEngineProcess [TODO] Fill a issue ? # Fix the RPATH of QtWebEngineProcess [TODO] Fill a issue ?
patchelf --set-rpath '$ORIGIN/../lib' $APPDIR/usr/libexec/QtWebEngineProcess patchelf --set-rpath '$ORIGIN/../lib' $APPDIR/usr/libexec/QtWebEngineProcess
cp $DESKTOPFILE $APPDIR/kiwix-desktop.desktop mv $APPDIR/{AppRun.wrapped,kiwix-desktop}
cp $ICONFILE $APPDIR/ sed -i 's/AppRun\.wrapped/kiwix-desktop/g' $APPDIR/AppRun
cp $ICONFILE $APPDIR/.DirIcon
rm "$APPDIR"/AppRun
cat > "$APPDIR"/AppRun <<'END'
#!/usr/bin/env bash
mydir=$(dirname "$0")
mydir=$(cd "$mydir" && pwd)
crt_path=??? # this is set by postprocessing via sed
if [ ! -e "$crt_path" ]
then
ln -s "$mydir"/etc/ssl/certs/ca-certificates.crt "$crt_path"
trap "rm '$crt_path'" EXIT
fi
"$mydir"/usr/bin/kiwix-desktop "$@"
END
sed -i "s#^crt_path=.*#crt_path=$crt_bundle_new_path#" "$APPDIR"/AppRun
chmod 0755 "$APPDIR"/AppRun
wget --continue https://github.com/AppImage/AppImageKit/releases/download/13/appimagetool-x86_64.AppImage wget --continue https://github.com/AppImage/AppImageKit/releases/download/13/appimagetool-x86_64.AppImage
chmod u+x appimagetool-x86_64.AppImage chmod u+x appimagetool-x86_64.AppImage