Page MenuHomeFreeBSD

Uses/java.mk: Add headless arg
Needs ReviewPublic

Authored by lwhsu on Sun, Nov 16, 10:45 AM.
Tags
None
Referenced Files
F136665442: D53782.diff
Tue, Nov 18, 7:41 PM
F136665402: D53782.diff
Tue, Nov 18, 7:40 PM
Unknown Object (File)
Mon, Nov 17, 4:40 AM
Unknown Object (File)
Sun, Nov 16, 6:55 PM
Unknown Object (File)
Sun, Nov 16, 6:52 PM
Unknown Object (File)
Sun, Nov 16, 4:27 PM
Unknown Object (File)
Sun, Nov 16, 2:31 PM
Subscribers
None

Details

Summary

This is not intented to be committed as it is, but for opening a discussion of
how to deal with the JAVA_HOME variable and the new headless flavor.

Currently the -headless flavor installs to /usr/local/openjdkXX-headless ,
but for ports has USES=java and JAVA_VERSION=XX looks for java binary in its
JAVA_HOME=/usr/local/openjdkXX and cannot find what it wants.

I'm thinking either we have a headless arg so the ports prefers headless
flavor can use USES=java:headless and set the JAVA_HOME correctly. Or,
perhaps we should let both full and headless flavors both install to
/usr/local/openjdkXX , as the ports want headless flavor should also work with
the full flavor. However this caused the ports need full flavor might be
confused /usr/local/openjdkXX is good for it. Maybe this can be solved by
checking other files instead of java binary...

Diff Detail

Repository
R11 FreeBSD ports repository
Lint
No Lint Coverage
Unit
No Test Coverage
Build Status
Buildable 68677
Build 65560: arc lint + arc unit

Event Timeline

lwhsu created this revision.

Sorry but please ignore the white space change, that was automatically forced by the ports framework... I can update the patch later.

This is a good point!

Just had a brief look now, but I think that the signal should be interpreted as "requires _at least_ the headless version". Any port that works with headless java also works with the full jdk, and any version that works with headless jre, also works with the full jre.

So it is not necessary to install the headless jdk or jre if the full version is already installed.

I'm not sure if the current patch takes that into consideration?

This is a good point!

Just had a brief look now, but I think that the signal should be interpreted as "requires _at least_ the headless version". Any port that works with headless java also works with the full jdk, and any version that works with headless jre, also works with the full jre.

So it is not necessary to install the headless jdk or jre if the full version is already installed.

I'm not sure if the current patch takes that into consideration?

Yes and no. I am aware of this, but I am not sure what's the best way to do it. This is mainly to point out that currently install openjdkXX-headless cannot fulfill any ports' need of openjdk becasue they don't search java stuff in the right place, we need either teach port to find in the current installation path (this patch does), or change the -headless flavor to install to the place those port look for openjdk.

I'm thinking perhaps teaching all openjdk install to the same place might be a better idea, as full version should also fulfill the need of the ports only require headless version, but I haven't had a good idea about how to handle the situation that a system has headless version, and is going to install a pkg needs full version, how the ports framework and pkg should behave. I suspect that this needs provides/requires mechanism in pkg. And in ports we probably cannot only checks for ${JAVA_HOME}/bin/java and think it's the full version, need to check for something only available in full version but not in headless version.

And in ports we probably cannot only checks for ${JAVA_HOME}/bin/java and think it's the full version, need to check for something only available in full version but not in headless version.

If it helps, bin/javac will not be available in JRE builds, and lib/libawt_xawt.so will not be available in the headless version, but will be there for for full versions of both the JRE and JDK.