aboutsummaryrefslogtreecommitdiffstats
path: root/deskutils/ganttproject/files/patch-ganttproject
blob: c0340cd03fa834a724227ec2862e3d6d282a6591 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
--- ganttproject.orig	2023-10-26 16:28:31 UTC
+++ ganttproject
@@ -64,7 +64,7 @@ fi
 
 USE_BUNDLED_RUNTIME=1
 DEBUG_ARGS=""
-APP_ARGS=()
+APP_ARGS=""
 
 while true; do
   case "$1" in
@@ -99,7 +99,7 @@ while true; do
       break;
       ;;
     *)
-      APP_ARGS+=("$1")
+      APP_ARGS="$APP_ARG $1"
       shift 1
       ;;
   esac
@@ -139,15 +139,29 @@ check_java() {
     return 1
   fi
 
-  VERSION="$( $JAVA_COMMAND -version 2>&1 | grep version | head -n 1)"
+  VERSION="$( $JAVA_COMMAND -version 2>&1 | grep version | head -n 1 | grep -Eo '\".*\"' | cut -c 2-4 )"
   log "...found $VERSION"
-  [[ "$VERSION" =~ 11\.? ]] && return 0;
-  [[ "$VERSION" =~ 12\.? ]] && return 0;
-  [[ "$VERSION" =~ 13\.? ]] && return 0;
-  [[ "$VERSION" =~ 14\.? ]] && return 0;
-  [[ "$VERSION" =~ 15\.? ]] && return 0;
-  [[ "$VERSION" =~ 16\.? ]] && return 0;
-  [[ "$VERSION" =~ 17\.? ]] && return 0;
+  if [ "$VERSION" == "11." ]; then
+	return 0;
+  fi
+  if [ "$VERSION" == "12." ]; then
+	return 0;
+  fi
+  if [ "$VERSION" == "13." ]; then
+	return 0;
+  fi
+  if [ "$VERSION" == "14." ]; then
+	return 0;
+  fi
+  if [ "$VERSION" == "15." ]; then
+	return 0;
+  fi
+  if [ "$VERSION" == "16." ]; then
+	return 0;
+  fi
+  if [ "$VERSION" == "17." ]; then
+	return 0;
+  fi
   log "...this seems to be an old Java Runtime";
   JAVA_COMMAND=""
   return 1
@@ -214,7 +228,9 @@ JAVA_EXPORTS="--add-exports javafx.controls/com.sun.ja
   --add-exports javafx.graphics/com.sun.javafx.util=ALL-UNNAMED\
   --add-opens java.desktop/sun.swing=ALL-UNNAMED\
   --add-opens java.desktop/sun.awt.X11=ALL-UNNAMED"
-"$JAVA_COMMAND" -Xmx1024m $JAVA_EXPORTS -Duser.dir="$(pwd)" $DEBUG_ARGS $BOOT_CLASS \
+"$JAVA_COMMAND" \
+  --module-path=/usr/local/openjfx14/lib --add-modules=javafx.swing,javafx.web,javafx.graphics,javafx.controls \
+  -Xmx1024m $JAVA_EXPORTS -Duser.dir="$(pwd)" $DEBUG_ARGS $BOOT_CLASS \
   --app net.sourceforge.ganttproject.GanttProject \
   --version-dirs "$GP_HOME"/plugins:~/.ganttproject.d/updates \
-  -log true -log_file "$LOG_FILE" "${APP_ARGS[@]}"
+  -log true -log_file "$LOG_FILE" "$APP_ARGS"