Package Details: playonlinux5-git r2553.b523e3f9e-1

Git Clone URL: https://aur.archlinux.org/playonlinux5-git.git (read-only, click to copy)
Package Base: playonlinux5-git
Description: GUI for managing Windows programs under linux (development version based on Java)
Upstream URL: http://www.playonlinux.com/
Keywords: playonlinux playonlinux5 pol pol5 wine
Licenses: GPL
Submitter: captain
Maintainer: None
Last Packager: TheGoliath
Votes: 27
Popularity: 0.000000
First Submitted: 2015-11-13 11:07
Last Updated: 2020-05-16 12:57

Dependencies (7)

Required by (0)

Sources (3)

Latest Comments

« First ‹ Previous 1 2 3 4 5 6 7 8 9 Next › Last »

Det commented on 2017-01-16 02:55

You don't seem to understand how an if statement works.

if (( $(archlinux-java get | cut -d "-" -f2) < 8 )); then
 do something
else
 do fallback
fi

..means, that whenever the statement (( $(archlinux-java get | cut -d "-" -f2) < 8 )) is true, you do the "something". Otherwise, in *all* cases, you do the fallback (what happens with OpenJDK 8 in there?). I didn't understand your custom explanation, but this is how it works (or did not, in your previous implementation. Now you don't have an else part, so it seems that you get it, but it doesn't match your wrong explanation at all).

Also, like I said, this still doesn't work if you have JDK>=8, but your default is *JRE*>=8, or if you only have JDK 9. This would be pretty straightforward, if all we had was OpenJDK 8 and Oracle JDK 8 which you recently started hard-coding in your statements.

And you don't need an overly complicated export mess (that doesn't work). You could use my aforementioned 3 lines, and it would work in all cases.

p.s. in Bash, instead of [[ "${openjdk}" != "" ]] you can do [[ ! $openjdk ]] (you don't need quotes in Bash's extended tests). And please use a consistent coding/scripting style. Try not to use ${var} and $var mixed up when there's no underscore (_) that you need to avoid. Either convert all to ${var} or all to $var. Same with your empty line rules and your indentations. Remember to replace my " " characters. They are only so that you get intents in the comments, but mess up the PKGBUILD.

p.p.s. "I can't put some wild condition in here". Are you saying you don't understand what [[ ! -f /usr/bin/javac ]] means? That's... pretty basic Bash.

ProfessorKaos64 commented on 2017-01-15 21:16

archlinux-java get can report anything > 8 (jdk/openjdk). If you already have anything >= 8, then with the change I just added, then nothing is touched. If more than 8, just keep going. There is no else to force it. I can't put some wild condition in here. If you are using Orace JDK >=8 it is fine, if <8, and you do not have openjdk, it will pick up your Oracle JDK. If you have both* Oracle JDK and OpenJDK < 8, then Idk what I can do for you. I can't please everyone's preferences. If you want to make an Oracle JDK version only of this, then ok.

if [[ $(archlinux-java get | cut -d "-" -f2) < 8 ]]; then

# test for openjdk, fall back on oracle jdk if not present
openjdk=$(ls /usr/lib/jvm/java-8-*/bin/javac 2>/dev/null | cut -d "/" -f-5 | awk '/-8-openjdk/')
oraclejdk=$(ls /usr/lib/jvm/java-8-*/bin/javac 2>/dev/null | cut -d "/" -f-5 | awk '/-8-jdk/')

if [[ "${openjdk}" != "" ]]; then
export JAVA_HOME=$(ls /usr/lib/jvm/java-8-*/bin/javac 2>/dev/null | cut -d "/" -f-5 | awk '/-openjdk/')
elif [[ "${oraclejdk}" != "" ]]; then
export JAVA_HOME=$(ls /usr/lib/jvm/java-8-*/bin/javac 2>/dev/null | cut -d "/" -f-5 | awk '/-jdk/')
fi

fi

Det commented on 2017-01-15 15:06

Why should it prefer OpenJDK? As far as I know it's slower than Oracle JDK.

