Re: [gentoo-dev] rfc: java-vm-2.eclass eapi 8 support

2021-11-27 Thread Sam James


> On 27 Nov 2021, at 09:54, Miroslav Šulc  wrote:
> 
> hello devs,
> 
> please find attached patch for upgrade of java-vm-2.eclass to support eapi 8. 
> eapi 5 is not used by any package inheriting this eclass so i dropped it.
> 
> i also attach update of the ebuilds of packages that use this eclass and can 
> be updated to eapi 8 (dev-java/icedtea can't atm, it also inherits another 
> java eclass that does not support eapi 8 yet, and dev-java/gcj-jdk is masked 
> in profiles/releases/17.0/package.mask). all works fine except 
> dev-java/openjdk (all slots) where the configuration phase fails or does not 
> finish correctly. all those packages merge fine with eapi 6 (in-tree ebuilds).
> 
> openjdk:8 - configuration finishes but no configuration file is created (and 
> hence compilation fails) as during the configuration phase it complains with 
> this:
> configure: error: Could not find freetype!
> 
> openjdk:11 and openjdk:17 - configuration fails with this error (i was told 
> by sam it is a known bug):
> configure: error: unrecognized options: --disable-static
> 

When b.g.o is back, let's make sure we update the existing bug about it / file 
a new one.

> i'd like to merge the patches asap (except the broken openjdk) so please let 
> me know if you find anything that could be improved or all's ok.
> 

lgtm. I'd send with git send-email in future to ease review.

I don't see a point in nitpicking the Java eclasses right now, especially as we 
might be looking at future improvements anyway for how we handle deps.

Thanks for doing this!

Best,
sam


signature.asc
Description: Message signed with OpenPGP


[gentoo-dev] rfc: java-vm-2.eclass eapi 8 support

2021-11-27 Thread Miroslav Šulc

hello devs,

please find attached patch for upgrade of java-vm-2.eclass to support 
eapi 8. eapi 5 is not used by any package inheriting this eclass so i 
dropped it.


i also attach update of the ebuilds of packages that use this eclass and 
can be updated to eapi 8 (dev-java/icedtea can't atm, it also inherits 
another java eclass that does not support eapi 8 yet, and 
dev-java/gcj-jdk is masked in profiles/releases/17.0/package.mask). all 
works fine except dev-java/openjdk (all slots) where the configuration 
phase fails or does not finish correctly. all those packages merge fine 
with eapi 6 (in-tree ebuilds).


openjdk:8 - configuration finishes but no configuration file is created 
(and hence compilation fails) as during the configuration phase it 
complains with this:

configure: error: Could not find freetype!

openjdk:11 and openjdk:17 - configuration fails with this error (i was 
told by sam it is a known bug):

configure: error: unrecognized options: --disable-static

i'd like to merge the patches asap (except the broken openjdk) so please 
let me know if you find anything that could be improved or all's ok.


thanks

fordfrog
diff --git a/eclass/java-vm-2.eclass b/eclass/java-vm-2.eclass
index 5f14493f18a1..d24339200ce0 100644
--- a/eclass/java-vm-2.eclass
+++ b/eclass/java-vm-2.eclass
@@ -4,14 +4,14 @@
 # @ECLASS: java-vm-2.eclass
 # @MAINTAINER:
 # j...@gentoo.org
-# @SUPPORTED_EAPIS: 5 6
+# @SUPPORTED_EAPIS: 6 8
 # @BLURB: Java Virtual Machine eclass
 # @DESCRIPTION:
 # This eclass provides functionality which assists with installing
 # virtual machines, and ensures that they are recognized by java-config.
 
 case ${EAPI:-0} in
-	5|6) ;;
+	[68]) ;;
 	*) die "EAPI=${EAPI} is not supported" ;;
 esac
 
@@ -20,8 +20,9 @@ inherit multilib pax-utils prefix xdg-utils
 EXPORT_FUNCTIONS pkg_setup pkg_postinst pkg_prerm pkg_postrm
 
 RDEPEND="
-	>=dev-java/java-config-2.2.0-r3
-	>=app-eselect/eselect-java-0.4.0"
+	dev-java/java-config
+	app-eselect/eselect-java
+"
 DEPEND="${RDEPEND}"
 
 export WANT_JAVA_CONFIG=2
