From 1a883b8d6dd5d4db4761e55f03add1ae05977431 Mon Sep 17 00:00:00 2001 From: "Alex Xu (Hello71)" Date: Fri, 22 Apr 2022 14:12:47 -0400 Subject: dev-java/openj9-openjdk: upgrade to *.0.32.0 --- dev-java/openj9-openjdk/Manifest | 10 +- .../openj9-openjdk/openj9-openjdk-11.0.30.1.ebuild | 313 -------------------- .../openj9-openjdk/openj9-openjdk-11.0.32.0.ebuild | 313 ++++++++++++++++++++ .../openj9-openjdk/openj9-openjdk-17.0.30.0.ebuild | 314 --------------------- .../openj9-openjdk/openj9-openjdk-17.0.32.0.ebuild | 314 +++++++++++++++++++++ 5 files changed, 631 insertions(+), 633 deletions(-) delete mode 100644 dev-java/openj9-openjdk/openj9-openjdk-11.0.30.1.ebuild create mode 100644 dev-java/openj9-openjdk/openj9-openjdk-11.0.32.0.ebuild delete mode 100644 dev-java/openj9-openjdk/openj9-openjdk-17.0.30.0.ebuild create mode 100644 dev-java/openj9-openjdk/openj9-openjdk-17.0.32.0.ebuild (limited to 'dev-java/openj9-openjdk') diff --git a/dev-java/openj9-openjdk/Manifest b/dev-java/openj9-openjdk/Manifest index d307305..1c1b7c0 100644 --- a/dev-java/openj9-openjdk/Manifest +++ b/dev-java/openj9-openjdk/Manifest @@ -1,6 +1,4 @@ -DIST openj9-0.30.0.tar.gz 16883499 BLAKE2B d6e518224aca5402a74fce20b457c71833f4c19f9c043607234b610bb544859ad0584a0bfb629976a35f22f8298d25c7799484ac75c35a0c94bb18ac144c10fe SHA512 9f4ea84f7d8e338e77e30e37d6d0ad952096a736d47d87f8893dda04735cd0e5e1fbd9e3901f46736645d39f7fadb374cda881df54e6f39f0bf27c4f564d43f9 -DIST openj9-0.30.1.tar.gz 16883383 BLAKE2B ff14a7b7b829a3044b133c5362ebca747cc433e2b89697bd3069b5873be0e9116e18b33e5738f5f989b9a32a2f381cbc3ea1cee34e6363386d27c367b30607c2 SHA512 a1232e9b6d14003a44360bc2c0a50a45134e27db3f894f1e65e7ccf4f1867b6e33d4977a7f08e4067c8c8072ace0cf12d8e06d434b7959042e8328f6a95c6035 -DIST openj9-omr-0.30.0.tar.gz 7857347 BLAKE2B 68e954a5f9360e18fd96d61d50fff46b0f7a53da4418e5e3f51e72da43536ff51b3b91fd3f76cc04922e5588c2b2b7802e0414d1a7858a1dd71dfe5bc77f7bc7 SHA512 c4778056c5edf1e40379ab1a16fd4ecf11789f5195ed4cd1860bcce7e52f9e158fb3d1c7bf83bc177a1ca7c140a31627d1414850c65e0459a935c405cc41095d -DIST openj9-omr-0.30.1.tar.gz 7858341 BLAKE2B f51dd1cc13d2b97477e83499ebf99ee699b5f4b58b76220c1c11d9d43976ea4e58f48dcabb8a06d13000ae9486a52881a2055b7398b5b948f0aa86562a82965f SHA512 8a579feb2d021e95c446c04e501eaf2a806efb39dec506024c58a8f64bcdada1d744ea9e9a250c431760585daff87b7480afbfd9947a27ae9dadf3efd4001150 -DIST openj9-openjdk-jdk11-openj9-0.30.1.tar.gz 109017465 BLAKE2B 292ae1e59a9e2fa6815f57e2646fde15fe7eed8f73c2abeb41db4466b1fd8efee7c95f54c98fd5a461f0f7f79aa6a27ef05db70c63d7d8a79d083d755db9f572 SHA512 38dfba678cf1f86ace465b9685152fb3191fbeb43f4d5ed313d0364629922ac85a98ef82064e1776e77ba93d5830c8caf86b6b9e3bb3c9a40ad4a534996bfcc7 -DIST openj9-openjdk-jdk17-openj9-0.30.0.tar.gz 93841453 BLAKE2B 48fa76809a7ebee24c6c5d1b411a58220c17c4c8eda09bffadec1ee8dd0c3d1c13e8f883b0ea7a91524fe179b3cbe15c57adb9838b12b7bae66fcaec1d4a408c SHA512 2e97beaee98f1b6f46fe7575a71d9a779008ce03cc5a79b5bf2b2ad4ed1e4130ef08d246ecaf3f0d2b2ae4f26fbf614ebcde9f38f06e688c083477065aa76d2c +DIST openj9-0.32.0.tar.gz 17217439 BLAKE2B ced6f66129b88d4c3def9f438cd95b98610be7edd66da0fedb9f8cc9c7a5357db49eeee0556ad3ccbdd2e6d5e999c1e75be24db28e963b48fc283bd94bb79466 SHA512 885e86e4a74b095aa333a9ad8456f28d5d0dce19e253af49e5a7fc8de9219e2352f7a52b4b6c043ff2d7882346277c7d3f11f6a1921202ffeb11f7a2c6898c6f +DIST openj9-omr-0.32.0.tar.gz 7873035 BLAKE2B 0344b4a07c1ad06aeb5e32bdd5485e49a495469906ae36a373d5809e7514b5177177cba61b21e38d4512c65c46e68ba678178ca732bcf92610011a879f04b015 SHA512 398c39d9db8ca3713d5fb4efb34f72820436a8839784a606504659a24a543ed4b8f28ddbd5fef38e7c1a6a55dd4ed6f59b45f6321361387d829f76fbdba6034b +DIST openj9-openjdk-jdk11-openj9-0.32.0.tar.gz 109076014 BLAKE2B 297fc7902fd3f194b948426cf5c3e6f130b81d7eb4dc2e752754ee4e7c72aa7ca36f5b4df985aea148002d557112763fad97c902fc029a41c441dc3a095fef9a SHA512 4f11715a33bec02bcf20657e69bf4b8bd0820aae5c7bf457aacf115cad654730ee151e9d57bfa6db6d33110178e0820c8a44fc850d2a5eb5064aaf51849bc176 +DIST openj9-openjdk-jdk17-openj9-0.32.0.tar.gz 93908310 BLAKE2B 56551dd892354e55d02f25db00df1f3142b41f29a5f45b2f015e45e0b7811b755f2d10f522f2382efef39bc6aa99db54c41f0b0c28dbda1d2439a0b74f687e5e SHA512 32c6f6f14f597ee5aaac66a3da37aaf989bd0f1ba542e3823e6fd788ebd341d04b440f165ceee033529fbb58c1b5227ed9de28bad2d9610706717bf313d7f18d diff --git a/dev-java/openj9-openjdk/openj9-openjdk-11.0.30.1.ebuild b/dev-java/openj9-openjdk/openj9-openjdk-11.0.30.1.ebuild deleted file mode 100644 index 18a4b68..0000000 --- a/dev-java/openj9-openjdk/openj9-openjdk-11.0.30.1.ebuild +++ /dev/null @@ -1,313 +0,0 @@ -# Copyright 1999-2020 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=6 - -inherit check-reqs eapi7-ver flag-o-matic java-pkg-2 java-vm-2 multiprocessing pax-utils toolchain-funcs - -SLOT="$(ver_cut 1)" -OPENJ9_PV="$(ver_cut 2-4)" -OPENJ9_P=openj9-${OPENJ9_PV} - -DESCRIPTION="Extensions for OpenJDK for Eclipse OpenJ9" -HOMEPAGE="https://www.eclipse.org/openj9/" -if [[ ${OPENJ9_PV} == 9999 ]]; then - inherit git-r3 - EGIT_REPO_URI="https://github.com/ibmruntimes/openj9-openjdk-jdk${SLOT}.git" - OPENJ9_EGIT_REPO_URI="https://github.com/eclipse/openj9.git" - OPENJ9_OMR_EGIT_REPO_URI="https://github.com/eclipse/openj9-omr.git" -else - SRC_URI=" - https://github.com/ibmruntimes/openj9-openjdk-jdk${SLOT}/archive/v${OPENJ9_PV}-release.tar.gz -> openj9-openjdk-jdk${SLOT}-${OPENJ9_P}.tar.gz - https://github.com/eclipse/openj9/archive/${OPENJ9_P}.tar.gz -> ${OPENJ9_P}.tar.gz - https://github.com/eclipse/openj9-omr/archive/${OPENJ9_P}.tar.gz -> openj9-omr-${OPENJ9_PV}.tar.gz - " -fi - -LICENSE="GPL-2" -KEYWORDS="~amd64" - -IUSE="alsa cups custom-optimization ddr debug doc gentoo-vm headless-awt javafx +jbootstrap selinux source systemtap" - -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 ) - - dev-libs/elfutils - ddr? ( dev-libs/libdwarf ) -" - -# 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 - dev-lang/nasm - 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}= ) - || ( - dev-java/openj9-openjdk-bin:${SLOT} - dev-java/openj9-openjdk:${SLOT} - dev-java/openjdk-bin:${SLOT} - dev-java/openjdk:${SLOT} - ) -" - -S="${WORKDIR}/openj9-openjdk-jdk${SLOT}-${OPENJ9_PV}-release" - -# The space required to build varies wildly depending on USE flags, -# ranging from 3GB to 16GB. This function is certainly not exact but -# should be close enough to be useful. -openjdk_check_requirements() { - local M - M=3192 - 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="openj9-openjdk-${SLOT} openj9-openjdk-bin-${SLOT} 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 [[ ${MERGE_TYPE} != binary ]]; then - if [[ -z ${JDK_HOME} ]]; then - for slot in ${SLOT} $((SLOT-1)); do - for variant in openj9- ''; do - if has_version --host-root dev-java/${variant}openjdk:${slot}; then - JDK_HOME=${EPREFIX}/usr/$(get_libdir)/${variant}openjdk-${slot} - break - elif has_version --host-root dev-java/${variant}openjdk-bin:${slot}; then - JDK_HOME=$(best_version --host-root dev-java/${variant}openjdk-bin:${slot}) - JDK_HOME=${JDK_HOME#*/} - JDK_HOME=${EPREFIX}/opt/${JDK_HOME%-r*} - break - fi - done - done - fi - [[ -n ${JDK_HOME} ]] || die "Build VM not found!" - export JDK_HOME - fi -} - -src_unpack() { - if [[ ${OPENJ9_PV} == 9999 ]]; then - EGIT_CHECKOUT_DIR=openj9 EGIT_REPO_URI=${OPENJ9_EGIT_REPO_URI} git-r3_src_unpack - EGIT_CHECKOUT_DIR=openj9-omr EGIT_REPO_URI=${OPENJ9_OMR_EGIT_REPO_URI} git-r3_src_unpack - # unpack openjdk last to save correct EGIT_VERSION - EGIT_CHECKOUT_DIR=${S} git-r3_src_unpack - else - default - fi -} - -src_prepare() { - if [[ ${OPENJ9_PV} == 9999 ]]; then - ln -s ../openj9 openj9 || die - ln -s ../openj9-omr omr || die - else - ln -s ../openj9-${OPENJ9_P} openj9 || die - ln -s ../openj9-omr-${OPENJ9_P} omr || die - fi - - default - - eapply -d openj9 -- "${FILESDIR}/openj9-no-o3.patch" - eapply -d omr -- "${FILESDIR}/omr-omrstr-iconv-failure-overflow.patch" - eapply -d omr -- "${FILESDIR}/omr-fam.patch" - - if [[ ${OPENJ9_PV} != 9999 ]]; then - sed -i -e '/^OPENJDK_SHA :=/s/:=.*/:= __OPENJDK_SHA__/' \ - -e '/^OPENJ9_SHA :=/s/:=.*/:= '${OPENJ9_P}/ \ - -e '/^OPENJ9_TAG :=/s/:=.*/:= '${OPENJ9_P}/ \ - -e '/^OPENJ9OMR_SHA :=/s/:=.*/:= '${OPENJ9_P}/ \ - closed/OpenJ9.gmk || die - fi - - find openj9/ omr/ -name CMakeLists.txt -exec sed -i -e '/set(OMR_WARNINGS_AS_ERRORS ON/s/ON/OFF/' {} + || die - - 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 - - use custom-optimization || filter-flags '-O*' - - # 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{,-omr,-openj9} - --enable-full-docs=no - --with-boot-jdk="${JDK_HOME}" - --with-extra-cflags="${CFLAGS}" - --with-extra-cxxflags="${CXXFLAGS}" - --with-extra-ldflags="${LDFLAGS}" - --with-stdc++lib=dynamic - --with-freetype=system - --with-giflib=system - --with-harfbuzz=system - --with-lcms=system - --with-libjpeg=system - --with-libpng=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-zlib=system - --enable-dtrace=$(usex systemtap yes no) - --enable-headless-only=$(usex headless-awt yes no) - $(tc-is-clang && echo "--with-toolchain-type=clang") - - --with-cmake - $(use_enable ddr) - ) - - 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 - - ( - unset _JAVA_OPTIONS JAVA JAVA_TOOL_OPTIONS JAVAC XARGS - CFLAGS= CXXFLAGS= LDFLAGS= \ - CONFIG_SITE=/dev/null \ - econf "${myconf[@]}" - ) -} - -src_compile() { - local mycmakeargsx=( - "-DCMAKE_C_FLAGS='${CFLAGS}'" - "-DJ9JIT_EXTRA_CFLAGS='${CFLAGS}'" - "-DCMAKE_CXX_FLAGS='${CXXFLAGS}'" - "-DJ9JIT_EXTRA_CXXFLAGS='${CXXFLAGS}'" - "-DCMAKE_EXE_LINKER_FLAGS='${LDFLAGS}'" - -DOMR_WARNINGS_AS_ERRORS=OFF - ) - local myemakeargs=( - JOBS=$(makeopts_jobs) - LOG=debug - $(usex doc docs '') - $(usex jbootstrap bootcycle-images product-images) - - EXTRA_CMAKE_ARGS="${mycmakeargsx[*]}" - ) - 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 source ; then - rm -v lib/src.zip || die - fi - - rm -v lib/security/cacerts || die - - dodir "${dest}" - cp -pPR * "${ddest}" || die - - dosym ../../../../../etc/ssl/certs/java/cacerts "${dest}"/lib/security/cacerts - - # must be done before running itself - java-vm_set-pax-markings "${ddest}" - - use gentoo-vm && 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 -} diff --git a/dev-java/openj9-openjdk/openj9-openjdk-11.0.32.0.ebuild b/dev-java/openj9-openjdk/openj9-openjdk-11.0.32.0.ebuild new file mode 100644 index 0000000..18a4b68 --- /dev/null +++ b/dev-java/openj9-openjdk/openj9-openjdk-11.0.32.0.ebuild @@ -0,0 +1,313 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +inherit check-reqs eapi7-ver flag-o-matic java-pkg-2 java-vm-2 multiprocessing pax-utils toolchain-funcs + +SLOT="$(ver_cut 1)" +OPENJ9_PV="$(ver_cut 2-4)" +OPENJ9_P=openj9-${OPENJ9_PV} + +DESCRIPTION="Extensions for OpenJDK for Eclipse OpenJ9" +HOMEPAGE="https://www.eclipse.org/openj9/" +if [[ ${OPENJ9_PV} == 9999 ]]; then + inherit git-r3 + EGIT_REPO_URI="https://github.com/ibmruntimes/openj9-openjdk-jdk${SLOT}.git" + OPENJ9_EGIT_REPO_URI="https://github.com/eclipse/openj9.git" + OPENJ9_OMR_EGIT_REPO_URI="https://github.com/eclipse/openj9-omr.git" +else + SRC_URI=" + https://github.com/ibmruntimes/openj9-openjdk-jdk${SLOT}/archive/v${OPENJ9_PV}-release.tar.gz -> openj9-openjdk-jdk${SLOT}-${OPENJ9_P}.tar.gz + https://github.com/eclipse/openj9/archive/${OPENJ9_P}.tar.gz -> ${OPENJ9_P}.tar.gz + https://github.com/eclipse/openj9-omr/archive/${OPENJ9_P}.tar.gz -> openj9-omr-${OPENJ9_PV}.tar.gz + " +fi + +LICENSE="GPL-2" +KEYWORDS="~amd64" + +IUSE="alsa cups custom-optimization ddr debug doc gentoo-vm headless-awt javafx +jbootstrap selinux source systemtap" + +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 ) + + dev-libs/elfutils + ddr? ( dev-libs/libdwarf ) +" + +# 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 + dev-lang/nasm + 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}= ) + || ( + dev-java/openj9-openjdk-bin:${SLOT} + dev-java/openj9-openjdk:${SLOT} + dev-java/openjdk-bin:${SLOT} + dev-java/openjdk:${SLOT} + ) +" + +S="${WORKDIR}/openj9-openjdk-jdk${SLOT}-${OPENJ9_PV}-release" + +# The space required to build varies wildly depending on USE flags, +# ranging from 3GB to 16GB. This function is certainly not exact but +# should be close enough to be useful. +openjdk_check_requirements() { + local M + M=3192 + 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="openj9-openjdk-${SLOT} openj9-openjdk-bin-${SLOT} 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 [[ ${MERGE_TYPE} != binary ]]; then + if [[ -z ${JDK_HOME} ]]; then + for slot in ${SLOT} $((SLOT-1)); do + for variant in openj9- ''; do + if has_version --host-root dev-java/${variant}openjdk:${slot}; then + JDK_HOME=${EPREFIX}/usr/$(get_libdir)/${variant}openjdk-${slot} + break + elif has_version --host-root dev-java/${variant}openjdk-bin:${slot}; then + JDK_HOME=$(best_version --host-root dev-java/${variant}openjdk-bin:${slot}) + JDK_HOME=${JDK_HOME#*/} + JDK_HOME=${EPREFIX}/opt/${JDK_HOME%-r*} + break + fi + done + done + fi + [[ -n ${JDK_HOME} ]] || die "Build VM not found!" + export JDK_HOME + fi +} + +src_unpack() { + if [[ ${OPENJ9_PV} == 9999 ]]; then + EGIT_CHECKOUT_DIR=openj9 EGIT_REPO_URI=${OPENJ9_EGIT_REPO_URI} git-r3_src_unpack + EGIT_CHECKOUT_DIR=openj9-omr EGIT_REPO_URI=${OPENJ9_OMR_EGIT_REPO_URI} git-r3_src_unpack + # unpack openjdk last to save correct EGIT_VERSION + EGIT_CHECKOUT_DIR=${S} git-r3_src_unpack + else + default + fi +} + +src_prepare() { + if [[ ${OPENJ9_PV} == 9999 ]]; then + ln -s ../openj9 openj9 || die + ln -s ../openj9-omr omr || die + else + ln -s ../openj9-${OPENJ9_P} openj9 || die + ln -s ../openj9-omr-${OPENJ9_P} omr || die + fi + + default + + eapply -d openj9 -- "${FILESDIR}/openj9-no-o3.patch" + eapply -d omr -- "${FILESDIR}/omr-omrstr-iconv-failure-overflow.patch" + eapply -d omr -- "${FILESDIR}/omr-fam.patch" + + if [[ ${OPENJ9_PV} != 9999 ]]; then + sed -i -e '/^OPENJDK_SHA :=/s/:=.*/:= __OPENJDK_SHA__/' \ + -e '/^OPENJ9_SHA :=/s/:=.*/:= '${OPENJ9_P}/ \ + -e '/^OPENJ9_TAG :=/s/:=.*/:= '${OPENJ9_P}/ \ + -e '/^OPENJ9OMR_SHA :=/s/:=.*/:= '${OPENJ9_P}/ \ + closed/OpenJ9.gmk || die + fi + + find openj9/ omr/ -name CMakeLists.txt -exec sed -i -e '/set(OMR_WARNINGS_AS_ERRORS ON/s/ON/OFF/' {} + || die + + 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 + + use custom-optimization || filter-flags '-O*' + + # 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{,-omr,-openj9} + --enable-full-docs=no + --with-boot-jdk="${JDK_HOME}" + --with-extra-cflags="${CFLAGS}" + --with-extra-cxxflags="${CXXFLAGS}" + --with-extra-ldflags="${LDFLAGS}" + --with-stdc++lib=dynamic + --with-freetype=system + --with-giflib=system + --with-harfbuzz=system + --with-lcms=system + --with-libjpeg=system + --with-libpng=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-zlib=system + --enable-dtrace=$(usex systemtap yes no) + --enable-headless-only=$(usex headless-awt yes no) + $(tc-is-clang && echo "--with-toolchain-type=clang") + + --with-cmake + $(use_enable ddr) + ) + + 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 + + ( + unset _JAVA_OPTIONS JAVA JAVA_TOOL_OPTIONS JAVAC XARGS + CFLAGS= CXXFLAGS= LDFLAGS= \ + CONFIG_SITE=/dev/null \ + econf "${myconf[@]}" + ) +} + +src_compile() { + local mycmakeargsx=( + "-DCMAKE_C_FLAGS='${CFLAGS}'" + "-DJ9JIT_EXTRA_CFLAGS='${CFLAGS}'" + "-DCMAKE_CXX_FLAGS='${CXXFLAGS}'" + "-DJ9JIT_EXTRA_CXXFLAGS='${CXXFLAGS}'" + "-DCMAKE_EXE_LINKER_FLAGS='${LDFLAGS}'" + -DOMR_WARNINGS_AS_ERRORS=OFF + ) + local myemakeargs=( + JOBS=$(makeopts_jobs) + LOG=debug + $(usex doc docs '') + $(usex jbootstrap bootcycle-images product-images) + + EXTRA_CMAKE_ARGS="${mycmakeargsx[*]}" + ) + 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 source ; then + rm -v lib/src.zip || die + fi + + rm -v lib/security/cacerts || die + + dodir "${dest}" + cp -pPR * "${ddest}" || die + + dosym ../../../../../etc/ssl/certs/java/cacerts "${dest}"/lib/security/cacerts + + # must be done before running itself + java-vm_set-pax-markings "${ddest}" + + use gentoo-vm && 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 +} diff --git a/dev-java/openj9-openjdk/openj9-openjdk-17.0.30.0.ebuild b/dev-java/openj9-openjdk/openj9-openjdk-17.0.30.0.ebuild deleted file mode 100644 index 2c42e9a..0000000 --- a/dev-java/openj9-openjdk/openj9-openjdk-17.0.30.0.ebuild +++ /dev/null @@ -1,314 +0,0 @@ -# Copyright 1999-2020 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=6 - -inherit check-reqs eapi7-ver flag-o-matic java-pkg-2 java-vm-2 multiprocessing pax-utils toolchain-funcs - -SLOT="$(ver_cut 1)" -OPENJ9_PV="$(ver_cut 2-4)" -OPENJ9_P=openj9-${OPENJ9_PV} - -DESCRIPTION="Extensions for OpenJDK for Eclipse OpenJ9" -HOMEPAGE="https://www.eclipse.org/openj9/" -if [[ ${OPENJ9_PV} == 9999 ]]; then - inherit git-r3 - EGIT_REPO_URI="https://github.com/ibmruntimes/openj9-openjdk-jdk${SLOT}.git" - OPENJ9_EGIT_REPO_URI="https://github.com/eclipse/openj9.git" - OPENJ9_OMR_EGIT_REPO_URI="https://github.com/eclipse/openj9-omr.git" -else - SRC_URI=" - https://github.com/ibmruntimes/openj9-openjdk-jdk${SLOT}/archive/v${OPENJ9_PV}-release.tar.gz -> openj9-openjdk-jdk${SLOT}-${OPENJ9_P}.tar.gz - https://github.com/eclipse/openj9/archive/${OPENJ9_P}.tar.gz -> ${OPENJ9_P}.tar.gz - https://github.com/eclipse/openj9-omr/archive/${OPENJ9_P}.tar.gz -> openj9-omr-${OPENJ9_PV}.tar.gz - " -fi - -LICENSE="GPL-2" -KEYWORDS="~amd64" - -IUSE="alsa cups ddr debug doc gentoo-vm headless-awt javafx +jbootstrap numa selinux source systemtap" - -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 ) - - dev-libs/elfutils - ddr? ( dev-libs/libdwarf ) - numa? ( sys-process/numactl ) -" - -# 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 - dev-lang/nasm - 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}= ) - || ( - dev-java/openj9-openjdk-bin:${SLOT} - dev-java/openj9-openjdk:${SLOT} - dev-java/openjdk-bin:${SLOT} - dev-java/openjdk:${SLOT} - ) -" - -S="${WORKDIR}/openj9-openjdk-jdk${SLOT}-${OPENJ9_PV}-release" - -# The space required to build varies wildly depending on USE flags, -# ranging from 3GB to 16GB. This function is certainly not exact but -# should be close enough to be useful. -openjdk_check_requirements() { - local M - M=3192 - 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="openj9-openjdk-${SLOT} openj9-openjdk-bin-${SLOT} 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 [[ ${MERGE_TYPE} != binary ]]; then - if [[ -z ${JDK_HOME} ]]; then - for slot in ${SLOT} $((SLOT-1)); do - for variant in openj9- ''; do - if has_version --host-root dev-java/${variant}openjdk:${slot}; then - JDK_HOME=${EPREFIX}/usr/$(get_libdir)/${variant}openjdk-${slot} - break - elif has_version --host-root dev-java/${variant}openjdk-bin:${slot}; then - JDK_HOME=$(best_version --host-root dev-java/${variant}openjdk-bin:${slot}) - JDK_HOME=${JDK_HOME#*/} - JDK_HOME=${EPREFIX}/opt/${JDK_HOME%-r*} - break - fi - done - done - fi - [[ -n ${JDK_HOME} ]] || die "Build VM not found!" - export JDK_HOME - fi -} - -src_unpack() { - if [[ ${OPENJ9_PV} == 9999 ]]; then - EGIT_CHECKOUT_DIR=openj9 EGIT_REPO_URI=${OPENJ9_EGIT_REPO_URI} git-r3_src_unpack - EGIT_CHECKOUT_DIR=openj9-omr EGIT_REPO_URI=${OPENJ9_OMR_EGIT_REPO_URI} git-r3_src_unpack - # unpack openjdk last to save correct EGIT_VERSION - EGIT_CHECKOUT_DIR=${S} git-r3_src_unpack - else - default - fi -} - -src_prepare() { - if [[ ${OPENJ9_PV} == 9999 ]]; then - ln -s ../openj9 openj9 || die - ln -s ../openj9-omr omr || die - else - ln -s ../openj9-${OPENJ9_P} openj9 || die - ln -s ../openj9-omr-${OPENJ9_P} omr || die - fi - - default - - eapply -d openj9 -- "${FILESDIR}/openj9-no-o3.patch" - eapply -d omr -- "${FILESDIR}/omr-omrstr-iconv-failure-overflow.patch" - eapply -d omr -- "${FILESDIR}/omr-fam.patch" - - if [[ ${OPENJ9_PV} != 9999 ]]; then - sed -i -e '/^OPENJDK_SHA :=/s/:=.*/:= __OPENJDK_SHA__/' \ - -e '/^OPENJ9_SHA :=/s/:=.*/:= '${OPENJ9_P}/ \ - -e '/^OPENJ9_TAG :=/s/:=.*/:= '${OPENJ9_P}/ \ - -e '/^OPENJ9OMR_SHA :=/s/:=.*/:= '${OPENJ9_P}/ \ - closed/OpenJ9.gmk || die - fi - - find openj9/ omr/ -name CMakeLists.txt -exec sed -i -e '/set(OMR_WARNINGS_AS_ERRORS ON/s/ON/OFF/' {} + || die - sed -i -e '/^ OPENJ9_CONFIGURE_NUMA$/d' closed/autoconf/custom-hook.m4 || die - - 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 - - # 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{,-omr,-openj9} - --enable-full-docs=no - --with-boot-jdk="${JDK_HOME}" - --with-extra-cflags="${CFLAGS}" - --with-extra-cxxflags="${CXXFLAGS}" - --with-extra-ldflags="${LDFLAGS}" - --with-stdc++lib=dynamic - --with-freetype=system - --with-giflib=system - --with-harfbuzz=system - --with-lcms=system - --with-libjpeg=system - --with-libpng=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-zlib=system - --enable-dtrace=$(usex systemtap yes no) - --enable-headless-only=$(usex headless-awt yes no) - $(tc-is-clang && echo "--with-toolchain-type=clang") - - --with-cmake - $(use_enable ddr) - ) - - 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 - - ( - unset _JAVA_OPTIONS JAVA JAVA_TOOL_OPTIONS JAVAC XARGS - CFLAGS= CXXFLAGS= LDFLAGS= \ - CONFIG_SITE=/dev/null \ - econf "${myconf[@]}" - ) -} - -src_compile() { - local mycmakeargsx=( - "-DCMAKE_C_FLAGS='${CFLAGS}'" - "-DJ9JIT_EXTRA_CFLAGS='${CFLAGS}'" - "-DCMAKE_CXX_FLAGS='${CXXFLAGS}'" - "-DJ9JIT_EXTRA_CXXFLAGS='${CXXFLAGS}'" - "-DCMAKE_EXE_LINKER_FLAGS='${LDFLAGS}'" - -DOMR_WARNINGS_AS_ERRORS=OFF - -DOMR_PORT_NUMA_SUPPORT=$(usex numa) - ) - local myemakeargs=( - JOBS=$(makeopts_jobs) - LOG=debug - $(usex doc docs '') - $(usex jbootstrap bootcycle-images product-images) - - EXTRA_CMAKE_ARGS="${mycmakeargsx[*]}" - ) - 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 source ; then - rm -v lib/src.zip || die - fi - - rm -v lib/security/cacerts || die - - dodir "${dest}" - cp -pPR * "${ddest}" || die - - dosym ../../../../../etc/ssl/certs/java/cacerts "${dest}"/lib/security/cacerts - - # must be done before running itself - java-vm_set-pax-markings "${ddest}" - - use gentoo-vm && 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 -} diff --git a/dev-java/openj9-openjdk/openj9-openjdk-17.0.32.0.ebuild b/dev-java/openj9-openjdk/openj9-openjdk-17.0.32.0.ebuild new file mode 100644 index 0000000..2c42e9a --- /dev/null +++ b/dev-java/openj9-openjdk/openj9-openjdk-17.0.32.0.ebuild @@ -0,0 +1,314 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +inherit check-reqs eapi7-ver flag-o-matic java-pkg-2 java-vm-2 multiprocessing pax-utils toolchain-funcs + +SLOT="$(ver_cut 1)" +OPENJ9_PV="$(ver_cut 2-4)" +OPENJ9_P=openj9-${OPENJ9_PV} + +DESCRIPTION="Extensions for OpenJDK for Eclipse OpenJ9" +HOMEPAGE="https://www.eclipse.org/openj9/" +if [[ ${OPENJ9_PV} == 9999 ]]; then + inherit git-r3 + EGIT_REPO_URI="https://github.com/ibmruntimes/openj9-openjdk-jdk${SLOT}.git" + OPENJ9_EGIT_REPO_URI="https://github.com/eclipse/openj9.git" + OPENJ9_OMR_EGIT_REPO_URI="https://github.com/eclipse/openj9-omr.git" +else + SRC_URI=" + https://github.com/ibmruntimes/openj9-openjdk-jdk${SLOT}/archive/v${OPENJ9_PV}-release.tar.gz -> openj9-openjdk-jdk${SLOT}-${OPENJ9_P}.tar.gz + https://github.com/eclipse/openj9/archive/${OPENJ9_P}.tar.gz -> ${OPENJ9_P}.tar.gz + https://github.com/eclipse/openj9-omr/archive/${OPENJ9_P}.tar.gz -> openj9-omr-${OPENJ9_PV}.tar.gz + " +fi + +LICENSE="GPL-2" +KEYWORDS="~amd64" + +IUSE="alsa cups ddr debug doc gentoo-vm headless-awt javafx +jbootstrap numa selinux source systemtap" + +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 ) + + dev-libs/elfutils + ddr? ( dev-libs/libdwarf ) + numa? ( sys-process/numactl ) +" + +# 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 + dev-lang/nasm + 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}= ) + || ( + dev-java/openj9-openjdk-bin:${SLOT} + dev-java/openj9-openjdk:${SLOT} + dev-java/openjdk-bin:${SLOT} + dev-java/openjdk:${SLOT} + ) +" + +S="${WORKDIR}/openj9-openjdk-jdk${SLOT}-${OPENJ9_PV}-release" + +# The space required to build varies wildly depending on USE flags, +# ranging from 3GB to 16GB. This function is certainly not exact but +# should be close enough to be useful. +openjdk_check_requirements() { + local M + M=3192 + 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="openj9-openjdk-${SLOT} openj9-openjdk-bin-${SLOT} 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 [[ ${MERGE_TYPE} != binary ]]; then + if [[ -z ${JDK_HOME} ]]; then + for slot in ${SLOT} $((SLOT-1)); do + for variant in openj9- ''; do + if has_version --host-root dev-java/${variant}openjdk:${slot}; then + JDK_HOME=${EPREFIX}/usr/$(get_libdir)/${variant}openjdk-${slot} + break + elif has_version --host-root dev-java/${variant}openjdk-bin:${slot}; then + JDK_HOME=$(best_version --host-root dev-java/${variant}openjdk-bin:${slot}) + JDK_HOME=${JDK_HOME#*/} + JDK_HOME=${EPREFIX}/opt/${JDK_HOME%-r*} + break + fi + done + done + fi + [[ -n ${JDK_HOME} ]] || die "Build VM not found!" + export JDK_HOME + fi +} + +src_unpack() { + if [[ ${OPENJ9_PV} == 9999 ]]; then + EGIT_CHECKOUT_DIR=openj9 EGIT_REPO_URI=${OPENJ9_EGIT_REPO_URI} git-r3_src_unpack + EGIT_CHECKOUT_DIR=openj9-omr EGIT_REPO_URI=${OPENJ9_OMR_EGIT_REPO_URI} git-r3_src_unpack + # unpack openjdk last to save correct EGIT_VERSION + EGIT_CHECKOUT_DIR=${S} git-r3_src_unpack + else + default + fi +} + +src_prepare() { + if [[ ${OPENJ9_PV} == 9999 ]]; then + ln -s ../openj9 openj9 || die + ln -s ../openj9-omr omr || die + else + ln -s ../openj9-${OPENJ9_P} openj9 || die + ln -s ../openj9-omr-${OPENJ9_P} omr || die + fi + + default + + eapply -d openj9 -- "${FILESDIR}/openj9-no-o3.patch" + eapply -d omr -- "${FILESDIR}/omr-omrstr-iconv-failure-overflow.patch" + eapply -d omr -- "${FILESDIR}/omr-fam.patch" + + if [[ ${OPENJ9_PV} != 9999 ]]; then + sed -i -e '/^OPENJDK_SHA :=/s/:=.*/:= __OPENJDK_SHA__/' \ + -e '/^OPENJ9_SHA :=/s/:=.*/:= '${OPENJ9_P}/ \ + -e '/^OPENJ9_TAG :=/s/:=.*/:= '${OPENJ9_P}/ \ + -e '/^OPENJ9OMR_SHA :=/s/:=.*/:= '${OPENJ9_P}/ \ + closed/OpenJ9.gmk || die + fi + + find openj9/ omr/ -name CMakeLists.txt -exec sed -i -e '/set(OMR_WARNINGS_AS_ERRORS ON/s/ON/OFF/' {} + || die + sed -i -e '/^ OPENJ9_CONFIGURE_NUMA$/d' closed/autoconf/custom-hook.m4 || die + + 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 + + # 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{,-omr,-openj9} + --enable-full-docs=no + --with-boot-jdk="${JDK_HOME}" + --with-extra-cflags="${CFLAGS}" + --with-extra-cxxflags="${CXXFLAGS}" + --with-extra-ldflags="${LDFLAGS}" + --with-stdc++lib=dynamic + --with-freetype=system + --with-giflib=system + --with-harfbuzz=system + --with-lcms=system + --with-libjpeg=system + --with-libpng=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-zlib=system + --enable-dtrace=$(usex systemtap yes no) + --enable-headless-only=$(usex headless-awt yes no) + $(tc-is-clang && echo "--with-toolchain-type=clang") + + --with-cmake + $(use_enable ddr) + ) + + 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 + + ( + unset _JAVA_OPTIONS JAVA JAVA_TOOL_OPTIONS JAVAC XARGS + CFLAGS= CXXFLAGS= LDFLAGS= \ + CONFIG_SITE=/dev/null \ + econf "${myconf[@]}" + ) +} + +src_compile() { + local mycmakeargsx=( + "-DCMAKE_C_FLAGS='${CFLAGS}'" + "-DJ9JIT_EXTRA_CFLAGS='${CFLAGS}'" + "-DCMAKE_CXX_FLAGS='${CXXFLAGS}'" + "-DJ9JIT_EXTRA_CXXFLAGS='${CXXFLAGS}'" + "-DCMAKE_EXE_LINKER_FLAGS='${LDFLAGS}'" + -DOMR_WARNINGS_AS_ERRORS=OFF + -DOMR_PORT_NUMA_SUPPORT=$(usex numa) + ) + local myemakeargs=( + JOBS=$(makeopts_jobs) + LOG=debug + $(usex doc docs '') + $(usex jbootstrap bootcycle-images product-images) + + EXTRA_CMAKE_ARGS="${mycmakeargsx[*]}" + ) + 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 source ; then + rm -v lib/src.zip || die + fi + + rm -v lib/security/cacerts || die + + dodir "${dest}" + cp -pPR * "${ddest}" || die + + dosym ../../../../../etc/ssl/certs/java/cacerts "${dest}"/lib/security/cacerts + + # must be done before running itself + java-vm_set-pax-markings "${ddest}" + + use gentoo-vm && 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 +} -- cgit v1.2.3-70-g09d2