commit:     eecdd44656b679a43d928ecb104aa9eda97e3f68
Author:     Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
AuthorDate: Wed May 11 19:25:39 2022 +0000
Commit:     Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
CommitDate: Wed May 11 20:14:15 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=eecdd446

dev-java/openjdk: add 17.0.3_p7

Signed-off-by: Georgy Yakovlev <gyakovlev <AT> gentoo.org>

 dev-java/openjdk/Manifest                 |   1 +
 dev-java/openjdk/openjdk-17.0.3_p7.ebuild | 313 ++++++++++++++++++++++++++++++
 2 files changed, 314 insertions(+)

diff --git a/dev-java/openjdk/Manifest b/dev-java/openjdk/Manifest
index a49747246ee3..47027360af4b 100644
--- a/dev-java/openjdk/Manifest
+++ b/dev-java/openjdk/Manifest
@@ -2,6 +2,7 @@ DIST openjdk-11.0.14-riscv.patch.xz 279088 BLAKE2B 
f67cf5707246b22285de8217b68fb
 DIST openjdk-11.0.14_p9.tar.gz 122803178 BLAKE2B 
521d7829b34fa4f9a143c51d61c339c8c7455f12c4f04eda4fdd687dafa842f2a1b1adfe2e897fecdfa4e1c3ee484ec0e3aaf38ab9246f20cd24e7185db6ba25
 SHA512 
3285d13ba0fbbfd4f1a676b0f099b0742527ff556edfc3387913b59b64126bdfecd2697d7ac83634ed7160adf46edca3b5b2c33d94e9dca068752da5b9d70837
 DIST openjdk-11.0.15_p10.tar.gz 122902351 BLAKE2B 
a2dabad415a92765d548b19261e22e2cd483a17b478c8ef98342b44e88b39b23d89d31aecc80f93b27fce8df50ba41f4e6e5f10b66035bbfc1e0c03fc4707a40
 SHA512 
9d9e631046769d3ad95229172f392649ef4162161eb2d6fa7371665619600a04db440e1b3d30c580e283ad2b6bd7580d1199fc854fad3cb962d79f18b2347c67
 DIST openjdk-17.0.2_p8.tar.gz 104741920 BLAKE2B 
749b1699f1b4b2bb6ee1139ceb704ba3b3f3789770176e5f0dc4b1d5ce5c2887514fc3c256a64f2ad9bb017339c20ef10110f35b523ee1edcd62924e41f44f03
 SHA512 
8eeb8b56410178179cc95aa02b0bf827fac3fbf6242a905502a6594763be809a727e55e87866ac65be56c22d6f78ec0c483bdaab9411f07d4b160c49b06921fa
+DIST openjdk-17.0.3_p7.tar.gz 104797560 BLAKE2B 
025ff6be360c74288990622bce31769e5780f3f326b0eed2b78a776cc4df8bdf8cb99dfb0d7dd3f03f8558ca9a66acc5c5bd04b227ba4dffe18f8586a287b74b
 SHA512 
3bebaaf0469cd6558a3f033b768005e880ec95d5bb2a24b8929d2f6a05f18ca9977b291ad49b220a904f661cf6b47780a1cfd776109ed11d4e34d5345be8f66c
 DIST openjdk-8.322_p06.tar.gz 88114268 BLAKE2B 
206b8373bacd829682e9203d9fbb14240994b63b7ddb3675cd3380ee7a4ab9c9016cdcc278b63d3110652ad02587d3c7965bc9865fed6c9ddd720e79bb917c71
 SHA512 
877b56bb11daf7295bd08d2a310cb4dc0478ac7465d4e7f88ba9b9ab2715761b2e83d2e47fb03dc82ec1f1651c9c0772f048360e1f71c0f91a19bda4b46cbcfc
 DIST openjdk-8.332_p09.tar.gz 88130953 BLAKE2B 
9c7419851588dfbca92610f8fbb8b74fa7516282f82e8c7c37af88c776ba0c83a22fb3d4a1c2c2b98d44e394025217d095cff9c79fba53f9c5a32a43eb91ad70
 SHA512 
f6a717f77cc0e85bc2eb3c3c599d09e06a4004e4987a2caf0773b1197336722469e2abcca9d39c1f4c534d15cd77408d6405c9ee6edb3815bccd8e4872571aaa
 DIST openjdk-bootstrap-11.0.13_p8-ppc64.tar.xz 108215404 BLAKE2B 
5e6c0b905b34b437137922b73a9724da96b8832186fea945f8c73d941db822ca1cc5718f3ecb4607ed98d1f8241c9f365b54caaf978863e8b84680a94f067b5d
 SHA512 
732e2220219d42be10589fcaf2420da87ebc8564b4afc6bd02f61f31cdca9c31b339366e34d374fb814499b92f8aa796435a18f28e10c8cb00d9a0f5953bb60e

