Setting a build dependency for the JDK
mf2k at macports.org
mf2k at macports.org
Tue Sep 4 14:50:07 UTC 2018
Hi Guenael,
> On Aug 31, 2018, at 8:32 PM, Guenael Strutt <macports at guenael.com> wrote:
>
> To build lang/processing, one needs a specific version of the JDK (as specified in https://github.com/processing/processing/blob/master/build/build.xml <https://github.com/processing/processing/blob/master/build/build.xml>). Question: how does one create a dependency in the Portfile to determine whether this version is present? The purpose is to 1) provide a better error message to the user and 2) prevent builds from failing https://travis-ci.org/macports/macports-ports/builds/423195489 <https://travis-ci.org/macports/macports-ports/builds/423195489> at every update. I tried checking for the existence of this folder: `/Library/Java/JavaVirtualMachines/jdk1.8.0_181.jdk/` but didn't get anywhere. Thanks!
Have you looked at the java-1.0 portgroup?
It is pretty simple and determines if the user has java installed and can set the JAVA_HOME directory in the environment variables.
It probably could be enhanced to determine the actual version and type (JRE vs. JDK) of java installed.
Otherwise, since Java is 3rd party, we cannot have a dependency on it and expect that it will be installed by Macports. We can only check if it is installed or not.
Cheers!
Frank
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macports.org/pipermail/macports-dev/attachments/20180904/73f6404a/attachment.html>
More information about the macports-dev
mailing list