Bug 238758 - Update for bsd.java.mk
Summary: Update for bsd.java.mk
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Ports Framework (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Greg Lewis
Depends on: 238976 238977 238978 238979 238980 238981 238982 238983
  Show dependency treegraph
Reported: 2019-06-22 08:28 UTC by Greg Lewis
Modified: 2019-07-31 16:09 UTC (History)
2 users (show)

See Also:
antoine: exp-run+

Proposed change for bsd.java.mk (6.21 KB, patch)
2019-06-22 08:28 UTC, Greg Lewis
no flags Details | Diff
Overall Patch (9.39 KB, patch)
2019-07-11 12:11 UTC, Greg Lewis
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Greg Lewis freebsd_committer 2019-06-22 08:28:59 UTC
Created attachment 205278 [details]
Proposed change for bsd.java.mk

Updates for bsd.java.mk

* Support for newer versions of the JDK (primary change)
* Switch to modern Java versioning (e.g. 8 rather than 1.8)
* Support ports that set the version as the USE_JAVA value (a few still do)

Note that the default JDK (openjdk8) is unchanged.

exp-run requested
Comment 1 Antoine Brodin freebsd_committer 2019-06-25 06:06:40 UTC
A few ports that may need patching:

databases/hbase/Makefile:.if ${JAVA_PORT_VERSION:M1.8.*}
databases/mysql-connector-java51/Makefile:.if ${JAVA_PORT_VERSION:M1.8.*}
databases/mysql-connector-java51/Makefile:.if ${JAVA_PORT_VERSION:N1.8.*}
devel/luajava/Makefile:.if ${JAVA_PORT_VERSION} == 1.7
devel/statcvs/Makefile:.if ${JAVA_PORT_VERSION} == "1.6.0"
dns/dnsjava/Makefile:.if ${JAVA_PORT_VERSION} == "1.6.0"
dns/dnsjava/Makefile:.if ${JAVA_PORT_VERSION} == "1.8.0"
graphics/jogl/Makefile:.if ${JAVA_PORT_VERSION:M1.6.*}
graphics/jogl/Makefile:.if ${JAVA_PORT_VERSION:M1.7.*}
graphics/jogl/Makefile:.if ${JAVA_PORT_VERSION:M1.8.*}
graphics/jogl/Makefile:.if ${JAVA_PORT_VERSION:M1.8.*}
java/icedtea-web/Makefile:.if ${JAVA_PORT_VERSION} == "1.6.0"
java/bouncycastle/Makefile:JDKMVERSION= 1.6 # ${JAVA_PORT_VERSION:C/^([0-9]\.[0-9])(.*)$/\1/}
java/bouncycastle/Makefile:JDKNVERSION= 16 # ${JAVA_PORT_VERSION:C/^([0-9])\.([0-9])(.*)$/\1\2/}
lang/kawa/Makefile:             --with-java-source=${JAVA_PORT_VERSION}
math/scilab/Makefile:.if ${PORT_OPTIONS:MGUI} && ${JAVA_PORT_VERSION:M1.8.*}
print/pdf-renderer/Makefile:.if ${JAVA_PORT_VERSION:M1.8.*}
textproc/jakarta-commons-digester/Makefile:.if ${JAVA_PORT_VERSION:C/^([0-9])\.([0-9])(.*)$/\1.\2/} != "1.4"
www/htmlcompressor/Makefile:SUB_LIST+=  JAVA_VERSION=${JAVA_PORT_VERSION:R}
Comment 2 Greg Lewis freebsd_committer 2019-07-02 16:55:32 UTC
Thanks.  Let me take a crack at them first.
Comment 3 Greg Lewis freebsd_committer 2019-07-02 17:09:35 UTC
Committed a fix for textproc/jakarta-commons-digester
Comment 4 Greg Lewis freebsd_committer 2019-07-02 17:31:02 UTC
Note that java/bouncycastle only has JAVA_PORT_VERSION in a comment, it doesn't actually use it
Comment 5 Greg Lewis freebsd_committer 2019-07-02 22:16:05 UTC
I don't believe this change will impact lang/kawa.  I reviewed the configure script, and it handles the --with-java-source argument in a case statement that checks for versions either with or with a leading 1.8.  E.g.

  /8/|/1.8*/) # Java 8

So switching from 1.8 to 8, for example, will make no difference.
Comment 6 Greg Lewis freebsd_committer 2019-07-02 22:17:06 UTC
I will create PRs for all the other fixes and link them in here.
Comment 7 Greg Lewis freebsd_committer 2019-07-04 02:53:16 UTC
databases/hbase: bug #238976
databases/mysql-connector-java51: bug #238977
devel/luajava: bug #238978
devel/statcvs: Fix committed
dns/dnsjava: bug #238979
games/jin: bug #238980
graphics/jogl: bug #238981
java/icedtea-web: Fix committed
math/scilab: bug #238982
print/pdf-renderer: bug #238983
www/htmlcompressor: Fix committed
Comment 8 Mathieu Arnold freebsd_committer 2019-07-08 09:13:59 UTC
As a side note, the old Mk/bsd.java.mk should be moved to the new way we do things, which is a Mk/Uses/java.mk.  It would be great if someone who actually knows what bsd.java.mk does did the job instead of a member of portmgr doing it with an axe.
Comment 9 Greg Lewis freebsd_committer 2019-07-08 20:21:51 UTC
(In reply to Mathieu Arnold from comment #8)

Agreed, but I do not want to mix multiple major changes together at once.  I'd like to get this done first.
Comment 10 Antoine Brodin freebsd_committer 2019-07-10 19:04:33 UTC
Can you provide a patch combining all the different patches together for the exp-run?
Comment 11 Greg Lewis freebsd_committer 2019-07-11 12:11:03 UTC
Created attachment 205692 [details]
Overall Patch

Here is a patch that combines the changes to bsd.java.mk and all remaining patches for the ports tree.
Comment 12 Antoine Brodin freebsd_committer 2019-07-12 17:02:31 UTC
Exp-run looks fine
Comment 13 Greg Lewis freebsd_committer 2019-07-17 14:52:41 UTC
Thanks for doing the exp run!

I'll commit the other changes and the bsd.java.mk changes given that there were no problems
Comment 14 commit-hook freebsd_committer 2019-07-31 16:07:33 UTC
A commit references this bug:

Author: glewis
Date: Wed Jul 31 16:06:32 UTC 2019
New revision: 507714
URL: https://svnweb.freebsd.org/changeset/ports/507714

  Support newer Java versions

  * Add configuration for newer versions of the JDK (11, 12)
  * Switch to modern Java versioning (e.g. 8 rather than 1.8)
  * Retain backwards compatibility with existing version specification
  * Support the few ports that set USE_JAVA to the requested version

  PR:		237054, 238758 (exp-run)

Comment 15 Greg Lewis freebsd_committer 2019-07-31 16:09:10 UTC
Thanks for the exp-run, I've committed the changes.