From 894ab4ba06daa9e78072cefdf04c5e132165df34 Mon Sep 17 00:00:00 2001 From: Matthieu Gautier Date: Tue, 12 Jun 2018 16:09:56 +0200 Subject: [PATCH] Add a script to package kiwix-desktop in a AppImage. AppImage is a tools to create application running in all linux. See https://appimage.org/ --- scripts/create_kiwix-desktop_appImage.sh | 42 ++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100755 scripts/create_kiwix-desktop_appImage.sh diff --git a/scripts/create_kiwix-desktop_appImage.sh b/scripts/create_kiwix-desktop_appImage.sh new file mode 100755 index 0000000..f7064df --- /dev/null +++ b/scripts/create_kiwix-desktop_appImage.sh @@ -0,0 +1,42 @@ +#!/usr/bin/env bash + +set -e + +INSTALLDIR=${1:-$PWD/BUILD_native_dyn/INSTALL} +APPDIR=${2:-$PWD/AppDir} + +#TODO We should have our icon +ICONFILE=/usr/share/icons/hicolor/48x48/apps/gvim.png + +# Create structure +mkdir -p $APPDIR/usr/{bin,lib,share} $APPDIR/usr/share/applications $APPDIR/usr/share/icons/hicolor/48x48/apps +# Copy our files +cp $INSTALLDIR/bin/kiwix-desktop $APPDIR/usr/bin/ +cp $INSTALLDIR/lib/x86_64-linux-gnu/*.so* $APPDIR/usr/lib +# Remove it as it break with linuxdeployqt (should we compile without it) ? +rm $APPDIR/usr/lib/libmagic.so* +# Copy nss lib (to not conflict with host's ones) +cp -a /usr/lib/x86_64-linux-gnu/nss $APPDIR/usr/lib +cp $ICONFILE $APPDIR/usr/share/icons/hicolor/48x48/apps/kiwix-desktop.png +# TODO we should have our .desktop +tee $APPDIR/usr/share/applications/kiwix-desktop.desktop < /dev/null +[Desktop Entry] +Name=Kiwix +Exec=kiwix-desktop %F +Icon=kiwix-desktop +Type=Application +Terminal=false +StartupNotify=true +NoDisplay=false +EOF + +# Get linuxdeployqt +wget https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage +chmod a+x linuxdeployqt-continuous-x86_64.AppImage + +# Fill with all deps libs and so +./linuxdeployqt-continuous-x86_64.AppImage $APPDIR/usr/bin/kiwix-desktop -verbose=3 -bundle-non-qt-libs +# Fix the RPATH of QtWebEngineProcess [TODO] Fill a issue ? +patchelf --set-rpath '$ORIGIN/../lib' $APPDIR/usr/libexec/QtWebEngineProcess +# Build the image. +./linuxdeployqt-continuous-x86_64.AppImage $APPDIR/usr/share/applications/kiwix-desktop.desktop -verbose=3 -bundle-non-qt-libs -appimage #