Merge pull request #232 from kiwix/fix_appimage

Fix appimage
This commit is contained in:
Matthieu Gautier 2018-08-03 16:34:57 +02:00 committed by GitHub
commit 05290ec859
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 19 deletions

View File

@ -3,10 +3,12 @@
set -e set -e
INSTALLDIR=${1:-$PWD/BUILD_native_dyn/INSTALL} INSTALLDIR=${1:-$PWD/BUILD_native_dyn/INSTALL}
APPDIR=${2:-$PWD/AppDir} SOURCEDIR=${2:-$PWD/SOURCE/kiwix-desktop}
APPDIR=${3:-$PWD/AppDir}
#TODO We should have our icon #TODO We should have our icon
ICONFILE=/usr/share/icons/hicolor/48x48/apps/gvim.png ICONFILE=$SOURCEDIR/resources/icons/kiwix/app_icon.svg
DESKTOPFILE=$SOURCEDIR/kiwix.desktop
# Create structure # Create structure
mkdir -p $APPDIR/usr/{bin,lib,share} $APPDIR/usr/share/applications $APPDIR/usr/share/icons/hicolor/48x48/apps mkdir -p $APPDIR/usr/{bin,lib,share} $APPDIR/usr/share/applications $APPDIR/usr/share/icons/hicolor/48x48/apps
@ -17,27 +19,20 @@ cp $INSTALLDIR/lib/x86_64-linux-gnu/*.so* $APPDIR/usr/lib
rm $APPDIR/usr/lib/libmagic.so* rm $APPDIR/usr/lib/libmagic.so*
# Copy nss lib (to not conflict with host's ones) # Copy nss lib (to not conflict with host's ones)
cp -a /usr/lib/x86_64-linux-gnu/nss $APPDIR/usr/lib cp -a /usr/lib/x86_64-linux-gnu/nss $APPDIR/usr/lib
cp $ICONFILE $APPDIR/usr/share/icons/hicolor/48x48/apps/kiwix-desktop.png cp -a /usr/lib/x86_64-linux-gnu/libstdc++.so* $APPDIR/usr/lib
# TODO we should have our .desktop cp -a /usr/lib/x86_64-linux-gnu/libc.so* $APPDIR/usr/lib
tee $APPDIR/usr/share/applications/kiwix-desktop.desktop <<EOF > /dev/null cp -a /usr/lib/x86_64-linux-gnu/libz.so* $APPDIR/usr/lib
[Desktop Entry] cp $ICONFILE $APPDIR/usr/share/icons/hicolor/48x48/apps/kiwix-desktop.svg
Name=Kiwix mkdir -p $APPDIR/usr/share/applications
Exec=kiwix-desktop %F cp $DESKTOPFILE $APPDIR/usr/share/applications/kiwix.desktop
Icon=kiwix-desktop
Type=Application
Terminal=false
StartupNotify=true
NoDisplay=false
Categories=Education;
EOF
# Get linuxdeployqt # Get linuxdeployqt
wget https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage wget https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage
chmod a+x linuxdeployqt-continuous-x86_64.AppImage chmod a+x linuxdeployqt-continuous-x86_64.AppImage
# Fill with all deps libs and so # Fill with all deps libs and so
./linuxdeployqt-continuous-x86_64.AppImage $APPDIR/usr/bin/kiwix-desktop -verbose=3 -bundle-non-qt-libs ./linuxdeployqt-continuous-x86_64.AppImage $APPDIR/usr/bin/kiwix-desktop -verbose=3 -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
# Build the image. # Build the image.
./linuxdeployqt-continuous-x86_64.AppImage $APPDIR/usr/share/applications/kiwix-desktop.desktop -verbose=3 -bundle-non-qt-libs -appimage # ./linuxdeployqt-continuous-x86_64.AppImage $APPDIR/usr/share/applications/kiwix.desktop -verbose=3 -bundle-non-qt-libs -extra-plugins=imageformats,iconengines -appimage

View File

@ -37,6 +37,8 @@ RUN \
libqt5gui5 \ libqt5gui5 \
qtbase5-dev \ qtbase5-dev \
qtwebengine5-dev \ qtwebengine5-dev \
libqt5svg5-dev \
qt5-image-formats-plugins \
qt5-default \ qt5-default \
# To create the appimage of kiwix-desktop # To create the appimage of kiwix-desktop
libfuse2 \ libfuse2 \

View File

@ -97,7 +97,7 @@ def run_kiwix_build(target, platform,
def create_app_image(): def create_app_image():
command = ['kiwix-build/scripts/create_kiwix-desktop_appImage.sh', command = ['kiwix-build/scripts/create_kiwix-desktop_appImage.sh',
str(BASE_DIR/'INSTALL'), str(HOME/'AppDir')] str(BASE_DIR/'INSTALL'), str(HOME/'SOURCE'/'kiwix-desktop'), str(HOME/'AppDir')]
print_message("Build AppImage of kiwix-desktop") print_message("Build AppImage of kiwix-desktop")
subprocess.check_call(command, cwd=str(HOME)) subprocess.check_call(command, cwd=str(HOME))
if make_release: if make_release:
@ -112,7 +112,7 @@ def create_app_image():
except FileExistsError: except FileExistsError:
pass pass
app_name = "kiwix-desktop_x86_64_{}".format(postfix) app_name = "kiwix-desktop_x86_64_{}.appimage".format(postfix)
print_message("Copy AppImage to {}".format(archive_dir/app_name)) print_message("Copy AppImage to {}".format(archive_dir/app_name))
shutil.copy(str(HOME/'Kiwix-x86_64.AppImage'), str(archive_dir/app_name)) shutil.copy(str(HOME/'Kiwix-x86_64.AppImage'), str(archive_dir/app_name))