Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding ebuild for JDK 20 #53

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions dev-java/openjdk-bin/Manifest
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,8 @@ DIST OpenJDK19U-jdk_ppc64le_linux_hotspot_19.0.2_7.tar.gz 199260239 BLAKE2B 40b5
DIST OpenJDK19U-jdk_x64_alpine-linux_hotspot_19.0.2_7.tar.gz 199287128 BLAKE2B 7d6d9cc91c4354f74e54b88fadf8a9be347c0cc51d0573310448e017636e74e6571dc69263790b5c80c5ccf80ce1b7d35b0fc79d709a21b7b887fcfe93df2619 SHA512 2c37d080dd3a88eb8d33363ac8db8a3ebc731a649d3eb175257b28e01b673f7c274d59a77b7459eb2cc87678552d5d431b986780344a00f745d51391d0c3c76e
DIST OpenJDK19U-jdk_x64_linux_hotspot_19.0.2_7.tar.gz 200079543 BLAKE2B 27cc090a99cf943f39c42af442365e120b72390b2286e61c5f93d9e059f84e0d6446d9a20f40cf5caeaba794e1b9e4b9ee96217955273bcc973dbbb37eae989e SHA512 bc04881cd3b999ede7dd4f3d580518b99990885cb57a165e807e32837b18cc7b4fd3a9320376222507f085b5f4fe88fd69d2b26dd4f8f34c890f000e6b316880
DIST OpenJDK19U-jdk_x64_mac_hotspot_19.0.2_7.tar.gz 195407051 BLAKE2B f8485e60483ce5c53a058d1fd138a256613e00cea66cefd2e96f828e1aaa0de542d5c3d37e09c4d41bd7c2eb05cabce0b9b65a4009cdf2b5bca3b1feddfc8ad2 SHA512 e6f393faaaa0ccf9ff8e126b17f5e7e6ceaecab969d5ef9297cf7e7b2e1daf1c5bd4b69b1c32df7709e0b4cb8dded06daf07cf699e970caad2d267c34c427676
DIST OpenJDK20U-jdk_aarch64_linux_hotspot_20.0.1_9.tar.gz 199955518 BLAKE2B 1db47d34cb8dc6aefde750fad4ca164b466e62856b0c9c8e30e93b1c10aa80cd6f7163793e60b5ff8faaaaadad8f23da51c9fe8ad3c341c914767dab31e0a9dd SHA512 2bf71265010cda2ad1d770fff9d7e37a81bfd06fdcfb3e0d618ec5ff65f616832b07570eeecd4805aef13bebf1bb01ee26ab175267bbcd0353177ca694fc72de
DIST OpenJDK20U-jdk_aarch64_mac_hotspot_20.0.1_9.tar.gz 186409240 BLAKE2B 71561920e2670abb191520d3c961b9bb6f421c3de276db518a5a3ed22f9b00a012184de3439f2a614df7cc83c9b1c722490c974f9418e4ece38d378d68b8f4c5 SHA512 e32eefcf3eed9fe8b73780877b8b0c1f36c7f35338f89ec4e5591eb26ef4bcd456d1d5ce68d6e8702d372d9997b351c9f301bd8f8b2391232bc2e70b7c7f13e6
DIST OpenJDK20U-jdk_x64_alpine-linux_hotspot_20.0.1_9.tar.gz 200896844 BLAKE2B 612981e681aaa149f41e7f0467ad1ec885b4ae6d9cbd2457ba727fa14211e18cfa4b2309e22b70ec6e21a62af32ffaa9e73663b99303af5d006b034b7c0464d3 SHA512 9089a5c85c95d44577866474bbcfd882c0a15d397bdf6e2d8e5c9671cbe107ef55a5a68c1b435e8193b7fbd03010629a621912abd9f0c2168fd7af2a3c6f4a9f
DIST OpenJDK20U-jdk_x64_linux_hotspot_20.0.1_9.tar.gz 201728713 BLAKE2B e6633ca2f52313cec28f8c0bf9a63f5d62f9a5eb051896eefc1e3734154ef340984ce08cc910cffd02c38c563353cbb745ccb32a32340ce9b23cac070eaf8ccd SHA512 aebaa6b9c62f18515ddbaff4c6eba730a84ab37b2a996c1bd1dab7fce094cc6925cc17ced820207ceb68ae8b8e34fcea3047f123477bd07f68ac789088decac1
DIST OpenJDK20U-jdk_x64_mac_hotspot_20.0.1_9.tar.gz 197180058 BLAKE2B a190a0400d8a09ce7d77671da042c4a17eb5b4b86dc72b9dea30a31f959e5cbd74270e328630171e3d60b81c99b8feed9906f0abda127cb1d87ca55e5cf0203b SHA512 70f9add59b65d29528dfa08b9f2d895c2bd80df1a982394ae049e63e9dacdb9e37a432d9bb6d3e0df09872b31047874d8bd85205137535c624d40527d6ed4812
135 changes: 135 additions & 0 deletions dev-java/openjdk-bin/openjdk-bin-20.0.1_p9.ebuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

