From 9b306f5f6172c85cf0575ae2a8e23dd4fd607c89 Mon Sep 17 00:00:00 2001 From: "Alex Xu (Hello71)" Date: Wed, 10 Aug 2022 15:28:18 -0400 Subject: dev-java/openj9-openjdk: upgrade to 0.33.0 --- dev-java/openj9-openjdk/Manifest | 8 +- dev-java/openj9-openjdk/files/omr-fam.patch | 70 ----- dev-java/openj9-openjdk/files/openj9-no-o3.patch | 11 +- .../files/openj9-openjdk-override-version.patch | 11 + .../openj9-openjdk/files/openj9-openjdk.env.sh | 3 - .../openj9-openjdk/openj9-openjdk-11.0.32.0.ebuild | 286 ------------------- .../openj9-openjdk/openj9-openjdk-11.0.33.0.ebuild | 290 +++++++++++++++++++ .../openj9-openjdk/openj9-openjdk-17.0.32.0.ebuild | 314 -------------------- .../openj9-openjdk/openj9-openjdk-17.0.33.0.ebuild | 315 +++++++++++++++++++++ 9 files changed, 625 insertions(+), 683 deletions(-) delete mode 100644 dev-java/openj9-openjdk/files/omr-fam.patch create mode 100644 dev-java/openj9-openjdk/files/openj9-openjdk-override-version.patch delete mode 100644 dev-java/openj9-openjdk/openj9-openjdk-11.0.32.0.ebuild create mode 100644 dev-java/openj9-openjdk/openj9-openjdk-11.0.33.0.ebuild delete mode 100644 dev-java/openj9-openjdk/openj9-openjdk-17.0.32.0.ebuild create mode 100644 dev-java/openj9-openjdk/openj9-openjdk-17.0.33.0.ebuild (limited to 'dev-java') diff --git a/dev-java/openj9-openjdk/Manifest b/dev-java/openj9-openjdk/Manifest index 1c1b7c0..50bce3a 100644 --- a/dev-java/openj9-openjdk/Manifest +++ b/dev-java/openj9-openjdk/Manifest @@ -1,4 +1,4 @@ -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 +DIST openj9-0.33.0.tar.gz 17354965 BLAKE2B 540cdd1bb83da0822229ffed115ea77ece1a7f928e8c74c677a0b1c14c9c3e2c580a6e6fedf90a973eec975054809ad39e6501287fd1fc0a6a770262e127d9a5 SHA512 8cb850e21f51a98701bc5d011ffa8d3918e358f5a7de3bc607fdd4925bda15bf83d5bfa13774fb9e244f092e5996cc6d0a7e6c8e60b44f09ca80772dfcd42216 +DIST openj9-omr-0.33.0.tar.gz 7932215 BLAKE2B 456b185243f9997345df1c4ffacc1579dd10b1667304cf04e2fc455379bd551594a7305a0015e05eccc9b98a0169fda88f9a59da59e05a11307ab3b13e5c1b81 SHA512 b25bf3dcb8cae02c9551a2cb3b9a15107f59471b413dedd6dd622cca7317fc80f80a1e1f9d43d764298a302559e0eee834677eafcf0000b7231c0bb4045fe494 +DIST openj9-openjdk-jdk11-openj9-0.33.0.tar.gz 109330741 BLAKE2B 6d8ff4c4cd090d37290088a23295bb98f45437e8dc62f01af620540043971d4eba34971cf1a301a8b8ae23173ed9397849cb645f0f0fe88982c3e02560b878f6 SHA512 8b778c45bfd2e05b784511a1c4407ea0eabc6bd34702a261fb18820e9b3e57ec8e701b27ea4934e8f46c829c0046a7b3906b356b0c4ed44745d428f3c23acbb6 +DIST openj9-openjdk-jdk17-openj9-0.33.0.tar.gz 94012332 BLAKE2B 7140b409fe19b7d64d76dd5b772d6d5efeb8c8c89ee512498bac464cd63b7e7ad6269fce1d423210efd288224ace8287a06e9f112e1fc9bd5aa3dfeb3202a54e SHA512 7367d436b3266cefc66a59067f27c290e16ab1c92b5614c5b6878f29988fbb59181eafafc68874d0736cd63ecb8dc2e7e45542e6839553a516112aacf3dbcaf0 diff --git a/dev-java/openj9-openjdk/files/omr-fam.patch b/dev-java/openj9-openjdk/files/omr-fam.patch deleted file mode 100644 index 9141ec1..0000000 --- a/dev-java/openj9-openjdk/files/omr-fam.patch +++ /dev/null @@ -1,70 +0,0 @@ -diff --git a/ddr/tools/blob_reader/blob_reader.cpp b/ddr/tools/blob_reader/blob_reader.cpp -index 028decd0c..a0212609f 100644 ---- a/ddr/tools/blob_reader/blob_reader.cpp -+++ b/ddr/tools/blob_reader/blob_reader.cpp -@@ -85,7 +85,7 @@ struct BlobHeaderV1 { - - struct BlobString { - uint16_t length; -- char data[1]; /* flexible array member */ -+ char data[]; - - void endian_swap() - { -diff --git a/include_core/ute_core.h b/include_core/ute_core.h -index 8b3b1c65d..330ea52c6 100644 ---- a/include_core/ute_core.h -+++ b/include_core/ute_core.h -@@ -125,7 +125,7 @@ typedef struct UtTraceRecord { - uint64_t threadSyn2; /* Thread synonym 2 */ - int32_t firstEntry; /* Offset to first trace entry */ - int32_t nextEntry; /* Offset to next entry */ -- char threadName[1]; /* Thread name */ -+ char threadName[]; /* Thread name */ - } UtTraceRecord; - - /* -diff --git a/include_core/ute_dataformat.h b/include_core/ute_dataformat.h -index 71d9e36ad..8a9dcb487 100644 ---- a/include_core/ute_dataformat.h -+++ b/include_core/ute_dataformat.h -@@ -180,7 +180,7 @@ typedef struct UtProcSection { - #define UT_TRACE_ACTIVE_SECTION_NAME "UTTA" - typedef struct UtActiveSection { - UtDataHeader header; /* Eyecatcher, version etc */ -- char active[1]; /* Trace activation commands */ -+ char active[]; /* Trace activation commands */ - } UtActiveSection; - - /* -@@ -191,7 +191,7 @@ typedef struct UtActiveSection { - #define UT_TRACE_SERVICE_SECTION_NAME "UTSS" - typedef struct UtServiceSection { - UtDataHeader header; /* Eyecatcher, version etc */ -- char level[1]; /* Service level info */ -+ char level[]; /* Service level info */ - } UtServiceSection; - - /* -@@ -202,7 +202,7 @@ typedef struct UtServiceSection { - #define UT_TRACE_STARTUP_SECTION_NAME "UTSO" - typedef struct UtStartupSection { - UtDataHeader header; /* Eyecatcher, version etc */ -- char options[1]; /* Startup options */ -+ char options[]; /* Startup options */ - } UtStartupSection; - - /* -diff --git a/omrtrace/omrtrace_internal.h b/omrtrace/omrtrace_internal.h -index e52347eac..a68a88abd 100644 ---- a/omrtrace/omrtrace_internal.h -+++ b/omrtrace/omrtrace_internal.h -@@ -157,7 +157,7 @@ typedef struct OMR_TraceGlobal OMR_TraceGlobal; - typedef struct UtTraceCfg { - UtDataHeader header; - struct UtTraceCfg *next; /* Next trace config command */ -- char command[1]; /* Start of variable length section */ -+ char command[]; /* Start of variable length section */ - } UtTraceCfg; - - typedef struct UtDeferredConfigInfo { diff --git a/dev-java/openj9-openjdk/files/openj9-no-o3.patch b/dev-java/openj9-openjdk/files/openj9-no-o3.patch index 63d1dcf..b332052 100644 --- a/dev-java/openj9-openjdk/files/openj9-no-o3.patch +++ b/dev-java/openj9-openjdk/files/openj9-no-o3.patch @@ -1,11 +1,10 @@ -diff -ru a/runtime/cmake/platform/toolcfg/gnu.cmake b/runtime/cmake/platform/toolcfg/gnu.cmake ---- a/runtime/cmake/platform/toolcfg/gnu.cmake 2021-07-20 17:24:52.000000000 -0400 -+++ b/runtime/cmake/platform/toolcfg/gnu.cmake 2021-08-07 09:46:15.685325927 -0400 +--- a/runtime/cmake/platform/toolcfg/gnu.cmake ++++ b/runtime/cmake/platform/toolcfg/gnu.cmake @@ -20,7 +20,6 @@ # SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 OR LicenseRef-GPL-2.0 WITH Assembly-exception ################################################################################ -list(APPEND OMR_PLATFORM_COMPILE_OPTIONS -O3 -g -fstack-protector) - list(APPEND OMR_PLATFORM_C_COMPILE_OPTIONS -Wimplicit -Wreturn-type) - list(APPEND OMR_PLATFORM_CXX_COMPILE_OPTIONS -fno-threadsafe-statics) - + if(OMR_DDR AND NOT (CMAKE_C_COMPILER_VERSION VERSION_LESS 11)) + # In gcc 11+ the default is to use DWARF version 5 which is not yet + # supported by ddrgen: tell the compiler to use DWARF version 4. diff --git a/dev-java/openj9-openjdk/files/openj9-openjdk-override-version.patch b/dev-java/openj9-openjdk/files/openj9-openjdk-override-version.patch new file mode 100644 index 0000000..1652627 --- /dev/null +++ b/dev-java/openj9-openjdk/files/openj9-openjdk-override-version.patch @@ -0,0 +1,11 @@ +--- a/closed/OpenJ9.gmk ++++ b/closed/OpenJ9.gmk +@@ -44,7 +44,7 @@ + # $4 - 'required' for a required repository, anything else for an optional one + GetVersion = $(eval $(call GetVersionHelper,$(strip $1),$(strip $2),$(strip $3),$(strip $4))) + define GetVersionHelper +- $2 := $$(if $(wildcard $3),$$(shell $(GIT) -C $3 rev-parse --short HEAD)) ++ $2 := $$(if $$($2),$$($2),$$(if $(wildcard $3),$$(shell $(GIT) -C $3 rev-parse --short HEAD))) + ifneq (,$$($2)) + VersionLabelWidth := $(shell $(ECHO) "$1" | $(AWK) "{ width = length; print (width > $(VersionLabelWidth) ? width : $(VersionLabelWidth)) }") + VersionPairs += "$1" "$$($2)" diff --git a/dev-java/openj9-openjdk/files/openj9-openjdk.env.sh b/dev-java/openj9-openjdk/files/openj9-openjdk.env.sh index 5aac9c7..8d0d130 100644 --- a/dev-java/openj9-openjdk/files/openj9-openjdk.env.sh +++ b/dev-java/openj9-openjdk/files/openj9-openjdk.env.sh @@ -1,6 +1,3 @@ -# Copyright 1999-2018 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - VERSION="OpenJDK ${SLOT} with OpenJ9 ${OPENJ9_PV}" JAVA_HOME="${EPREFIX}/usr/$(get_libdir)/${PN}-${SLOT}" JDK_HOME="${EPREFIX}/usr/$(get_libdir)/${PN}-${SLOT}" 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 deleted file mode 100644 index d11ce4a..0000000 --- a/dev-java/openj9-openjdk/openj9-openjdk-11.0.32.0.ebuild +++ /dev/null @@ -1,286 +0,0 @@ -# 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 - -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 headless-awt javafx +jbootstrap numa selinux source systemtap" - -REQUIRED_USE=" - javafx? ( alsa !headless-awt ) -" - -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}[gentoo-vm(+)] - dev-java/openj9-openjdk:${SLOT}[gentoo-vm(+)] - dev-java/openjdk-bin:${SLOT}[gentoo-vm(+)] - dev-java/openjdk:${SLOT}[gentoo-vm(+)] - ) -" - -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 - - [[ ${MERGE_TYPE} == "binary" ]] && return - - 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}" - - java-pkg-2_pkg_setup -} - -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 -r /etc/ssl/certs/java/cacerts "${dest}"/lib/security/cacerts - - # must be done before running itself - java-vm_set-pax-markings "${ddest}" - - 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.33.0.ebuild b/dev-java/openj9-openjdk/openj9-openjdk-11.0.33.0.ebuild new file mode 100644 index 0000000..0d76c28 --- /dev/null +++ b/dev-java/openj9-openjdk/openj9-openjdk-11.0.33.0.ebuild @@ -0,0 +1,290 @@ +# 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 + +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 headless-awt javafx +jbootstrap numa selinux source systemtap" + +REQUIRED_USE=" + javafx? ( alsa !headless-awt ) +" + +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 + media-libs/libjpeg-turbo: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}[gentoo-vm(+)] + dev-java/openj9-openjdk:${SLOT}[gentoo-vm(+)] + dev-java/openjdk-bin:${SLOT}[gentoo-vm(+)] + dev-java/openjdk:${SLOT}[gentoo-vm(+)] + ) +" + +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 + + [[ ${MERGE_TYPE} == "binary" ]] && return + + 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}" + + java-pkg-2_pkg_setup +} + +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 -- "${FILESDIR}/openj9-openjdk-override-version.patch" + eapply -d openj9 -- "${FILESDIR}/openj9-no-o3.patch" + eapply -d omr -- "${FILESDIR}/omr-omrstr-iconv-failure-overflow.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[*]}" + OPENJDK_SHA=$(ver_cut 1-3) + OPENJ9_SHA=${OPENJ9_P} + OPENJ9_TAG=${OPENJ9_P} + OPENJ9OMR_SHA=${OPENJ9_P} + ) + 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 + + dosym8 -r /etc/ssl/certs/java/cacerts "${dest}"/lib/security/cacerts + + # must be done before running itself + java-vm_set-pax-markings "${ddest}" + + 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 deleted file mode 100644 index e42663c..0000000 --- a/dev-java/openj9-openjdk/openj9-openjdk-17.0.32.0.ebuild +++ /dev/null @@ -1,314 +0,0 @@ -# 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 - -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" - -REQUIRED_USE=" - javafx? ( alsa !headless-awt ) -" - -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 - - [[ ${MERGE_TYPE} == "binary" ]] && return - - 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 - - for variant in openj9- ''; do - if has_version dev-java/${variant}openjdk:${SLOT}; then - JDK_HOME=${EPREFIX}/usr/$(get_libdir)/${variant}openjdk-${SLOT} - break - elif has_version dev-java/${variant}openjdk-bin:${SLOT}; then - JDK_HOME=$(best_version dev-java/${variant}openjdk-bin:${SLOT}) - JDK_HOME=${JDK_HOME#*/} - JDK_HOME=${EPREFIX}/opt/${JDK_HOME%-r*} - break - fi - done - [[ -n ${JDK_HOME} ]] || die "Build VM not found!" - export JDK_HOME -} - -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 -r /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.33.0.ebuild b/dev-java/openj9-openjdk/openj9-openjdk-17.0.33.0.ebuild new file mode 100644 index 0000000..7ee9bac --- /dev/null +++ b/dev-java/openj9-openjdk/openj9-openjdk-17.0.33.0.ebuild @@ -0,0 +1,315 @@ +# 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 + +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 jitserver numa selinux source systemtap" + +REQUIRED_USE=" + javafx? ( alsa !headless-awt ) +" + +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 + media-libs/libjpeg-turbo: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" + + if use jitserver && tc-is-clang; then + die "jitserver does not compile with clang" + fi + fi +} + +pkg_setup() { + openjdk_check_requirements + java-vm-2_pkg_setup + + [[ ${MERGE_TYPE} == "binary" ]] && return + + 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 ${BROOT}/usr/lib/jvm/${vm} ]]; then + java-pkg-2_pkg_setup + return + fi + done +} + +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 -- "${FILESDIR}/openj9-openjdk-override-version.patch" + eapply -d openj9 -- "${FILESDIR}/openj9-no-o3.patch" + eapply -d omr -- "${FILESDIR}/omr-omrstr-iconv-failure-overflow.patch" + + 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() { + for variant in openj9- ''; do + if has_version dev-java/${variant}openjdk:${SLOT}; then + JDK_HOME=${EPREFIX}/usr/$(get_libdir)/${variant}openjdk-${SLOT} + break + elif has_version dev-java/${variant}openjdk-bin:${SLOT}; then + JDK_HOME=$(best_version dev-java/${variant}openjdk-bin:${SLOT}) + JDK_HOME=${JDK_HOME#*/} + JDK_HOME=${EPREFIX}/opt/${JDK_HOME%-r*} + break + fi + done + [[ -n ${JDK_HOME} ]] || die "Build VM not found!" + export JDK_HOME + + # 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) + $(use_enable jitserver) + ) + + 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[*]}" + OPENJDK_SHA=$(ver_cut 1-3) + OPENJ9_SHA=${OPENJ9_P} + OPENJ9_TAG=${OPENJ9_P} + OPENJ9OMR_SHA=${OPENJ9_P} + ) + 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 + + dosym8 -r /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-54-g00ecf