summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVolkmar W. Pogatzki <gentoo@pogatzki.net>2022-02-21 17:38:28 +0100
committerMiroslav Šulc <fordfrog@gentoo.org>2022-02-22 08:44:31 +0100
commitd69a238faf8e3bba5a66917136cc83207a380860 (patch)
treefb713f970ae36930a2e051b8b2840ceec301a90c /dev-java/cglib
parentdev-java/rome: EAPI 8, min java 1.8:* (diff)
downloadgentoo-d69a238faf8e3bba5a66917136cc83207a380860.tar.gz
gentoo-d69a238faf8e3bba5a66917136cc83207a380860.tar.bz2
gentoo-d69a238faf8e3bba5a66917136cc83207a380860.zip
dev-java/cglib: Fix test failure
Package-Manager: Portage-3.0.30, Repoman-3.0.3 Signed-off-by: Volkmar W. Pogatzki <gentoo@pogatzki.net> Closes: https://github.com/gentoo/gentoo/pull/24301 Signed-off-by: Miroslav Šulc <fordfrog@gentoo.org>
Diffstat (limited to 'dev-java/cglib')
-rw-r--r--dev-java/cglib/cglib-3.3.0-r1.ebuild71
1 files changed, 71 insertions, 0 deletions
diff --git a/dev-java/cglib/cglib-3.3.0-r1.ebuild b/dev-java/cglib/cglib-3.3.0-r1.ebuild
new file mode 100644
index 000000000000..d82a7f3a7d4a
--- /dev/null
+++ b/dev-java/cglib/cglib-3.3.0-r1.ebuild
@@ -0,0 +1,71 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+# doc USE flag is not in IUSE as the docs does not compile because of errors
+JAVA_PKG_IUSE="examples source test"
+MAVEN_ID="cglib:cglib:3.3.0"
+JAVA_TESTING_FRAMEWORKS="junit-4"
+
+inherit java-pkg-2 java-pkg-simple
+
+MY_PV=RELEASE_${PV//./_}
+MY_P=cglib-${MY_PV}
+
+DESCRIPTION="cglib is a powerful, high performance and quality Code Generation Library"
+HOMEPAGE="https://github.com/cglib/cglib"
+SRC_URI="https://github.com/cglib/cglib/archive//${MY_PV}.tar.gz -> ${MY_P}.tar.gz"
+
+LICENSE="Apache-2.0"
+SLOT="3"
+KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~x86"
+
+CDEPEND="dev-java/ant-core:0
+ dev-java/asm:9
+"
+DEPEND="
+ >=virtual/jdk-1.8:*
+ ${CDEPEND}
+"
+RDEPEND="
+ >=virtual/jre-1.8:*
+ ${CDEPEND}
+"
+
+S="${WORKDIR}"
+
+JAVA_GENTOO_CLASSPATH="asm-9 ant-core"
+JAVA_SRC_DIR="${MY_P}/${PN}/src/main/java"
+JAVA_RESOURCE_DIRS="${MY_P}/${PN}/src/main/resources"
+
+JAVA_TEST_GENTOO_CLASSPATH="junit-4"
+JAVA_TEST_SRC_DIR="${MY_P}/${PN}/src/test/java"
+JAVA_TEST_EXCLUDES=(
+ "net.sf.cglib.CodeGenTestCase" # not a test class
+ "net.sf.cglib.TestAll"
+ "net.sf.cglib.TestGenerator" # not a test class
+ "net.sf.cglib.proxy.TestEnhancer" # broken tests
+ "net.sf.cglib.proxy.TestInterceptor" # not a test class
+ "net.sf.cglib.reflect.TestFastClass" # broken tests
+)
+
+src_test() {
+ # Caused by: net.sf.cglib.core.CodeGenerationException:
+ # java.lang.reflect.InaccessibleObjectException-->Unable to make protected final java.lang.Class
+ # java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
+ # throws java.lang.ClassFormatError accessible: module java.base does not "opens java.lang" to unnamed module @42bb2aee
+
+ local vm_version="$(java-config -g PROVIDES_VERSION)"
+ if [[ "${vm_version}" -ge "17" ]] ; then
+ JAVA_TEST_EXTRA_ARGS+=( --add-opens=java.base/java.lang=ALL-UNNAMED )
+ fi
+
+ java-pkg-simple_src_test
+}
+
+src_install() {
+ java-pkg-simple_src_install
+
+ use examples && java-pkg_doexamples --subdir samples ${MY_P}/cglib-sample/src/main/java
+}