summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sci-mathematics/geogebra-bin/files/geogebra.sh33
-rw-r--r--sci-mathematics/geogebra-bin/geogebra-bin-5.0.604.0-r2.ebuild (renamed from sci-mathematics/geogebra-bin/geogebra-bin-5.0.604.0-r1.ebuild)1
2 files changed, 22 insertions, 12 deletions
diff --git a/sci-mathematics/geogebra-bin/files/geogebra.sh b/sci-mathematics/geogebra-bin/files/geogebra.sh
index 652563aa47f..b0f941e8a46 100644
--- a/sci-mathematics/geogebra-bin/files/geogebra.sh
+++ b/sci-mathematics/geogebra-bin/files/geogebra.sh
@@ -1,23 +1,32 @@
#!@GENTOO_PORTAGE_EPREFIX@/bin/bash
+set -euo pipefail
+IFS=$'\n\t'
+
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)"
+ local j8 j11 jcmd
+ j8="$(java-config --select-vm openjdk-8 -J 2> /dev/null || true)"
+ j11="$(java-config --select-vm openjdk-11 -J 2> /dev/null || true)"
- if [[ -f $(dirname ${j8:-/})/../jre/lib/javafx.properties ]]; then
- JAVACMD="${j8}"
- elif [[ -f $(dirname ${j11:-/})/../lib/javafx.properties ]]; then
- JAVACMD="${j11}"
+ if [[ -f "$(dirname "${j8:-/}")/../jre/lib/javafx.properties" ]]; then
+ jcmd="${j8}"
+ elif [[ -f "$(dirname "${j11:-/}")/../lib/javafx.properties" ]]; then
+ jcmd="${j11}"
+ elif [[ -f @GENTOO_PORTAGE_EPREFIX@/usr/lib64/openjdk-11/lib/javafx.properties ]]; then
+ jcmd="@GENTOO_PORTAGE_EPREFIX@/usr/lib64/openjdk-11/bin/java"
+ elif [[ -f @GENTOO_PORTAGE_EPREFIX@/usr/lib/openjdk-11/lib/javafx.properties ]]; then
+ jcmd="@GENTOO_PORTAGE_EPREFIX@/usr/lib/openjdk-11/bin/java"
else
- echo "openjdk[javafx] not found!" 1>&2
+ echo "dev-java/openjdk[javafx] not found!" 1>&2
+ exit 1
+ fi
+
+ if [[ ! -x "${jcmd}" ]]; then
+ echo "${jcmd} not executable!" 1>&2
exit 1
fi
- echo "using ${JAVACMD}"
- export JAVACMD
- exec "@GENTOO_PORTAGE_EPREFIX@/opt/geogebra/geogebra" "${@}"
+ env JAVACMD="${jcmd}" "@GENTOO_PORTAGE_EPREFIX@/opt/geogebra/geogebra" "${@}"
}
main "$@"
diff --git a/sci-mathematics/geogebra-bin/geogebra-bin-5.0.604.0-r1.ebuild b/sci-mathematics/geogebra-bin/geogebra-bin-5.0.604.0-r2.ebuild
index 510a5bd2d37..f2e49482106 100644
--- a/sci-mathematics/geogebra-bin/geogebra-bin-5.0.604.0-r1.ebuild
+++ b/sci-mathematics/geogebra-bin/geogebra-bin-5.0.604.0-r2.ebuild
@@ -18,6 +18,7 @@ KEYWORDS="~amd64 ~ppc64"
IUSE=""
RDEPEND="
+ dev-java/java-config
|| (
dev-java/openjdk:8[javafx]
dev-java/openjdk:11[javafx]