From ef4f923740a15799a4cf896da98bd0a8da41abbe Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Sun, 28 May 2017 13:41:53 +0200 Subject: [PATCH 1/4] Lets AppImage this! Signed-off-by: Roeland Jago Douma --- linux/AppImage/Dockerfile | 13 ++++++ linux/AppImage/build.sh | 93 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 106 insertions(+) create mode 100644 linux/AppImage/Dockerfile create mode 100755 linux/AppImage/build.sh diff --git a/linux/AppImage/Dockerfile b/linux/AppImage/Dockerfile new file mode 100644 index 0000000..10ca9c6 --- /dev/null +++ b/linux/AppImage/Dockerfile @@ -0,0 +1,13 @@ +FROM ubuntu:trusty + +MAINTAINER Roeland Jago Douma + +RUN apt-get update + +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-qt562-trusty + +RUN apt-get update + +RUN apt-get install -y qt56base qt56tools diff --git a/linux/AppImage/build.sh b/linux/AppImage/build.sh new file mode 100755 index 0000000..233c5ac --- /dev/null +++ b/linux/AppImage/build.sh @@ -0,0 +1,93 @@ +#/bin/bash + +#Get Qt-5.6.2 +source /opt/qt56/bin/qt56-env.sh + +#QtKeyChain +cd +git clone https://github.com/frankosterfeld/qtkeychain.git +cd qtkeychain +git checkout v0.8.0 +mkdir build +cd build +cmake -D CMAKE_INSTALL_PREFIX=/app ../ +make +make install + +#Build client +cd +mkdir build-client +cd build-client +cmake -D CMAKE_INSTALL_PREFIX=/app \ + -D NO_SHIBBOLETH=1 \ + -D OEM_THEME_DIR=/home/client/nextcloudtheme \ + -DMIRALL_VERSION_SUFFIX=beta \ + -DMIRALL_VERSION_BUILD=13 \ + /home/client/client +make +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/ + +#Fetch appimage functions +wget -q https://github.com/probonopd/AppImages/raw/master/functions.sh -O ./functions.sh +. ./functions.sh + +cd $APP.AppDir + +#clean binary +sed -i -e 's|/app|././|g' /app/bin/nextcloud + +# Copy installed stuff +cp -r /app/* ./usr/ + +get_apprun + +cp /app/share/applications/nextcloud.desktop . +cp /app/share/icons/hicolor/256x256/apps/Nextcloud.png nextcloud.png + +#Copy qt plugins +mkdir -p ./usr/lib/qt5/plugis +cp -r /opt/qt56/plugins ./usr/lib/qt5/plugins + +#Copy dependencies +copy_deps + +delete_blacklisted + +# We don't bundle the developer stuff +rm -rf usr/include || true +rm -rf usr/lib/cmake || true +rm -rf usr/lib/pkgconfig || true +find . -name '*.la' | xargs -i rm {} +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/ + + +#Move qt5.6 libs to the right location +mv ./opt/qt56/lib/* ./usr/lib/x86_64-linux-gnu/ +rm -rf ./opt/ + +#Move sync exlucde to right location +mv ./usr/etc/Nextcloud/sync-exclude.lst ./usr/bin/ + +#desktop intergration +get_desktopintegration $LOWERAPP + +#Generate the appimage +cd .. +mkdir -p ../out/ +generate_type2_appimage + +#move appimag +mv ../out/ /home/client/ From d2d90444cd544d87d746ebee0667f224570edaf2 Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Sun, 28 May 2017 20:24:35 +0200 Subject: [PATCH 2/4] Bump to qt5.8 Signed-off-by: Roeland Jago Douma --- linux/AppImage/Dockerfile | 4 ++-- linux/AppImage/build.sh | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/linux/AppImage/Dockerfile b/linux/AppImage/Dockerfile index 10ca9c6..6e4e76d 100644 --- a/linux/AppImage/Dockerfile +++ b/linux/AppImage/Dockerfile @@ -6,8 +6,8 @@ RUN apt-get update 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-qt562-trusty +RUN add-apt-repository -y ppa:beineri/opt-qt58-trusty RUN apt-get update -RUN apt-get install -y qt56base qt56tools +RUN apt-get install -y qt58base qt58tools diff --git a/linux/AppImage/build.sh b/linux/AppImage/build.sh index 233c5ac..2ab7007 100755 --- a/linux/AppImage/build.sh +++ b/linux/AppImage/build.sh @@ -1,7 +1,7 @@ #/bin/bash -#Get Qt-5.6.2 -source /opt/qt56/bin/qt56-env.sh +#Get Qt-5.8 +source /opt/qt58/bin/qt58-env.sh #QtKeyChain cd @@ -11,7 +11,7 @@ git checkout v0.8.0 mkdir build cd build cmake -D CMAKE_INSTALL_PREFIX=/app ../ -make +make -j4 make install #Build client @@ -22,9 +22,9 @@ cmake -D CMAKE_INSTALL_PREFIX=/app \ -D NO_SHIBBOLETH=1 \ -D OEM_THEME_DIR=/home/client/nextcloudtheme \ -DMIRALL_VERSION_SUFFIX=beta \ - -DMIRALL_VERSION_BUILD=13 \ + -DMIRALL_VERSION_BUILD=14 \ /home/client/client -make +make -j4 make install #Set info @@ -56,7 +56,7 @@ cp /app/share/icons/hicolor/256x256/apps/Nextcloud.png nextcloud.png #Copy qt plugins mkdir -p ./usr/lib/qt5/plugis -cp -r /opt/qt56/plugins ./usr/lib/qt5/plugins +cp -r /opt/qt58/plugins ./usr/lib/qt5/plugins #Copy dependencies copy_deps @@ -74,8 +74,8 @@ rm -rf app/ || true cp /lib/x86_64-linux-gnu/libssl.so.1.0.0 usr/lib/ -#Move qt5.6 libs to the right location -mv ./opt/qt56/lib/* ./usr/lib/x86_64-linux-gnu/ +#Move qt5.8 libs to the right location +mv ./opt/qt58/lib/* ./usr/lib/ rm -rf ./opt/ #Move sync exlucde to right location From f67f62f82f39d70ff60c8c3e258039a63f8dd542 Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Mon, 29 May 2017 12:59:11 +0200 Subject: [PATCH 3/4] 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/ From b5951bccb20f1a48d04698b9d24f3abfabd744b7 Mon Sep 17 00:00:00 2001 From: TheAssassin Date: Fri, 7 Jul 2017 22:20:44 +0200 Subject: [PATCH 4/4] Fix cmake command chain (#181) --- linux/appimage-build.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/linux/appimage-build.sh b/linux/appimage-build.sh index 63dab41..6b53970 100755 --- a/linux/appimage-build.sh +++ b/linux/appimage-build.sh @@ -14,10 +14,10 @@ sudo apt-get -y build-dep owncloud-client git submodule update --init --recursive mkdir build-linux cd build-linux -cmake -D CMAKE_INSTALL_PREFIX=/app -D OEM_THEME_DIR=`pwd`/../nextcloudtheme ../client +cmake -D CMAKE_INSTALL_PREFIX=/usr -D OEM_THEME_DIR=`pwd`/../nextcloudtheme ../client make find . -sudo make install +sudo make install DESTDIR=/app find /app ########################################################################