diff --git a/dev-java/icedtea-bin/icedtea-bin-3.16.0-r1.ebuild b/dev-java/icedtea-bin/icedtea-bin-3.16.0-r1.ebuild
new file mode 100644
index ..79aca0a922b8
--- /dev/null
+++ b/dev-java/icedtea-bin/icedtea-bin-3.16.0-r1.ebuild
@@ -0,0 +1,132 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit java-vm-2 toolchain-funcs
+
+abi_uri() {
+	echo "${2-$1}? (
+			${BASE_URI}/${PN}-core-${PV}${3+-r${3}}-${1}.tar.xz
+			examples? ( ${BASE_URI}/${PN}-examples-${PV}${3+-r${3}}-${1}.tar.xz )
+		)"
+}
+
+BASE_URI="https://dev.gentoo.org/~gyakovlev/distfiles;
+SRC_URI="
+	doc? ( ${BASE_URI}/${PN}-doc-${PV}.tar.xz )
+	source? ( ${BASE_URI}/${PN}-src-${PV}.tar.xz )
+	big-endian? ( $(abi_uri ppc64) )
+	!big-endian? ( $(abi_uri ppc64le ppc64) )
+	$(abi_uri amd64)
+	$(abi_uri arm)
+	$(abi_uri arm64)
+	$(abi_uri x86)
+"
+
+DESCRIPTION="A Gentoo-made binary build of the IcedTea JDK"
+HOMEPAGE="http://icedtea.classpath.org;
+
+LICENSE="GPL-2-with-classpath-exception"
+SLOT="8"
+KEYWORDS="-* ~amd64 ~arm ~arm64 ~ppc64 ~x86"
+IUSE="+alsa big-endian cups doc examples +gtk headless-awt pulseaudio selinux source"
+
+REQUIRED_USE="gtk? ( !headless-awt )"
+
+RESTRICT="preserve-libs strip"
+QA_PREBUILT="opt/.*"
+
+DEPEND="app-arch/xz-utils"
+
+RDEPEND="
+	>=dev-libs/glib-2.60.7:2
+	>=media-libs/fontconfig-2.13:1.0
+	>=media-libs/freetype-2.9.1:2
+	>=media-libs/lcms-2.9:2
+	>=sys-apps/baselayout-java-0.1.0-r1
+	>=sys-libs/zlib-1.2.11-r2
+	virtual/jpeg-compat:62
+	alsa? ( >=media-libs/alsa-lib-1.2 )
+	cups? ( >=net-print/cups-2.0 )
+	gtk? (
+		>=dev-libs/atk-2.32.0
+		>=x11-libs/cairo-1.16.0
+		x11-libs/gdk-pixbuf:2
+		>=x11-libs/gtk+-2.24:2
+		>=x11-libs/pango-1.42
+	)
+	selinux? ( sec-policy/selinux-java )
+	virtual/ttf-fonts
+	!headless-awt? (
+		media-libs/giflib:0/7
+		=media-libs/libpng-1.6*
+		>=x11-libs/libX11-1.6
+		>=x11-libs/libXcomposite-0.4
+		>=x11-libs/libXext-1.3
+		>=x11-libs/libXi-1.7
+		>=x11-libs/libXrender-0.9.10
+		>=x11-libs/libXtst-1.2
+	)
+"
+
+PDEPEND="pulseaudio? ( dev-java/icedtea-sound )"
+
+S="${WORKDIR}"
+
+pkg_pretend() {
+	if [[ "$(tc-is-softfloat)" != "no" ]]; then
+		die "These binaries require a hardfloat system."
+	fi
+}
+
+src_prepare() {
+	default
+
+	# I wouldn't normally use -f below but symlinks in the arm files
+	# make this fail otherwise and any other approach would be tedious.
+
+	if ! use alsa; then
+		rm -fv */jre/lib/*/libjsoundalsa.* || die
+	fi
+
+	if use headless-awt; then
+		rm -fvr */jre/lib/*/lib*{[jx]awt,splashscreen}* \
+		   */{,jre/}bin/policytool */bin/appletviewer || die
+	fi
+}
+
+src_install() {
+	local dest="/opt/${P}"
+	local ddest="${ED}/${dest#/}"
+	dodir "${dest}"
+
+	dodoc ${P}-${ABI}/doc/{ASSEMBLY_EXCEPTION,AUTHORS,NEWS,README,THIRD_PARTY_README}
+	use doc && dodoc -r ${P}/doc/html
+
+	# doins doesn't preserve executable bits.
+	cp -pRP