diff options
author | V3n3RiX <venerix@koprulu.sector> | 2022-11-10 15:28:02 +0000 |
---|---|---|
committer | V3n3RiX <venerix@koprulu.sector> | 2022-11-10 15:28:02 +0000 |
commit | 0d0e3e0adedd9f237ceea9e95cbd0ed29a4576d4 (patch) | |
tree | f4f226a7d18e1d67a2f44d24f0485ef3bd630698 /dev-java/byte-buddy | |
parent | e80777b54c5b430ca044e16878f59a2020423d48 (diff) |
gentoo auto-resync : 10:11:2022 - 15:28:02
Diffstat (limited to 'dev-java/byte-buddy')
-rw-r--r-- | dev-java/byte-buddy/Manifest | 3 | ||||
-rw-r--r-- | dev-java/byte-buddy/byte-buddy-1.12.18.ebuild | 175 | ||||
-rw-r--r-- | dev-java/byte-buddy/files/byte-buddy-1.12.18-not-java20.patch | 52 |
3 files changed, 230 insertions, 0 deletions
diff --git a/dev-java/byte-buddy/Manifest b/dev-java/byte-buddy/Manifest index 891a2787e2da..1893a3b22008 100644 --- a/dev-java/byte-buddy/Manifest +++ b/dev-java/byte-buddy/Manifest @@ -1,3 +1,6 @@ +AUX byte-buddy-1.12.18-not-java20.patch 2497 BLAKE2B e63fa330e65aa9038a0f0f9e732c39114c62df845a6d481300b0fa8cc1a03e5fe9e057838ab945d9de50f0c2b22db14f0f3fdba95073f793e5c6f627e0e9bbe1 SHA512 c856eda61f8ee64245185431f6a0646fda16a5a8d632710e94abdffb7cebaca8e630f52d4027b81154dec7905290d7730c85a2452960ee485df3296c8d305174 DIST byte-buddy-1.12.14.tar.gz 1857258 BLAKE2B 6957246f6689d1bdfdc6277ad752e03df0ae47c62b0afded77c94cdd41e00cc736517d0e4e5d5f8c59be519262a03864cde9bffa4ae53e5a7daeed84a519967f SHA512 5035be16fbdf2f7e8e2c93b87ee5f9adc927a19fd3b7d9fcd262906d8d21532cef8111084c3d6d0b75e101df0bfee19bf9177bc6a7d4b18cf0f26146fba4f147 +DIST byte-buddy-1.12.18.tar.gz 1924438 BLAKE2B 278ac97d60e62c7d44142a01da94113b29b483bff532f08fca7e345f383a4ddf83cb8c4d0544bce1879bb26909d048a76562cd816c4e9cb06695127ed849f08c SHA512 637e041f97981b85cd13ffecb0de47206b5c99d8b98561561414d8a599f5d53a6e047ba3ad9bc88ca030125221df3ebe49d6eff18a4093f4027d8cbf34a483b0 EBUILD byte-buddy-1.12.14.ebuild 6733 BLAKE2B ce062dbe393a761d43e64cc4cf41edea638a3eaf31ff6151cc2c6a9ac2737e878f0718b41486d5766286b824ba7d8092aa112bd5f373e5b87f8a0cec2baf2b19 SHA512 5568d986f73bf6ff41b538a7816cca17f3bdc7128656f0601655dfb259ff88255a3961880cf2a005050e4d831238e657e9c8a6fd934e59ee9dd7fc0ab0cfcc1a +EBUILD byte-buddy-1.12.18.ebuild 5311 BLAKE2B 1193b4a051c525da8493e6716ffe35999dced484690ddafc838f51b9cb9493bf628adc785736aba273a3b55335e45ceeef9f2b171da2375dad4d1bc1513d4a65 SHA512 5af73cd8105cb3514b23d511e8522d33c1502df8b088ad1d40f9c406d5093c9c7bb821127c5b6fbf74adec03188bb79c8353c464044f3a7385e89c40c1abfb79 MISC metadata.xml 440 BLAKE2B ef73e69de33dc6bbea38c81b8744fad5ce4764644d9cc6168d7c0f175856e30c3a577ffc597f25f8caf26bacfd80663b55eddde047a346fcb582d883269233b9 SHA512 b27c92e768c2783c90c8b4693c3265a9533a09abe76b2b3bd54e3865d270eed91414fcd89513bc30feb0243ea21f63d354b907b74eb18e98f899811101a6c956 diff --git a/dev-java/byte-buddy/byte-buddy-1.12.18.ebuild b/dev-java/byte-buddy/byte-buddy-1.12.18.ebuild new file mode 100644 index 000000000000..847b00aff70c --- /dev/null +++ b/dev-java/byte-buddy/byte-buddy-1.12.18.ebuild @@ -0,0 +1,175 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +# Skeleton command: +# java-ebuilder --generate-ebuild --workdir . --pom pom.xml --download-uri https://github.com/raphw/byte-buddy/archive/byte-buddy-1.12.18.tar.gz --slot 0 --keywords "~amd64 ~arm ~arm64 ~ppc64 ~x86" --ebuild byte-buddy-1.12.18.ebuild + +EAPI=8 + +JAVA_PKG_IUSE="doc source test" +MAVEN_ID="net.bytebuddy:byte-buddy-agent:1.12.18" +JAVA_TESTING_FRAMEWORKS="junit-4" + +inherit java-pkg-2 java-pkg-simple + +DESCRIPTION="Offers convenience for attaching an agent to the local or a remote VM" +HOMEPAGE="https://bytebuddy.net" +SRC_URI="https://github.com/raphw/byte-buddy/archive/${P}.tar.gz" + +LICENSE="Apache-2.0" +SLOT="0" +KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~x86" + +DEPEND=" + >=virtual/jdk-11:* + dev-java/asm:9 + dev-java/findbugs-annotations:0 + dev-java/jna:4 + dev-java/jsr305:0 + test? ( + dev-java/mockito:4 + ) +" + +RDEPEND=">=virtual/jre-1.8:*" + +PATCHES=( + "${FILESDIR}/byte-buddy-1.12.18-not-java20.patch" +) + +S="${WORKDIR}/byte-buddy-${P}" + +JAVA_CLASSPATH_EXTRA=" + asm-9 + findbugs-annotations + jsr305 + jna-4 +" + +src_prepare() { + default + # https://github.com/raphw/byte-buddy/blob/byte-buddy-1.12.18/byte-buddy-agent/pom.xml#L142-L176 + cat > byte-buddy-agent/src/main/java/module-info.java <<-EOF || die + module net.bytebuddy.agent { + requires java.instrument; + requires static jdk.attach; + requires static com.sun.jna; + requires static com.sun.jna.platform; + requires java.base; + exports net.bytebuddy.agent; + exports net.bytebuddy.agent.utility.nullability; + } + EOF + + # adjustment for recent mockito versions + sed \ + -e 's:verifyZeroInteractions:verifyNoInteractions:g' \ + -i byte-buddy-dep/src/test/java/net/bytebuddy/*.java \ + -i byte-buddy-dep/src/test/java/net/bytebuddy/*/*Test.java \ + -i byte-buddy-dep/src/test/java/net/bytebuddy/*/*/*Test.java \ + -i byte-buddy-dep/src/test/java/net/bytebuddy/*/*/*/*Test.java \ + -i byte-buddy-dep/src/test/java/net/bytebuddy/*/*/*/*/*Test.java \ + || die + + # instead of shading byte-buddy-dep we move it into byte-buddy. + mv byte-buddy{-dep,}/src/main/java || die "cannot move sources" + + # https://github.com/raphw/byte-buddy/blob/byte-buddy-1.12.18/byte-buddy/pom.xml#L159-L195 + local exports="$( \ + sed -n '/<packages.list.external>/,/<\/packages.list.external/p' \ + byte-buddy/pom.xml \ + | sed -e 's:^:exports :' -e 's:,:;:' \ + | grep -v 'packages.list.external\|shade' | tr -s '[:space:]' \ + )" || die + cat > byte-buddy/src/main/java/module-info.java <<-EOF || die + module net.bytebuddy { + requires static java.instrument; + requires static java.management; + requires static jdk.unsupported; + requires static net.bytebuddy.agent; + requires static com.sun.jna; + requires static com.sun.jna.platform; + requires java.base; + ${exports} + } + EOF +} + +src_compile() { + einfo "Compiling byte-buddy-agent.jar" + JAVA_JAR_FILENAME="byte-buddy-agent.jar" + JAVA_RESOURCE_DIRS="byte-buddy-agent/src/main/resources" + JAVA_SRC_DIR="byte-buddy-agent/src/main/java" + java-pkg-simple_src_compile + JAVA_GENTOO_CLASSPATH_EXTRA+=":byte-buddy-agent.jar" + rm -r target || die + + einfo "Compiling byte-buddy.jar" + JAVA_JAR_FILENAME="byte-buddy.jar" + JAVA_MAIN_CLASS="net.bytebuddy.build.Plugin\$Engine\$Default" + JAVA_RESOURCE_DIRS=() + JAVA_SRC_DIR="byte-buddy/src/main/java" + java-pkg-simple_src_compile + JAVA_GENTOO_CLASSPATH_EXTRA+=":byte-buddy.jar" + rm -r target || die + + if use doc; then + einfo "Compiling javadocs" + rm byte-buddy-agent/src/main/java/module-info.java || die + JAVA_SRC_DIR=( + "byte-buddy-agent/src/main/java" + "byte-buddy/src/main/java" + ) + JAVA_JAR_FILENAME="ignoreme.jar" + java-pkg-simple_src_compile + fi +} + +src_test() { + # instead of shading byte-buddy-dep we move it into byte-buddy. + mv byte-buddy{-dep,}/src/test || die "cannot move tests" + + # @Ignore one of 4 tests, https://bugs.gentoo.org/863386 + sed \ + -e '/import org.junit.Test/a import org.junit.Ignore;' \ + -e '/testIgnoreExistingField()/i @Ignore' \ + -i byte-buddy/src/test/java/net/bytebuddy/build/CachedReturnPluginOtherTest.java || die + + # @Ignore one of 39 tests, https://bugs.gentoo.org/863386 + sed \ + -e '/import org.junit.Test/a import org.junit.Ignore;' \ + -e '/testNoParameterNameAndModifiers()/i @Ignore' \ + -i byte-buddy/src/test/java/net/bytebuddy/description/method/AbstractMethodDescriptionTest.java || die + + JAVA_TEST_GENTOO_CLASSPATH="junit-4,mockito-4" + + einfo "Testing byte-buddy-agent" + # https://github.com/raphw/byte-buddy/issues/1321#issuecomment-1252776459 + JAVA_TEST_EXTRA_ARGS=( -Dnet.bytebuddy.test.jnapath="${EPREFIX}/usr/$(get_libdir)/jna-4/" ) + JAVA_TEST_SRC_DIR="byte-buddy-agent/src/test/java" + java-pkg-simple_src_test + + einfo "Testing byte-buddy" + JAVA_TEST_RESOURCE_DIRS=( byte-buddy/src/test/{resources,precompiled*} ) + JAVA_TEST_SRC_DIR="byte-buddy/src/test/java" + + JAVA_TEST_EXCLUDES=( + # all tests in this class fail, https://bugs.gentoo.org/863386 + net.bytebuddy.build.CachedReturnPluginTest + ) + java-pkg-simple_src_test +} + +src_install() { + java-pkg_dojar "byte-buddy-agent.jar" + java-pkg_dojar "byte-buddy.jar" + + if use doc; then + java-pkg_dojavadoc target/api + fi + + if use source; then + java-pkg_dosrc "byte-buddy-agent/src/main/java/*" + java-pkg_dosrc "byte-buddy/src/main/java/*" + fi +} diff --git a/dev-java/byte-buddy/files/byte-buddy-1.12.18-not-java20.patch b/dev-java/byte-buddy/files/byte-buddy-1.12.18-not-java20.patch new file mode 100644 index 000000000000..73b9bccdab3e --- /dev/null +++ b/dev-java/byte-buddy/files/byte-buddy-1.12.18-not-java20.patch @@ -0,0 +1,52 @@ +# We don't have JAVA_V20 +--- a/byte-buddy-dep/src/main/java/net/bytebuddy/ClassFileVersion.java ++++ b/byte-buddy-dep/src/main/java/net/bytebuddy/ClassFileVersion.java +@@ -140,11 +140,6 @@ public class ClassFileVersion implements Comparable<ClassFileVersion>, Serializa + */ + public static final ClassFileVersion JAVA_V19 = new ClassFileVersion(Opcodes.V19); + +- /** +- * The class file version of Java 20. +- */ +- public static final ClassFileVersion JAVA_V20 = new ClassFileVersion(Opcodes.V20); +- + /** + * A version locator for the executing JVM. + */ +@@ -235,8 +230,6 @@ public class ClassFileVersion implements Comparable<ClassFileVersion>, Serializa + return JAVA_V18; + } else if (javaVersionString.equals("1.19") || javaVersionString.equals("19")) { + return JAVA_V19; +- } else if (javaVersionString.equals("1.20") || javaVersionString.equals("20")) { +- return JAVA_V20; + } else { + if (OpenedClassReader.EXPERIMENTAL) { + try { +@@ -300,8 +293,6 @@ public class ClassFileVersion implements Comparable<ClassFileVersion>, Serializa + return JAVA_V18; + case 19: + return JAVA_V19; +- case 20: +- return JAVA_V20; + default: + if (OpenedClassReader.EXPERIMENTAL && javaVersion > 0) { + return new ClassFileVersion(BASE_VERSION + javaVersion); +@@ -317,7 +308,7 @@ public class ClassFileVersion implements Comparable<ClassFileVersion>, Serializa + * @return The latest officially supported Java version. + */ + public static ClassFileVersion latest() { +- return ClassFileVersion.JAVA_V20; ++ return ClassFileVersion.JAVA_V19; + } + + /** +--- a/byte-buddy-dep/src/test/java/net/bytebuddy/ClassFileVersionKnownVersionsTest.java ++++ b/byte-buddy-dep/src/test/java/net/bytebuddy/ClassFileVersionKnownVersionsTest.java +@@ -77,7 +77,6 @@ public class ClassFileVersionKnownVersionsTest { + {17, 17, Arrays.asList("1.17", "17"), Opcodes.V17, (short) 61, (short) 0, true, true, true}, + {18, 18, Arrays.asList("1.18", "18"), Opcodes.V18, (short) 62, (short) 0, true, true, true}, + {19, 19, Arrays.asList("1.19", "19"), Opcodes.V19, (short) 63, (short) 0, true, true, true}, +- {20, 20, Arrays.asList("1.20", "20"), Opcodes.V20, (short) 64, (short) 0, true, true, true} + }); + } + |