net/keycloak: Fix runtime for Java 25+, improve port
Add to JAVA_ADD_OPENS in kc.sh for run with Java 25+:
--add-opens=java.base/java.lang=ALL-UNNAMED --enable-native-access=ALL-UNNAMED
The patch was obtained from here:
https://github.com/keycloak/keycloak/pull/45872/files#diff-28d941fe33e0f8217892e8096ba7152ba9ade67e3b2c3f0ce31a333d90cc339d
For more information read:
https://github.com/keycloak/keycloak/issues/43265
https://github.com/keycloak/keycloak/pull/45872
Improve port:
- Parametrize "keycloak" with "${PORTNAME}" in USE_RC_SUBR.
- Replace "RM *.bat" with "EXTRACT_AFTER_ARGS=--exclude *.bat".
- Remove unnecessary "+" in "SUB_FILES+=" and "SUB_LIST+=".
- Use declared "KEYCLOAK_GROUP" instead of "USERS" in "GROUPS" assignment.
- Use "RLN" instad of "LN -sf".
- Move the creation of "*.sample" configuration files from "post-patch" to "do-install".
- Improve alignment in comments rc script.
- Respect "%%USER%%" and "%%GROUP%%" in rc script.
- Replace "export JAVA_HOME=…" with "${name}_env=JAVA_HOME=…" in rc script.
PR: 294235
Approved by: Matthias Wolf <freebsd@rheinwolf.de> (maintainer)
Sponsored by: UNIS Labs
MFH: 2026Q2