summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael DeGuzis2017-09-17 18:27:58 -0400
committerMichael DeGuzis2017-09-17 18:27:58 -0400
commita974aeb2f1454b2d30d5b81b3f4f84aee044745a (patch)
tree9fa9bfd61c6159090ed850fc80003d2918eca168
parent3b0b2eb0d1a59905ad646d2103f56dbf400b4ec9 (diff)
downloadaur-a974aeb2f1454b2d30d5b81b3f4f84aee044745a.tar.gz
transparent java ver/pkg pickup during build/runtime
-rw-r--r--.SRCINFO4
-rw-r--r--PKGBUILD24
-rwxr-xr-xPlayOnLinux.sh32
3 files changed, 53 insertions, 7 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 464eee803f2..896f01df5ff 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 = r1784.151328a6
+ pkgver = r1917.1ca1f402
pkgrel = 1
epoch = 2
url = http://www.playonlinux.com/
@@ -19,7 +19,7 @@ pkgbase = playonlinux5-git
source = PlayOnLinux.sh
md5sums = SKIP
md5sums = 7fe925810fc7ec6d8745817b1c541e7b
- md5sums = 77201d6c6376d4dd8340ad47a0f47cf7
+ md5sums = b4f37c90412bff625b3068e9e1e5ff59
pkgname = playonlinux5-git
diff --git a/PKGBUILD b/PKGBUILD
index fbf671ca034..f220542c596 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -11,7 +11,7 @@
_pkgname=playonlinux5
pkgname=${_pkgname}-git
-pkgver=r1784.151328a6
+pkgver=r1917.1ca1f402
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'
- '77201d6c6376d4dd8340ad47a0f47cf7'
+ 'b4f37c90412bff625b3068e9e1e5ff59'
)
pkgver() {
@@ -47,20 +47,38 @@ build() {
cd "${_pkgname}"
# 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)
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)
+
else
# fall back to other JDKs
- export JAVA_HOME=$(ls /usr/lib/jvm/java-{8,9}-*/bin/javac 2>/dev/null | cut -d "/" -f-5 | head -1)
+ export JAVA_HOME=$(ls /usr/lib/jvm/java-{8,9}-jdk*/bin/javac 2>/dev/null | cut -d "/" -f-5 | head -1)
+ msg2 "Using JDK $JAVA_HOME"
fi
+ else
+ msg2 "Default Java JDK set is of verison 8 or higher, proceeding..."
+ msg2 "Using: $(archlinux-java get)"
+
fi
# Build
diff --git a/PlayOnLinux.sh b/PlayOnLinux.sh
index 27184d8a72c..fd713fbf883 100755
--- a/PlayOnLinux.sh
+++ b/PlayOnLinux.sh
@@ -6,8 +6,36 @@ CLASSPATH=${CLASSPATH}:$POL_HOME/lib/*
# Allow either openjdk java or Oracle java to be used
if (( $(archlinux-java get | cut -d "-" -f2) < 8 )); then
- #export PATH=$(ls -d /usr/lib/jvm/java-{8,9}-* 2>/dev/null | head -1):$PATH
- javaver=$(ls -d /usr/lib/jvm/java-{8,9}-* 2>/dev/null | head -1)
+
+ 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
+ else
+ echo -e "\t==> Failed to find a compatible runtime JVM!"
+ fi
+
+else
+
+ echo "Running compatible JVM already (default set): $(archlinux-java get)"
+
fi
# Start PlayOnLinux