Browse Source

run Cryptomator binaries instead of java from AppImage launcher .sh

Sebastian Stenzel 3 years ago
parent
commit
fab70ef8c9

+ 2 - 0
.github/workflows/appimage.yml

@@ -60,6 +60,7 @@ jobs:
           --compress=1
       - name: Run jpackage
         run: >
+          envsubst '${SEMVER_STR} ${REVISION_NUM}' < dist/linux/launcher-gtk2.properties > launcher-gtk2.properties
           ${JAVA_HOME}/bin/jpackage
           --verbose
           --type app-image
@@ -83,6 +84,7 @@ jobs:
           --java-options "-Dcryptomator.mountPointsDir=\"~/.local/share/Cryptomator/mnt\""
           --java-options "-Dcryptomator.showTrayIcon=false"
           --java-options "-Dcryptomator.buildNumber=\"appimage-${{  steps.versions.outputs.revNum }}\""
+          --add-launcher Cryptomator-gtk2=launcher-gtk2.properties \
           --resource-dir dist/linux/resources
       - name: Patch Cryptomator.AppDir
         run: |

+ 2 - 0
dist/linux/appimage/build.sh

@@ -26,6 +26,7 @@ ${JAVA_HOME}/bin/jlink \
     --compress=1
 
 # create app dir
+envsubst '${SEMVER_STR} ${REVISION_NUM}' < dist/linux/launcher-gtk2.properties > launcher-gtk2.properties
 ${JAVA_HOME}/bin/jpackage \
     --verbose \
     --type app-image \
@@ -48,6 +49,7 @@ ${JAVA_HOME}/bin/jpackage \
     --java-options "-Dcryptomator.mountPointsDir=\"~/.local/share/Cryptomator/mnt\"" \
     --java-options "-Dcryptomator.showTrayIcon=false" \
     --java-options "-Dcryptomator.buildNumber=\"appimage-${REVISION_NO}\"" \
+    --add-launcher cryptomator-gtk2=launcher-gtk2.properties \
     --resource-dir ../resources
 
 # transform AppDir

+ 5 - 20
dist/linux/appimage/resources/AppDir/bin/cryptomator.sh

@@ -15,26 +15,11 @@ elif command -v pacman &> /dev/null; then # don't forget arch
 	GTK3_PRESENT=`pacman -Qi gtk3 &> /dev/null; echo $?`
 fi
 
-if [ "$GTK2_PRESENT" -eq 0 ] && [ "$GTK3_PRESENT" -ne 0 ]; then
-	GTK_FLAG="-Djdk.gtk.version=2"
-fi
-
 # workaround for https://github.com/cryptomator/cryptomator-linux/issues/27
 export LD_PRELOAD=lib/app/libjffi.so
 
-# start Cryptomator
-./lib/runtime/bin/java \
-	-p "lib/app/mods" \
-	-cp "lib/app/*" \
-	-Dfile.encoding="utf-8" \
-	-Dcryptomator.logDir="~/.local/share/Cryptomator/logs" \
-	-Dcryptomator.pluginDir="~/.local/share/Cryptomator/plugins" \
-	-Dcryptomator.mountPointsDir="~/.local/share/Cryptomator/mnt" \
-	-Dcryptomator.settingsPath="~/.config/Cryptomator/settings.json:~/.Cryptomator/settings.json" \
-	-Dcryptomator.ipcSocketPath="~/.config/Cryptomator/ipc.socket" \
-	-Dcryptomator.buildNumber="appimage-${REVISION_NO}" \
-	-Dcryptomator.appVersion="${SEMVER_STR}" \
-	$GTK_FLAG \
-	-Xss5m \
-	-Xmx256m \
-	-m org.cryptomator.desktop/org.cryptomator.launcher.Cryptomator
+if [ "$GTK2_PRESENT" -eq 0 ] && [ "$GTK3_PRESENT" -ne 0 ]; then
+	./bin/Cryptomator-gtk2
+else
+  ./bin/Cryptomator
+fi

+ 12 - 0
dist/linux/launcher-gtk2.properties

@@ -0,0 +1,12 @@
+java-options=-Xss5m \
+            -Xmx256m \
+            -Dfile.encoding=\"utf-8\" \
+            -Dcryptomator.appVersion=\"${SEMVER_STR}\" \
+            -Dcryptomator.logDir=\"~/.local/share/Cryptomator/logs\" \
+            -Dcryptomator.pluginDir=\"~/.local/share/Cryptomator/plugins\" \
+            -Dcryptomator.settingsPath=\"~/.config/Cryptomator/settings.json:~/.Cryptomator/settings.json\" \
+            -Dcryptomator.ipcSocketPath=\"~/.config/Cryptomator/ipc.socket\" \
+            -Dcryptomator.mountPointsDir=\"~/.local/share/Cryptomator/mnt\" \
+            -Dcryptomator.showTrayIcon=false \
+            -Dcryptomator.buildNumber=\"appimage-${REVISION_NUM}\" \
+            -Djdk.gtk.version=2