summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael DeGuzis2017-09-19 20:20:42 -0400
committerMichael DeGuzis2017-09-19 20:20:42 -0400
commit7e54b9cd6bcbb3eaa57f9b2f0b9d710635fbf509 (patch)
tree1523f8745c4afa4f1a9b36033ee55f22c87379a8
parenta974aeb2f1454b2d30d5b81b3f4f84aee044745a (diff)
downloadaur-7e54b9cd6bcbb3eaa57f9b2f0b9d710635fbf509.tar.gz
WIP logic for handling javafx detect
-rw-r--r--.SRCINFO4
-rw-r--r--PKGBUILD55
-rwxr-xr-xPlayOnLinux.sh82
3 files changed, 108 insertions, 33 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 896f01df5ff..d64ba9eb4d6 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,6 +1,6 @@
pkgbase = playonlinux5-git
pkgdesc = GUI for managing Windows programs under linux (development version based on Java)
- pkgver = r1917.1ca1f402
+ pkgver = r1918.48bf7f2a
pkgrel = 1
epoch = 2
url = http://www.playonlinux.com/
@@ -19,7 +19,7 @@ pkgbase = playonlinux5-git
source = PlayOnLinux.sh
md5sums = SKIP
md5sums = 7fe925810fc7ec6d8745817b1c541e7b
- md5sums = b4f37c90412bff625b3068e9e1e5ff59
+ md5sums = 84eb4201e3f3da463b916cbb116c0677
pkgname = playonlinux5-git
diff --git a/PKGBUILD b/PKGBUILD
index f220542c596..bcf3b10d76f 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -11,7 +11,7 @@
_pkgname=playonlinux5
pkgname=${_pkgname}-git
-pkgver=r1917.1ca1f402
+pkgver=r1918.48bf7f2a
pkgrel=1
epoch=2
pkgdesc="GUI for managing Windows programs under linux (development version based on Java)"
@@ -29,7 +29,7 @@ source=(
md5sums=(
'SKIP'
'7fe925810fc7ec6d8745817b1c541e7b'
- 'b4f37c90412bff625b3068e9e1e5ff59'
+ '84eb4201e3f3da463b916cbb116c0677'
)
pkgver() {
@@ -48,27 +48,28 @@ build() {
# Set environment
msg2 "Assessing Java build environment"
- if (( $(archlinux-java get | cut -d "-" -f2) < 8 )) || [[ ! -f /usr/bin/javac ]]; then
- # test for openjdk, fall back on other jdks if not found
- # Take the highest sorted version (alpahumericly,head -1)
- _openjdk=$(ls /usr/lib/jvm/java-{8,9}-openjdk/bin/javac 2>/dev/null | cut -d "/" -f-5)
- _openjdk_jetbeans=$(ls /usr/lib/jvm/java-{8,9}-openjdk-jetbrains/bin/javac 2>/dev/null | cut -d "/" -f-5)
- _oraclejdk=$(ls /usr/lib/jvm/java-{8,9}-jdk/bin/javac 2>/dev/null | cut -d "/" -f-5)
+ # test for openjdk, fall back on other jdks if not found
+ # Take the highest sorted version (alpahumericly,head -1)
+ _openjdk=$(ls /usr/lib/jvm/java-{8,9}-openjdk/bin/javac 2>/dev/null | cut -d "/" -f-5)
+ _openjdk_jetbeans=$(ls /usr/lib/jvm/java-{8,9}-openjdk-jetbrains/bin/javac 2>/dev/null | cut -d "/" -f-5)
+ _oraclejdk=$(ls /usr/lib/jvm/java-{8,9}-jdk/bin/javac 2>/dev/null | cut -d "/" -f-5)
+
+ if (( $(archlinux-java get | cut -d "-" -f2) < 8 )) || [[ ! -f /usr/bin/javac ]]; then
if [[ "${_openjdk}" ]]; then
# choose the first one available
msg2 "Using OpenJDK for build"
export JAVA_HOME="${_openjdk[0]}"
- elif [[ "${_openjdk_jetbrains}" ]]; then
- msg2 "Using JetBrains JDK for build"
- export JAVA_HOME=$(ls /usr/lib/jvm/java-{8,9}-openjdk-jetbrains*/bin/javac 2>/dev/null | cut -d "/" -f-5 | head -1)
-
elif [[ "${_oraclejdk}" ]]; then
msg2 "Using Oracle JDK for build"
export JAVA_HOME=$(ls /usr/lib/jvm/java-{8,9}-jdk*/bin/javac 2>/dev/null | cut -d "/" -f-5 | head -1)
+ elif [[ "${_openjdk_jetbrains}" ]]; then
+ msg2 "Using Jetbrains for build"
+ export JAVA_HOME=$(ls /usr/lib/jvm/java-{8,9}-jdk-jetbrains*/bin/javac 2>/dev/null | cut -d "/" -f-5 | head -1)
+
else
# fall back to other JDKs
export JAVA_HOME=$(ls /usr/lib/jvm/java-{8,9}-jdk*/bin/javac 2>/dev/null | cut -d "/" -f-5 | head -1)
@@ -76,8 +77,38 @@ build() {
fi
else
+
msg2 "Default Java JDK set is of verison 8 or higher, proceeding..."
msg2 "Using: $(archlinux-java get)"
+ export JAVA_HOME="/usr/lib/jvm/default"
+
+ fi
+
+ # Test for JavaFX (required)
+ JAVA_FX=$(find $JAVA_HOME/ -name "javafx.properties")
+ if [[ -n "$JAVA_FX" ]]; then
+ JAVA_FX_BOOLEAN="True"
+ else
+ JAVA_FX_BOOLEAN="False"
+ fi
+
+ msg2 "JavaFX Capabale? $JAVA_FX_BOOLEAN"
+
+ if [[ "$JAVA_FX_BOOLEAN" = "False" ]]; then
+ msg2 "Forcing proper Java (if available)"
+
+ if [[ "${_openjdk}" ]]; then
+ export JAVA_HOME="${_openjdk[0]}"
+ msg2 "Switching to OpenJDK"
+
+ elif [[ "${_oraclejdk}" ]]; then
+ export JAVA_HOME=$(ls /usr/lib/jvm/java-{8,9}-jdk*/bin/javac 2>/dev/null | cut -d "/" -f-5 | head -1)
+ msg2 "Switching to Oracle JDK"
+
+ else
+ msg2 "ERROR: Could not find a proper java build environment. Exiting"
+ exit 1
+ fi
fi
diff --git a/PlayOnLinux.sh b/PlayOnLinux.sh
index fd713fbf883..b91952c90f0 100755
--- a/PlayOnLinux.sh
+++ b/PlayOnLinux.sh
@@ -1,8 +1,21 @@
#!/bin/bash
+cat<<-EOF
+
+-----------------------------------------
+Unofficial PlayOnLinux5 Launcher
+-----------------------------------------
+
+EOF
+
POL_HOME=/opt/playonlinux5
CLASSPATH=${CLASSPATH}:$POL_HOME/lib/*
+# Test for active java
+_openjdk=$(ls -d /usr/lib/jvm/java-{8,9}-openjdk* 2>/dev/null | head -1)
+_oraclejdk=$(ls -d /usr/lib/jvm/java-{8,9}-jdk* 2>/dev/null | head -1)
+_opendjdk_jetbrains=$(ls -d /usr/lib/jvm/java-{8,9}-openjdk-jetbrains* 2>/dev/null | head -1)
+
# Allow either openjdk java or Oracle java to be used
if (( $(archlinux-java get | cut -d "-" -f2) < 8 )); then
@@ -10,33 +23,64 @@ if (( $(archlinux-java get | cut -d "-" -f2) < 8 )); then
echo "WARNING: A JVM of version 8 or higher was not found"
java_default=$(archlinux-java get)
echo -e "\t==> Picked up default Java of: $java_default"
- echo -e "\t==> Assessing if we have JetBrains or OpenJDK with version 8 or higher..."
-
- # Order is Oracle/Jetbrains/OpenJDK
- # If you have both Oracle/Jetbrains, choose one.
- # It is too diffcult to appease everyone...
- javaver_oracle=$(ls -d /usr/lib/jvm/java-{8,9}-jdk* 2>/dev/null | head -1)
- javaver_openjdk=$(ls -d /usr/lib/jvm/java-{8,9}-openjdk* 2>/dev/null | head -1)
- javaver_jetbrains=$(ls -d /usr/lib/jvm/java-{8,9}-openjdk-jetbrains* 2>/dev/null | head -1)
-
- if [[ "$javaver_oracle" ]]; then
- echo -e "\t==> Picked up compatible JVM: $javaver_oracle"
- javaver=$javaver_oracle
- elif [[ "$javaver_jetbrains" ]]; then
- echo -e "\t==> Picked up compatible JVM: $javaver_jetbrains"
- javaver=$javaver_jetbrains
- elif [[ "$javaver_openjdk" ]]; then
- echo -e "\t==> Picked up compatible JVM: $javaver_openjdk"
- javaver=$javaver_opendjdk
+ echo -e "\t==> Assessing if we have java version 8 or higher..."
+
+ if [[ "$_oraclejdk" ]]; then
+ echo -e "\t==> Picked up compatible JVM: $_oraclejdk"
+ JAVA_HOME=$_oraclejdk
+
+ elif [[ "$_openjdk_jetbrains" ]]; then
+ echo -e "\t==> Picked up compatible JVM: $opendjdk_jetbrains"
+ JAVA_HOME=$_openjdk_jetbrains
+
+ elif [[ "$_openjdk" ]]; then
+ echo -e "\t==> Picked up compatible JVM: $_openjdk"
+ JAVA_HOME=$_opendjdk
+
else
echo -e "\t==> Failed to find a compatible runtime JVM!"
+
fi
else
echo "Running compatible JVM already (default set): $(archlinux-java get)"
+ echo "Using: $(archlinux-java get)"
+ export JAVA_HOME="/usr/lib/jvm/default"
+
+fi
+# JavaFX
+# Test for JavaFX (required)
+
+JAVA_FX=$(find $JAVA_HOME/ -name "javafx.properties")
+if [[ -n "$JAVA_FX" ]]; then
+ JAVA_FX_BOOLEAN="True"
+else
+ JAVA_FX_BOOLEAN="False"
fi
+echo "JavaFX Capabale? $JAVA_FX_BOOLEAN"
+
+if [[ "$JAVA_FX_BOOLEAN" = "False" ]]; then
+ echo "Forcing proper Java (if available)"
+
+ if [[ "${_openjdk}" ]]; then
+ export JAVA_HOME="${_openjdk[0]}"
+ echo "Switching to OpenJDK"
+
+ elif [[ "${_oraclejdk}" ]]; then
+ export JAVA_HOME=$(ls /usr/lib/jvm/java-{8,9}-jdk*/bin/javac 2>/dev/null | cut -d "/" -f-5 | head -1)
+ msg2 "Switching to Oracle JDK"
+ else
+ msg2 "ERROR: Could not find a proper java build environment. Exiting"
+ exit 1
+ fi
+
+fi
+
+echo "JAVA_HOME: $JAVA_HOME"
+
# Start PlayOnLinux
-$javaver/bin/java -classpath "$CLASSPATH" org.phoenicis.javafx.JavaFXApplication "$@"
+echo "Launching PlayOnLinux5"
+$JAVA_HOME/bin/java -classpath "$CLASSPATH" org.phoenicis.javafx.JavaFXApplication "$@"