From f67f62f82f39d70ff60c8c3e258039a63f8dd542 Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Mon, 29 May 2017 12:59:11 +0200 Subject: [PATCH] Bit cleaner build Signed-off-by: Roeland Jago Douma --- linux/AppImage/Dockerfile | 13 ++--- .../AppImage/{build.sh => build-appimage.sh} | 57 +++++++++++++------ 2 files changed, 47 insertions(+), 23 deletions(-) rename linux/AppImage/{build.sh => build-appimage.sh} (55%) diff --git a/linux/AppImage/Dockerfile b/linux/AppImage/Dockerfile index 6e4e76d..9246818 100644 --- a/linux/AppImage/Dockerfile +++ b/linux/AppImage/Dockerfile @@ -2,12 +2,11 @@ FROM ubuntu:trusty MAINTAINER Roeland Jago Douma -RUN apt-get update +RUN apt-get update && \ + apt-get install -y wget libsqlite3-dev libssl-dev cmake git \ + software-properties-common build-essential mesa-common-dev fuse rsync -RUN apt-get install -y wget libsqlite3-dev libssl-dev cmake git software-properties-common build-essential mesa-common-dev fuse +RUN add-apt-repository -y ppa:beineri/opt-qt58-trusty && \ + apt-get update && \ + apt-get install -y qt58base qt58tools -RUN add-apt-repository -y ppa:beineri/opt-qt58-trusty - -RUN apt-get update - -RUN apt-get install -y qt58base qt58tools diff --git a/linux/AppImage/build.sh b/linux/AppImage/build-appimage.sh similarity index 55% rename from linux/AppImage/build.sh rename to linux/AppImage/build-appimage.sh index 2ab7007..6200f45 100755 --- a/linux/AppImage/build.sh +++ b/linux/AppImage/build-appimage.sh @@ -1,10 +1,22 @@ -#/bin/bash +#! /bin/bash -#Get Qt-5.8 -source /opt/qt58/bin/qt58-env.sh +export SUDO_UID=${SUDO_UID:-1000} +export SUDO_GID=${SUDO_GID:-1000} -#QtKeyChain -cd +export APP=Nextcloud +export LOWERAPP=${APP,,} +export ARCH=x86_64 +export VERSION=2.3.2-beta + +#Set Qt-5.8 +export QT_BASE_DIR=/opt/qt58 +export QTDIR=$QT_BASE_DIR +export PATH=$QT_BASE_DIR/bin:$PATH +export LD_LIBRARY_PATH=$QT_BASE_DIR/lib/x86_64-linux-gnu:$QT_BASE_DIR/lib:$LD_LIBRARY_PATH +export PKG_CONFIG_PATH=$QT_BASE_DIR/lib/pkgconfig:$PKG_CONFIG_PATH + +#QtKeyChain 0.8.0 +cd git clone https://github.com/frankosterfeld/qtkeychain.git cd qtkeychain git checkout v0.8.0 @@ -15,7 +27,7 @@ make -j4 make install #Build client -cd +cd mkdir build-client cd build-client cmake -D CMAKE_INSTALL_PREFIX=/app \ @@ -27,12 +39,6 @@ cmake -D CMAKE_INSTALL_PREFIX=/app \ make -j4 make install -#Set info -ARCH=$(arch) -APP=Nextcloud -LOWERAPP=${APP,,} -VERSION=2.3.2-beta - #Create skeleton mkdir -p $HOME/$APP/$APP.AppDir/usr/ cd $HOME/$APP/ @@ -72,7 +78,15 @@ strip usr/bin/* usr/lib/* || true rm -rf app/ || true # Copy, since libssl must be in sync with libcrypto cp /lib/x86_64-linux-gnu/libssl.so.1.0.0 usr/lib/ - +# No need to add CMake stuff +rm -rf usr/lib/x86_64-linux-gnu/cmake/ +rm -rf usr/mkspecs +# Don't bundle nextcloudcmd as we don't run it anyway +rm usr/bin/nextcloudcmd +# Don't bundle the explorer extentions as we can't do anything with them in the AppImage +rm -rf usr/share/caja-python/ +rm -rf usr/share/nautilus-python/ +rm -rf usr/share/nemo-python/ #Move qt5.8 libs to the right location mv ./opt/qt58/lib/* ./usr/lib/ @@ -80,14 +94,25 @@ rm -rf ./opt/ #Move sync exlucde to right location mv ./usr/etc/Nextcloud/sync-exclude.lst ./usr/bin/ +rm -rf ./usr/etc #desktop intergration get_desktopintegration $LOWERAPP #Generate the appimage cd .. +wget -c https://github.com/probonopd/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage +chmod +x appimagetool-x86_64.AppImage +./appimagetool-x86_64.AppImage --appimage-extract + mkdir -p ../out/ -generate_type2_appimage +GLIBC_NEEDED=$(glibc_needed) +APPIMAGE_FILENAME=${APP}-${VERSION}-${ARCH}.glibc$GLIBC_NEEDED.AppImage +APPIMAGE_PATH=../out/$APPIMAGE_FILENAME + +./squashfs-root/AppRun -n -v $APP.AppDir $APPIMAGE_PATH -#move appimag -mv ../out/ /home/client/ +#move appimage +chown $SUDO_UID:$SUDO_GID ../out/*.AppImage +mkdir -p /home/client/out +mv ../out/*.AppImage /home/client/out/