Also, you're only preferring OpenJDK when JDK is less than 8. If your default is OpenJDK 8, it's changing it to Oracle.

It doesn't work, if you only have JDK 9 either.

ProfessorKaos64 commented on 2017-01-15 13:38

The string you provided will resolve to /usr/lib/jvm/java-8-jdk. This way, you can have oracle JDK in use if you don't like opendk. Instead, it should prefer openjdk, else, orace jdk if that does not exist. You cannot use the PATH addition, I tried, the build will start, but then fail. You need to set java home. I tested the below with java 7 openjdk as my default, and openjdk 7/oracle jdk 8 both installed. The logic:

if (( $(archlinux-java get | cut -d "-" -f2) < 8 )); then
export JAVA_HOME=$(ls /usr/lib/jvm/java-{8,9}-*/bin/javac 2>/dev/null | cut -d "/" -f-5 | awk '/-8-openjdk/')
else
export JAVA_HOME=$(ls /usr/lib/jvm/java-{8,9}-*/bin/javac 2>/dev/null | cut -d "/" -f-5 | awk '/-8-jdk/')
fi

will set the following if the default java is < 8.

if java < 8 then
set /usr/lib/jvm/java-8-openjdk
else
set /usr/lib/jvm/java-8-jdk
fi

Det commented on 2017-01-15 09:04

That's not what it's doing at all? You're now checking if the default Java is less than 8, and then use _that_ (a double-use mind you, it's already used (/usr/bin/java) *without* the JAVA_HOME export). Or if it's 8 or higher (so it's OK), then pick the first one of all the Javas that work (even though this one already works).

Use the one I provided. You need to verify as well whether the default is JDK (for compilation/running) or JRE (only for running). That's what the [[ ! -f /usr/bin/javac ]] was for.

ProfessorKaos64 commented on 2017-01-15 02:06

ok, the old behavior is back. it is not a duplicate JAVA_HOME. the first section checks if openjdk is present for java < 8. if that is not there, it sets it to java 8 from oracle.

if (( $(archlinux-java get | cut -d "-" -f2) < 8 )); then
JAVA_VER=$(archlinux-java get)
export JAVA_HOME="/usr/lib/jvm/${JAVA_VER}"
else
export JAVA_HOME=$(ls /usr/lib/jvm/java-{8,9}-*/bin/javac 2>/dev/null | cut -d "/" -f-5 | head -1)

first line: /usr/lib/jvm/java-8-openjdk
second line: /usr/lib/jvm/java-8-jdk

Det commented on 2017-01-14 21:03

Hehe, well it's still wrong. That:

# Set environment
# Use path to Java 8 for users not defaulted to Java 8 yet
if (( $(archlinux-java get | cut -d "-" -f2) >= 8 )); then
 JAVA_VER=$(archlinux-java get)
 export JAVA_HOME="/usr/lib/jvm/${JAVA_VER}"
fi

..just means "if already using Java 8 or higher (any Java, including JRE), tell it to be used one more time."

I meant that you should check if it's less than that. Same as in the launcher, e.g.:

if (( $(archlinux-java get | cut -d "-" -f2) < 8 )) || [[ ! -f /usr/bin/javac ]]; then
 export PATH=$(ls /usr/lib/jvm/java-{8,9}-*/bin/javac 2>/dev/null | cut -d "/" -f-5 | head -1):$PATH
fi

ProfessorKaos64 commented on 2017-01-14 20:39

I can put back in Java Home, that's no problem. Yes, it builds without gradle I will remove that.

Det commented on 2017-01-14 20:36

Did you *try* building without Gradle or ask about that directly?

Also, I don't think it builds now, if you don't manually set Java 8 as default.

ProfessorKaos64 commented on 2017-01-14 20:34

Removed JAVA_HOME for build, not needed with java 8 as default. Fixed up launcher version of java needed. Talked to some regulars in the IRC channel, no problem with the makedeps seen (I trust this particular users judgment).