1- # /bin/bash
1+ #! /bin/bash
22
3- # Get Qt-5.8
4- source /opt/qt58/bin/qt58-env.sh
3+ export SUDO_UID= ${SUDO_UID :- 1000}
4+ export SUDO_GID= ${SUDO_GID :- 1000}
55
6- # QtKeyChain
7- cd
6+ export APP=Nextcloud
7+ export LOWERAPP=${APP,,}
8+ export ARCH=x86_64
9+ export VERSION=2.3.2-beta
10+
11+ # Set Qt-5.8
12+ export QT_BASE_DIR=/opt/qt58
13+ export QTDIR=$QT_BASE_DIR
14+ export PATH=$QT_BASE_DIR /bin:$PATH
15+ export LD_LIBRARY_PATH=$QT_BASE_DIR /lib/x86_64-linux-gnu:$QT_BASE_DIR /lib:$LD_LIBRARY_PATH
16+ export PKG_CONFIG_PATH=$QT_BASE_DIR /lib/pkgconfig:$PKG_CONFIG_PATH
17+
18+ # QtKeyChain 0.8.0
19+ cd
820git clone https://github.com/frankosterfeld/qtkeychain.git
921cd qtkeychain
1022git checkout v0.8.0
@@ -15,7 +27,7 @@ make -j4
1527make install
1628
1729# Build client
18- cd
30+ cd
1931mkdir build-client
2032cd build-client
2133cmake -D CMAKE_INSTALL_PREFIX=/app \
@@ -27,12 +39,6 @@ cmake -D CMAKE_INSTALL_PREFIX=/app \
2739make -j4
2840make install
2941
30- # Set info
31- ARCH=$( arch)
32- APP=Nextcloud
33- LOWERAPP=${APP,,}
34- VERSION=2.3.2-beta
35-
3642# Create skeleton
3743mkdir -p $HOME /$APP /$APP .AppDir/usr/
3844cd $HOME /$APP /
@@ -72,22 +78,41 @@ strip usr/bin/* usr/lib/* || true
7278rm -rf app/ || true
7379# Copy, since libssl must be in sync with libcrypto
7480cp /lib/x86_64-linux-gnu/libssl.so.1.0.0 usr/lib/
75-
81+ # No need to add CMake stuff
82+ rm -rf usr/lib/x86_64-linux-gnu/cmake/
83+ rm -rf usr/mkspecs
84+ # Don't bundle nextcloudcmd as we don't run it anyway
85+ rm usr/bin/nextcloudcmd
86+ # Don't bundle the explorer extentions as we can't do anything with them in the AppImage
87+ rm -rf usr/share/caja-python/
88+ rm -rf usr/share/nautilus-python/
89+ rm -rf usr/share/nemo-python/
7690
7791# Move qt5.8 libs to the right location
7892mv ./opt/qt58/lib/* ./usr/lib/
7993rm -rf ./opt/
8094
8195# Move sync exlucde to right location
8296mv ./usr/etc/Nextcloud/sync-exclude.lst ./usr/bin/
97+ rm -rf ./usr/etc
8398
8499# desktop intergration
85100get_desktopintegration $LOWERAPP
86101
87102# Generate the appimage
88103cd ..
104+ wget -c https://github.com/probonopd/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage
105+ chmod +x appimagetool-x86_64.AppImage
106+ ./appimagetool-x86_64.AppImage --appimage-extract
107+
89108mkdir -p ../out/
90- generate_type2_appimage
109+ GLIBC_NEEDED=$( glibc_needed)
110+ APPIMAGE_FILENAME=${APP} -${VERSION} -${ARCH} .glibc$GLIBC_NEEDED .AppImage
111+ APPIMAGE_PATH=../out/$APPIMAGE_FILENAME
112+
113+ ./squashfs-root/AppRun -n -v $APP .AppDir $APPIMAGE_PATH
91114
92- # move appimag
93- mv ../out/ /home/client/
115+ # move appimage
116+ chown $SUDO_UID :$SUDO_GID ../out/* .AppImage
117+ mkdir -p /home/client/out
118+ mv ../out/* .AppImage /home/client/out/
0 commit comments