inherit java-vm-2 toolchain-funcs

abi_uri() {
local baseuri="https://github.com/adoptium/temurin${SLOT}-binaries/releases/download/jdk-${MY_PV}/"
local musl=
local os=linux

case ${2} in
*-macos) os=mac ;;
*-solaris) os=solaris ;;
esac

if [[ ${3} == musl ]]; then
os=alpine-linux
musl=true
fi

echo "${2-$1}? (
${musl:+ elibc_musl? ( }
${baseuri}/OpenJDK${SLOT}U-jdk_${1}_${os}_hotspot_${MY_PV_2//+/_}.tar.gz
${musl:+ ) } )"
}

MY_PV="20.0.1+9"
MY_PV_2="20.0.1+9"
SLOT=$(ver_cut 1)

SRC_URI="
$(abi_uri aarch64 arm64)
$(abi_uri x64 amd64)
$(abi_uri x64 amd64 musl)
$(abi_uri aarch64 arm64-macos)
$(abi_uri x64 x64-macos)
"

DESCRIPTION="Prebuilt Java JDK binaries provided by Eclipse Temurin"
HOMEPAGE="https://adoptium.net"
LICENSE="GPL-2-with-classpath-exception"
KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~x64-macos"
IUSE="alsa cups headless-awt selinux source"

RDEPEND="
>=sys-apps/baselayout-java-0.1.0-r1
kernel_linux? (
media-libs/fontconfig:1.0
media-libs/freetype:2
media-libs/harfbuzz
elibc_glibc? ( >=sys-libs/glibc-2.2.5:* )
elibc_musl? ( sys-libs/musl )
sys-libs/zlib
alsa? ( media-libs/alsa-lib )
cups? ( net-print/cups )
selinux? ( sec-policy/selinux-java )
!headless-awt? (
x11-libs/libX11
x11-libs/libXext
x11-libs/libXi
x11-libs/libXrender
x11-libs/libXtst
)
)"

RESTRICT="preserve-libs splitdebug"
QA_PREBUILT="*"

S="${WORKDIR}/jdk-${MY_PV}"

pkg_pretend() {
if [[ "$(tc-is-softfloat)" != "no" ]]; then
die "These binaries require a hardfloat system."
fi
}

src_unpack() {
default
if [[ ${A} == *_mac_* ]] ; then
mv -v "${S}/Contents/Home/"* "${S}" || die
rm -Rf "${S}/Contents" # drop macOS executable
fi
}

src_install() {
local dest="/opt/${P}"
local ddest="${ED}/${dest#/}"

# on macOS if they would exist they would be called .dylib, but most
# importantly, there are no different providers, so everything
# that's shipped works.
if [[ ${A} != *_mac_* ]] ; then
# Not sure why they bundle this as it's commonly available and they
# only do so on x86_64. It's needed by libfontmanager.so. IcedTea
# also has an explicit dependency while Oracle seemingly dlopens it.
rm -vf lib/libfreetype.so || die

# prefer system copy # https://bugs.gentoo.org/776676
rm -vf lib/libharfbuzz.so || die

# Oracle and IcedTea have libjsoundalsa.so depending on
# libasound.so.2 but AdoptOpenJDK only has libjsound.so. Weird.
if ! use alsa ; then
rm -v lib/libjsound.* || die
fi

if use headless-awt ; then
rm -v lib/lib*{[jx]awt,splashscreen}* || die
fi
fi

if ! use source ; then
rm -v lib/src.zip || die
fi

rm -v lib/security/cacerts || die
dosym -r /etc/ssl/certs/java/cacerts "${dest}"/lib/security/cacerts

dodir "${dest}"
cp -pPR * "${ddest}" || die

# provide stable symlink
dosym "${P}" "/opt/${PN}-${SLOT}"

java-vm_install-env "${FILESDIR}"/${PN}.env.sh
java-vm_set-pax-markings "${ddest}"
java-vm_revdep-mask
java-vm_sandbox-predict /dev/random /proc/self/coredump_filter
}

pkg_postinst() {
java-vm-2_pkg_postinst
}