1 |
commit: b3702b18f502f88733cb382a777d26fc953fb4d7 |
2 |
Author: Volkmar W. Pogatzki <gentoo <AT> pogatzki <DOT> net> |
3 |
AuthorDate: Sat Jun 25 22:52:02 2022 +0000 |
4 |
Commit: Miroslav Šulc <fordfrog <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Jul 3 07:46:39 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b3702b18 |
7 |
|
8 |
dev-java/hamcrest: new package, add 2.2 |
9 |
|
10 |
Thanks to the patch provided by fordfrog it compiles with jdk-17 |
11 |
Signed-off-by: Volkmar W. Pogatzki <gentoo <AT> pogatzki.net> |
12 |
Closes: https://github.com/gentoo/gentoo/pull/26078 |
13 |
Signed-off-by: Miroslav Šulc <fordfrog <AT> gentoo.org> |
14 |
|
15 |
dev-java/hamcrest/Manifest | 1 + |
16 |
dev-java/hamcrest/files/hamcrest-2.2-java-11.patch | 127 +++++++++++++++++++++ |
17 |
dev-java/hamcrest/hamcrest-2.2.ebuild | 49 ++++++++ |
18 |
dev-java/hamcrest/metadata.xml | 10 ++ |
19 |
4 files changed, 187 insertions(+) |
20 |
|
21 |
diff --git a/dev-java/hamcrest/Manifest b/dev-java/hamcrest/Manifest |
22 |
new file mode 100644 |
23 |
index 000000000000..db8fb161eae4 |
24 |
--- /dev/null |
25 |
+++ b/dev-java/hamcrest/Manifest |
26 |
@@ -0,0 +1 @@ |
27 |
+DIST hamcrest-2.2.tar.gz 603615 BLAKE2B b367fcb13be3314655e29e9196f3ae202200335801ea5bd8f97b5cd845bf7ecb39c4910b10e49938a373aa7897b62bc0935780490386bde1993add5b943b1eaf SHA512 8120e4f4ad83ff41b8b8ede1fe0817eb8fce6f13072e932aff7fc8c9f64689698753ae47b9f024922d5ab0a5bf7bb88b9e1998064d69a58b8c418ab89200e66a |
28 |
|
29 |
diff --git a/dev-java/hamcrest/files/hamcrest-2.2-java-11.patch b/dev-java/hamcrest/files/hamcrest-2.2-java-11.patch |
30 |
new file mode 100644 |
31 |
index 000000000000..83d8ddea9108 |
32 |
--- /dev/null |
33 |
+++ b/dev-java/hamcrest/files/hamcrest-2.2-java-11.patch |
34 |
@@ -0,0 +1,127 @@ |
35 |
+diff --git a/hamcrest/src/main/java/org/hamcrest/collection/ArrayMatching.java b/hamcrest/src/main/java/org/hamcrest/collection/ArrayMatching.java |
36 |
+index fc968e0..3bbc36e 100644 |
37 |
+--- a/hamcrest/src/main/java/org/hamcrest/collection/ArrayMatching.java |
38 |
++++ b/hamcrest/src/main/java/org/hamcrest/collection/ArrayMatching.java |
39 |
+@@ -67,7 +67,7 @@ public class ArrayMatching { |
40 |
+ */ |
41 |
+ @SafeVarargs |
42 |
+ public static <E> Matcher<E[]> arrayContainingInAnyOrder(Matcher<? super E>... itemMatchers) { |
43 |
+- return arrayContainingInAnyOrder(asList(itemMatchers)); |
44 |
++ return arrayContainingInAnyOrder((List<Matcher<? super E>>) asList(itemMatchers)); |
45 |
+ } |
46 |
+ |
47 |
+ /** |
48 |
+diff --git a/hamcrest/src/main/java/org/hamcrest/collection/IsArrayContainingInAnyOrder.java b/hamcrest/src/main/java/org/hamcrest/collection/IsArrayContainingInAnyOrder.java |
49 |
+index 7e72a62..35ff806 100644 |
50 |
+--- a/hamcrest/src/main/java/org/hamcrest/collection/IsArrayContainingInAnyOrder.java |
51 |
++++ b/hamcrest/src/main/java/org/hamcrest/collection/IsArrayContainingInAnyOrder.java |
52 |
+@@ -59,7 +59,7 @@ public class IsArrayContainingInAnyOrder<E> extends TypeSafeMatcher<E[]> { |
53 |
+ * a list of matchers, each of which must be satisfied by an entry in an examined array |
54 |
+ */ |
55 |
+ public static <E> Matcher<E[]> arrayContainingInAnyOrder(Matcher<? super E>... itemMatchers) { |
56 |
+- return arrayContainingInAnyOrder(Arrays.asList(itemMatchers)); |
57 |
++ return arrayContainingInAnyOrder((List<Matcher<? super E>>) Arrays.asList(itemMatchers)); |
58 |
+ } |
59 |
+ |
60 |
+ /** |
61 |
+diff --git a/hamcrest/src/main/java/org/hamcrest/collection/IsArrayContainingInOrder.java b/hamcrest/src/main/java/org/hamcrest/collection/IsArrayContainingInOrder.java |
62 |
+index c046914..312543f 100644 |
63 |
+--- a/hamcrest/src/main/java/org/hamcrest/collection/IsArrayContainingInOrder.java |
64 |
++++ b/hamcrest/src/main/java/org/hamcrest/collection/IsArrayContainingInOrder.java |
65 |
+@@ -73,7 +73,7 @@ public class IsArrayContainingInOrder<E> extends TypeSafeMatcher<E[]> { |
66 |
+ * the matchers that must be satisfied by the items in the examined array |
67 |
+ */ |
68 |
+ public static <E> Matcher<E[]> arrayContaining(Matcher<? super E>... itemMatchers) { |
69 |
+- return arrayContaining(asList(itemMatchers)); |
70 |
++ return arrayContaining((List<Matcher<? super E>>) asList(itemMatchers)); |
71 |
+ } |
72 |
+ |
73 |
+ /** |
74 |
+diff --git a/hamcrest/src/main/java/org/hamcrest/collection/IsIterableContainingInAnyOrder.java b/hamcrest/src/main/java/org/hamcrest/collection/IsIterableContainingInAnyOrder.java |
75 |
+index d6a9a33..6b4e39e 100644 |
76 |
+--- a/hamcrest/src/main/java/org/hamcrest/collection/IsIterableContainingInAnyOrder.java |
77 |
++++ b/hamcrest/src/main/java/org/hamcrest/collection/IsIterableContainingInAnyOrder.java |
78 |
+@@ -98,7 +98,7 @@ public class IsIterableContainingInAnyOrder<T> extends TypeSafeDiagnosingMatcher |
79 |
+ */ |
80 |
+ @SafeVarargs |
81 |
+ public static <T> Matcher<Iterable<? extends T>> containsInAnyOrder(Matcher<? super T>... itemMatchers) { |
82 |
+- return containsInAnyOrder(Arrays.asList(itemMatchers)); |
83 |
++ return containsInAnyOrder((List<Matcher<? super T>>) Arrays.asList(itemMatchers)); |
84 |
+ } |
85 |
+ |
86 |
+ /** |
87 |
+diff --git a/hamcrest/src/main/java/org/hamcrest/collection/IsIterableContainingInRelativeOrder.java b/hamcrest/src/main/java/org/hamcrest/collection/IsIterableContainingInRelativeOrder.java |
88 |
+index 0657768..383c552 100644 |
89 |
+--- a/hamcrest/src/main/java/org/hamcrest/collection/IsIterableContainingInRelativeOrder.java |
90 |
++++ b/hamcrest/src/main/java/org/hamcrest/collection/IsIterableContainingInRelativeOrder.java |
91 |
+@@ -99,7 +99,7 @@ public class IsIterableContainingInRelativeOrder<E> extends TypeSafeDiagnosingMa |
92 |
+ */ |
93 |
+ @SafeVarargs |
94 |
+ public static <E> Matcher<Iterable<? extends E>> containsInRelativeOrder(Matcher<? super E>... itemMatchers) { |
95 |
+- return containsInRelativeOrder(asList(itemMatchers)); |
96 |
++ return containsInRelativeOrder((List<Matcher<? super E>>) asList(itemMatchers)); |
97 |
+ } |
98 |
+ |
99 |
+ /** |
100 |
+diff --git a/hamcrest/src/main/java/org/hamcrest/core/AllOf.java b/hamcrest/src/main/java/org/hamcrest/core/AllOf.java |
101 |
+index b8c3faa..e7e2550 100644 |
102 |
+--- a/hamcrest/src/main/java/org/hamcrest/core/AllOf.java |
103 |
++++ b/hamcrest/src/main/java/org/hamcrest/core/AllOf.java |
104 |
+@@ -4,6 +4,7 @@ import org.hamcrest.Description; |
105 |
+ import org.hamcrest.DiagnosingMatcher; |
106 |
+ import org.hamcrest.Matcher; |
107 |
+ |
108 |
++import java.util.List; |
109 |
+ import java.util.Arrays; |
110 |
+ |
111 |
+ /** |
112 |
+@@ -56,6 +57,6 @@ public class AllOf<T> extends DiagnosingMatcher<T> { |
113 |
+ */ |
114 |
+ @SafeVarargs |
115 |
+ public static <T> Matcher<T> allOf(Matcher<? super T>... matchers) { |
116 |
+- return allOf(Arrays.asList(matchers)); |
117 |
++ return allOf((List<Matcher<? super T>>) Arrays.asList(matchers)); |
118 |
+ } |
119 |
+ } |
120 |
+diff --git a/hamcrest/src/main/java/org/hamcrest/core/AnyOf.java b/hamcrest/src/main/java/org/hamcrest/core/AnyOf.java |
121 |
+index 7a22c22..ba52275 100644 |
122 |
+--- a/hamcrest/src/main/java/org/hamcrest/core/AnyOf.java |
123 |
++++ b/hamcrest/src/main/java/org/hamcrest/core/AnyOf.java |
124 |
+@@ -3,6 +3,7 @@ package org.hamcrest.core; |
125 |
+ import org.hamcrest.Description; |
126 |
+ import org.hamcrest.Matcher; |
127 |
+ |
128 |
++import java.util.List; |
129 |
+ import java.util.Arrays; |
130 |
+ |
131 |
+ /** |
132 |
+@@ -46,6 +47,6 @@ public class AnyOf<T> extends ShortcutCombination<T> { |
133 |
+ */ |
134 |
+ @SafeVarargs |
135 |
+ public static <T> AnyOf<T> anyOf(Matcher<? super T>... matchers) { |
136 |
+- return anyOf(Arrays.asList(matchers)); |
137 |
++ return anyOf((List<Matcher<? super T>>) Arrays.asList(matchers)); |
138 |
+ } |
139 |
+ } |
140 |
+diff --git a/hamcrest/src/main/java/org/hamcrest/core/CombinableMatcher.java b/hamcrest/src/main/java/org/hamcrest/core/CombinableMatcher.java |
141 |
+index e37efce..3ca6f96 100644 |
142 |
+--- a/hamcrest/src/main/java/org/hamcrest/core/CombinableMatcher.java |
143 |
++++ b/hamcrest/src/main/java/org/hamcrest/core/CombinableMatcher.java |
144 |
+@@ -57,7 +57,7 @@ public class CombinableMatcher<T> extends TypeSafeDiagnosingMatcher<T> { |
145 |
+ this.first = matcher; |
146 |
+ } |
147 |
+ public CombinableMatcher<X> and(Matcher<? super X> other) { |
148 |
+- return new CombinableMatcher<>(first).and(other); |
149 |
++ return new CombinableMatcher<X>(first).and(other); |
150 |
+ } |
151 |
+ } |
152 |
+ |
153 |
+@@ -76,7 +76,7 @@ public class CombinableMatcher<T> extends TypeSafeDiagnosingMatcher<T> { |
154 |
+ this.first = matcher; |
155 |
+ } |
156 |
+ public CombinableMatcher<X> or(Matcher<? super X> other) { |
157 |
+- return new CombinableMatcher<>(first).or(other); |
158 |
++ return new CombinableMatcher<X>(first).or(other); |
159 |
+ } |
160 |
+ } |
161 |
+ } |
162 |
|
163 |
diff --git a/dev-java/hamcrest/hamcrest-2.2.ebuild b/dev-java/hamcrest/hamcrest-2.2.ebuild |
164 |
new file mode 100644 |
165 |
index 000000000000..6b0b18d4b6b5 |
166 |
--- /dev/null |
167 |
+++ b/dev-java/hamcrest/hamcrest-2.2.ebuild |
168 |
@@ -0,0 +1,49 @@ |
169 |
+# Copyright 1999-2022 Gentoo Authors |
170 |
+# Distributed under the terms of the GNU General Public License v2 |
171 |
+ |
172 |
+# Skeleton command: |
173 |
+# java-ebuilder --generate-ebuild --workdir . --pom hamcrest-2.2.pom --download-uri https://github.com/hamcrest/JavaHamcrest/archive/v2.2.tar.gz --slot 0 --keywords "~amd64" --ebuild hamcrest-2.2.ebuild |
174 |
+ |
175 |
+EAPI=8 |
176 |
+ |
177 |
+JAVA_PKG_IUSE="doc source test" |
178 |
+MAVEN_ID="org.hamcrest:hamcrest:2.2" |
179 |
+JAVA_TESTING_FRAMEWORKS="junit-4" |
180 |
+ |
181 |
+inherit java-pkg-2 java-pkg-simple |
182 |
+ |
183 |
+DESCRIPTION="Core API and libraries of hamcrest matcher framework." |
184 |
+HOMEPAGE="http://hamcrest.org/JavaHamcrest/" |
185 |
+SRC_URI="https://github.com/${PN}/JavaHamcrest/archive/v${PV}.tar.gz -> ${P}.tar.gz" |
186 |
+ |
187 |
+LICENSE="BSD" |
188 |
+SLOT="0" |
189 |
+KEYWORDS="~amd64" |
190 |
+ |
191 |
+DEPEND=" |
192 |
+ >=virtual/jdk-1.8:* |
193 |
+" |
194 |
+ |
195 |
+RDEPEND=" |
196 |
+ >=virtual/jre-1.8:* |
197 |
+" |
198 |
+ |
199 |
+PATCHES=( "${FILESDIR}"/hamcrest-2.2-java-11.patch ) |
200 |
+ |
201 |
+DOCS=( {CHANGES,README}.md ) |
202 |
+ |
203 |
+S="${WORKDIR}/JavaHamcrest-${PV}" |
204 |
+ |
205 |
+JAVA_SRC_DIR="hamcrest/src/main/java" |
206 |
+JAVA_TEST_GENTOO_CLASSPATH="junit-4" |
207 |
+JAVA_TEST_SRC_DIR="hamcrest/src/test/java" |
208 |
+ |
209 |
+src_prepare() { |
210 |
+ default |
211 |
+ java-pkg-2_src_prepare |
212 |
+} |
213 |
+ |
214 |
+src_install() { |
215 |
+ default # https://bugs.gentoo.org/789582 |
216 |
+ java-pkg-simple_src_install |
217 |
+} |
218 |
|
219 |
diff --git a/dev-java/hamcrest/metadata.xml b/dev-java/hamcrest/metadata.xml |
220 |
new file mode 100644 |
221 |
index 000000000000..27becd4fbc1d |
222 |
--- /dev/null |
223 |
+++ b/dev-java/hamcrest/metadata.xml |
224 |
@@ -0,0 +1,10 @@ |
225 |
+<?xml version="1.0" encoding="UTF-8"?> |
226 |
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd"> |
227 |
+<pkgmetadata> |
228 |
+ <maintainer type="project"> |
229 |
+ <email>java@g.o</email> |
230 |
+ </maintainer> |
231 |
+ <upstream> |
232 |
+ <remote-id type="github">hamcrest/JavaHamcrest</remote-id> |
233 |
+ </upstream> |
234 |
+</pkgmetadata> |