commit:     95759d9dc56112d6c12256df4718e070f3bd6e82
Author:     Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
AuthorDate: Mon Sep 21 01:38:38 2020 +0000
Commit:     Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
CommitDate: Mon Sep 21 01:49:33 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=95759d9d

sci-mathematics/geogebra-bin: revbump, wrapper improvements

should work with openjdk:11 without gentoo-vm useflag now.

Package-Manager: Portage-3.0.7, Repoman-3.0.1
Signed-off-by: Georgy Yakovlev <gyakovlev <AT> gentoo.org>

 sci-mathematics/geogebra-bin/files/geogebra.sh     | 33 ++++++++++++++--------
 ...-r1.ebuild => geogebra-bin-5.0.604.0-r2.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
similarity index 98%
rename from sci-mathematics/geogebra-bin/geogebra-bin-5.0.604.0-r1.ebuild
rename to 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]

Reply via email to