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/commons-compress/, dev-java/commons-compress/files/
Date: Tue, 12 Oct 2021 06:51:58
Message-Id: 1634021508.67f37a4652c157fd4e616cbb052f725d84dd3315.fordfrog@gentoo
1 commit: 67f37a4652c157fd4e616cbb052f725d84dd3315
2 Author: Miroslav Šulc <fordfrog <AT> gentoo <DOT> org>
3 AuthorDate: Tue Oct 12 06:51:38 2021 +0000
4 Commit: Miroslav Šulc <fordfrog <AT> gentoo <DOT> org>
5 CommitDate: Tue Oct 12 06:51:48 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=67f37a46
7
8 dev-java/commons-compress: bump to 1.21
9
10 Bug: https://bugs.gentoo.org/802078
11 Package-Manager: Portage-3.0.28, Repoman-3.0.3
12 Signed-off-by: Miroslav Šulc <fordfrog <AT> gentoo.org>
13
14 dev-java/commons-compress/Manifest | 1 +
15 .../commons-compress/commons-compress-1.21.ebuild | 73 +++++++++
16 .../files/commons-compress-1.21-asm7+.patch | 164 +++++++++++++++++++++
17 3 files changed, 238 insertions(+)
18
19 diff --git a/dev-java/commons-compress/Manifest b/dev-java/commons-compress/Manifest
20 index 9ce212e7e1b..5de04003112 100644
21 --- a/dev-java/commons-compress/Manifest
22 +++ b/dev-java/commons-compress/Manifest
23 @@ -1 +1,2 @@
24 DIST commons-compress-1.20-sources.tar.gz 12990994 BLAKE2B 5709419bc7b54ac9eee4ee9a42f2ecef9ae7ed0d4b1a91e0b79c791f4cf018aed8bff4ce507d1ef9136fdc28bd550d234632d0bb9ebe7819b57c5ce99694adb6 SHA512 1794bae69e00339d9e4d35b3276543ff6f9a0f1614ec9bd7c4ec8ff1bc86d08cd48e9dc3ec712b969cf8ccd61ef6054d0c6203d7cba0c28b22e6a3ecccd0c43e
25 +DIST commons-compress-1.21-sources.tar.gz 15165800 BLAKE2B 3fed32af039860c6b434c485f0c78939ed810a224a12680ddf1d9d6ed540f4e74530edd0e0077fd41af31404c296a607db912465cfd725c31446bc6fa7b8df8a SHA512 8041371b491057435ca62390e70b30031e4d21e80c37d9cb922fdffa794b56aee3b5d60d8241e4db0cecc28c82dfdaafbe52b2175e26062da169fec8efbb17e1
26
27 diff --git a/dev-java/commons-compress/commons-compress-1.21.ebuild b/dev-java/commons-compress/commons-compress-1.21.ebuild
28 new file mode 100644
29 index 00000000000..3d5ac30baec
30 --- /dev/null
31 +++ b/dev-java/commons-compress/commons-compress-1.21.ebuild
32 @@ -0,0 +1,73 @@
33 +# Copyright 1999-2021 Gentoo Authors
34 +# Distributed under the terms of the GNU General Public License v2
35 +
36 +# Skeleton command:
37 +# java-ebuilder --generate-ebuild --workdir . --pom pom.xml --download-uri https://apache.miloslavbrada.cz//commons/compress/source/commons-compress-1.21-src.tar.gz --slot 0 --keywords "~amd64 ~arm64 ~x86" --ebuild commons-compress-1.21.ebuild
38 +
39 +EAPI=7
40 +
41 +JAVA_PKG_IUSE="doc source"
42 +MAVEN_ID="org.apache.commons:commons-compress:1.21"
43 +
44 +inherit java-pkg-2 java-pkg-simple
45 +
46 +DESCRIPTION="Java API for working with archive files"
47 +HOMEPAGE="https://commons.apache.org/proper/commons-compress/"
48 +SRC_URI="mirror://apache/commons/compress/source/${P}-src.tar.gz -> ${P}-sources.tar.gz"
49 +LICENSE="Apache-2.0"
50 +SLOT="0"
51 +KEYWORDS="~amd64 ~arm64 ~x86"
52 +
53 +# Common dependencies
54 +# POM: pom.xml
55 +# asm:asm:3.2 -> !!!groupId-not-found!!!
56 +# com.github.luben:zstd-jni:1.5.0-2 -> >=dev-java/zstd-jni-1.5.0.4:0
57 +# org.brotli:dec:0.1.2 -> >=dev-java/brotli-dec-0.1.2:0
58 +# org.tukaani:xz:1.9 -> >=dev-java/xz-java-1.9:0
59 +
60 +CDEPEND="
61 + dev-java/asm:9
62 + >=dev-java/brotli-dec-0.1.2:0
63 + >=dev-java/xz-java-1.9:0
64 + >=dev-java/zstd-jni-1.5.0.4:0
65 +"
66 +
67 +# Compile dependencies
68 +# POM: pom.xml
69 +# org.osgi:org.osgi.core:6.0.0 -> !!!artifactId-not-found!!!
70 +# POM: pom.xml
71 +# test? com.github.marschall:memoryfilesystem:2.1.0 -> !!!groupId-not-found!!!
72 +# test? javax.inject:javax.inject:1 -> !!!groupId-not-found!!!
73 +# test? junit:junit:4.13.2 -> >=dev-java/junit-4.13.2:4
74 +# test? org.apache.felix:org.apache.felix.framework:7.0.0 -> !!!groupId-not-found!!!
75 +# test? org.hamcrest:hamcrest:2.2 -> !!!artifactId-not-found!!!
76 +# test? org.mockito:mockito-core:3.11.1 -> !!!suitable-mavenVersion-not-found!!!
77 +# test? org.ops4j.pax.exam:pax-exam-cm:4.13.1 -> !!!groupId-not-found!!!
78 +# test? org.ops4j.pax.exam:pax-exam-container-native:4.13.1 -> !!!groupId-not-found!!!
79 +# test? org.ops4j.pax.exam:pax-exam-junit4:4.13.1 -> !!!groupId-not-found!!!
80 +# test? org.ops4j.pax.exam:pax-exam-link-mvn:4.13.1 -> !!!groupId-not-found!!!
81 +# test? org.slf4j:slf4j-api:1.7.30 -> >=dev-java/slf4j-api-1.7.30:0
82 +
83 +DEPEND="
84 + >=virtual/jdk-1.8:*
85 + ${CDEPEND}
86 +"
87 +
88 +RDEPEND="
89 + >=virtual/jre-1.8:*
90 + ${CDEPEND}"
91 +
92 +S="${WORKDIR}/${P}-src"
93 +
94 +PATCHES=(
95 + "${FILESDIR}/${P}-asm7+.patch"
96 +)
97 +
98 +JAVA_ENCODING="iso-8859-1"
99 +
100 +JAVA_GENTOO_CLASSPATH="asm-9,zstd-jni,brotli-dec,xz-java"
101 +JAVA_SRC_DIR="src/main/java"
102 +
103 +src_prepare() {
104 + default
105 +}
106
107 diff --git a/dev-java/commons-compress/files/commons-compress-1.21-asm7+.patch b/dev-java/commons-compress/files/commons-compress-1.21-asm7+.patch
108 new file mode 100644
109 index 00000000000..e20fa89787d
110 --- /dev/null
111 +++ b/dev-java/commons-compress/files/commons-compress-1.21-asm7+.patch
112 @@ -0,0 +1,164 @@
113 +From 7709c8be97147e8d5c5d7fa42d076504931ba9e0 Mon Sep 17 00:00:00 2001
114 +From: Stephan Blecher <token_github@×××××××.at>
115 +Date: Tue, 10 Aug 2021 14:39:21 +0200
116 +Subject: [PATCH] COMPRESS-582: update harmony to ASM >= 7.0
117 +
118 +---
119 + pom.xml | 5 +--
120 + .../harmony/pack200/Pack200ClassReader.java | 2 +-
121 + .../compress/harmony/pack200/Segment.java | 35 +++++++++++++++----
122 + .../harmony/pack200/tests/ArchiveTest.java | 0
123 + 4 files changed, 32 insertions(+), 10 deletions(-)
124 + mode change 100644 => 100755 src/test/java/org/apache/commons/compress/harmony/pack200/tests/ArchiveTest.java
125 +
126 +diff --git a/pom.xml b/pom.xml
127 +index 28f50f06a..1c6844d24 100644
128 +--- a/pom.xml
129 ++++ b/pom.xml
130 +@@ -78,6 +78,7 @@ Brotli, Zstandard and ar, cpio, jar, tar, zip, dump, 7z, arj.
131 + <commons.jacoco.version>0.8.7</commons.jacoco.version>
132 + <commons.japicmp.version>0.15.3</commons.japicmp.version>
133 + <commons.javadoc.version>3.3.0</commons.javadoc.version>
134 ++ <asm.version>7.0</asm.version>
135 + </properties>
136 +
137 + <issueManagement>
138 +@@ -119,9 +120,9 @@ Brotli, Zstandard and ar, cpio, jar, tar, zip, dump, 7z, arj.
139 +
140 + <!-- Pack200 -->
141 + <dependency>
142 +- <groupId>asm</groupId>
143 ++ <groupId>org.ow2.asm</groupId>
144 + <artifactId>asm</artifactId>
145 +- <version>3.2</version>
146 ++ <version>${asm.version}</version>
147 + <optional>true</optional>
148 + </dependency>
149 +
150 +diff --git a/src/main/java/org/apache/commons/compress/harmony/pack200/Pack200ClassReader.java b/src/main/java/org/apache/commons/compress/harmony/pack200/Pack200ClassReader.java
151 +index 2a017bc01..7022b7b30 100644
152 +--- a/src/main/java/org/apache/commons/compress/harmony/pack200/Pack200ClassReader.java
153 ++++ b/src/main/java/org/apache/commons/compress/harmony/pack200/Pack200ClassReader.java
154 +@@ -40,7 +40,7 @@ public int readUnsignedShort(final int index) {
155 + // Doing this to check whether last load-constant instruction was ldc (18) or ldc_w (19)
156 + // TODO: Assess whether this impacts on performance
157 + final int unsignedShort = super.readUnsignedShort(index);
158 +- if (b[index - 1] == 19) {
159 ++ if (index > 0 && b[index - 1] == 19) {
160 + lastUnsignedShort = unsignedShort;
161 + } else {
162 + lastUnsignedShort = Short.MIN_VALUE;
163 +diff --git a/src/main/java/org/apache/commons/compress/harmony/pack200/Segment.java b/src/main/java/org/apache/commons/compress/harmony/pack200/Segment.java
164 +index 0609aa4c2..1bc73a018 100644
165 +--- a/src/main/java/org/apache/commons/compress/harmony/pack200/Segment.java
166 ++++ b/src/main/java/org/apache/commons/compress/harmony/pack200/Segment.java
167 +@@ -32,12 +32,20 @@
168 + import org.objectweb.asm.FieldVisitor;
169 + import org.objectweb.asm.Label;
170 + import org.objectweb.asm.MethodVisitor;
171 ++import org.objectweb.asm.Opcodes;
172 + import org.objectweb.asm.Type;
173 +
174 ++
175 + /**
176 + * A Pack200 archive consists of one or more Segments.
177 + */
178 +-public class Segment implements ClassVisitor {
179 ++public class Segment extends ClassVisitor {
180 ++
181 ++ public static int ASM_API = Opcodes.ASM4; /* see https://asm.ow2.io/javadoc/org/objectweb/asm/Opcodes.html#ASM4 */
182 ++
183 ++ public Segment() {
184 ++ super(ASM_API);
185 ++ }
186 +
187 + private SegmentHeader segmentHeader;
188 + private CpBands cpBands;
189 +@@ -255,8 +263,12 @@ public void visitEnd() {
190 + *
191 + * It delegates to BcBands for bytecode related visits and to ClassBands for everything else.
192 + */
193 +- public class SegmentMethodVisitor implements MethodVisitor {
194 +-
195 ++ public class SegmentMethodVisitor extends MethodVisitor {
196 ++
197 ++ public SegmentMethodVisitor() {
198 ++ super(ASM_API);
199 ++ }
200 ++
201 + @Override
202 + public AnnotationVisitor visitAnnotation(final String desc, final boolean visible) {
203 + return new SegmentAnnotationVisitor(MetadataBandGroup.CONTEXT_METHOD, desc, visible);
204 +@@ -427,7 +439,7 @@ public ClassBands getClassBands() {
205 + /**
206 + * SegmentAnnotationVisitor implements <code>AnnotationVisitor</code> to visit Annotations found in a class file.
207 + */
208 +- public class SegmentAnnotationVisitor implements AnnotationVisitor {
209 ++ public class SegmentAnnotationVisitor extends AnnotationVisitor {
210 +
211 + private int context = -1;
212 + private int parameter = -1;
213 +@@ -443,17 +455,20 @@ public ClassBands getClassBands() {
214 + private final List nestPairN = new ArrayList();
215 +
216 + public SegmentAnnotationVisitor(final int context, final String desc, final boolean visible) {
217 ++ super(ASM_API);
218 + this.context = context;
219 + this.desc = desc;
220 + this.visible = visible;
221 + }
222 +
223 + public SegmentAnnotationVisitor(final int context) {
224 ++ super(ASM_API);
225 + this.context = context;
226 + }
227 +
228 + public SegmentAnnotationVisitor(final int context, final int parameter, final String desc,
229 + final boolean visible) {
230 ++ super(ASM_API);
231 + this.context = context;
232 + this.parameter = parameter;
233 + this.desc = desc;
234 +@@ -478,7 +493,7 @@ public AnnotationVisitor visitAnnotation(String name, final String desc) {
235 + nameRU.add(name);
236 + nestTypeRS.add(desc);
237 + nestPairN.add(Integer.valueOf(0));
238 +- return new AnnotationVisitor() {
239 ++ return new AnnotationVisitor(context, av) {
240 + @Override
241 + public void visit(final String name, final Object value) {
242 + final Integer numPairs = (Integer) nestPairN.remove(nestPairN.size() - 1);
243 +@@ -552,7 +567,7 @@ public void visitEnum(String name, final String desc, final String value) {
244 + }
245 + }
246 +
247 +- public class ArrayVisitor implements AnnotationVisitor {
248 ++ public class ArrayVisitor extends AnnotationVisitor {
249 +
250 + private final int indexInCaseArrayN;
251 + private final List caseArrayN;
252 +@@ -561,6 +576,8 @@ public void visitEnum(String name, final String desc, final String value) {
253 + private final List T;
254 +
255 + public ArrayVisitor(final List caseArrayN, final List T, final List nameRU, final List values) {
256 ++ super(ASM_API);
257 ++
258 + this.caseArrayN = caseArrayN;
259 + this.T = T;
260 + this.nameRU = nameRU;
261 +@@ -612,7 +629,11 @@ public void visitEnum(final String name, final String desc, final String value)
262 + * SegmentFieldVisitor implements <code>FieldVisitor</code> to visit the metadata relating to fields in a class
263 + * file.
264 + */
265 +- public class SegmentFieldVisitor implements FieldVisitor {
266 ++ public class SegmentFieldVisitor extends FieldVisitor {
267 ++
268 ++ public SegmentFieldVisitor() {
269 ++ super(ASM_API);
270 ++ }
271 +
272 + @Override
273 + public AnnotationVisitor visitAnnotation(final String desc, final boolean visible) {
274 +diff --git a/src/test/java/org/apache/commons/compress/harmony/pack200/tests/ArchiveTest.java b/src/test/java/org/apache/commons/compress/harmony/pack200/tests/ArchiveTest.java
275 +old mode 100644
276 +new mode 100755