1 |
1 |
# Copyright 1999-2022 Gentoo Authors
|
2 |
2 |
# Distributed under the terms of the GNU General Public License v2
|
3 |
3 |
|
4 |
|
# Skeleton command:
|
5 |
|
# java-ebuilder --generate-ebuild --workdir . --pom pom.xml --download-uri https://github.com/easymock/easymock/archive/easymock-2.5.2.tar.gz --slot 2.5 --keywords "~amd64" --ebuild easymock-2.5.2.ebuild
|
6 |
|
|
7 |
4 |
EAPI=8
|
8 |
5 |
|
9 |
6 |
JAVA_PKG_IUSE="doc source test"
|
10 |
|
MAVEN_ID="org.easymock:easymock:2.5.2"
|
|
7 |
MAVEN_ID="org.easymock:easymock:3.3.1"
|
11 |
8 |
JAVA_TESTING_FRAMEWORKS="junit-4"
|
12 |
9 |
|
13 |
10 |
inherit java-pkg-2 java-pkg-simple
|
14 |
11 |
|
15 |
12 |
DESCRIPTION="Mock Objects for interfaces in JUnit tests by generating them on the fly"
|
16 |
|
HOMEPAGE="https://easymock.org"
|
17 |
|
SRC_URI="https://github.com/easymock/easymock/archive/${P}.tar.gz"
|
|
13 |
HOMEPAGE="https://easymock.org/"
|
|
14 |
SRC_URI="https://github.com/${PN}/${PN}/archive/refs/tags/${P}.tar.gz"
|
18 |
15 |
|
19 |
16 |
LICENSE="Apache-2.0"
|
20 |
|
SLOT="2.5"
|
|
17 |
SLOT="3.2"
|
21 |
18 |
KEYWORDS="amd64 ~arm arm64 ppc64 x86"
|
22 |
19 |
|
23 |
|
DEPEND=">=virtual/jdk-1.8:*"
|
24 |
|
RDEPEND=">=virtual/jre-1.8:*"
|
25 |
|
|
26 |
|
PATCHES=(
|
27 |
|
"${FILESDIR}/easymock-2.5.5-nameClash.patch"
|
28 |
|
"${FILESDIR}/easymock-2.5.5-tests2nameClash.patch"
|
|
20 |
CDEPEND="
|
|
21 |
dev-java/cglib:3
|
|
22 |
dev-java/junit:4
|
|
23 |
dev-java/objenesis:0
|
|
24 |
"
|
|
25 |
|
|
26 |
DEPEND="
|
|
27 |
>=virtual/jdk-1.8:*
|
|
28 |
${CDEPEND}
|
|
29 |
"
|
|
30 |
|
|
31 |
RDEPEND="
|
|
32 |
>=virtual/jre-1.8:*
|
|
33 |
${CDEPEND}
|
|
34 |
"
|
|
35 |
|
|
36 |
S="${WORKDIR}/${PN}-${P}"
|
|
37 |
|
|
38 |
JAVA_ENCODING="ISO-8859-1"
|
|
39 |
|
|
40 |
JAVA_GENTOO_CLASSPATH="cglib-3,junit-4,objenesis"
|
|
41 |
JAVA_SRC_DIR=(
|
|
42 |
"${PN}/src/main/java"
|
|
43 |
"${PN}/src/samples/java"
|
29 |
44 |
)
|
30 |
45 |
|
31 |
|
S="${WORKDIR}/easymock-easymock-${PV}"
|
32 |
|
|
33 |
|
JAVA_SRC_DIR="src/main/java"
|
34 |
|
|
35 |
46 |
JAVA_TEST_GENTOO_CLASSPATH="junit-4"
|
36 |
|
JAVA_TEST_SRC_DIR="src/test/java"
|
37 |
|
JAVA_TEST_RESOURCE_DIRS="src/test/resources"
|
|
47 |
JAVA_TEST_SRC_DIR="${PN}/src/test/java"
|
|
48 |
JAVA_TEST_EXCLUDES=(
|
|
49 |
"org.easymock.tests2.EasyMockAnnotationsTest" # "java.lang.InstantiationException" (12 x)
|
|
50 |
"org.easymock.tests.BaseEasyMockRunnerTest" # No runnable methods
|
|
51 |
)
|
38 |
52 |
|
39 |
53 |
src_prepare() {
|
40 |
|
default # https://bugs.gentoo.org/780585
|
41 |
|
# 1) testGetInstance(org.easymock.tests2.EasyMockPropertiesTest)
|
42 |
|
# java.lang.AssertionError: expected:<1> but was:<null>
|
43 |
|
sed \
|
44 |
|
-e '/import org.junit.Test/a import org.junit.Ignore;' \
|
45 |
|
-e '/testGetInstance()/i @Ignore' \
|
46 |
|
-i src/test/java/org/easymock/tests2/EasyMockPropertiesTest.java || die
|
47 |
|
|
48 |
|
# 2) testPrimitiveDeprecated(org.easymock.tests2.CaptureTest)
|
49 |
|
# java.lang.AssertionError:
|
50 |
|
# 3) testPrimitiveVsObject(org.easymock.tests2.CaptureTest)
|
51 |
|
# java.lang.AssertionError:
|
52 |
|
sed \
|
53 |
|
-e '/import org.junit.Test/a import org.junit.Ignore;' \
|
54 |
|
-e '/testPrimitiveDeprecated()/i @Ignore' \
|
55 |
|
-e '/testPrimitiveVsObject()/i @Ignore' \
|
56 |
|
-i src/test/java/org/easymock/tests2/CaptureTest.java || die
|
|
54 |
default
|
|
55 |
# error: package com.google.dexmaker.stock does not exist
|
|
56 |
eapply "${FILESDIR}"/3.3.1-r1-no-android.patch
|
|
57 |
rm easymock/src/main/java/org/easymock/internal/AndroidClassProxyFactory.java || die
|
|
58 |
# cannot find symbol o = ProxyBuilder.forClass(ArrayList.class)
|
|
59 |
rm easymock/src/test/java/org/easymock/tests2/ClassExtensionHelperTest.java || die
|
|
60 |
}
|
|
61 |
|
|
62 |
src_test() {
|
|
63 |
# ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain) throws
|
|
64 |
# java.lang.ClassFormatError accessible: module java.base does not "opens java.lang" to unnamed module @66da75e4
|
|
65 |
local vm_version="$(java-config -g PROVIDES_VERSION)"
|
|
66 |
if ver_test "${vm_version}" -ge 17; then
|
|
67 |
JAVA_TEST_EXTRA_ARGS+=( --add-opens=java.base/java.lang=ALL-UNNAMED )
|
|
68 |
JAVA_TEST_EXTRA_ARGS+=( --add-opens=java.base/java.io=ALL-UNNAMED )
|
|
69 |
fi
|
|
70 |
java-pkg-simple_src_test
|
57 |
71 |
}
|