Gentoo Archives: gentoo-commits

From: "Miroslav Šulc" <fordfrog@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-java/mvel/files/, dev-java/mvel/
Date: Wed, 19 Jan 2022 09:23:54
Message-Id: 1642584131.28f70d482376d73456a37367becda59a6d79acb4.fordfrog@gentoo
1 commit: 28f70d482376d73456a37367becda59a6d79acb4
2 Author: Yuan Liao <liaoyuan <AT> gmail <DOT> com>
3 AuthorDate: Mon Dec 20 16:59:15 2021 +0000
4 Commit: Miroslav Šulc <fordfrog <AT> gentoo <DOT> org>
5 CommitDate: Wed Jan 19 09:22:11 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=28f70d48
7
8 dev-java/mvel: Initial import
9
10 Signed-off-by: Yuan Liao <liaoyuan <AT> gmail.com>
11 Closes: https://github.com/gentoo/gentoo/pull/23438/commits/d5e0c70697375cdd5351448f086e33d6cf3260ff
12 Signed-off-by: Miroslav Šulc <fordfrog <AT> gentoo.org>
13
14 dev-java/mvel/Manifest | 1 +
15 .../files/mvel-2.3.2-ignore-failing-tests.patch | 43 ++++++++++++
16 ...mvel-2.3.2-update-supported-java-versions.patch | 51 ++++++++++++++
17 .../mvel-2.3.2-update-version-in-output.patch | 26 +++++++
18 dev-java/mvel/metadata.xml | 11 +++
19 dev-java/mvel/mvel-2.3.2.ebuild | 82 ++++++++++++++++++++++
20 6 files changed, 214 insertions(+)
21
22 diff --git a/dev-java/mvel/Manifest b/dev-java/mvel/Manifest
23 new file mode 100644
24 index 000000000000..4af3792b6c2f
25 --- /dev/null
26 +++ b/dev-java/mvel/Manifest
27 @@ -0,0 +1 @@
28 +DIST mvel2-2.3.2.Final.tar.gz 2405839 BLAKE2B 5f12652a0f4375f6e24f18313d99a02bb86463cc1acc2f8845b815c9c7afcda410d67c9f1c30544f9ab1cd50a48ce0ab72e9cca94faafab776f3704b1d5fa087 SHA512 9d1c92bfe90aa4cfe5f4bbdd7eef2060bfaec3979c5c07a5baf3ddb4d84a00632dcaec266bab675b31d5b745bfa36a89dd5969ababeb64332069939a4df23dbc
29
30 diff --git a/dev-java/mvel/files/mvel-2.3.2-ignore-failing-tests.patch b/dev-java/mvel/files/mvel-2.3.2-ignore-failing-tests.patch
31 new file mode 100644
32 index 000000000000..1cfd9e8abc36
33 --- /dev/null
34 +++ b/dev-java/mvel/files/mvel-2.3.2-ignore-failing-tests.patch
35 @@ -0,0 +1,43 @@
36 +From fcf12bd0322556b4396a72a5402124d9543781d9 Mon Sep 17 00:00:00 2001
37 +From: Yuan Liao <liaoyuan@×××××.com>
38 +Date: Sun, 16 Jan 2022 09:48:48 -0800
39 +Subject: [PATCH] Ignore tests that fail even when run by Maven on JUnit 4.13.2
40 +
41 +To reproduce the failure, make sure to edit line 249 of pom.xml to use
42 +JUnit 4.13.2. Note that the failed tests are JUnit 3 tests, which
43 +cannot be ignored with the @org.junit.Ignore annotation.
44 +
45 +When no tests are ignored, only testMapAccessWithNestedMethodCall() will
46 +fail. However, ignoring that test will cause
47 +testMapAccessWithNestedProperty() to fail afterwards.
48 +
49 +Signed-off-by: Yuan Liao <liaoyuan@×××××.com>
50 +---
51 + src/test/java/org/mvel2/tests/core/CoreConfidenceTests.java | 4 ++--
52 + 1 file changed, 2 insertions(+), 2 deletions(-)
53 +
54 +diff --git a/src/test/java/org/mvel2/tests/core/CoreConfidenceTests.java b/src/test/java/org/mvel2/tests/core/CoreConfidenceTests.java
55 +index ea7661bb..1c92c327 100644
56 +--- a/src/test/java/org/mvel2/tests/core/CoreConfidenceTests.java
57 ++++ b/src/test/java/org/mvel2/tests/core/CoreConfidenceTests.java
58 +@@ -3431,7 +3431,7 @@ public class CoreConfidenceTests extends AbstractTest {
59 + assertTrue(result);
60 + }
61 +
62 +- public void testMapAccessWithNestedMethodCall() {
63 ++ public void noTestMapAccessWithNestedMethodCall() {
64 + String str = "map[aMethod(1)] == \"one\"";
65 +
66 + ParserConfiguration pconf = new ParserConfiguration();
67 +@@ -3446,7 +3446,7 @@ public class CoreConfidenceTests extends AbstractTest {
68 + assertTrue(result);
69 + }
70 +
71 +- public void testMapAccessWithNestedProperty() {
72 ++ public void noTestMapAccessWithNestedProperty() {
73 + String str = "map[key] == \"one\"";
74 +
75 + ParserConfiguration pconf = new ParserConfiguration();
76 +--
77 +2.34.1
78 +
79
80 diff --git a/dev-java/mvel/files/mvel-2.3.2-update-supported-java-versions.patch b/dev-java/mvel/files/mvel-2.3.2-update-supported-java-versions.patch
81 new file mode 100644
82 index 000000000000..d019002cda1f
83 --- /dev/null
84 +++ b/dev-java/mvel/files/mvel-2.3.2-update-supported-java-versions.patch
85 @@ -0,0 +1,51 @@
86 +From 04f476bbc3768d9052ae9c8a1b0aa53340a993b3 Mon Sep 17 00:00:00 2001
87 +From: Yuan Liao <liaoyuan@×××××.com>
88 +Date: Sun, 16 Jan 2022 08:01:46 -0800
89 +Subject: [PATCH] ASMAccessorOptimizer: Update supported Java versions as of
90 + 2.4.14
91 +
92 +Squashed patch of the following commits:
93 +
94 +From: deaddowney <spamcontrol@×××.com>
95 +Date: Fri, 22 Jun 2018 09:38:24 -0400
96 +Subject: [PATCH 1/4] Mvel not working with Java 10 (11) GH Issue #159
97 +
98 +From: dieter sauvillers <dieter.sauvillers@×××××××.be>
99 +Date: Tue, 2 Apr 2019 10:20:31 +0200
100 +Subject: [PATCH 2/4] mvel does not work with java 12 #185
101 +
102 +From: mmelko <mmelko@××××××.com>
103 +Date: Fri, 26 Jun 2020 08:55:24 +0200
104 +Subject: [PATCH 3/4] Fix building on java 14
105 +
106 +From: mariofusco <mario.fusco@×××××.com>
107 +Date: Mon, 24 Aug 2020 08:54:22 +0200
108 +Subject: [PATCH 4/4] drop compatibility with java versions lower than 1.4
109 +
110 +Signed-off-by: Yuan Liao <liaoyuan@×××××.com>
111 +---
112 + .../mvel2/optimizers/impl/asm/ASMAccessorOptimizer.java | 7 +------
113 + 1 file changed, 1 insertion(+), 6 deletions(-)
114 +
115 +diff --git a/src/main/java/org/mvel2/optimizers/impl/asm/ASMAccessorOptimizer.java b/src/main/java/org/mvel2/optimizers/impl/asm/ASMAccessorOptimizer.java
116 +index 45520538..4c4c876e 100644
117 +--- a/src/main/java/org/mvel2/optimizers/impl/asm/ASMAccessorOptimizer.java
118 ++++ b/src/main/java/org/mvel2/optimizers/impl/asm/ASMAccessorOptimizer.java
119 +@@ -118,13 +118,8 @@ public class ASMAccessorOptimizer extends AbstractOptimizer implements AccessorO
120 + OPCODES_VERSION = Opcodes.V1_4;
121 + } else if (javaVersion.startsWith("1.5")) {
122 + OPCODES_VERSION = Opcodes.V1_5;
123 +- } else if (javaVersion.startsWith("1.6")
124 +- || javaVersion.startsWith("1.7")
125 +- || javaVersion.startsWith("1.8")
126 +- || javaVersion.startsWith("9")) {
127 +- OPCODES_VERSION = Opcodes.V1_6;
128 + } else {
129 +- OPCODES_VERSION = Opcodes.V1_2;
130 ++ OPCODES_VERSION = Opcodes.V1_6;
131 + }
132 +
133 + String defaultNameSapce = getProperty("mvel2.namespace");
134 +--
135 +2.34.1
136 +
137
138 diff --git a/dev-java/mvel/files/mvel-2.3.2-update-version-in-output.patch b/dev-java/mvel/files/mvel-2.3.2-update-version-in-output.patch
139 new file mode 100644
140 index 000000000000..8b7250540b05
141 --- /dev/null
142 +++ b/dev-java/mvel/files/mvel-2.3.2-update-version-in-output.patch
143 @@ -0,0 +1,26 @@
144 +From 0a316a5cb0d889220fb3e730ea1471c1b4052736 Mon Sep 17 00:00:00 2001
145 +From: Yuan Liao <liaoyuan@×××××.com>
146 +Date: Sun, 16 Jan 2022 10:21:47 -0800
147 +Subject: [PATCH] Update program version shown in program output
148 +
149 +Signed-off-by: Yuan Liao <liaoyuan@×××××.com>
150 +---
151 + src/main/java/org/mvel2/MVEL.java | 2 +-
152 + 1 file changed, 1 insertion(+), 1 deletion(-)
153 +
154 +diff --git a/src/main/java/org/mvel2/MVEL.java b/src/main/java/org/mvel2/MVEL.java
155 +index eafe17fc..6bbf5f06 100644
156 +--- a/src/main/java/org/mvel2/MVEL.java
157 ++++ b/src/main/java/org/mvel2/MVEL.java
158 +@@ -45,7 +45,7 @@ import static org.mvel2.util.ParseTools.optimizeTree;
159 + public class MVEL {
160 + public static final String NAME = "MVEL (MVFLEX Expression Language)";
161 + public static final String VERSION = "2.3";
162 +- public static final String VERSION_SUB = "0";
163 ++ public static final String VERSION_SUB = "2";
164 + public static final String CODENAME = "liberty";
165 + static boolean DEBUG_FILE = getBoolean("mvel2.debug.fileoutput");
166 + static String ADVANCED_DEBUGGING_FILE = System.getProperty("mvel2.debugging.file") == null ? "mvel_debug.txt" : System.getProperty("mvel2.debugging.file");
167 +--
168 +2.34.1
169 +
170
171 diff --git a/dev-java/mvel/metadata.xml b/dev-java/mvel/metadata.xml
172 new file mode 100644
173 index 000000000000..8c54e97e66cc
174 --- /dev/null
175 +++ b/dev-java/mvel/metadata.xml
176 @@ -0,0 +1,11 @@
177 +<?xml version="1.0" encoding="UTF-8"?>
178 +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
179 +<pkgmetadata>
180 + <maintainer type="project">
181 + <email>java@g.o</email>
182 + <name>Java</name>
183 + </maintainer>
184 + <upstream>
185 + <remote-id type="github">mvel/mvel</remote-id>
186 + </upstream>
187 +</pkgmetadata>
188
189 diff --git a/dev-java/mvel/mvel-2.3.2.ebuild b/dev-java/mvel/mvel-2.3.2.ebuild
190 new file mode 100644
191 index 000000000000..1c0e3cd39852
192 --- /dev/null
193 +++ b/dev-java/mvel/mvel-2.3.2.ebuild
194 @@ -0,0 +1,82 @@
195 +# Copyright 2021-2022 Gentoo Authors
196 +# Distributed under the terms of the GNU General Public License v2
197 +
198 +EAPI=8
199 +
200 +JAVA_PKG_IUSE="doc source test"
201 +MAVEN_ID="org.mvel:mvel2:2.3.2.Final"
202 +
203 +# Note: This package has a mixture of JUnit 3 and JUnit 4 tests, all of which
204 +# can be run with JUnit 4. As of January 2022, JUnit 3 test launcher will only
205 +# run 2 tests out of nearly 1100 JUnit 3 tests in total, whereas JUnit 4 test
206 +# launcher can run all of them
207 +JAVA_TESTING_FRAMEWORKS="junit-4"
208 +
209 +inherit java-pkg-2 java-pkg-simple
210 +
211 +DESCRIPTION="MVFLEX Expression Language"
212 +HOMEPAGE="https://github.com/mvel/mvel"
213 +SRC_URI="https://github.com/mvel/mvel/archive/refs/tags/mvel2-${PV}.Final.tar.gz"
214 +
215 +LICENSE="Apache-2.0"
216 +SLOT="0"
217 +KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~x86"
218 +
219 +DEPEND="
220 + >=virtual/jdk-1.8:*
221 +"
222 +
223 +RDEPEND="
224 + >=virtual/jre-1.8:*
225 +"
226 +
227 +S="${WORKDIR}/${PN}-${PN}2-${PV}.Final"
228 +
229 +JAVA_SRC_DIR="src/main/java"
230 +# Required due to use of '_' as identifiers in source files
231 +JAVADOC_ARGS="-source 8"
232 +# https://github.com/mvel/mvel/blob/mvel2-2.3.2.Final/pom.xml#L131
233 +JAVA_MAIN_CLASS="org.mvel2.sh.Main"
234 +JAVA_LAUNCHER_FILENAME="${PN}"
235 +
236 +JAVA_TEST_GENTOO_CLASSPATH="junit-4"
237 +JAVA_TEST_SRC_DIR="src/test/java"
238 +JAVA_TEST_RESOURCE_DIRS=( "src/test/resources" )
239 +JAVA_TEST_EXCLUDES=(
240 + # No runnable methods
241 + org.mvel2.tests.perftests.CompiledPerformanceTests
242 + org.mvel2.tests.perftests.SimpleTests
243 + org.mvel2.tests.core.MVELThreadTest
244 + org.mvel2.tests.core.res.TestClass
245 + org.mvel2.tests.core.res.TestInterface
246 + org.mvel2.tests.core.res.TestMVEL197
247 + org.mvel2.tests.templates.tests.res.TestPluginNode
248 +)
249 +# Significantly speed up test execution
250 +# https://github.com/mvel/mvel/blob/mvel2-2.3.2.Final/pom.xml#L158-L171
251 +JAVA_TEST_EXTRA_ARGS=(
252 + -Dfile.encoding=UTF-8
253 + -Dmvel.disable.jit=true
254 + -Dmvel.tests.quick=true
255 +)
256 +
257 +pkg_setup() {
258 + java-pkg-2_pkg_setup
259 + # Fix org.mvel2.tests.core.PropertyAccessTests.testMVEL308 failure
260 + # on Java 17, caused by java.lang.reflect.InaccessibleObjectException:
261 + # module java.base does not "opens java.util" to unnamed module
262 + # https://github.com/mvel/mvel/issues/282
263 + ver_test "$(java-config -g PROVIDES_VERSION)" -ge 17 && \
264 + JAVA_TEST_EXTRA_ARGS+=( --add-opens=java.base/java.util=ALL-UNNAMED )
265 +}
266 +
267 +src_prepare() {
268 + # Clean up bundled JARs "manually" to prevent
269 + # removal of JARs under JAVA_TEST_RESOURCE_DIRS
270 + rm -r lib/ || die "Failed to remove bundled JARs"
271 +
272 + eapply "${FILESDIR}/${P}-update-supported-java-versions.patch"
273 + eapply "${FILESDIR}/${P}-update-version-in-output.patch"
274 + use test && eapply "${FILESDIR}/${P}-ignore-failing-tests.patch"
275 + java-pkg-2_src_prepare
276 +}