further adjustments to new directory structure

This commit is contained in:
Sebastian Stenzel
2021-07-21 12:57:45 +02:00
parent 81ab8b7803
commit aa7a4dbda9
3 changed files with 44 additions and 24 deletions

View File

@@ -231,7 +231,6 @@ jobs:
name: appdir-linux
- name: Patch Cryptomator.AppDir
run: |
ls -lR Cryptomator
mv Cryptomator Cryptomator.AppDir
cp -r dist/appimage/resources/AppDir/* Cryptomator.AppDir/
chmod +x Cryptomator.AppDir/lib/runtime/bin/java

View File

@@ -11,29 +11,44 @@ command -v curl >/dev/null 2>&1 || { echo >&2 "curl not found."; exit 1; }
# compile
mvn -B -f../../pom.xml clean package -DskipTests -Plinux
# prepare AppDir
mkdir Cryptomator.AppDir
mv ../../target/libs Cryptomator.AppDir
mv ../../target/mods Cryptomator.AppDir
cp ../../LICENSE.txt Cryptomator.AppDir
# add runtime
${JAVA_HOME}/bin/jlink
--output Cryptomator.AppDir/runtime
--module-path "${JAVA_HOME}/jmods"
--add-modules java.base,java.desktop,java.logging,java.naming,java.net.http,java.scripting,java.sql,java.xml,jdk.unsupported,jdk.crypto.ec,jdk.accessibility
--no-header-files
--no-man-pages
--strip-debug
--compress=1
${JAVA_HOME}/bin/jlink \
--output runtime \
--module-path "${JAVA_HOME}/jmods" \
--add-modules java.base,java.desktop,java.logging,java.naming,java.net.http,java.scripting,java.sql,java.xml,jdk.unsupported,jdk.crypto.ec,jdk.accessibility \
--no-header-files \
--no-man-pages \
--strip-debug \
--compress=1
# extract jffi
JFFI_NATIVE_JAR=`ls Cryptomator.AppDir/libs | grep -e 'jffi-[1-9]\.[0-9]\{1,2\}.[0-9]\{1,2\}-native.jar'`
${JAVA_HOME}/bin/jar -xf Cryptomator.AppDir/libs/${JFFI_NATIVE_JAR} /jni/x86_64-Linux/
mv jni/x86_64-Linux/* Cryptomator.AppDir/libs/libjffi.so
rm -r jni/x86_64-Linux
# create app dir
${JAVA_HOME}/bin/jpackage \
--verbose \
--type app-image \
--runtime-image runtime \
--input buildkit/libs \
--module-path buildkit/mods \
--module org.cryptomator.desktop/org.cryptomator.launcher.Cryptomator \
--dest . \
--name Cryptomator \
--vendor "Skymatic GmbH" \
--copyright "(C) 2016 - 2021 Skymatic GmbH" \
--java-options "-Xss5m" \
--java-options "-Xmx256m" \
--app-version "${{ needs.metadata.outputs.versionNum }}.${{ needs.metadata.outputs.revNum }}" \
--java-options "-Dfile.encoding=\"utf-8\"" \
--java-options "-Dcryptomator.logDir=\"~/.local/share/Cryptomator/logs\"" \
--java-options "-Dcryptomator.settingsPath=\"~/.config/Cryptomator/settings.json:~/.Cryptomator/settings.json\"" \
--java-options "-Dcryptomator.ipcSocketPath=\"~/.config/Cryptomator/ipc.socket\"" \
--java-options "-Dcryptomator.mountPointsDir=\"~/.local/share/Cryptomator/mnt\"" \
--java-options "-Dcryptomator.showTrayIcon=false" \
--java-options "-Dcryptomator.buildNumber=\"appimage-${{ needs.metadata.outputs.revNum }}\"" \
--resource-dir ../appdir/linux/resources
# finalize AppDir
# transform AppDir
mv Cryptomator Cryptomator.AppDir
cp -r dist/appimage/resources/AppDir/* Cryptomator.AppDir/
chmod +x Cryptomator.AppDir/lib/runtime/bin/java
envsubst '${REVISION_NO}' < resources/AppDir/bin/cryptomator.sh > Cryptomator.AppDir/bin/cryptomator.sh
ln -s usr/share/icons/hicolor/scalable/apps/org.cryptomator.Cryptomator.svg Cryptomator.AppDir/org.cryptomator.Cryptomator.svg
ln -s usr/share/icons/hicolor/scalable/apps/org.cryptomator.Cryptomator.svg Cryptomator.AppDir/Cryptomator.svg
@@ -41,6 +56,12 @@ ln -s usr/share/icons/hicolor/scalable/apps/org.cryptomator.Cryptomator.svg Cryp
ln -s usr/share/applications/org.cryptomator.Cryptomator.desktop Cryptomator.AppDir/Cryptomator.desktop
ln -s bin/cryptomator.sh Cryptomator.AppDir/AppRun
# extract jffi
JFFI_NATIVE_JAR=`ls Cryptomator.AppDir/lib/app | grep -e 'jffi-[1-9]\.[0-9]\{1,2\}.[0-9]\{1,2\}-native.jar'`
${JAVA_HOME}/bin/jar -xf Cryptomator.AppDir/lib/app/${JFFI_NATIVE_JAR} /jni/x86_64-Linux/
mv jni/x86_64-Linux/* Cryptomator.AppDir/lib/app/libjffi.so
rm -r jni/x86_64-Linux
# load AppImageTool
curl -L https://github.com/AppImage/AppImageKit/releases/download/13/appimagetool-x86_64.AppImage -o /tmp/appimagetool.AppImage
chmod +x /tmp/appimagetool.AppImage

View File

@@ -23,9 +23,9 @@ fi
export LD_PRELOAD=libs/libjffi.so
# start Cryptomator
./runtime/bin/java \
-p "mods" \
-cp "libs/*" \
./lib/runtime/bin/java \
-p "lib/app/mods" \
-cp "lib/app/*" \
-Dcryptomator.logDir="~/.local/share/Cryptomator/logs" \
-Dcryptomator.mountPointsDir="~/.local/share/Cryptomator/mnt" \
-Dcryptomator.settingsPath="~/.config/Cryptomator/settings.json:~/.Cryptomator/settings.json" \