diff --git a/dev-java/openjdk/openjdk-17.0.3_p7.ebuild 
b/dev-java/openjdk/openjdk-17.0.3_p7.ebuild
new file mode 100644
index 000000000000..5e8f8d958a2a
--- /dev/null
+++ b/dev-java/openjdk/openjdk-17.0.3_p7.ebuild
@@ -0,0 +1,313 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit check-reqs eapi8-dosym flag-o-matic java-pkg-2 java-vm-2 
multiprocessing toolchain-funcs
+
+# variable name format: <UPPERCASE_KEYWORD>_XPAK
+ARM64_XPAK="17.0.2_p8" # musl bootstrap install
+PPC64_XPAK="17.0.1_p12" # big-endian bootstrap tarball
+X86_XPAK="17.0.1_p12"
+
+# Usage: bootstrap_uri <keyword> <version> [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:+) })"
+}
+
+MY_PV="${PV//_p/+}"
+SLOT="$(ver_cut 1)"
+
+DESCRIPTION="Open source implementation of the Java programming language"
+HOMEPAGE="https://openjdk.java.net";
+SRC_URI="
+       
https://github.com/${PN}/jdk${SLOT}u/archive/refs/tags/jdk-${MY_PV}.tar.gz
+               -> ${P}.tar.gz
+       !system-bootstrap? (
+               $(bootstrap_uri arm64 ${ARM64_XPAK} elibc_musl)
+               $(bootstrap_uri ppc64 ${PPC64_XPAK} big-endian)
+               $(bootstrap_uri x86 ${X86_XPAK})
+       )
+"
+
+LICENSE="GPL-2"
+KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~x86"
+
+IUSE="alsa big-endian cups debug doc examples gentoo-vm headless-awt javafx 
+jbootstrap selinux source system-bootstrap systemtap"
+
+REQUIRED_USE="
+       javafx? ( alsa !headless-awt )
+       !system-bootstrap? ( jbootstrap )
+"
+
+COMMON_DEPEND="
+       media-libs/freetype:2=
+       media-libs/giflib:0/7
+       media-libs/harfbuzz:=
+       media-libs/libpng:0=
+       media-libs/lcms:2=
+       sys-libs/zlib
+       virtual/jpeg:0=
+       systemtap? ( dev-util/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}
+               )
+       )
+"
+
+S="${WORKDIR}/jdk${SLOT}u-jdk-${MY_PV//+/-}"
+
+# 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
+
+       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 ${EPREFIX}/usr/lib/jvm/${vm} ]]; then
+                       java-pkg-2_pkg_setup
+                       return
+               fi
+       done
+
+       if has_version dev-java/openjdk:${SLOT}; then
+               export JDK_HOME=${EPREFIX}/usr/$(get_libdir)/openjdk-${SLOT}
+       elif use !system-bootstrap ; then
+               local xpakvar="${ARCH^^}_XPAK"
+               export JDK_HOME="${WORKDIR}/openjdk-bootstrap-${!xpakvar}"
+       else
+               if [[ ${MERGE_TYPE} != "binary" ]]; then
+                       JDK_HOME=$(best_version dev-java/openjdk-bin:${SLOT})
+                       [[ -n ${JDK_HOME} ]] || die "Build VM not found!"
+                       JDK_HOME=${JDK_HOME#*/}
+                       JDK_HOME=${EPREFIX}/opt/${JDK_HOME%-r*}
+                       export JDK_HOME
+               fi
+       fi
+}
+
+src_prepare() {
+       default
+       chmod +x configure || die
+}
+
+src_configure() {
+       # Work around stack alignment issue, bug #647954. in case we ever have 
x86
+       use x86 && append-flags -mincoming-stack-boundary=2
+
+       # Work around -fno-common ( GCC10 default ), bug #713180
+       append-flags -fcommon
+
+       # Strip some flags users may set, but should not. #818502
+       filter-flags -fexceptions
+
+       # 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.
+
+       local 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-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="${PV%_p*}"
+               --with-version-build="${PV#*_p}"
+               --with-zlib="${XPAK_BOOTSTRAP:-system}"
+               --enable-dtrace=$(usex systemtap yes no)
+               --enable-headless-only=$(usex headless-awt yes no)
+               $(tc-is-clang && echo "--with-toolchain-type=clang")
+       )
+
+       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
+
+       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() {
+       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 #nowarn
+}
+
+src_install() {
+       local dest="/usr/$(get_libdir)/${PN}-${SLOT}"
+       local ddest="${ED}/${dest#/}"
+
+       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
+
+       use gentoo-vm && java-vm_install-env "${FILESDIR}"/${PN}-${SLOT}.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
+
+       if use gentoo-vm ; then
+               ewarn "WARNING! You have enabled the gentoo-vm USE flag, making 
this JDK"
+               ewarn "recognised by the system. This will almost certainly 
break"
+               ewarn "many java ebuilds as they are not ready for 
openjdk-${SLOT}"
+       else
+               ewarn "The experimental gentoo-vm USE flag has not been enabled 
so this JDK"
+               ewarn "will not be recognised by the system. For example, 
simply calling"
+               ewarn "\"java\" will launch a different JVM. This is necessary 
until Gentoo"
+               ewarn "fully supports Java ${SLOT}. This JDK must therefore be 
invoked using its"
+               ewarn "absolute location under 
${EPREFIX}/usr/$(get_libdir)/${PN}-${SLOT}."
+       fi
+}

Reply via email to