diff --git a/Mk/Uses/java.mk b/Mk/Uses/java.mk index e4e2016935fa..cc2c7adba4bc 100644 --- a/Mk/Uses/java.mk +++ b/Mk/Uses/java.mk @@ -1,501 +1,504 @@ # Provide support for Java (java) # Feature: java # Usage: USES=java or USES=java:args # # Defaults to USES=java:build,run if no arguments are provided and NO_BUILD is # undefined. If NO_BUILD is defined, USES=java:run is used. # # Valid ARGS: ant build extract # # ant - Should be defined when the port uses Apache Ant. Ant is thus # considered to be the sub-make command. When no 'do-build' # target is defined by the port, a default one will be set # that simply runs Ant according to MAKE_ENV, MAKE_ARGS and # ALL_TARGET. Read the documentation in bsd.port.mk for more # information. # # build - Add the JDK port to the build dependencies # # extract - Add the JDK port to the extract dependencies # # run - Add the JDK port to the run dependencies # # For FreeBSD committers: # Please send all suggested changes to the maintainer instead of committing # them yourself. # #------------------------------------------------------------------------------- # Variables that each port can define: # # JAVA_VERSION List of space-separated suitable java versions for the # port. An optional "+" allows you to specify a range of # versions. (allowed values: 8[+] 11[+] 17[+] -# 21[+] 22[+] 23[+] 24[+] 25[+]) +# 21[+] 22[+] 23[+] 24[+] 25[+] 26[+]) # # JAVA_OS List of space-separated suitable JDK port operating systems # for the port. (allowed values: native linux) # # JAVA_VENDOR List of space-separated suitable JDK port vendors for the # port. (allowed values: openjdk oracle) # #------------------------------------------------------------------------------- # Variables defined for the port: # # JAVA_PORT The name of the JDK port. (e.g. 'java/openjdk8') # # JAVA_PORT_VERSION The version of the JDK port. (e.g. '8') # # JAVA_PORT_OS The operating system used by the JDK port. (e.g. 'linux') # # JAVA_PORT_VENDOR The vendor of the JDK port. (e.g. 'openjdk') # # JAVA_PORT_OS_DESCRIPTION Description of the operating system used by the # JDK port. (e.g. 'Linux') # # JAVA_PORT_VENDOR_DESCRIPTION Description of the vendor of the JDK port. # (e.g. 'OpenJDK BSD Porting Team') # # JAVA_HOME Path to the installation directory of the JDK. (e.g. # '/usr/local/openjdk8') # # JAVAC Path to the Java compiler to use. (e.g. # '/usr/local/openjdk8/bin/javac' or '/usr/local/bin/javac') # # JAR Path to the JAR tool to use. (e.g. # '/usr/local/openjdk8/bin/jar' or '/usr/local/bin/fastjar') # # APPLETVIEWER Path to the appletviewer utility. (e.g. # '/usr/local/linux-jdk1.8.0/bin/appletviewer') # # JAVA Path to the java executable. Use this for executing Java # programs. (e.g. '/usr/local/openjdk8/bin/java') # # JAVADOC Path to the javadoc utility program. # # JAVAH Path to the javah program. # # JAVAP Path to the javap program. # # JAVA_KEYTOOL Path to the keytool utility program. # # JAVA_N2A Path to the native2ascii tool. # # JAVA_POLICYTOOL Path to the policytool program. # # JAVA_SERIALVER Path to the serialver utility program. # # RMIC Path to the RMI stub/skeleton generator, rmic. # # RMIREGISTRY Path to the RMI registry program, rmiregistry. # # RMID Path to the RMI daemon program. # # JAVA_CLASSES Path to the archive that contains the JDK class files. On # most JDKs, this is ${JAVA_HOME}/jre/lib/rt.jar. # # JAVASHAREDIR The base directory for all shared Java resources. # # JAVAJARDIR The directory where a port should install JAR files. # # JAVALIBDIR The directory where JAR files installed by other ports # are located. # #------------------------------------------------------------------------------- # Porter's hints # # To retrieve the Major version number from JAVA_PORT_VERSION (e.g. "1.8"): # -> ${JAVA_PORT_VERSION:C/^([0-9])\.([0-9])(.*)$/\1.\2/} # #------------------------------------------------------------------------------- # There are the following stages: # # Stage 1: Define constants # Stage 2: Determine which JDK ports are installed and which JDK ports are # suitable # Stage 3: Decide the exact JDK to use (or install) # Stage 4: Add any dependencies if necessary # Stage 5: Define all settings for the port to use # # MAINTAINER: java@FreeBSD.org .if !defined(_INCLUDE_USES_JAVA_MK) _INCLUDE_USES_JAVA_MK= yes _JAVA_VALID_ARGS= ant build extract run _JAVA_UNKNOWN_ARGS= . for arg in ${java_ARGS} . if empty(_JAVA_VALID_ARGS:M${arg}) _JAVA_UNKNOWN_ARGS+= ${arg} . endif . endfor . if !empty(_JAVA_UNKNOWN_ARGS) IGNORE= has unknown USES=java arguments: ${_JAVA_UNKNOWN_ARGS} . endif . if empty(java_ARGS) . if defined(NO_BUILD) java_ARGS= run . else java_ARGS= build,run . endif . endif . if !empty(java_ARGS) .undef _USE_JAVA_ANT .undef _USE_JAVA_BUILD .undef _USE_JAVA_EXTRACT .undef _USE_JAVA_RUN _JAVA_ARGS= ${java_ARGS:S/,/ /g} . if ${_JAVA_ARGS:Mextract} _USE_JAVA_EXTRACT= yes _JAVA_ARGS:= ${_JAVA_ARGS:Nextract} . endif . if ${_JAVA_ARGS:Mant} . if defined(NO_BUILD) IGNORE= Makefile error: NO_BUILD and USES=java:ant cannot be set at the same time . else _USE_JAVA_ANT= yes _USE_JAVA_BUILD= yes _JAVA_ARGS:= ${_JAVA_ARGS:Nant} . endif . endif . if ${_JAVA_ARGS:Mbuild} . if defined(NO_BUILD) IGNORE= Makefile error: NO_BUILD and USES=java:build cannot be set at the same time . else _USE_JAVA_BUILD= yes _JAVA_ARGS:= ${_JAVA_ARGS:Nbuild} . endif . endif . if ${_JAVA_ARGS:Mrun} _USE_JAVA_RUN= yes _JAVA_ARGS:= ${_JAVA_ARGS:Nrun} . endif . endif # !empty(java_ARGS) #------------------------------------------------------------------------------- # Stage 1: Define constants # # System-global directories # NB: If the value of JAVALIBDIR is altered here it must also be altered # in java/javavmwrapper/Makefile. JAVASHAREDIR?= ${PREFIX}/share/java JAVAJARDIR?= ${JAVASHAREDIR}/classes JAVALIBDIR?= ${LOCALBASE}/share/java/classes # Add appropriate substitutions to PLIST_SUB and LIST_SUB PLIST_SUB+= JAVASHAREDIR="${JAVASHAREDIR:S,^${PREFIX}/,,}" \ JAVAJARDIR="${JAVAJARDIR:S,^${PREFIX}/,,}" SUB_LIST+= JAVASHAREDIR="${JAVASHAREDIR}" \ JAVAJARDIR="${JAVAJARDIR}" \ JAVALIBDIR="${JAVALIBDIR}" . if defined(JAVA_VERSION) SUB_LIST+= JAVA_VERSION="${JAVA_VERSION}" . endif . if defined(JAVA_VENDOR) SUB_LIST+= JAVA_VENDOR="${JAVA_VENDOR}" . endif . if defined(JAVA_OS) SUB_LIST+= JAVA_OS="${JAVA_OS}" . endif # The complete list of Java versions, os and vendors supported. -__JAVA_VERSION_LIST= 8 11 17 21 22 23 24 25 +__JAVA_VERSION_LIST= 8 11 17 21 22 23 24 25 26 _JAVA_VERSION_LIST= ${__JAVA_VERSION_LIST} ${__JAVA_VERSION_LIST:S/$/+/} _JAVA_OS_LIST= native linux _JAVA_VENDOR_LIST= openjdk oracle # Set all meta-information about JDK ports: # port location, corresponding JAVA_HOME, JDK version, OS, vendor _JAVA_PORT_NATIVE_OPENJDK_JDK_8_INFO= PORT=java/openjdk8 HOME=${LOCALBASE}/openjdk8 \ VERSION=8 OS=native VENDOR=openjdk _JAVA_PORT_NATIVE_OPENJDK_JDK_11_INFO= PORT=java/openjdk11 HOME=${LOCALBASE}/openjdk11 \ VERSION=11 OS=native VENDOR=openjdk _JAVA_PORT_NATIVE_OPENJDK_JDK_17_INFO= PORT=java/openjdk17 HOME=${LOCALBASE}/openjdk17 \ VERSION=17 OS=native VENDOR=openjdk _JAVA_PORT_NATIVE_OPENJDK_JDK_21_INFO= PORT=java/openjdk21 HOME=${LOCALBASE}/openjdk21 \ VERSION=21 OS=native VENDOR=openjdk _JAVA_PORT_NATIVE_OPENJDK_JDK_22_INFO= PORT=java/openjdk22 HOME=${LOCALBASE}/openjdk22 \ VERSION=22 OS=native VENDOR=openjdk _JAVA_PORT_NATIVE_OPENJDK_JDK_23_INFO= PORT=java/openjdk23 HOME=${LOCALBASE}/openjdk23 \ VERSION=23 OS=native VENDOR=openjdk _JAVA_PORT_NATIVE_OPENJDK_JDK_24_INFO= PORT=java/openjdk24 HOME=${LOCALBASE}/openjdk24 \ VERSION=24 OS=native VENDOR=openjdk _JAVA_PORT_NATIVE_OPENJDK_JDK_25_INFO= PORT=java/openjdk25 HOME=${LOCALBASE}/openjdk25 \ VERSION=25 OS=native VENDOR=openjdk +_JAVA_PORT_NATIVE_OPENJDK_JDK_26_INFO= PORT=java/openjdk26 HOME=${LOCALBASE}/openjdk26 \ + VERSION=26 OS=native VENDOR=openjdk _JAVA_PORT_LINUX_ORACLE_JDK_8_INFO= PORT=java/linux-oracle-jdk18 HOME=${LOCALBASE}/linux-oracle-jdk1.8.0 \ VERSION=8 OS=linux VENDOR=oracle # Verbose description for each VENDOR _JAVA_VENDOR_openjdk= "OpenJDK BSD Porting Team" _JAVA_VENDOR_oracle= Oracle # Verbose description for each OS _JAVA_OS_native= Native _JAVA_OS_linux= Linux # List all JDK ports in order of preference __JAVA_PORTS_ALL= \ JAVA_PORT_NATIVE_OPENJDK_JDK_8 \ JAVA_PORT_NATIVE_OPENJDK_JDK_11 \ JAVA_PORT_NATIVE_OPENJDK_JDK_17 \ JAVA_PORT_NATIVE_OPENJDK_JDK_21 \ JAVA_PORT_NATIVE_OPENJDK_JDK_22 \ JAVA_PORT_NATIVE_OPENJDK_JDK_23 \ JAVA_PORT_NATIVE_OPENJDK_JDK_24 \ JAVA_PORT_NATIVE_OPENJDK_JDK_25 \ + JAVA_PORT_NATIVE_OPENJDK_JDK_26 \ JAVA_PORT_LINUX_ORACLE_JDK_8 _JAVA_PORTS_ALL= ${JAVA_PREFERRED_PORTS} \ JAVA_PORT_NATIVE_OPENJDK_JDK_${JAVA_DEFAULT} \ ${__JAVA_PORTS_ALL} # Set the name of the file that indicates that a JDK is indeed installed, as a # relative path within the JAVA_HOME directory. _JDK_FILE=bin/javac #------------------------------------------------------------------------------- # Stage 2: Determine which JDK ports are suitable and which JDK ports are # suitable # # Error checking: defined JAVA_{HOME,PORT,PORT_VERSION,PORT_VENDOR,PORT_OS} . for variable in JAVA_HOME JAVA_PORT JAVA_PORT_VERSION JAVA_PORT_VENDOR JAVA_PORT_OS . if defined(${variable}) check-makevars:: @${ECHO_CMD} "${PKGNAME}: Environment error: \"${variable}\" should not be defined -- clearing." .undef ${variable} . endif . endfor # Error checking: JAVA_VERSION . if defined(JAVA_VERSION) . if !defined(_JAVA_VERSION_LIST_REGEXP) _JAVA_VERSION_LIST_REGEXP= ${_JAVA_VERSION_LIST:C/\+/\\+/:ts|} . endif check-makevars:: @( test ! -z "${JAVA_VERSION}" && ( ${ECHO_CMD} "${JAVA_VERSION}" | ${TR} " " "\n" | ${GREP} -Eq "${_JAVA_VERSION_LIST_REGEXP}")) || \ (${ECHO_CMD} "${PKGNAME}: Makefile error: \"${JAVA_VERSION}\" is not a valid value for JAVA_VERSION. It should be one or more of: ${__JAVA_VERSION_LIST} (with an optional \"+\" suffix.)"; ${FALSE}) . endif # Error checking: JAVA_VENDOR . if defined(JAVA_VENDOR) . if !defined(_JAVA_VENDOR_LIST_REGEXP) _JAVA_VENDOR_LIST_REGEXP= ${_JAVA_VENDOR_LIST:ts|} . endif check-makevars:: @( test ! -z "${JAVA_VENDOR}" && ( ${ECHO_CMD} "${JAVA_VENDOR}" | ${TR} " " "\n" | ${GREP} -Eq "${_JAVA_VENDOR_LIST_REGEXP}" )) || \ (${ECHO_CMD} "${PKGNAME}: Makefile error: \"${JAVA_VENDOR}\" is not a valid value for JAVA_VENDOR. It should be one or more of: ${_JAVA_VENDOR_LIST}"; \ ${FALSE}) . endif # Error checking: JAVA_OS . if defined(JAVA_OS) . if !defined(_JAVA_OS_LIST_REGEXP) _JAVA_OS_LIST_REGEXP= ${_JAVA_OS_LIST:ts|} . endif check-makevars:: @( test ! -z "${JAVA_OS}" && ( ${ECHO_CMD} "${JAVA_OS}" | ${TR} " " "\n" | ${GREP} -Eq "${_JAVA_OS_LIST_REGEXP}")) || \ (${ECHO_CMD} "${PKGNAME}: Makefile error: \"${JAVA_OS}\" is not a valid value for JAVA_OS. It should be one or more of: ${_JAVA_OS_LIST}"; \ ${FALSE}) . endif # JDK dependency setting . undef _JAVA_PORTS_INSTALLED . undef _JAVA_PORTS_POSSIBLE . if defined(JAVA_VERSION) -_JAVA_VERSION= ${JAVA_VERSION:S/^8+/8 11+/:S/^11+/11 17+/:S/^17+/17 21+/:S/^21+/21 22+/:S/^22+/22 23+/:S/^23+/23 24+/:S/^24+/24 25+/:S/^25+/25/} +_JAVA_VERSION= ${JAVA_VERSION:S/^8+/8 11+/:S/^11+/11 17+/:S/^17+/17 21+/:S/^21+/21 22+/:S/^22+/22 23+/:S/^23+/23 24+/:S/^24+/24 25+/:S/^25+/25 26+/:S/^26+/26/} . else _JAVA_VERSION= ${__JAVA_VERSION_LIST} . endif . if defined(JAVA_OS) _JAVA_OS= ${JAVA_OS} . else _JAVA_OS= ${_JAVA_OS_LIST} . endif . if defined(JAVA_VENDOR) _JAVA_VENDOR= ${JAVA_VENDOR} . else _JAVA_VENDOR= ${_JAVA_VENDOR_LIST} . endif . for A_JAVA_PORT in ${_JAVA_PORTS_ALL} A_JAVA_PORT_INFO:= ${A_JAVA_PORT:S/^/\${_/:S/$/_INFO}/} A_JAVA_PORT_HOME= ${A_JAVA_PORT_INFO:MHOME=*:S,HOME=,,} A_JAVA_PORT_VERSION= ${A_JAVA_PORT_INFO:MVERSION=*:S,VERSION=,,} A_JAVA_PORT_OS= ${A_JAVA_PORT_INFO:MOS=*:S,OS=,,} A_JAVA_PORT_VENDOR= ${A_JAVA_PORT_INFO:MVENDOR=*:S,VENDOR=,,} . if !defined(_JAVA_PORTS_INSTALLED) && exists(${A_JAVA_PORT_HOME}/${_JDK_FILE}) __JAVA_PORTS_INSTALLED+= ${A_JAVA_PORT} . endif # Because variables inside for loops are special (directly replaced as strings), # we are allowed to use them inside modifiers, where normally ${FOO:M${BAR}} is # not allowed. # . for ver in ${A_JAVA_PORT_VERSION} . for os in ${A_JAVA_PORT_OS} . for vendor in ${A_JAVA_PORT_VENDOR} . if ${_JAVA_VERSION:M${ver}} && ${_JAVA_OS:M${os}} && ${_JAVA_VENDOR:M${vendor}} __JAVA_PORTS_POSSIBLE+= ${A_JAVA_PORT} . endif . endfor . endfor . endfor . endfor . if !defined(_JAVA_PORTS_INSTALLED) _JAVA_PORTS_INSTALLED= ${__JAVA_PORTS_INSTALLED:C/ [ ]+/ /g} . endif _JAVA_PORTS_POSSIBLE= ${__JAVA_PORTS_POSSIBLE:C/ [ ]+/ /g} #------------------------------------------------------------------------------- # Stage 3: Decide the exact JDK to use (or install) # # Find an installed JDK port that matches the requirements of the port . undef _JAVA_PORTS_INSTALLED_POSSIBLE . for A_JAVA_PORT in ${_JAVA_PORTS_POSSIBLE} __JAVA_PORTS_INSTALLED_POSSIBLE+= ${_JAVA_PORTS_INSTALLED:M${A_JAVA_PORT}} . endfor _JAVA_PORTS_INSTALLED_POSSIBLE= ${__JAVA_PORTS_INSTALLED_POSSIBLE:C/[ ]+//g} . if ${_JAVA_PORTS_INSTALLED_POSSIBLE} != "" . for i in ${_JAVA_PORTS_INSTALLED_POSSIBLE} . if !defined(_JAVA_PORTS_INSTALLED_POSSIBLE_shortcircuit) _JAVA_PORT= $i _JAVA_PORTS_INSTALLED_POSSIBLE_shortcircuit= 1 . endif . endfor # If no installed JDK port fits, then pick one from the list of possible ones . else . for i in ${_JAVA_PORTS_POSSIBLE} . if !defined(_JAVA_PORTS_POSSIBLE_shortcircuit) _JAVA_PORT= $i _JAVA_PORTS_POSSIBLE_shortcircuit= 1 . endif . endfor . endif _JAVA_PORT_INFO:= ${_JAVA_PORT:S/^/\${_/:S/$/_INFO}/} JAVA_PORT= ${_JAVA_PORT_INFO:MPORT=*:S,PORT=,,} JAVA_HOME= ${_JAVA_PORT_INFO:MHOME=*:S,HOME=,,} JAVA_PORT_VERSION= ${_JAVA_PORT_INFO:MVERSION=*:S,VERSION=,,} JAVA_PORT_OS= ${_JAVA_PORT_INFO:MOS=*:S,OS=,,} JAVA_PORT_VENDOR= ${_JAVA_PORT_INFO:MVENDOR=*:S,VENDOR=,,} JAVA_PORT_VENDOR_DESCRIPTION:= ${JAVA_PORT_VENDOR:S/^/\${_JAVA_VENDOR_/:S/$/}/} JAVA_PORT_OS_DESCRIPTION:= ${JAVA_PORT_OS:S/^/\${_JAVA_OS_/:S/$/}/} #------------------------------------------------------------------------------- # Stage 4: Add any dependencies if necessary # # Add the JDK port to the dependencies DEPEND_JAVA= ${JAVA}:${JAVA_PORT} . if defined(_USE_JAVA_EXTRACT) EXTRACT_DEPENDS+= ${DEPEND_JAVA} . endif . if defined(_USE_JAVA_BUILD) BUILD_DEPENDS+= ${DEPEND_JAVA} . endif . if defined(_USE_JAVA_RUN) RUN_DEPENDS+= ${DEPEND_JAVA} . endif # Ant support: default do-build target . if defined(_USE_JAVA_ANT) DESTDIRNAME= -Dfreebsd.ports.destdir ANT?= ${LOCALBASE}/bin/ant MAKE_ENV+= JAVA_HOME=${JAVA_HOME} BUILD_DEPENDS+= ${ANT}:devel/apache-ant ALL_TARGET?= . if !target(do-build) do-build: @(cd ${BUILD_WRKSRC}; ${SETENVI} ${WRK_ENV} ${MAKE_ENV} \ ${ANT} ${MAKE_ARGS} ${ALL_TARGET}) . endif . if !target(do-test) && defined(TEST_TARGET) TEST_DEPENDS+= ${DEPEND_JAVA} TEST_DEPENDS+= ${ANT}:devel/apache-ant do-test: @(cd ${TEST_WRKSRC}; ${SETENVI} ${WRK_ENV} ${MAKE_ENV} \ ${ANT} ${MAKE_ARGS} ${TEST_TARGET}) . endif . endif #----------------------------------------------------------------------------- # Stage 5: Define all settings for the port to use # # At this stage both JAVA_HOME and JAVA_PORT are definitely given a value. # # Define the location of the Java compiler. # Only define JAVAC if a JDK is needed #. undef JAVAC # Then test if a JAVAC has to be set (JAVA_BUILD==jdk) . if defined(_USE_JAVA_BUILD) && !defined(JAVAC) JAVAC?= ${JAVA_HOME}/bin/javac . endif # Define the location of some more executables. APPLETVIEWER?= ${JAVA_HOME}/bin/appletviewer JAR?= ${JAVA_HOME}/bin/jar JAVA?= ${JAVA_HOME}/bin/java JAVADOC?= ${JAVA_HOME}/bin/javadoc JAVAH?= ${JAVA_HOME}/bin/javah JAVAP?= ${JAVA_HOME}/bin/javap JAVA_N2A?= ${JAVA_HOME}/bin/native2ascii JAVA_SERIALVER?=${JAVA_HOME}/bin/serialver RMIC?= ${JAVA_HOME}/bin/rmic RMIREGISTRY?= ${JAVA_HOME}/bin/rmiregistry JAVA_KEYTOOL?= ${JAVA_HOME}/bin/keytool JAVA_POLICYTOOL?= ${JAVA_HOME}/bin/policytool RMID?= ${JAVA_HOME}/bin/rmid # Set the location of the ZIP or JAR file with all standard Java classes. JAVA_CLASSES= ${JAVA_HOME}/jre/lib/rt.jar #------------------------------------------------------------------------------- # Additional Java support # Debug target # Use it to check Java dependency while porting java-debug: @${ECHO_CMD} "# User specified parameters:" @${ECHO_CMD} "JAVA_VERSION= ${JAVA_VERSION} (${_JAVA_VERSION})" @${ECHO_CMD} "JAVA_OS= ${JAVA_OS} (${_JAVA_OS})" @${ECHO_CMD} "JAVA_VENDOR= ${JAVA_VENDOR} (${_JAVA_VENDOR})" @${ECHO_CMD} "JAVA_BUILD= ${_USE_JAVA_BUILD}" @${ECHO_CMD} "JAVA_RUN= ${_USE_JAVA_RUN}" @${ECHO_CMD} "JAVA_EXTRACT= ${_USE_JAVA_EXTRACT}" @${ECHO_CMD} "JAVA_DEFAULT= ${JAVA_DEFAULT}" @${ECHO_CMD} @${ECHO_CMD} "# JDK port dependency selection process:" @${ECHO_CMD} "_JAVA_PORTS_POSSIBLE= ${_JAVA_PORTS_POSSIBLE}" @${ECHO_CMD} "_JAVA_PORTS_INSTALLED= ${_JAVA_PORTS_INSTALLED}" @${ECHO_CMD} "_JAVA_PORTS_INSTALLED_POSSIBLE= ${_JAVA_PORTS_INSTALLED_POSSIBLE}" @${ECHO_CMD} "_JAVA_PORT= ${_JAVA_PORT}" @${ECHO_CMD} "_JAVA_PORT_INFO= ${_JAVA_PORT_INFO:S/\t/ /}" @${ECHO_CMD} @${ECHO_CMD} "# Selected JDK port:" @${ECHO_CMD} "JAVA_PORT= ${JAVA_PORT}" @${ECHO_CMD} "JAVA_HOME= ${JAVA_HOME}" @${ECHO_CMD} "JAVA_PORT_VERSION= ${JAVA_PORT_VERSION}" @${ECHO_CMD} "JAVA_PORT_OS= ${JAVA_PORT_OS} (${JAVA_PORT_OS_DESCRIPTION})" @${ECHO_CMD} "JAVA_PORT_VENDOR= ${JAVA_PORT_VENDOR} (${JAVA_PORT_VENDOR_DESCRIPTION})" @${ECHO_CMD} @${ECHO_CMD} "# Additional variables:" @${ECHO_CMD} "JAVAC= ${JAVAC}" @${ECHO_CMD} "JAVA_CLASSES= ${JAVA_CLASSES}" .endif diff --git a/java/Makefile b/java/Makefile index 99a5095f4bf2..a4a2e0fd6188 100644 --- a/java/Makefile +++ b/java/Makefile @@ -1,103 +1,104 @@ COMMENT = Java language support SUBDIR += apache-bcel SUBDIR += apache-commons-beanutils SUBDIR += apache-commons-cli SUBDIR += apache-commons-codec SUBDIR += apache-commons-collections SUBDIR += apache-commons-collections4 SUBDIR += apache-commons-dbcp SUBDIR += apache-commons-httpclient SUBDIR += apache-commons-lang SUBDIR += apache-commons-lang3 SUBDIR += apache-commons-logging SUBDIR += apache-commons-pool SUBDIR += aparapi SUBDIR += avis SUBDIR += berkeley-db SUBDIR += bluej SUBDIR += bootstrap-openjdk11 SUBDIR += bootstrap-openjdk17 SUBDIR += bootstrap-openjdk8 SUBDIR += bouncycastle SUBDIR += dbvis SUBDIR += eclipse SUBDIR += eclipse-EPIC SUBDIR += eclipse-cdt SUBDIR += eclipse-drjava SUBDIR += eclipse-ecj SUBDIR += eclipse-findbugs SUBDIR += eclipse-pydev SUBDIR += eclipse-shelled SUBDIR += eclipse-yaml-editor SUBDIR += hamcrest SUBDIR += icedtea-web SUBDIR += intellij SUBDIR += intellij-fsnotifier SUBDIR += intellij-pty4j SUBDIR += intellij-ultimate SUBDIR += jad SUBDIR += jai SUBDIR += jakarta-oro SUBDIR += jasmin SUBDIR += jattach SUBDIR += java-cup SUBDIR += java-getopt SUBDIR += java-subversion SUBDIR += java-zoneinfo SUBDIR += java3d SUBDIR += javacpp SUBDIR += javahelp SUBDIR += javamail SUBDIR += javavmwrapper SUBDIR += jcalendar SUBDIR += jcckit SUBDIR += jcommon SUBDIR += jd-gui SUBDIR += jdk11-doc SUBDIR += jdk8-doc SUBDIR += jflex SUBDIR += jfreechart SUBDIR += jgraph SUBDIR += jgraphx SUBDIR += jikes SUBDIR += jlex SUBDIR += jlint SUBDIR += jmf SUBDIR += jode SUBDIR += jrosetta SUBDIR += jtiger SUBDIR += jump SUBDIR += junit SUBDIR += jxgrabkey SUBDIR += lightweight-java-profiler SUBDIR += linux-oracle-jdk18 SUBDIR += linux-oracle-jre18 SUBDIR += linux-oracle-serverjre10 SUBDIR += mmake SUBDIR += netbeans SUBDIR += netrexx SUBDIR += netty SUBDIR += openjdk11 SUBDIR += openjdk11-jre SUBDIR += openjdk17 SUBDIR += openjdk17-jre SUBDIR += openjdk21 SUBDIR += openjdk21-jre SUBDIR += openjdk22 SUBDIR += openjdk23 SUBDIR += openjdk24 SUBDIR += openjdk25 + SUBDIR += openjdk26 SUBDIR += openjdk8 SUBDIR += openjdk8-jre SUBDIR += openjfx14 SUBDIR += phpeclipse SUBDIR += proguard SUBDIR += sigar SUBDIR += sqlitejdbc SUBDIR += trove4j SUBDIR += veditor SUBDIR += visualvm SUBDIR += wildfly .include diff --git a/java/openjdk26/Makefile b/java/openjdk26/Makefile new file mode 100644 index 000000000000..cfa7e4d5f5ce --- /dev/null +++ b/java/openjdk26/Makefile @@ -0,0 +1,206 @@ +PORTNAME= openjdk +DISTVERSIONPREFIX= jdk- +DISTVERSION= ${JDK_FULL_VERSION:S/.0.0//} +CATEGORIES= java devel +PKGNAMESUFFIX?= ${JDK_MAJOR_VERSION} +MASTER_SITES= LOCAL/openjdk:boot +DISTFILES= ${BOOTSTRAPJDKFILE}:boot + +MAINTAINER= java@FreeBSD.org +COMMENT= ${COMMENT_${FLAVOR}} ${JDK_MAJOR_VERSION} +COMMENT_jdk= Java Development Kit +COMMENT_headless= Java Development Kit (headless version) +COMMENT_jre= Java Runtime Environment +COMMENT_jre_headless= Java Runtime Environment (headless version) + +WWW= https://openjdk.java.net/projects/jdk/26/ + +LICENSE= GPLv2 + +ONLY_FOR_ARCHS= aarch64 amd64 powerpc64 powerpc64le + +# This port supports the following flavors: +# +# - jdk (default) Full OpenJDK including dev tools and x11 support +# - headless Full OpenJDK including dev tools, but without x11 support +# - jre Java Runtime Environment including x11 support +# - jre_headless Jave Runtime Environment without x11 support +FLAVORS= jdk jre headless jre_headless + +headless_PKGNAMESUFFIX= ${JDK_MAJOR_VERSION}-headless +jre_PKGNAMESUFFIX= -jre +jre_headless_PKGNAMESUFFIX= ${JDK_MAJOR_VERSION}-jre-headless + +FLAVOR?= ${BUILD_JRE:?jre:${FLAVORS:[1]}} + +BUILD_DEPENDS= ${LOCALBASE}/include/cups/cups.h:print/cups \ + bash:shells/bash \ + gsed:textproc/gsed \ + zip:archivers/zip + +LIB_DEPENDS= libasound.so:audio/alsa-lib \ + libfontconfig.so:x11-fonts/fontconfig \ + libfreetype.so:print/freetype2 \ + libgif.so:graphics/giflib \ + libharfbuzz.so:print/harfbuzz \ + liblcms2.so:graphics/lcms2 \ + libpng.so:graphics/png + +RUN_DEPENDS= javavm:java/javavmwrapper +.if ${FLAVOR:M*headless} == "" +RUN_DEPENDS+= xorg-fonts-truetype>0:x11-fonts/xorg-fonts-truetype +.endif + +USES= autoreconf:build compiler:features cpe gmake iconv jpeg pkgconfig xorg + +CPE_VENDOR= oracle + +USE_GITHUB= yes +GH_ACCOUNT= freebsd + +USE_XORG= x11 xext xi xrandr xrender xt xtst + +GNU_CONFIGURE= yes +CONFIGURE_ARGS= --disable-ccache \ + --disable-javac-server \ + --with-alsa=${LOCALBASE} \ + --with-boot-jdk=${BOOTSTRAPJDKDIR} \ + --with-cups=${LOCALBASE} \ + --with-debug-level=release \ + --with-fontconfig=${LOCALBASE} \ + --with-freetype=system \ + --with-giflib-include=${LOCALBASE}/include \ + --with-giflib-lib=${LOCALBASE}/lib \ + --with-giflib=system \ + --with-harfbuzz=system \ + --with-lcms=system \ + --with-libjpeg=system \ + --with-libpng=system \ + --with-native-debug-symbols=none \ + --with-num-cores=${MAKE_JOBS_NUMBER} \ + --with-vendor-bug-url="${JDK_BUG_URL}" \ + --with-vendor-name="OpenJDK BSD Porting Team" \ + --with-vendor-url="https://github.com/${GH_ACCOUNT}/${GH_PROJECT}/" \ + --with-vendor-vm-bug-url="${JDK_BUG_URL}" \ + --with-version-string=${JDK_MAJOR_VERSION}.${JDK_MINOR_VERSION}.${JDK_PATCH_VERSION}+${JDK_BUILD_NUMBER}-${BSD_JDK_VERSION} \ + --with-zlib=system \ + --x-includes=${LOCALBASE}/include \ + --x-libraries=${LOCALBASE}/lib +.if ${FLAVOR:M*headless} +CONFIGURE_ARGS+= --enable-headless-only +.endif + +CONFIGURE_ENV= ac_cv_path_SED=${LOCALBASE}/bin/gsed +CONFIGURE_TARGET= ${JDK_ARCH}-portbld-${OPSYS:tl}${OSREL} + +# Suppress passing -j to do-build target via Mk/bsd.port.mk +# In the JDK build the number of parallel jobs is passed in via configure --with-num-cores=N +_MAKE_JOBS= # +MAKE_ENV= CLASSPATH="" \ + JAVA_HOME="" \ + LD_LIBRARY_PATH="" \ + LOG=cmdlines \ + MAKEFLAGS="" + +.if ${FLAVOR:Mjre*} +ALL_TARGET= legacy-images +.else +ALL_TARGET= images +.endif +JDK_BUILD_TYPE= release + +JDK_ARCH= ${ARCH:S/amd64/x86_64/:S/i386/x86/:S/powerpc64/ppc64/} +BOOTSTRAPJDKFILE= openjdk25-25.0.1+8.f.1.${JDK_ARCH}.tar.xz +JDK_OSARCH= bsd-${JDK_ARCH} +JDK_BUILDDIR= ${WRKSRC}/build/${JDK_OSARCH}-${JDK_BUILD_JVM}-${JDK_BUILD_TYPE} +.if ${FLAVOR:Mjre*} +BUILD_JRE= true +JDK_IMAGEDIR= ${JDK_BUILDDIR}/images/jre +.else +JDK_IMAGEDIR= ${JDK_BUILDDIR}/images/jdk +.endif +INSTALLDIR= ${PREFIX}/${PKGBASE} +BOOTSTRAPJDKDIR= ${WRKDIR}/boot-jdk + +NO_CCACHE= yes +NOPRECIOUSMAKEVARS= yes + +JDK_MAJOR_VERSION= 26 +JDK_MINOR_VERSION= 0 +JDK_PATCH_VERSION= 0 +JDK_BUILD_NUMBER= 35 +BSD_JDK_VERSION= 1 +JDK_FULL_VERSION= ${JDK_MAJOR_VERSION}.${JDK_MINOR_VERSION}.${JDK_PATCH_VERSION}+${JDK_BUILD_NUMBER}-${BSD_JDK_VERSION} + +JDK_BUG_URL= https://bugs.freebsd.org/bugzilla/enter_bug.cgi?product=Ports%20%26%20Packages&component=Individual%20Port(s)&short_desc=java/${PORTNAME}${JDK_MAJOR_VERSION}%3A%20 + +.ifnmake portclippy +JAVAVMS_COMMENT= OpenJDK${JDK_MAJOR_VERSION} +.endif + +.include + +JDK_BUILD_JVM= server + +MAKE_ENV+= --with-toolchain-type=${COMPILER_TYPE} +CONFIGURE_ARGS+= --with-toolchain-type=${COMPILER_TYPE} +CONFIGURE_ARGS+= --disable-warnings-as-errors + +.if ${COMPILER_TYPE} == gcc +USE_GCC= yes +CONFIGURE_ARGS+= --with-extra-cflags="-Wl,-rpath=${LOCALBASE}/lib/gcc${GCC_DEFAULT}" \ + --with-extra-cxxflags="-Wl,-rpath=${LOCALBASE}/lib/gcc${GCC_DEFAULT}" \ + --with-extra-ldflags="-Wl,-rpath=${LOCALBASE}/lib/gcc${GCC_DEFAULT} -L${LOCALBASE}/lib/gcc${GCC_DEFAULT}" +.else +MAKE_ENV+= USE_CLANG=true +EXTRA_CFLAGS+= -Wno-unused-but-set-parameter +EXTRA_CFLAGS+= -Wno-bitwise-instead-of-logical \ + -Wno-error=deprecated-non-prototype +CONFIGURE_ARGS+= --with-extra-cflags="${EXTRA_CFLAGS}" +CONFIGURE_ARGS+= --with-extra-cxxflags="${EXTRA_CFLAGS}" +.endif + +.if ${ARCH} == aarch64 +CONFIGURE_ARGS+= --disable-dtrace +.endif + +.if empty(ICONV_LIB) +ICONV_CFLAGS= -DLIBICONV_PLUG +.else +ICONV_CFLAGS= -I${LOCALBASE}/include +ICONV_LDFLAGS= -L${LOCALBASE}/lib +ICONV_LIBS= ${ICONV_LIB} +.endif + +post-patch: + @${RM} ${WRKSRC}/src/hotspot/os_cpu/bsd_ppc/thread_bsd_ppc.cpp + @${MV} ${WRKSRC}/src/hotspot/os_cpu/bsd_ppc/thread_bsd_ppc.hpp \ + ${WRKSRC}/src/hotspot/os_cpu/bsd_ppc/javaThread_bsd_ppc.hpp + + @${FIND} ${WRKSRC} -name '*.orig' -delete + @${CHMOD} 755 ${WRKSRC}/configure + @${REINPLACE_CMD} -e 's|%%LOCALBASE%%|${LOCALBASE}|' \ + ${WRKSRC}/configure \ + ${WRKSRC}/src/hotspot/os/bsd/os_bsd.cpp + @${REINPLACE_CMD} -e 's|%%ICONV_CFLAGS%%|${ICONV_CFLAGS}|' \ + -e 's|%%ICONV_LDFLAGS%%|${ICONV_LDFLAGS}|' \ + -e 's|%%ICONV_LIBS%%|${ICONV_LIBS}|' \ + ${WRKSRC}/make/autoconf/libraries.m4 + +post-build: +.if defined(OPENJDK_SYMLINK_CACERTS) + @${RM} ${JDK_IMAGEDIR}/lib/security/cacerts + @${LN} -sf ${OPENJDK_SYMLINK_CACERTS} ${JDK_IMAGEDIR}/lib/security/cacerts +.endif + +do-install: + @${MKDIR} ${STAGEDIR}${INSTALLDIR} + @cd ${JDK_IMAGEDIR} && ${COPYTREE_SHARE} . ${STAGEDIR}${INSTALLDIR} + @cd ${STAGEDIR}${INSTALLDIR} && \ + ${FIND} bin -type f -exec ${CHMOD} ${BINMODE} {} \; + @${CHMOD} ${BINMODE} ${STAGEDIR}${INSTALLDIR}/lib/jspawnhelper + @${ECHO} "@javavm ${INSTALLDIR}/bin/java" >> ${TMPPLIST} + @${FIND} ${STAGEDIR}${INSTALLDIR} -not -type d | ${SORT} | \ + ${SED} -e 's|^${STAGEDIR}${PREFIX}/||' >> ${TMPPLIST} + +.include diff --git a/java/openjdk26/distinfo b/java/openjdk26/distinfo new file mode 100644 index 000000000000..01a6c4fdf6bc --- /dev/null +++ b/java/openjdk26/distinfo @@ -0,0 +1,11 @@ +TIMESTAMP = 1773920001 +SHA256 (openjdk25-25.0.1+8.f.1.aarch64.tar.xz) = cb1d88e0e299a0c2347dbbaa17c3650403a28e8065076cf7898478646c473b2b +SIZE (openjdk25-25.0.1+8.f.1.aarch64.tar.xz) = 189254412 +SHA256 (openjdk25-25.0.1+8.f.1.ppc64.tar.xz) = ae3e9658208889233f374b172b06f10b36fb19061d830252384a5e98aebe7184 +SIZE (openjdk25-25.0.1+8.f.1.ppc64.tar.xz) = 186892692 +SHA256 (openjdk25-25.0.1+8.f.1.ppc64le.tar.xz) = dabfb39d05b31c41c76d6c172af3836b2a6fda9dc86111d7b5730ca780de6223 +SIZE (openjdk25-25.0.1+8.f.1.ppc64le.tar.xz) = 188302548 +SHA256 (openjdk25-25.0.1+8.f.1.x86_64.tar.xz) = 0449e5a9257d8eb7ed1518af1e4e9e546ee63e4bfaf21e1021e9ab45d2840f27 +SIZE (openjdk25-25.0.1+8.f.1.x86_64.tar.xz) = 191262784 +SHA256 (freebsd-openjdk-jdk-26+35-1_GH0.tar.gz) = c5db71942e814bcc44c6788536a062678e43856dfaa08549e77fc90e838e0816 +SIZE (freebsd-openjdk-jdk-26+35-1_GH0.tar.gz) = 121724470 diff --git a/java/openjdk26/files/patch-configure b/java/openjdk26/files/patch-configure new file mode 100644 index 000000000000..4c97fddabcd2 --- /dev/null +++ b/java/openjdk26/files/patch-configure @@ -0,0 +1,14 @@ +--- configure.orig 2025-10-24 11:51:54 UTC ++++ configure +@@ -1,4 +1,4 @@ +-#!/bin/bash ++#!%%LOCALBASE%%/bin/bash + # + # Copyright (c) 2012, 2023, Oracle and/or its affiliates. All rights reserved. + # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +@@ -36,4 +36,4 @@ fi + # Delegate to wrapper, forcing wrapper to believe $0 is this script by using -c. + # This trick is needed to get autoconf to co-operate properly. + # The ${-:+-$-} construction passes on bash options. +-bash ${-:+-$-} -c ". \"${this_script_dir}/make/autoconf/configure\"" "${this_script_dir}/configure" CHECKME "${this_script_dir}" "$@" ++%%LOCALBASE%%/bin/bash ${-:+-$-} -c ". \"${this_script_dir}/make/autoconf/configure\"" "${this_script_dir}/configure" CHECKME "${this_script_dir}" "$@" diff --git a/java/openjdk26/files/patch-make_autoconf_flags-cflags.m4 b/java/openjdk26/files/patch-make_autoconf_flags-cflags.m4 new file mode 100644 index 000000000000..81bc372519f5 --- /dev/null +++ b/java/openjdk26/files/patch-make_autoconf_flags-cflags.m4 @@ -0,0 +1,12 @@ +--- make/autoconf/flags-cflags.m4.orig 2025-09-16 10:24:48 UTC ++++ make/autoconf/flags-cflags.m4 +@@ -780,6 +780,9 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_CPU_DEP], + # Use Power8, this is the first CPU to support PPC64 LE with ELFv2 ABI. + $1_CFLAGS_CPU_JVM="${$1_CFLAGS_CPU_JVM} -DABI_ELFv2 -mcpu=power8 -mtune=power10" + fi ++ if test "x$FLAGS_CPU" = xppc64; then ++ $1_CFLAGS_CPU_JVM="${$1_CFLAGS_CPU_JVM} -DABI_ELFv2 -mcpu=powerpc64 -mtune=power5" ++ fi + fi + if test "x$OPENJDK_TARGET_OS" = xaix; then + $1_CFLAGS_CPU="-mcpu=pwr8" diff --git a/java/openjdk26/files/patch-make_autoconf_libraries.m4 b/java/openjdk26/files/patch-make_autoconf_libraries.m4 new file mode 100644 index 000000000000..9c86f7093ac7 --- /dev/null +++ b/java/openjdk26/files/patch-make_autoconf_libraries.m4 @@ -0,0 +1,15 @@ +--- make/autoconf/libraries.m4.orig 2025-10-24 12:39:13 UTC ++++ make/autoconf/libraries.m4 +@@ -212,9 +212,9 @@ AC_DEFUN_ONCE([LIB_SETUP_MISC_LIBS], + ICONV_LDFLAGS="-L/usr/local/lib" + ICONV_LIBS=-liconv + elif test "x$OPENJDK_TARGET_OS_ENV" = "xbsd.freebsd"; then +- ICONV_CFLAGS=-DLIBICONV_PLUG +- ICONV_LDFLAGS= +- ICONV_LIBS= ++ ICONV_CFLAGS=%%ICONV_CFLAGS%% ++ ICONV_LDFLAGS=%%ICONV_LDFLAGS%% ++ ICONV_LIBS=%%ICONV_LIBS%% + else + ICONV_CFLAGS= + ICONV_LDFLAGS= diff --git a/java/openjdk26/files/patch-src_hotspot_os_bsd_os__bsd.cpp b/java/openjdk26/files/patch-src_hotspot_os_bsd_os__bsd.cpp new file mode 100644 index 000000000000..402f0f475bc3 --- /dev/null +++ b/java/openjdk26/files/patch-src_hotspot_os_bsd_os__bsd.cpp @@ -0,0 +1,11 @@ +--- src/hotspot/os/bsd/os_bsd.cpp.orig 2021-09-29 21:25:10 UTC ++++ src/hotspot/os/bsd/os_bsd.cpp +@@ -361,7 +361,7 @@ + #elif defined(__NetBSD__) + #define DEFAULT_LIBPATH "/usr/lib:/usr/pkg/lib" + #else +- #define DEFAULT_LIBPATH "/usr/lib:/usr/local/lib" ++ #define DEFAULT_LIBPATH "/usr/lib:%%LOCALBASE%%/lib" + #endif + #else + #define DEFAULT_LIBPATH OVERRIDE_LIBPATH diff --git a/java/openjdk26/pkg-descr b/java/openjdk26/pkg-descr new file mode 100644 index 000000000000..a6701ff6ef33 --- /dev/null +++ b/java/openjdk26/pkg-descr @@ -0,0 +1 @@ +An open-source implementation of the Java Platform, Standard Edition. diff --git a/java/openjdk26/pkg-message b/java/openjdk26/pkg-message new file mode 100644 index 000000000000..c072654ad070 --- /dev/null +++ b/java/openjdk26/pkg-message @@ -0,0 +1,15 @@ +[ +{ type: install + message: <