From ffcb24a0dd6794fd8c0ac09e2013f47b1b973e18 Mon Sep 17 00:00:00 2001 From: "Liguros - Gitlab CI/CD [develop]" Date: Tue, 16 Dec 2025 07:16:57 +0000 Subject: Adding metadata --- dev-java/apache-rat/Manifest | 2 - dev-java/apache-rat/apache-rat-0.15-r2.ebuild | 109 ------- .../files/apache-rat-0.15-fix-tests.patch | 39 --- dev-java/commons-rng/commons-rng-1.6.ebuild | 18 +- dev-java/openjdk/Manifest | 2 +- dev-java/openjdk/openjdk-25.0.1_p8-r1.ebuild | 352 ++++++++++++++++++++ dev-java/openjdk/openjdk-25.0.1_p8.ebuild | 353 -------------------- dev-java/openjdk/openjdk-26_alpha28.ebuild | 356 --------------------- dev-java/openjdk/openjdk-26_beta28.ebuild | 356 +++++++++++++++++++++ dev-java/protobuf-java/Manifest | 1 + dev-java/protobuf-java/protobuf-java-4.33.2.ebuild | 164 ++++++++++ 11 files changed, 879 insertions(+), 873 deletions(-) delete mode 100644 dev-java/apache-rat/apache-rat-0.15-r2.ebuild delete mode 100644 dev-java/apache-rat/files/apache-rat-0.15-fix-tests.patch create mode 100644 dev-java/openjdk/openjdk-25.0.1_p8-r1.ebuild delete mode 100644 dev-java/openjdk/openjdk-25.0.1_p8.ebuild delete mode 100644 dev-java/openjdk/openjdk-26_alpha28.ebuild create mode 100644 dev-java/openjdk/openjdk-26_beta28.ebuild create mode 100644 dev-java/protobuf-java/protobuf-java-4.33.2.ebuild (limited to 'dev-java') diff --git a/dev-java/apache-rat/Manifest b/dev-java/apache-rat/Manifest index a84157688d24..00106504c571 100644 --- a/dev-java/apache-rat/Manifest +++ b/dev-java/apache-rat/Manifest @@ -1,4 +1,2 @@ -DIST apache-rat-0.15-src.tar.bz2 203040 BLAKE2B 0727fb932cfbab7080eba5115bee69e5c46155a231509109a5c7aecf40ed539d4357f2d9b31342717306221891e4a411e01077ae55a0988abe4926e40f1fafc4 SHA512 7f9fb219a5ce0b95909f006140b20e7621d9f5ce583c42a57e2783ec40fd842e75b546843ab033a99bf5108d0d8369a0ab1aac80e33af9685f651fed3dd603ee -DIST apache-rat-0.15-src.tar.bz2.asc 833 BLAKE2B b87e059a5a83d3d728c28c25926129743fdfb6a5c7cf2e258892d86711e7f5890d140ca1cfa5fc1012d56b6321ec2c93903ec30854bd3536216c8f1fd269f504 SHA512 f5abcb3df5d23834deab8c3c1a476100324452cba88e9185fb398dd6118c3c8ff8dc00c4c9f8166245833d6e602c51bc8cdf20361813bbe1e720022766412b8d DIST apache-rat-0.16.1-src.tar.bz2 1941799 BLAKE2B 4b871debc73c11b36bfdb7fcd2e9463dabb46673672c8a4731b2a81fc6fc4a063aede934e3c5e870968108aa3b5a2c01d0b17dba57ee81bad625290b705e4b0d SHA512 44a37a06bb7981835a26b302f0d9e0027e45443920f892e19c6c0240329dbfb89c3c9fea3cef67a94e553606f5f16718278a712f034b0e448fb2d3224108363d DIST apache-rat-0.16.1-src.tar.bz2.asc 833 BLAKE2B cdb503b69140cfd1dab7d9c84a4c96fb5e54f33b4293121b06c1a0b6672f293d5c645499b847b8b79e6168b0c6f9c4fcb62a0fe851642f644888a22b88cd338f SHA512 1677082f6b93cda1b60e752d352f81ab368d2b4f6a5123f9ad82f675fdb142950476fc7b7e35c065965dc0052a5b4bf06f857c07cd8514dab235d1751fc5c971 diff --git a/dev-java/apache-rat/apache-rat-0.15-r2.ebuild b/dev-java/apache-rat/apache-rat-0.15-r2.ebuild deleted file mode 100644 index 628754f463cb..000000000000 --- a/dev-java/apache-rat/apache-rat-0.15-r2.ebuild +++ /dev/null @@ -1,109 +0,0 @@ -# Copyright 1999-2024 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -# javadoc is broken for java 17, see https://bugs.gentoo.org/914458 -JAVA_PKG_IUSE="doc source test" -MAVEN_PROVIDES=" - org.apache.rat:apache-rat-core:${PV} - org.apache.rat:apache-rat-tasks:${PV} -" -JAVA_TESTING_FRAMEWORKS="junit-4" - -inherit java-pkg-2 java-pkg-simple verify-sig - -DESCRIPTION="Apache Rat is a release audit tool, focused on licenses" -HOMEPAGE="https://creadur.apache.org/rat/" -SRC_URI="https://archive.apache.org/dist/creadur/${P}/${P}-src.tar.bz2 - verify-sig? ( https://archive.apache.org/dist/creadur/${P}/${P}-src.tar.bz2.asc )" -S="${WORKDIR}/${P}" - -LICENSE="Apache-2.0" -SLOT="0" -KEYWORDS="amd64" - -CP_DEPEND=" - >=dev-java/ant-1.10.14:0 - dev-java/commons-cli:0 - dev-java/commons-collections:4 - dev-java/commons-compress:0 - dev-java/commons-io:1 - dev-java/commons-lang:3.6 -" - -DEPEND="${CP_DEPEND} - >=virtual/jdk-1.8:* - test? ( >=dev-java/ant-1.10.14:0[junit,testutil] )" -RDEPEND="${CP_DEPEND} - >=virtual/jre-1.8:*" - -BDEPEND="verify-sig? ( sec-keys/openpgp-keys-apache-creadur )" -VERIFY_SIG_OPENPGP_KEY_PATH="/usr/share/openpgp-keys/creadur.apache.org.asc" - -DOCS=( NOTICE README.md README.txt RELEASE-NOTES.txt RELEASE_NOTES.txt ) - -PATCHES=( "${FILESDIR}/apache-rat-0.15-fix-tests.patch" ) - -JAVADOC_SRC_DIRS=( - "${PN}-core/src/main/java" - "${PN}-tasks/src/main/java" -) - -src_prepare() { - default #780585 - java-pkg-2_src_prepare -} - -src_compile() { - einfo "Compiling apache-rat-core.jar" - JAVA_JAR_FILENAME="${PN}-core.jar" - JAVA_RESOURCE_DIRS="${PN}-core/src/main/resources" - JAVA_SRC_DIR="${PN}-core/src/main/java" - java-pkg-simple_src_compile - JAVA_GENTOO_CLASSPATH_EXTRA+=":${PN}-core.jar" - rm -r target || die - - einfo "Compiling apache-rat-tasks.jar" - JAVA_JAR_FILENAME="${PN}-tasks.jar" - JAVA_RESOURCE_DIRS="${PN}-tasks/src/main/resources" - JAVA_SRC_DIR="${PN}-tasks/src/main/java" - java-pkg-simple_src_compile - JAVA_GENTOO_CLASSPATH_EXTRA+=":${PN}-tasks.jar" - rm -r target || die - - # javadoc is broken for java 17, see https://bugs.gentoo.org/914458 - JAVADOC_CLASSPATH="${JAVA_GENTOO_CLASSPATH}" - use doc && ejavadoc -} - -src_test() { - JAVA_TEST_GENTOO_CLASSPATH="ant,junit-4" - - einfo "Testing apache-rat-core" - cp -r "${PN}"-core/src/{main,test} src || die - JAVA_TEST_RESOURCE_DIRS="src/test/resources" - JAVA_TEST_SRC_DIR="src/test/java" - java-pkg-simple_src_test - rm -r src/{main,test} || die - - einfo "Testing apache-rat-tasks" - cp -r "${PN}"-tasks/src/{main,test} src || die - mkdir -p target/it-sources || die - JAVA_TEST_RESOURCE_DIRS="src/test/resources" - JAVA_TEST_SRC_DIR="src/test/java" - java-pkg-simple_src_test -} - -src_install() { - java-pkg_dojar "${PN}-core.jar" - java-pkg_dojar "${PN}-tasks.jar" - java-pkg_dolauncher "${PN}" --main org.apache.rat.Report - - use doc && java-pkg_dojavadoc target/api - - if use source; then - java-pkg_dosrc "${PN}-core/src/main/java/*" - java-pkg_dosrc "${PN}-tasks/src/main/java/*" - fi -} diff --git a/dev-java/apache-rat/files/apache-rat-0.15-fix-tests.patch b/dev-java/apache-rat/files/apache-rat-0.15-fix-tests.patch deleted file mode 100644 index b9cb73648008..000000000000 --- a/dev-java/apache-rat/files/apache-rat-0.15-fix-tests.patch +++ /dev/null @@ -1,39 +0,0 @@ ---- a/apache-rat-tasks/src/test/resources/antunit/report-junit.xml -+++ b/apache-rat-tasks/src/test/resources/antunit/report-junit.xml -@@ -48,7 +48,7 @@ - - - -- -+ - - - -@@ -88,22 +88,22 @@ - - - -- -+ - -- -+ - - - - - -- -+ - - - - -- -+ - -- -+ - - - diff --git a/dev-java/commons-rng/commons-rng-1.6.ebuild b/dev-java/commons-rng/commons-rng-1.6.ebuild index e97fc15e396d..4f32bf86a4bd 100644 --- a/dev-java/commons-rng/commons-rng-1.6.ebuild +++ b/dev-java/commons-rng/commons-rng-1.6.ebuild @@ -20,11 +20,14 @@ KEYWORDS="amd64 arm64 ppc64" BDEPEND="verify-sig? ( sec-keys/openpgp-keys-aherbert )" +# [-vintage] because, if junit:5 compiled with 'USE=vintage': +# Error: Module junit not found, required by org.junit.vintage.engine DEPEND=" >=virtual/jdk-11:* test? ( >=dev-java/commons-math-3.6.1-r2:3 >=dev-java/jmh-core-1.37:0 + dev-java/junit:5[-vintage] dev-java/opentest4j:0 ) " @@ -38,6 +41,8 @@ JAVADOC_SRC_DIRS=( commons-rng-core/src/main/java commons-rng-simple/src/main/java ) +JAVA_TEST_GENTOO_CLASSPATH="commons-math-3 jmh-core junit-5 opentest4j" +JAVA_TEST_SRC_DIR=( commons-rng-{client-api,core,simple}/src/test/java ) VERIFY_SIG_OPENPGP_KEY_PATH="/usr/share/openpgp-keys/aherbert.asc" src_prepare() { @@ -82,19 +87,6 @@ src_compile() { use doc && ejavadoc } -src_test() { - JAVA_TEST_GENTOO_CLASSPATH="commons-math-3 jmh-core junit-5 opentest4j" - - JAVA_TEST_SRC_DIR="commons-rng-client-api/src/test/java" - junit5_src_test - - JAVA_TEST_SRC_DIR="commons-rng-core/src/test/java" - junit5_src_test - - JAVA_TEST_SRC_DIR="commons-rng-simple/src/test/java" - junit5_src_test -} - src_install() { java-pkg-simple_src_install java-pkg_dojar commons-rng-{client-api,core}.jar diff --git a/dev-java/openjdk/Manifest b/dev-java/openjdk/Manifest index 4b4eacb00884..e9f00214d678 100644 --- a/dev-java/openjdk/Manifest +++ b/dev-java/openjdk/Manifest @@ -3,7 +3,7 @@ DIST openjdk-11.0.29_p7.tar.gz 116622259 BLAKE2B 9b4b2abe361914e4e9c44ff27b53dbc DIST openjdk-17.0.17_p10.tar.gz 107966134 BLAKE2B 638ddbcab4a958c54b9aab4bb2d1deabd313bf0f2c9944465ed8b5d5c9b0e890af04ada7180c0a3608d21604cda67b5568e79fb1d840b4b91e905b79893c601a SHA512 ddb409fe2c8714af081e1174df2b1febcb05097dd83eed60abe9cdaf6b9cfb9a960626480ff4f8719e8890480274ca5ce2abb449317aeb617d9bfe964b33ad29 DIST openjdk-21.0.9_p10.tar.gz 113806114 BLAKE2B b6511bd023d022bbc21a11acc173257ec8b015e89ee148be94dad9a7bd71e711f576b74d4e94dac8e06bc19c54745b134d7b0da4284e4de424a1e1489c071ae6 SHA512 f209839c830e5db7080613b5d5e7c33ccd6a55cb72a2e6237bb26646569691a34a7b93349c9fa219a3496e111e156c2d24abda3b389056b16625668e8756aed0 DIST openjdk-25.0.1_p8.tar.gz 119363842 BLAKE2B 24fcb7607cf7847c743cc5f538b1ae11f8fd551e5c75777ae68a58efb7bcba67a02ef0b02b0123c715a5dabe0d68c9dd49e51678b73e3fe232009bc6a834b4b5 SHA512 002ca3cbd9b581bed8c01e2bbda7647845b88d165f638460870aee510feffcc014588b6c5315e77467458682b049e7d2bb1c6be8728f8cf5067539f5d8233352 -DIST openjdk-26_alpha28.tar.gz 121507141 BLAKE2B f69f61f597da3b9a99430df0e75c761dab98d631529c11bd0d308117194295c59852f020a7d91ba5c15cdec302a53da5acb3f4b3fa93b5e71bfcda97e4b69a43 SHA512 7964ff767398d7f238408e68d93f00550c64f8b1597cbca490716790c9135dc590f16207f13ea2af42f6803f0c402598305db42d3d845312a2e9c0ba36045001 +DIST openjdk-26_beta28.tar.gz 121524950 BLAKE2B 5ad807bf475335b9866579104a2b8d5fa9ccb0a9d24c7b57682d036d2ac0422fc9a5a468c322d357f172539b039a43d67d6452c84f240232201fd9eb56d8728e SHA512 5046ead222d09ca494979c7767d5bfc7a4e55035a48404bce17665e1e01c671410124121a1039b11c6e72435fde1b3d500479114f4b363710c1ad9d0f7a9bae6 DIST openjdk-27_alpha2.tar.gz 121547511 BLAKE2B e6e2a8c6dc8685ecc0345c6881fb1f5f06152e8fdda097c90175a7dfe284b17bee2c157de518ed15d48b0bc992bc6150a9125dee1597d655b1277f8f9b188019 SHA512 cc966cedb963bcd8e3bd3685e5ddd2f3476cd4aee8215eefade70e1dc0eb63608ea111ebb3f584a6104f0937c795ed2b136795a752ad5b4a36a43a66c9df7722 DIST openjdk-8.472_p08.tar.gz 92827251 BLAKE2B 5f5c90ef0eeaf934947c943798e2ef035fc2fb6a86c21d5408cf737257e4db63555581278ca688b9dd1cb76913effa22149152986eddaf233b1217f884ca84d1 SHA512 1acebcb878d0da98fe9d66040037ddeb10c307c89402a8e2471f074068589f6bcbcaafffd24d2eb94e1aaf25e953430d94e299465e3222869789f252eacc6446 DIST openjdk-bootstrap-11.0.13_p8-ppc64.tar.xz 108215404 BLAKE2B 5e6c0b905b34b437137922b73a9724da96b8832186fea945f8c73d941db822ca1cc5718f3ecb4607ed98d1f8241c9f365b54caaf978863e8b84680a94f067b5d SHA512 732e2220219d42be10589fcaf2420da87ebc8564b4afc6bd02f61f31cdca9c31b339366e34d374fb814499b92f8aa796435a18f28e10c8cb00d9a0f5953bb60e diff --git a/dev-java/openjdk/openjdk-25.0.1_p8-r1.ebuild b/dev-java/openjdk/openjdk-25.0.1_p8-r1.ebuild new file mode 100644 index 000000000000..1e5e0f14f2ef --- /dev/null +++ b/dev-java/openjdk/openjdk-25.0.1_p8-r1.ebuild @@ -0,0 +1,352 @@ +# Copyright 1999-2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +# Avoid circular dependency +JAVA_DISABLE_DEPEND_ON_JAVA_DEP_CHECK="true" + +inherit check-reqs flag-o-matic java-pkg-2 java-vm-2 multiprocessing toolchain-funcs + +# variable name format: _XPAK +PPC64_XPAK="25_p36" # big-endian bootstrap tarball + +# Usage: bootstrap_uri [extracond] +# Example: $(bootstrap_uri ppc64 17.0.1_p12 big-endian) +# Output: ppc64? ( big-endian? ( https://...17.0.1_p12-ppc64.tar.xz ) ) +bootstrap_uri() { + local baseuri="https://dev.gentoo.org/~arthurzam/distfiles/dev-java/${PN}/${PN}-bootstrap" + local suff="tar.xz" + local kw="${1:?${FUNCNAME[0]}: keyword not specified}" + local ver="${2:?${FUNCNAME[0]}: version not specified}" + local cond="${3-}" + [[ ${cond} == elibc_musl* ]] && local musl=yes + + # here be dragons + echo "${kw}? ( ${cond:+${cond}? (} ${baseuri}-${ver}-${kw}${musl:+-musl}.${suff} ${cond:+) })" +} + +# don't change versioning scheme +# to find correct _p number, look at +# https://github.com/openjdk/jdk${SLOT}u/tags +# you will see, for example, jdk-17.0.4.1-ga and jdk-17.0.4.1+1, both point +# to exact same commit sha. we should always use the full version. +# -ga tag is just for humans to easily identify General Availability release tag. +# MY_PV="${PV%_p*}-ga" + +# Upstream starts new major versions usually in https://github.com/openjdk/jdk. +# In ebuilds for those early versions, use '_alpha' in the version string. +# Exapmle: openjdk-26_alpha10.ebuild +# Later, upstream creates the versioned repository like e.g. +# https://github.com/openjdk/jdk25u. +# In ebuilds for those later versions, use '_beta' in the version string. +# Example: openjdk-25_beta35.ebuild +if [[ "${PV%_alpha*}" != "${PV}" ]]; then # version string contains "_alpha" + MY_PV="${PV/_alpha/+}" + JDK_REPO="jdk" + MY_VERSION_STRING="${PV%_alpha*}" + MY_VERSION_BUILD="${PV#*_alpha}" +elif [[ "${PV%_beta*}" != "${PV}" ]]; then # version string contains "_beta" + MY_PV="${PV/_beta/+}" + JDK_REPO="jdk$(ver_cut 1)u" + MY_VERSION_STRING="${PV%_beta*}" + MY_VERSION_BUILD="${PV#*_beta}" +else + MY_PV="${PV%_p*}-ga" + JDK_REPO="jdk$(ver_cut 1)u" + MY_VERSION_STRING="${PV%_p*}" + MY_VERSION_BUILD="${PV#*_p}" +fi + +DESCRIPTION="Open source implementation of the Java programming language" +HOMEPAGE="https://openjdk.org" +SRC_URI=" + https://github.com/${PN}/${JDK_REPO}/archive/jdk-${MY_PV}.tar.gz + -> ${P}.tar.gz + !system-bootstrap? ( + $(bootstrap_uri ppc64 ${PPC64_XPAK} big-endian) + ) +" +S="${WORKDIR}/${JDK_REPO}-jdk-${MY_PV//+/-}" + +LICENSE="GPL-2-with-classpath-exception" +SLOT="$(ver_cut 1)" +KEYWORDS="amd64 arm64 ppc64 ~riscv" + +IUSE="alsa big-endian cups debug doc examples headless-awt javafx +jbootstrap selinux source +system-bootstrap systemtap" + +REQUIRED_USE=" + javafx? ( alsa !headless-awt ) + !system-bootstrap? ( jbootstrap ) + !system-bootstrap? ( ppc64 ) +" + +COMMON_DEPEND=" + media-libs/freetype:2= + media-libs/giflib:0/7 + media-libs/harfbuzz:= + media-libs/libpng:0= + media-libs/lcms:2= + virtual/zlib:= + media-libs/libjpeg-turbo:0= + systemtap? ( dev-debug/systemtap ) +" + +# Many libs are required to build, but not to run, make is possible to remove +# by listing conditionally in RDEPEND unconditionally in DEPEND +RDEPEND=" + ${COMMON_DEPEND} + >=sys-apps/baselayout-java-0.1.0-r1 + !headless-awt? ( + x11-libs/libX11 + x11-libs/libXext + x11-libs/libXi + x11-libs/libXrandr + x11-libs/libXrender + x11-libs/libXt + x11-libs/libXtst + ) + alsa? ( media-libs/alsa-lib ) + cups? ( net-print/cups ) + selinux? ( sec-policy/selinux-java ) +" + +DEPEND=" + ${COMMON_DEPEND} + app-arch/zip + media-libs/alsa-lib + net-print/cups + x11-base/xorg-proto + x11-libs/libX11 + x11-libs/libXext + x11-libs/libXi + x11-libs/libXrandr + x11-libs/libXrender + x11-libs/libXt + x11-libs/libXtst + javafx? ( dev-java/openjfx:${SLOT}= ) + system-bootstrap? ( + || ( + dev-java/openjdk-bin:${SLOT} + dev-java/openjdk:${SLOT} + ) + ) +" + +# The space required to build varies wildly depending on USE flags, +# ranging from 2GB to 16GB. This function is certainly not exact but +# should be close enough to be useful. +openjdk_check_requirements() { + local M + M=2048 + M=$(( $(usex jbootstrap 2 1) * $M )) + M=$(( $(usex debug 3 1) * $M )) + M=$(( $(usex doc 320 0) + $(usex source 128 0) + 192 + $M )) + + CHECKREQS_DISK_BUILD=${M}M check-reqs_pkg_${EBUILD_PHASE} +} + +pkg_pretend() { + openjdk_check_requirements + if [[ ${MERGE_TYPE} != binary ]]; then + has ccache ${FEATURES} && die "FEATURES=ccache doesn't work with ${PN}, bug #677876" + fi +} + +pkg_setup() { + openjdk_check_requirements + java-vm-2_pkg_setup + + [[ ${MERGE_TYPE} == "binary" ]] && return + + JAVA_PKG_WANT_BUILD_VM="openjdk-${SLOT} openjdk-bin-${SLOT}" + JAVA_PKG_WANT_SOURCE="${SLOT}" + JAVA_PKG_WANT_TARGET="${SLOT}" + + # The nastiness below is necessary while the gentoo-vm USE flag is + # masked. First we call java-pkg-2_pkg_setup if it looks like the + # flag was unmasked against one of the possible build VMs. If not, + # we try finding one of them in their expected locations. This would + # have been slightly less messy if openjdk-bin had been installed to + # /opt/${PN}-${SLOT} or if there was a mechanism to install a VM env + # file but disable it so that it would not normally be selectable. + + local vm + for vm in ${JAVA_PKG_WANT_BUILD_VM}; do + if [[ -d ${BROOT}/usr/lib/jvm/${vm} ]]; then + java-pkg-2_pkg_setup + return + fi + done +} + +src_prepare() { + default + chmod +x configure || die +} + +src_configure() { + local myconf=() + + if has_version dev-java/openjdk:${SLOT}; then + export JDK_HOME=${BROOT}/usr/$(get_libdir)/openjdk-${SLOT} + elif use !system-bootstrap ; then + local xpakvar="${ARCH^^}_XPAK" + export JDK_HOME="${WORKDIR}/openjdk-bootstrap-${!xpakvar}" + else + JDK_HOME=$(best_version -b dev-java/openjdk-bin:${SLOT}) + [[ -n ${JDK_HOME} ]] || die "Build VM not found!" + JDK_HOME=${JDK_HOME#*/} + JDK_HOME=${BROOT}/opt/${JDK_HOME%-r*} + export JDK_HOME + fi + + # bug 906987; append-cppflags doesnt work + use elibc_musl && append-flags -D_LARGEFILE64_SOURCE + + # Strip some flags users may set, but should not. #818502 + filter-flags -fexceptions + + # Strip lto related flags, we rely on --with-jvm-features=link-time-opt + # See bug #833097 and bug #833098. + # + # .. but because of -Werror=odr (bug #916735), we disable it + # entirely for now. + #tc-is-lto && myconf+=( --with-jvm-features=link-time-opt ) + filter-lto + filter-flags -fdevirtualize-at-ltrans + + # Enabling full docs appears to break doc building. If not + # explicitly disabled, the flag will get auto-enabled if pandoc and + # graphviz are detected. pandoc has loads of dependencies anyway. + + myconf+=( + --disable-ccache + --disable-precompiled-headers + --disable-warnings-as-errors + --enable-full-docs=no + --with-boot-jdk="${JDK_HOME}" + --with-extra-cflags="${CFLAGS}" + --with-extra-cxxflags="${CXXFLAGS}" + --with-extra-ldflags="${LDFLAGS}" + --with-freetype="${XPAK_BOOTSTRAP:-system}" + --with-giflib="${XPAK_BOOTSTRAP:-system}" + --with-harfbuzz="${XPAK_BOOTSTRAP:-system}" + --with-lcms="${XPAK_BOOTSTRAP:-system}" + --with-libjpeg="${XPAK_BOOTSTRAP:-system}" + --with-libpng="${XPAK_BOOTSTRAP:-system}" + --with-stdc++lib=dynamic + --with-native-debug-symbols=$(usex debug internal none) + --with-vendor-name="Gentoo" + --with-vendor-url="https://gentoo.org" + --with-vendor-bug-url="https://bugs.gentoo.org" + --with-vendor-vm-bug-url="https://bugs.openjdk.java.net" + --with-vendor-version-string="${PVR}" + --with-version-pre="" + --with-version-string="${MY_VERSION_STRING}" + --with-version-build="${MY_VERSION_BUILD}" + --with-zlib="${XPAK_BOOTSTRAP:-system}" + --enable-jvm-feature-dtrace=$(usex systemtap yes no) + --enable-headless-only=$(usex headless-awt yes no) + $(tc-is-clang && echo "--with-toolchain-type=clang") + ) + + use riscv && myconf+=( --with-boot-jdk-jvmargs="-Djdk.lang.Process.launchMechanism=vfork" ) + + if use javafx; then + local zip="${EPREFIX}/usr/$(get_libdir)/openjfx-${SLOT}/javafx-exports.zip" + if [[ -r ${zip} ]]; then + myconf+=( --with-import-modules="${zip}" ) + else + die "${zip} not found or not readable" + fi + fi + + # Workaround for bug #938302 + if use systemtap && has_version "dev-debug/systemtap[-dtrace-symlink(+)]" ; then + myconf+=( DTRACE="${BROOT}"/usr/bin/stap-dtrace ) + fi + + if use !system-bootstrap ; then + addpredict /dev/random + addpredict /proc/self/coredump_filter + fi + + ( + unset _JAVA_OPTIONS JAVA JAVA_TOOL_OPTIONS JAVAC XARGS + CFLAGS= CXXFLAGS= LDFLAGS= \ + CONFIG_SITE=/dev/null \ + econf "${myconf[@]}" + ) +} + +src_compile() { + # Too brittle - gets confused by e.g. -Oline + export MAKEOPTS="-j$(makeopts_jobs) -l$(makeopts_loadavg)" + unset GNUMAKEFLAGS MAKEFLAGS + + local myemakeargs=( + JOBS=$(makeopts_jobs) + LOG=debug + CFLAGS_WARNINGS_ARE_ERRORS= # No -Werror + NICE= # Use PORTAGE_NICENESS, don't adjust further down + $(usex doc docs '') + $(usex jbootstrap bootcycle-images product-images) + ) + emake "${myemakeargs[@]}" -j1 +} + +src_install() { + local dest="/usr/$(get_libdir)/${PN}-${SLOT}" + local ddest="${ED}/${dest#/}" + + # https://bugs.gentoo.org/922741 + docompress "${dest}/man" + + cd "${S}"/build/*-release/images/jdk || die + + # Create files used as storage for system preferences. + mkdir .systemPrefs || die + touch .systemPrefs/.system.lock || die + touch .systemPrefs/.systemRootModFile || die + + # Oracle and IcedTea have libjsoundalsa.so depending on + # libasound.so.2 but OpenJDK only has libjsound.so. Weird. + if ! use alsa ; then + rm -v lib/libjsound.* || die + fi + + if ! use examples ; then + rm -vr demo/ || die + fi + + if ! use source ; then + rm -v lib/src.zip || die + fi + + rm -v lib/security/cacerts || die + + dodir "${dest}" + cp -pPR * "${ddest}" || die + + dosym -r /etc/ssl/certs/java/cacerts "${dest}"/lib/security/cacerts + + # must be done before running itself + java-vm_set-pax-markings "${ddest}" + + einfo "Creating the Class Data Sharing archives and disabling usage tracking" + "${ddest}/bin/java" -server -Xshare:dump -Djdk.disableLastUsageTracking || die + + java-vm_install-env "${FILESDIR}"/${PN}.env.sh + java-vm_revdep-mask + java-vm_sandbox-predict /dev/random /proc/self/coredump_filter + + if use doc ; then + docinto html + dodoc -r "${S}"/build/*-release/images/docs/* + fi +} + +pkg_postinst() { + java-vm-2_pkg_postinst +} diff --git a/dev-java/openjdk/openjdk-25.0.1_p8.ebuild b/dev-java/openjdk/openjdk-25.0.1_p8.ebuild deleted file mode 100644 index e2b154f5742a..000000000000 --- a/dev-java/openjdk/openjdk-25.0.1_p8.ebuild +++ /dev/null @@ -1,353 +0,0 @@ -# Copyright 1999-2025 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -# Avoid circular dependency -JAVA_DISABLE_DEPEND_ON_JAVA_DEP_CHECK="true" - -inherit check-reqs flag-o-matic java-pkg-2 java-vm-2 multiprocessing toolchain-funcs - -# variable name format: _XPAK -PPC64_XPAK="25_p36" # big-endian bootstrap tarball - -# Usage: bootstrap_uri [extracond] -# Example: $(bootstrap_uri ppc64 17.0.1_p12 big-endian) -# Output: ppc64? ( big-endian? ( https://...17.0.1_p12-ppc64.tar.xz ) ) -bootstrap_uri() { - local baseuri="https://dev.gentoo.org/~arthurzam/distfiles/dev-java/${PN}/${PN}-bootstrap" - local suff="tar.xz" - local kw="${1:?${FUNCNAME[0]}: keyword not specified}" - local ver="${2:?${FUNCNAME[0]}: version not specified}" - local cond="${3-}" - [[ ${cond} == elibc_musl* ]] && local musl=yes - - # here be dragons - echo "${kw}? ( ${cond:+${cond}? (} ${baseuri}-${ver}-${kw}${musl:+-musl}.${suff} ${cond:+) })" -} - -# don't change versioning scheme -# to find correct _p number, look at -# https://github.com/openjdk/jdk${SLOT}u/tags -# you will see, for example, jdk-17.0.4.1-ga and jdk-17.0.4.1+1, both point -# to exact same commit sha. we should always use the full version. -# -ga tag is just for humans to easily identify General Availability release tag. -# MY_PV="${PV%_p*}-ga" - -# Upstream starts new major versions usually in https://github.com/openjdk/jdk. -# In ebuilds for those early versions, use '_alpha' in the version string. -# Exapmle: openjdk-26_alpha10.ebuild -# Later, upstream creates the versioned repository like e.g. -# https://github.com/openjdk/jdk25u. -# In ebuilds for those later versions, use '_beta' in the version string. -# Example: openjdk-25_beta35.ebuild -if [[ "${PV%_alpha*}" != "${PV}" ]]; then # version string contains "_alpha" - MY_PV="${PV/_alpha/+}" - JDK_REPO="jdk" - MY_VERSION_STRING="${PV%_alpha*}" - MY_VERSION_BUILD="${PV#*_alpha}" -elif [[ "${PV%_beta*}" != "${PV}" ]]; then # version string contains "_beta" - MY_PV="${PV/_beta/+}" - JDK_REPO="jdk$(ver_cut 1)u" - MY_VERSION_STRING="${PV%_beta*}" - MY_VERSION_BUILD="${PV#*_beta}" -else - MY_PV="${PV%_p*}-ga" - JDK_REPO="jdk$(ver_cut 1)u" - MY_VERSION_STRING="${PV%_p*}" - MY_VERSION_BUILD="${PV#*_p}" -fi - -DESCRIPTION="Open source implementation of the Java programming language" -HOMEPAGE="https://openjdk.org" -SRC_URI=" - https://github.com/${PN}/${JDK_REPO}/archive/jdk-${MY_PV}.tar.gz - -> ${P}.tar.gz - !system-bootstrap? ( - $(bootstrap_uri ppc64 ${PPC64_XPAK} big-endian) - ) -" -S="${WORKDIR}/${JDK_REPO}-jdk-${MY_PV//+/-}" - -LICENSE="GPL-2-with-classpath-exception" -SLOT="$(ver_cut 1)" -KEYWORDS="amd64 arm64 ppc64 ~riscv" - -IUSE="alsa big-endian cups debug doc examples headless-awt javafx +jbootstrap selinux source +system-bootstrap systemtap" - -REQUIRED_USE=" - javafx? ( alsa !headless-awt ) - !system-bootstrap? ( jbootstrap ) - !system-bootstrap? ( ppc64 ) -" - -COMMON_DEPEND=" - media-libs/freetype:2= - media-libs/giflib:0/7 - media-libs/harfbuzz:= - media-libs/libpng:0= - media-libs/lcms:2= - virtual/zlib:= - media-libs/libjpeg-turbo:0= - systemtap? ( dev-debug/systemtap ) -" - -# Many libs are required to build, but not to run, make is possible to remove -# by listing conditionally in RDEPEND unconditionally in DEPEND -RDEPEND=" - ${COMMON_DEPEND} - >=sys-apps/baselayout-java-0.1.0-r1 - !headless-awt? ( - x11-libs/libX11 - x11-libs/libXext - x11-libs/libXi - x11-libs/libXrandr - x11-libs/libXrender - x11-libs/libXt - x11-libs/libXtst - ) - alsa? ( media-libs/alsa-lib ) - cups? ( net-print/cups ) - selinux? ( sec-policy/selinux-java ) -" - -DEPEND=" - ${COMMON_DEPEND} - app-arch/zip - media-libs/alsa-lib - net-print/cups - x11-base/xorg-proto - x11-libs/libX11 - x11-libs/libXext - x11-libs/libXi - x11-libs/libXrandr - x11-libs/libXrender - x11-libs/libXt - x11-libs/libXtst - javafx? ( dev-java/openjfx:${SLOT}= ) - system-bootstrap? ( - || ( - dev-java/openjdk-bin:${SLOT} - dev-java/openjdk:${SLOT} - ) - ) -" - -# The space required to build varies wildly depending on USE flags, -# ranging from 2GB to 16GB. This function is certainly not exact but -# should be close enough to be useful. -openjdk_check_requirements() { - local M - M=2048 - M=$(( $(usex jbootstrap 2 1) * $M )) - M=$(( $(usex debug 3 1) * $M )) - M=$(( $(usex doc 320 0) + $(usex source 128 0) + 192 + $M )) - - CHECKREQS_DISK_BUILD=${M}M check-reqs_pkg_${EBUILD_PHASE} -} - -pkg_pretend() { - openjdk_check_requirements - if [[ ${MERGE_TYPE} != binary ]]; then - has ccache ${FEATURES} && die "FEATURES=ccache doesn't work with ${PN}, bug #677876" - fi -} - -pkg_setup() { - openjdk_check_requirements - java-vm-2_pkg_setup - - [[ ${MERGE_TYPE} == "binary" ]] && return - - JAVA_PKG_WANT_BUILD_VM="openjdk-${SLOT} openjdk-bin-${SLOT}" - JAVA_PKG_WANT_SOURCE="${SLOT}" - JAVA_PKG_WANT_TARGET="${SLOT}" - - # The nastiness below is necessary while the gentoo-vm USE flag is - # masked. First we call java-pkg-2_pkg_setup if it looks like the - # flag was unmasked against one of the possible build VMs. If not, - # we try finding one of them in their expected locations. This would - # have been slightly less messy if openjdk-bin had been installed to - # /opt/${PN}-${SLOT} or if there was a mechanism to install a VM env - # file but disable it so that it would not normally be selectable. - - local vm - for vm in ${JAVA_PKG_WANT_BUILD_VM}; do - if [[ -d ${BROOT}/usr/lib/jvm/${vm} ]]; then - java-pkg-2_pkg_setup - return - fi - done -} - -src_prepare() { - default - chmod +x configure || die -} - -src_configure() { - local myconf=() - - if has_version dev-java/openjdk:${SLOT}; then - export JDK_HOME=${BROOT}/usr/$(get_libdir)/openjdk-${SLOT} - elif use !system-bootstrap ; then - local xpakvar="${ARCH^^}_XPAK" - export JDK_HOME="${WORKDIR}/openjdk-bootstrap-${!xpakvar}" - else - JDK_HOME=$(best_version -b dev-java/openjdk-bin:${SLOT}) - [[ -n ${JDK_HOME} ]] || die "Build VM not found!" - JDK_HOME=${JDK_HOME#*/} - JDK_HOME=${BROOT}/opt/${JDK_HOME%-r*} - export JDK_HOME - fi - - # bug 906987; append-cppflags doesnt work - use elibc_musl && append-flags -D_LARGEFILE64_SOURCE - - # Strip some flags users may set, but should not. #818502 - filter-flags -fexceptions - - # Strip lto related flags, we rely on --with-jvm-features=link-time-opt - # See bug #833097 and bug #833098. - # - # .. but because of -Werror=odr (bug #916735), we disable it - # entirely for now. - #tc-is-lto && myconf+=( --with-jvm-features=link-time-opt ) - filter-lto - filter-flags -fdevirtualize-at-ltrans - - # Enabling full docs appears to break doc building. If not - # explicitly disabled, the flag will get auto-enabled if pandoc and - # graphviz are detected. pandoc has loads of dependencies anyway. - - myconf+=( - --disable-ccache - --disable-precompiled-headers - --disable-warnings-as-errors - --enable-full-docs=no - --with-boot-jdk="${JDK_HOME}" - --with-extra-cflags="${CFLAGS}" - --with-extra-cxxflags="${CXXFLAGS}" - --with-extra-ldflags="${LDFLAGS}" - --with-freetype="${XPAK_BOOTSTRAP:-system}" - --with-giflib="${XPAK_BOOTSTRAP:-system}" - --with-harfbuzz="${XPAK_BOOTSTRAP:-system}" - --with-lcms="${XPAK_BOOTSTRAP:-system}" - --with-libjpeg="${XPAK_BOOTSTRAP:-system}" - --with-libpng="${XPAK_BOOTSTRAP:-system}" - --with-stdc++lib=dynamic - --with-native-debug-symbols=$(usex debug internal none) - --with-vendor-name="Gentoo" - --with-vendor-url="https://gentoo.org" - --with-vendor-bug-url="https://bugs.gentoo.org" - --with-vendor-vm-bug-url="https://bugs.openjdk.java.net" - --with-vendor-version-string="${PVR}" - --with-version-pre="" - --with-version-string="${MY_VERSION_STRING}" - --with-version-build="${MY_VERSION_BUILD}" - --with-zlib="${XPAK_BOOTSTRAP:-system}" - --enable-jvm-feature-dtrace=$(usex systemtap yes no) - --enable-headless-only=$(usex headless-awt yes no) - $(tc-is-clang && echo "--with-toolchain-type=clang") - ) - - use riscv && myconf+=( --with-boot-jdk-jvmargs="-Djdk.lang.Process.launchMechanism=vfork" ) - - if use javafx; then - local zip="${EPREFIX}/usr/$(get_libdir)/openjfx-${SLOT}/javafx-exports.zip" - if [[ -r ${zip} ]]; then - myconf+=( --with-import-modules="${zip}" ) - else - die "${zip} not found or not readable" - fi - fi - - # Workaround for bug #938302 - if use systemtap && has_version "dev-debug/systemtap[-dtrace-symlink(+)]" ; then - myconf+=( DTRACE="${BROOT}"/usr/bin/stap-dtrace ) - fi - - if use !system-bootstrap ; then - addpredict /dev/random - addpredict /proc/self/coredump_filter - fi - - ( - unset _JAVA_OPTIONS JAVA JAVA_TOOL_OPTIONS JAVAC XARGS - CFLAGS= CXXFLAGS= LDFLAGS= \ - CONFIG_SITE=/dev/null \ - econf "${myconf[@]}" - ) -} - -src_compile() { - # Too brittle - gets confused by e.g. -Oline - export MAKEOPTS="-j$(makeopts_jobs) -l$(makeopts_loadavg)" - unset GNUMAKEFLAGS MAKEFLAGS - - local myemakeargs=( - JOBS=$(makeopts_jobs) - LOG=debug - CFLAGS_WARNINGS_ARE_ERRORS= # No -Werror - NICE= # Use PORTAGE_NICENESS, don't adjust further down - $(usex doc docs '') - $(usex jbootstrap bootcycle-images product-images) - ) - emake "${myemakeargs[@]}" -j1 -} - -src_install() { - local dest="/usr/$(get_libdir)/${PN}-${SLOT}" - local ddest="${ED}/${dest#/}" - - # https://bugs.gentoo.org/922741 - docompress "${dest}/man" - - cd "${S}"/build/*-release/images/jdk || die - - # Create files used as storage for system preferences. - mkdir .systemPrefs || die - touch .systemPrefs/.system.lock || die - touch .systemPrefs/.systemRootModFile || die - - # Oracle and IcedTea have libjsoundalsa.so depending on - # libasound.so.2 but OpenJDK only has libjsound.so. Weird. - if ! use alsa ; then - rm -v lib/libjsound.* || die - fi - - if ! use examples ; then - rm -vr demo/ || die - fi - - if ! use source ; then - rm -v lib/src.zip || die - fi - - rm -v lib/security/cacerts || die - - dodir "${dest}" - cp -pPR * "${ddest}" || die - - dosym -r /etc/ssl/certs/java/cacerts "${dest}"/lib/security/cacerts - - # must be done before running itself - java-vm_set-pax-markings "${ddest}" - - einfo "Creating the Class Data Sharing archives and disabling usage tracking" - "${ddest}/bin/java" -server -Xshare:dump -Djdk.disableLastUsageTracking || die - - java-vm_install-env "${FILESDIR}"/${PN}.env.sh - java-vm_revdep-mask - java-vm_sandbox-predict /dev/random /proc/self/coredump_filter - - if use doc ; then - docinto html - dodoc -r "${S}"/build/*-release/images/docs/* - dosym ../../../usr/share/doc/"${PF}" /usr/share/doc/"${PN}-${SLOT}" - fi -} - -pkg_postinst() { - java-vm-2_pkg_postinst -} diff --git a/dev-java/openjdk/openjdk-26_alpha28.ebuild b/dev-java/openjdk/openjdk-26_alpha28.ebuild deleted file mode 100644 index d49473c8982f..000000000000 --- a/dev-java/openjdk/openjdk-26_alpha28.ebuild +++ /dev/null @@ -1,356 +0,0 @@ -# Copyright 1999-2025 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -# Avoid circular dependency -JAVA_DISABLE_DEPEND_ON_JAVA_DEP_CHECK="true" - -inherit check-reqs flag-o-matic java-pkg-2 java-vm-2 multiprocessing toolchain-funcs - -# variable name format: _XPAK -PPC64_XPAK="25_p36" # big-endian bootstrap tarball - -# Usage: bootstrap_uri [extracond] -# Example: $(bootstrap_uri ppc64 17.0.1_p12 big-endian) -# Output: ppc64? ( big-endian? ( https://...17.0.1_p12-ppc64.tar.xz ) ) -bootstrap_uri() { - local baseuri="https://dev.gentoo.org/~arthurzam/distfiles/dev-java/${PN}/${PN}-bootstrap" - local suff="tar.xz" - local kw="${1:?${FUNCNAME[0]}: keyword not specified}" - local ver="${2:?${FUNCNAME[0]}: version not specified}" - local cond="${3-}" - [[ ${cond} == elibc_musl* ]] && local musl=yes - - # here be dragons - echo "${kw}? ( ${cond:+${cond}? (} ${baseuri}-${ver}-${kw}${musl:+-musl}.${suff} ${cond:+) })" -} - -# don't change versioning scheme -# to find correct _p number, look at -# https://github.com/openjdk/jdk${SLOT}u/tags -# you will see, for example, jdk-17.0.4.1-ga and jdk-17.0.4.1+1, both point -# to exact same commit sha. we should always use the full version. -# -ga tag is just for humans to easily identify General Availability release tag. -# MY_PV="${PV%_p*}-ga" - -# Upstream starts new major versions usually in https://github.com/openjdk/jdk. -# In ebuilds for those early versions, use '_alpha' in the version string. -# Exapmle: openjdk-26_alpha10.ebuild -# Later, upstream creates the versioned repository like e.g. -# https://github.com/openjdk/jdk25u. -# In ebuilds for those later versions, use '_beta' in the version string. -# Example: openjdk-25_beta35.ebuild -if [[ "${PV%_alpha*}" != "${PV}" ]]; then # version string contains "_alpha" - MY_PV="${PV/_alpha/+}" - JDK_REPO="jdk" - MY_VERSION_STRING="${PV%_alpha*}" - MY_VERSION_BUILD="${PV#*_alpha}" -elif [[ "${PV%_beta*}" != "${PV}" ]]; then # version string contains "_beta" - MY_PV="${PV/_beta/+}" - JDK_REPO="jdk$(ver_cut 1)u" - MY_VERSION_STRING="${PV%_beta*}" - MY_VERSION_BUILD="${PV#*_beta}" -else - MY_PV="${PV%_p*}-ga" - JDK_REPO="jdk$(ver_cut 1)u" - MY_VERSION_STRING="${PV%_p*}" - MY_VERSION_BUILD="${PV#*_p}" -fi - -DESCRIPTION="Open source implementation of the Java programming language" -HOMEPAGE="https://openjdk.org" -SRC_URI=" - https://github.com/${PN}/${JDK_REPO}/archive/jdk-${MY_PV}.tar.gz - -> ${P}.tar.gz - !system-bootstrap? ( - $(bootstrap_uri ppc64 ${PPC64_XPAK} big-endian) - ) -" -S="${WORKDIR}/${JDK_REPO}-jdk-${MY_PV//+/-}" - -LICENSE="GPL-2-with-classpath-exception" -SLOT="$(ver_cut 1)" -# KEYWORDS="" # Not an LTS candidate - -IUSE="alsa big-endian cups debug doc examples headless-awt javafx +jbootstrap selinux source +system-bootstrap systemtap" - -REQUIRED_USE=" - javafx? ( alsa !headless-awt ) - !system-bootstrap? ( jbootstrap ) - !system-bootstrap? ( ppc64 ) -" - -COMMON_DEPEND=" - media-libs/freetype:2= - media-libs/giflib:0/7 - media-libs/harfbuzz:= - media-libs/libpng:0= - media-libs/lcms:2= - virtual/zlib:= - media-libs/libjpeg-turbo:0= - systemtap? ( dev-debug/systemtap ) -" - -# Many libs are required to build, but not to run, make is possible to remove -# by listing conditionally in RDEPEND unconditionally in DEPEND -RDEPEND=" - ${COMMON_DEPEND} - >=sys-apps/baselayout-java-0.1.0-r1 - !headless-awt? ( - x11-libs/libX11 - x11-libs/libXext - x11-libs/libXi - x11-libs/libXrandr - x11-libs/libXrender - x11-libs/libXt - x11-libs/libXtst - ) - alsa? ( media-libs/alsa-lib ) - cups? ( net-print/cups ) - selinux? ( sec-policy/selinux-java ) -" - -DEPEND=" - ${COMMON_DEPEND} - app-arch/zip - media-libs/alsa-lib - net-print/cups - x11-base/xorg-proto - x11-libs/libX11 - x11-libs/libXext - x11-libs/libXi - x11-libs/libXrandr - x11-libs/libXrender - x11-libs/libXt - x11-libs/libXtst - javafx? ( dev-java/openjfx:${SLOT}= ) - system-bootstrap? ( - || ( - dev-java/openjdk:25 - dev-java/openjdk-bin:${SLOT} - dev-java/openjdk:${SLOT} - ) - ) -" - -# The space required to build varies wildly depending on USE flags, -# ranging from 2GB to 16GB. This function is certainly not exact but -# should be close enough to be useful. -openjdk_check_requirements() { - local M - M=2048 - M=$(( $(usex jbootstrap 2 1) * $M )) - M=$(( $(usex debug 3 1) * $M )) - M=$(( $(usex doc 320 0) + $(usex source 128 0) + 192 + $M )) - - CHECKREQS_DISK_BUILD=${M}M check-reqs_pkg_${EBUILD_PHASE} -} - -pkg_pretend() { - openjdk_check_requirements - if [[ ${MERGE_TYPE} != binary ]]; then - has ccache ${FEATURES} && die "FEATURES=ccache doesn't work with ${PN}, bug #677876" - fi -} - -pkg_setup() { - openjdk_check_requirements - java-vm-2_pkg_setup - - [[ ${MERGE_TYPE} == "binary" ]] && return - - JAVA_PKG_WANT_BUILD_VM="openjdk-25 openjdk-${SLOT} openjdk-bin-${SLOT}" - JAVA_PKG_WANT_SOURCE="${SLOT}" - JAVA_PKG_WANT_TARGET="${SLOT}" - - # The nastiness below is necessary while the gentoo-vm USE flag is - # masked. First we call java-pkg-2_pkg_setup if it looks like the - # flag was unmasked against one of the possible build VMs. If not, - # we try finding one of them in their expected locations. This would - # have been slightly less messy if openjdk-bin had been installed to - # /opt/${PN}-${SLOT} or if there was a mechanism to install a VM env - # file but disable it so that it would not normally be selectable. - - local vm - for vm in ${JAVA_PKG_WANT_BUILD_VM}; do - if [[ -d ${BROOT}/usr/lib/jvm/${vm} ]]; then - java-pkg-2_pkg_setup - return - fi - done -} - -src_prepare() { - default - chmod +x configure || die -} - -src_configure() { - local myconf=() - - if has_version dev-java/openjdk:${SLOT}; then - export JDK_HOME=${BROOT}/usr/$(get_libdir)/openjdk-${SLOT} - elif has_version dev-java/openjdk:25; then - export JDK_HOME=${BROOT}/usr/$(get_libdir)/openjdk-25 - elif use !system-bootstrap ; then - local xpakvar="${ARCH^^}_XPAK" - export JDK_HOME="${WORKDIR}/openjdk-bootstrap-${!xpakvar}" - else - JDK_HOME=$(best_version -b dev-java/openjdk-bin:${SLOT}) - [[ -n ${JDK_HOME} ]] || die "Build VM not found!" - JDK_HOME=${JDK_HOME#*/} - JDK_HOME=${BROOT}/opt/${JDK_HOME%-r*} - export JDK_HOME - fi - - # bug 906987; append-cppflags doesnt work - use elibc_musl && append-flags -D_LARGEFILE64_SOURCE - - # Strip some flags users may set, but should not. #818502 - filter-flags -fexceptions - - # Strip lto related flags, we rely on --with-jvm-features=link-time-opt - # See bug #833097 and bug #833098. - # - # .. but because of -Werror=odr (bug #916735), we disable it - # entirely for now. - #tc-is-lto && myconf+=( --with-jvm-features=link-time-opt ) - filter-lto - filter-flags -fdevirtualize-at-ltrans - - # Enabling full docs appears to break doc building. If not - # explicitly disabled, the flag will get auto-enabled if pandoc and - # graphviz are detected. pandoc has loads of dependencies anyway. - - myconf+=( - --disable-ccache - --disable-precompiled-headers - --disable-warnings-as-errors - --enable-full-docs=no - --with-boot-jdk="${JDK_HOME}" - --with-extra-cflags="${CFLAGS}" - --with-extra-cxxflags="${CXXFLAGS}" - --with-extra-ldflags="${LDFLAGS}" - --with-freetype="${XPAK_BOOTSTRAP:-system}" - --with-giflib="${XPAK_BOOTSTRAP:-system}" - --with-harfbuzz="${XPAK_BOOTSTRAP:-system}" - --with-lcms="${XPAK_BOOTSTRAP:-system}" - --with-libjpeg="${XPAK_BOOTSTRAP:-system}" - --with-libpng="${XPAK_BOOTSTRAP:-system}" - --with-stdc++lib=dynamic - --with-native-debug-symbols=$(usex debug internal none) - --with-vendor-name="Gentoo" - --with-vendor-url="https://gentoo.org" - --with-vendor-bug-url="https://bugs.gentoo.org" - --with-vendor-vm-bug-url="https://bugs.openjdk.java.net" - --with-vendor-version-string="${PVR}" - --with-version-pre="" - --with-version-string="${MY_VERSION_STRING}" - --with-version-build="${MY_VERSION_BUILD}" - --with-zlib="${XPAK_BOOTSTRAP:-system}" - --enable-jvm-feature-dtrace=$(usex systemtap yes no) - --enable-headless-only=$(usex headless-awt yes no) - $(tc-is-clang && echo "--with-toolchain-type=clang") - ) - - use riscv && myconf+=( --with-boot-jdk-jvmargs="-Djdk.lang.Process.launchMechanism=vfork" ) - - if use javafx; then - local zip="${EPREFIX}/usr/$(get_libdir)/openjfx-${SLOT}/javafx-exports.zip" - if [[ -r ${zip} ]]; then - myconf+=( --with-import-modules="${zip}" ) - else - die "${zip} not found or not readable" - fi - fi - - # Workaround for bug #938302 - if use systemtap && has_version "dev-debug/systemtap[-dtrace-symlink(+)]" ; then - myconf+=( DTRACE="${BROOT}"/usr/bin/stap-dtrace ) - fi - - if use !system-bootstrap ; then - addpredict /dev/random - addpredict /proc/self/coredump_filter - fi - - ( - unset _JAVA_OPTIONS JAVA JAVA_TOOL_OPTIONS JAVAC XARGS - CFLAGS= CXXFLAGS= LDFLAGS= \ - CONFIG_SITE=/dev/null \ - econf "${myconf[@]}" - ) -} - -src_compile() { - # Too brittle - gets confused by e.g. -Oline - export MAKEOPTS="-j$(makeopts_jobs) -l$(makeopts_loadavg)" - unset GNUMAKEFLAGS MAKEFLAGS - - local myemakeargs=( - JOBS=$(makeopts_jobs) - LOG=debug - CFLAGS_WARNINGS_ARE_ERRORS= # No -Werror - NICE= # Use PORTAGE_NICENESS, don't adjust further down - $(usex doc docs '') - $(usex jbootstrap bootcycle-images product-images) - ) - emake "${myemakeargs[@]}" -j1 -} - -src_install() { - local dest="/usr/$(get_libdir)/${PN}-${SLOT}" - local ddest="${ED}/${dest#/}" - - # https://bugs.gentoo.org/922741 - docompress "${dest}/man" - - cd "${S}"/build/*-release/images/jdk || die - - # Create files used as storage for system preferences. - mkdir .systemPrefs || die - touch .systemPrefs/.system.lock || die - touch .systemPrefs/.systemRootModFile || die - - # Oracle and IcedTea have libjsoundalsa.so depending on - # libasound.so.2 but OpenJDK only has libjsound.so. Weird. - if ! use alsa ; then - rm -v lib/libjsound.* || die - fi - - if ! use examples ; then - rm -vr demo/ || die - fi - - if ! use source ; then - rm -v lib/src.zip || die - fi - - rm -v lib/security/cacerts || die - - dodir "${dest}" - cp -pPR * "${ddest}" || die - - dosym -r /etc/ssl/certs/java/cacerts "${dest}"/lib/security/cacerts - - # must be done before running itself - java-vm_set-pax-markings "${ddest}" - - einfo "Creating the Class Data Sharing archives and disabling usage tracking" - "${ddest}/bin/java" -server -Xshare:dump -Djdk.disableLastUsageTracking || die - - java-vm_install-env "${FILESDIR}"/${PN}.env.sh - java-vm_revdep-mask - java-vm_sandbox-predict /dev/random /proc/self/coredump_filter - - if use doc ; then - docinto html - dodoc -r "${S}"/build/*-release/images/docs/* - dosym ../../../usr/share/doc/"${PF}" /usr/share/doc/"${PN}-${SLOT}" - fi -} - -pkg_postinst() { - java-vm-2_pkg_postinst -} diff --git a/dev-java/openjdk/openjdk-26_beta28.ebuild b/dev-java/openjdk/openjdk-26_beta28.ebuild new file mode 100644 index 000000000000..d49473c8982f --- /dev/null +++ b/dev-java/openjdk/openjdk-26_beta28.ebuild @@ -0,0 +1,356 @@ +# Copyright 1999-2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +# Avoid circular dependency +JAVA_DISABLE_DEPEND_ON_JAVA_DEP_CHECK="true" + +inherit check-reqs flag-o-matic java-pkg-2 java-vm-2 multiprocessing toolchain-funcs + +# variable name format: _XPAK +PPC64_XPAK="25_p36" # big-endian bootstrap tarball + +# Usage: bootstrap_uri [extracond] +# Example: $(bootstrap_uri ppc64 17.0.1_p12 big-endian) +# Output: ppc64? ( big-endian? ( https://...17.0.1_p12-ppc64.tar.xz ) ) +bootstrap_uri() { + local baseuri="https://dev.gentoo.org/~arthurzam/distfiles/dev-java/${PN}/${PN}-bootstrap" + local suff="tar.xz" + local kw="${1:?${FUNCNAME[0]}: keyword not specified}" + local ver="${2:?${FUNCNAME[0]}: version not specified}" + local cond="${3-}" + [[ ${cond} == elibc_musl* ]] && local musl=yes + + # here be dragons + echo "${kw}? ( ${cond:+${cond}? (} ${baseuri}-${ver}-${kw}${musl:+-musl}.${suff} ${cond:+) })" +} + +# don't change versioning scheme +# to find correct _p number, look at +# https://github.com/openjdk/jdk${SLOT}u/tags +# you will see, for example, jdk-17.0.4.1-ga and jdk-17.0.4.1+1, both point +# to exact same commit sha. we should always use the full version. +# -ga tag is just for humans to easily identify General Availability release tag. +# MY_PV="${PV%_p*}-ga" + +# Upstream starts new major versions usually in https://github.com/openjdk/jdk. +# In ebuilds for those early versions, use '_alpha' in the version string. +# Exapmle: openjdk-26_alpha10.ebuild +# Later, upstream creates the versioned repository like e.g. +# https://github.com/openjdk/jdk25u. +# In ebuilds for those later versions, use '_beta' in the version string. +# Example: openjdk-25_beta35.ebuild +if [[ "${PV%_alpha*}" != "${PV}" ]]; then # version string contains "_alpha" + MY_PV="${PV/_alpha/+}" + JDK_REPO="jdk" + MY_VERSION_STRING="${PV%_alpha*}" + MY_VERSION_BUILD="${PV#*_alpha}" +elif [[ "${PV%_beta*}" != "${PV}" ]]; then # version string contains "_beta" + MY_PV="${PV/_beta/+}" + JDK_REPO="jdk$(ver_cut 1)u" + MY_VERSION_STRING="${PV%_beta*}" + MY_VERSION_BUILD="${PV#*_beta}" +else + MY_PV="${PV%_p*}-ga" + JDK_REPO="jdk$(ver_cut 1)u" + MY_VERSION_STRING="${PV%_p*}" + MY_VERSION_BUILD="${PV#*_p}" +fi + +DESCRIPTION="Open source implementation of the Java programming language" +HOMEPAGE="https://openjdk.org" +SRC_URI=" + https://github.com/${PN}/${JDK_REPO}/archive/jdk-${MY_PV}.tar.gz + -> ${P}.tar.gz + !system-bootstrap? ( + $(bootstrap_uri ppc64 ${PPC64_XPAK} big-endian) + ) +" +S="${WORKDIR}/${JDK_REPO}-jdk-${MY_PV//+/-}" + +LICENSE="GPL-2-with-classpath-exception" +SLOT="$(ver_cut 1)" +# KEYWORDS="" # Not an LTS candidate + +IUSE="alsa big-endian cups debug doc examples headless-awt javafx +jbootstrap selinux source +system-bootstrap systemtap" + +REQUIRED_USE=" + javafx? ( alsa !headless-awt ) + !system-bootstrap? ( jbootstrap ) + !system-bootstrap? ( ppc64 ) +" + +COMMON_DEPEND=" + media-libs/freetype:2= + media-libs/giflib:0/7 + media-libs/harfbuzz:= + media-libs/libpng:0= + media-libs/lcms:2= + virtual/zlib:= + media-libs/libjpeg-turbo:0= + systemtap? ( dev-debug/systemtap ) +" + +# Many libs are required to build, but not to run, make is possible to remove +# by listing conditionally in RDEPEND unconditionally in DEPEND +RDEPEND=" + ${COMMON_DEPEND} + >=sys-apps/baselayout-java-0.1.0-r1 + !headless-awt? ( + x11-libs/libX11 + x11-libs/libXext + x11-libs/libXi + x11-libs/libXrandr + x11-libs/libXrender + x11-libs/libXt + x11-libs/libXtst + ) + alsa? ( media-libs/alsa-lib ) + cups? ( net-print/cups ) + selinux? ( sec-policy/selinux-java ) +" + +DEPEND=" + ${COMMON_DEPEND} + app-arch/zip + media-libs/alsa-lib + net-print/cups + x11-base/xorg-proto + x11-libs/libX11 + x11-libs/libXext + x11-libs/libXi + x11-libs/libXrandr + x11-libs/libXrender + x11-libs/libXt + x11-libs/libXtst + javafx? ( dev-java/openjfx:${SLOT}= ) + system-bootstrap? ( + || ( + dev-java/openjdk:25 + dev-java/openjdk-bin:${SLOT} + dev-java/openjdk:${SLOT} + ) + ) +" + +# The space required to build varies wildly depending on USE flags, +# ranging from 2GB to 16GB. This function is certainly not exact but +# should be close enough to be useful. +openjdk_check_requirements() { + local M + M=2048 + M=$(( $(usex jbootstrap 2 1) * $M )) + M=$(( $(usex debug 3 1) * $M )) + M=$(( $(usex doc 320 0) + $(usex source 128 0) + 192 + $M )) + + CHECKREQS_DISK_BUILD=${M}M check-reqs_pkg_${EBUILD_PHASE} +} + +pkg_pretend() { + openjdk_check_requirements + if [[ ${MERGE_TYPE} != binary ]]; then + has ccache ${FEATURES} && die "FEATURES=ccache doesn't work with ${PN}, bug #677876" + fi +} + +pkg_setup() { + openjdk_check_requirements + java-vm-2_pkg_setup + + [[ ${MERGE_TYPE} == "binary" ]] && return + + JAVA_PKG_WANT_BUILD_VM="openjdk-25 openjdk-${SLOT} openjdk-bin-${SLOT}" + JAVA_PKG_WANT_SOURCE="${SLOT}" + JAVA_PKG_WANT_TARGET="${SLOT}" + + # The nastiness below is necessary while the gentoo-vm USE flag is + # masked. First we call java-pkg-2_pkg_setup if it looks like the + # flag was unmasked against one of the possible build VMs. If not, + # we try finding one of them in their expected locations. This would + # have been slightly less messy if openjdk-bin had been installed to + # /opt/${PN}-${SLOT} or if there was a mechanism to install a VM env + # file but disable it so that it would not normally be selectable. + + local vm + for vm in ${JAVA_PKG_WANT_BUILD_VM}; do + if [[ -d ${BROOT}/usr/lib/jvm/${vm} ]]; then + java-pkg-2_pkg_setup + return + fi + done +} + +src_prepare() { + default + chmod +x configure || die +} + +src_configure() { + local myconf=() + + if has_version dev-java/openjdk:${SLOT}; then + export JDK_HOME=${BROOT}/usr/$(get_libdir)/openjdk-${SLOT} + elif has_version dev-java/openjdk:25; then + export JDK_HOME=${BROOT}/usr/$(get_libdir)/openjdk-25 + elif use !system-bootstrap ; then + local xpakvar="${ARCH^^}_XPAK" + export JDK_HOME="${WORKDIR}/openjdk-bootstrap-${!xpakvar}" + else + JDK_HOME=$(best_version -b dev-java/openjdk-bin:${SLOT}) + [[ -n ${JDK_HOME} ]] || die "Build VM not found!" + JDK_HOME=${JDK_HOME#*/} + JDK_HOME=${BROOT}/opt/${JDK_HOME%-r*} + export JDK_HOME + fi + + # bug 906987; append-cppflags doesnt work + use elibc_musl && append-flags -D_LARGEFILE64_SOURCE + + # Strip some flags users may set, but should not. #818502 + filter-flags -fexceptions + + # Strip lto related flags, we rely on --with-jvm-features=link-time-opt + # See bug #833097 and bug #833098. + # + # .. but because of -Werror=odr (bug #916735), we disable it + # entirely for now. + #tc-is-lto && myconf+=( --with-jvm-features=link-time-opt ) + filter-lto + filter-flags -fdevirtualize-at-ltrans + + # Enabling full docs appears to break doc building. If not + # explicitly disabled, the flag will get auto-enabled if pandoc and + # graphviz are detected. pandoc has loads of dependencies anyway. + + myconf+=( + --disable-ccache + --disable-precompiled-headers + --disable-warnings-as-errors + --enable-full-docs=no + --with-boot-jdk="${JDK_HOME}" + --with-extra-cflags="${CFLAGS}" + --with-extra-cxxflags="${CXXFLAGS}" + --with-extra-ldflags="${LDFLAGS}" + --with-freetype="${XPAK_BOOTSTRAP:-system}" + --with-giflib="${XPAK_BOOTSTRAP:-system}" + --with-harfbuzz="${XPAK_BOOTSTRAP:-system}" + --with-lcms="${XPAK_BOOTSTRAP:-system}" + --with-libjpeg="${XPAK_BOOTSTRAP:-system}" + --with-libpng="${XPAK_BOOTSTRAP:-system}" + --with-stdc++lib=dynamic + --with-native-debug-symbols=$(usex debug internal none) + --with-vendor-name="Gentoo" + --with-vendor-url="https://gentoo.org" + --with-vendor-bug-url="https://bugs.gentoo.org" + --with-vendor-vm-bug-url="https://bugs.openjdk.java.net" + --with-vendor-version-string="${PVR}" + --with-version-pre="" + --with-version-string="${MY_VERSION_STRING}" + --with-version-build="${MY_VERSION_BUILD}" + --with-zlib="${XPAK_BOOTSTRAP:-system}" + --enable-jvm-feature-dtrace=$(usex systemtap yes no) + --enable-headless-only=$(usex headless-awt yes no) + $(tc-is-clang && echo "--with-toolchain-type=clang") + ) + + use riscv && myconf+=( --with-boot-jdk-jvmargs="-Djdk.lang.Process.launchMechanism=vfork" ) + + if use javafx; then + local zip="${EPREFIX}/usr/$(get_libdir)/openjfx-${SLOT}/javafx-exports.zip" + if [[ -r ${zip} ]]; then + myconf+=( --with-import-modules="${zip}" ) + else + die "${zip} not found or not readable" + fi + fi + + # Workaround for bug #938302 + if use systemtap && has_version "dev-debug/systemtap[-dtrace-symlink(+)]" ; then + myconf+=( DTRACE="${BROOT}"/usr/bin/stap-dtrace ) + fi + + if use !system-bootstrap ; then + addpredict /dev/random + addpredict /proc/self/coredump_filter + fi + + ( + unset _JAVA_OPTIONS JAVA JAVA_TOOL_OPTIONS JAVAC XARGS + CFLAGS= CXXFLAGS= LDFLAGS= \ + CONFIG_SITE=/dev/null \ + econf "${myconf[@]}" + ) +} + +src_compile() { + # Too brittle - gets confused by e.g. -Oline + export MAKEOPTS="-j$(makeopts_jobs) -l$(makeopts_loadavg)" + unset GNUMAKEFLAGS MAKEFLAGS + + local myemakeargs=( + JOBS=$(makeopts_jobs) + LOG=debug + CFLAGS_WARNINGS_ARE_ERRORS= # No -Werror + NICE= # Use PORTAGE_NICENESS, don't adjust further down + $(usex doc docs '') + $(usex jbootstrap bootcycle-images product-images) + ) + emake "${myemakeargs[@]}" -j1 +} + +src_install() { + local dest="/usr/$(get_libdir)/${PN}-${SLOT}" + local ddest="${ED}/${dest#/}" + + # https://bugs.gentoo.org/922741 + docompress "${dest}/man" + + cd "${S}"/build/*-release/images/jdk || die + + # Create files used as storage for system preferences. + mkdir .systemPrefs || die + touch .systemPrefs/.system.lock || die + touch .systemPrefs/.systemRootModFile || die + + # Oracle and IcedTea have libjsoundalsa.so depending on + # libasound.so.2 but OpenJDK only has libjsound.so. Weird. + if ! use alsa ; then + rm -v lib/libjsound.* || die + fi + + if ! use examples ; then + rm -vr demo/ || die + fi + + if ! use source ; then + rm -v lib/src.zip || die + fi + + rm -v lib/security/cacerts || die + + dodir "${dest}" + cp -pPR * "${ddest}" || die + + dosym -r /etc/ssl/certs/java/cacerts "${dest}"/lib/security/cacerts + + # must be done before running itself + java-vm_set-pax-markings "${ddest}" + + einfo "Creating the Class Data Sharing archives and disabling usage tracking" + "${ddest}/bin/java" -server -Xshare:dump -Djdk.disableLastUsageTracking || die + + java-vm_install-env "${FILESDIR}"/${PN}.env.sh + java-vm_revdep-mask + java-vm_sandbox-predict /dev/random /proc/self/coredump_filter + + if use doc ; then + docinto html + dodoc -r "${S}"/build/*-release/images/docs/* + dosym ../../../usr/share/doc/"${PF}" /usr/share/doc/"${PN}-${SLOT}" + fi +} + +pkg_postinst() { + java-vm-2_pkg_postinst +} diff --git a/dev-java/protobuf-java/Manifest b/dev-java/protobuf-java/Manifest index a1089b31d2c9..d72debe5a3a0 100644 --- a/dev-java/protobuf-java/Manifest +++ b/dev-java/protobuf-java/Manifest @@ -1 +1,2 @@ DIST protobuf-33.0.tar.gz 6872665 BLAKE2B 5d456c000117b590dea5b7e721a8b8d00d9e7067ba2156f082e4959a17fcf8d4f2e306f90335aad97e1a94dfd2491544d67cb29670f0022034fde574140a8066 SHA512 2956270a81631895ab6ed8c3c2a22b353a461b0827ee17a1c569b24374307a8e2525a06db6728140bff759a40e47a1d2a291cfb34293b364fe279f10468f3cb9 +DIST protobuf-33.2.tar.gz 6868986 BLAKE2B 82909ba8919b1034619a7ea5bd1525db667294310363c035e535a150dac2e7cd819b6bfbffc5203adfbcc0abf1378168e0b06da417b455bdca63ab7eb5db7dd4 SHA512 6d884194d7e4799a2ff9cb8b9d62fdf302a3a5f90e8d4006918d88b037eb5758ef4d2153abd7dc9d5d526e1e04cc91dd87ed7e06befb573bab1e7d259649bff4 diff --git a/dev-java/protobuf-java/protobuf-java-4.33.2.ebuild b/dev-java/protobuf-java/protobuf-java-4.33.2.ebuild new file mode 100644 index 000000000000..7c97927c2f1b --- /dev/null +++ b/dev-java/protobuf-java/protobuf-java-4.33.2.ebuild @@ -0,0 +1,164 @@ +# Copyright 2008-2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +JAVA_PKG_IUSE="doc source test" +JAVA_TESTING_FRAMEWORKS="junit-4" +MAVEN_ID="com.google.protobuf:protobuf-java:${PV}" + +inherit cmake java-pkg-2 java-pkg-simple + +DESCRIPTION="Core Protocol Buffers library" +HOMEPAGE="https://protobuf.dev" +MY_PV4="${PV#4.}" +MY_PV="${MY_PV4/_rc/-rc}" +MY_P="protobuf-${MY_PV}.tar.gz" +SRC_URI="https://github.com/protocolbuffers/protobuf/releases/download/v${MY_PV}/${MY_P}" +S="${WORKDIR}/protobuf-${MY_PV}" + +LICENSE="BSD" +SLOT="0" +KEYWORDS="~amd64" +IUSE="system-protoc" + +BDEPEND=" + system-protoc? ( ~dev-libs/protobuf-${MY_PV4}:0[protoc] ) + !system-protoc? ( >=dev-cpp/abseil-cpp-20250512.1:= ) +" + +# restrict virtual/jdk because asm-jdk-bridge-0.0.13 is not ready for java 27. +DEPEND=" + =dev-java/guava-33.5.0:0 + >=dev-java/mockito-4.11.0:4 + >=dev-java/snakeyaml-2.5:0 + >=dev-java/testparameterinjector-1.19:0 + >=dev-java/truth-1.4.5:0 + ) +" + +RDEPEND=">=virtual/jre-1.8:*" + +JAVA_AUTOMATIC_MODULE_NAME="com.google.protobuf" +JAVA_JAR_FILENAME="protobuf.jar" +JAVA_RESOURCE_DIRS="java/core/src/main/resources" +JAVA_SRC_DIR="java/core/src/main/java" +JAVA_TEST_GENTOO_CLASSPATH="guava,junit-4,mockito-4,snakeyaml" +JAVA_TEST_RESOURCE_DIRS="java/core/src/main/resources" +JAVA_TEST_SRC_DIR="java/core/src/test/java" + +run-protoc() { + if use system-protoc; then + protoc "$1" + else + "${BUILD_DIR}/protoc" "$1" + fi +} + +src_prepare() { + # If the corrsponding version of system-protoc is not available we build protoc locally + if ! use system-protoc; then + cmake_src_prepare + fi + java-pkg-2_src_prepare + + # ${S}/java/core/generate-sources-build.xml + einfo "Replace variables in generate-sources-build.xml" + sed \ + -e 's:${generated.sources.dir}:java/core/src/main/java:' \ + -e 's:${protobuf.java_source.dir}:java/core/src/main/resources:' \ + -e 's:${protobuf.source.dir}:src:' \ + -e 's:^.*value="::' -e 's:\"/>::' \ + -e '/project\|echo\|mkdir\|exec/d' \ + -i java/core/generate-sources-build.xml || die "sed to sources failed" + + # ${S}/java/core/generate-test-sources-build.xml + einfo "Replace variables in generate-test-sources-build.xml" + sed \ + -e 's:${generated.testsources.dir}:java/core/src/test/java:' \ + -e 's:${protobuf.source.dir}:src:' \ + -e 's:${test.proto.dir}:java/core/src/test/proto:' \ + -e 's:^.*value="::' -e 's:\"/>::' \ + -e '/project\|mkdir\|exec\|Also generate/d' \ + -i java/core/generate-test-sources-build.xml || die "sed to test sources failed" + + # Split the file in two parts, one for each run-protoc call + awk '/--java_out/{x="test-sources-build-"++i;}{print > x;}' \ + java/core/generate-test-sources-build.xml || die + + # We add some *.proto files to the 'test-sources-build-1' file which + # are needed to avoid compilation errors on related test classes. + cat <<-EOF >> test-sources-build-1 || die "append test-sources-build-1" + src/google/protobuf/edition_unittest.proto + src/google/protobuf/unittest_delimited.proto + src/google/protobuf/unittest_delimited_import.proto + src/google/protobuf/unittest_import_option.proto + java/core/src/test/proto/com/google/protobuf/large_open_enum.proto + java/core/src/test/proto/com/google/protobuf/generator_names_edition2024_defaults.proto + EOF +} + +src_configure() { + local mycmakeargs=( + -Dprotobuf_BUILD_TESTS=OFF + -Dprotobuf_LOCAL_DEPENDENCIES_ONLY=ON + ) + if ! use system-protoc; then + cmake_src_configure + fi +} + +src_compile() { + if ! use system-protoc; then + cmake_src_compile + fi + + einfo "Run protoc to generate sources" + run-protoc @java/core/generate-sources-build.xml \ + || die "protoc sources failed" + + java-pkg-simple_src_compile +} + +src_test() { + # Note: Annotation processing is enabled because one or more processors were found + # on the class path. A future release of javac may disable annotation processing + # unless at least one processor is specified by name (-processor), or a search + # path is specified (--processor-path, --processor-module-path), or annotation + # processing is enabled explicitly (-proc:only, -proc:full). + JAVA_GENTOO_CLASSPATH_EXTRA+=":$(java-pkg_getjars --build-only testparameterinjector,truth)" + + # java/core/src/test/java/com/google/protobuf/GeneratorNamesTest.java:33: error: cannot find symbol + # GeneratorNamesPre2024Defaults.getDescriptor(), GeneratorNamesPre2024Defaults.class), + # ^ + # symbol: class GeneratorNamesPre2024Defaults + # location: class FileClassProvider + rm java/core/src/test/java/com/google/protobuf/GeneratorNamesTest.java || die "remove test" + + einfo "Running protoc on first part of generate-test-sources-build.xml" + # java/core/src/test/proto/com/google/protobuf/test_check_utf8.proto:15:1: + # Import "google/protobuf/java_features.proto" was not found or had errors. + cp {java/core/src/main/resources,src}/google/protobuf/java_features.proto || die + run-protoc @test-sources-build-1 \ + || die "run-protoc test-sources-build-1 failed" + + einfo "Running protoc on second part of generate-test-sources-build.xml" + run-protoc @test-sources-build-2 \ + || die "run-protoc test-sources-build-2 failed" + + einfo "Running tests" + # Invalid test class 'map_test.MapInitializationOrderTest': + # 1. Test class should have exactly one public constructor + # Invalid test class 'proto2_unittest.CachedFieldSizeTest': + # 1. Test class should have exactly one public constructor + local JAVA_TEST_RUN_ONLY=$(find "${JAVA_TEST_SRC_DIR}" \ + -path "**/*Test.java" \ + ! -path "**/Abstract*Test.java" \ + ! -name "MapInitializationOrderTest.java" \ + ! -name 'CachedFieldSizeTest.java' -printf "%P\n") + JAVA_TEST_RUN_ONLY="${JAVA_TEST_RUN_ONLY//.java}" + JAVA_TEST_RUN_ONLY="${JAVA_TEST_RUN_ONLY//\//.}" + java-pkg-simple_src_test +} -- cgit v1.3.1