summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'sci-mathematics/geogebra-bin/files/geogebra.sh')
-rw-r--r--sci-mathematics/geogebra-bin/files/geogebra.sh23
1 files changed, 23 insertions, 0 deletions
diff --git a/sci-mathematics/geogebra-bin/files/geogebra.sh b/sci-mathematics/geogebra-bin/files/geogebra.sh
new file mode 100644
index 000000000000..652563aa47f9
--- /dev/null
+++ b/sci-mathematics/geogebra-bin/files/geogebra.sh
@@ -0,0 +1,23 @@
+#!@GENTOO_PORTAGE_EPREFIX@/bin/bash
+
+main() {
+ local JAVACMD
+ # prefer openjdk-8 over 11
+ local j8="$(java-config --select-vm openjdk-8 -J)"
+ local j11="$(java-config --select-vm openjdk-11 -J)"
+
+ if [[ -f $(dirname ${j8:-/})/../jre/lib/javafx.properties ]]; then
+ JAVACMD="${j8}"
+ elif [[ -f $(dirname ${j11:-/})/../lib/javafx.properties ]]; then
+ JAVACMD="${j11}"
+ else
+ echo "openjdk[javafx] not found!" 1>&2
+ exit 1
+ fi
+
+ echo "using ${JAVACMD}"
+ export JAVACMD
+ exec "@GENTOO_PORTAGE_EPREFIX@/opt/geogebra/geogebra" "${@}"
+}
+
+main "$@"