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/snakeyaml/
Date: Mon, 20 Mar 2023 07:26:54
Message-Id: 1679297201.aee65fdfa0ce1abe59f9f4433f309fda95630e5f.fordfrog@gentoo
1 commit: aee65fdfa0ce1abe59f9f4433f309fda95630e5f
2 Author: Volkmar W. Pogatzki <gentoo <AT> pogatzki <DOT> net>
3 AuthorDate: Sun Mar 19 14:49:00 2023 +0000
4 Commit: Miroslav Šulc <fordfrog <AT> gentoo <DOT> org>
5 CommitDate: Mon Mar 20 07:26:41 2023 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=aee65fdf
7
8 dev-java/snakeyaml: add 2.0 - CVE-2022-1471
9
10 - skips 2 classes in META-INF/versions/9 due to https://bugs.gentoo.org/900433
11
12 Bug: https://bugs.gentoo.org/883853
13 Signed-off-by: Volkmar W. Pogatzki <gentoo <AT> pogatzki.net>
14 Closes: https://github.com/gentoo/gentoo/pull/30235
15 Signed-off-by: Miroslav Šulc <fordfrog <AT> gentoo.org>
16
17 dev-java/snakeyaml/Manifest | 1 +
18 dev-java/snakeyaml/snakeyaml-2.0.ebuild | 76 +++++++++++++++++++++++++++++++++
19 2 files changed, 77 insertions(+)
20
21 diff --git a/dev-java/snakeyaml/Manifest b/dev-java/snakeyaml/Manifest
22 index c2603d2f156f..97b875b06b47 100644
23 --- a/dev-java/snakeyaml/Manifest
24 +++ b/dev-java/snakeyaml/Manifest
25 @@ -1 +1,2 @@
26 DIST snakeyaml-1.33.tar.gz 406196 BLAKE2B 9b7e7d7a5d35d433445737f4b5cc07744e3686a71cc4b9e44ce46153831b76f01da7ef6bc60ea82a7173283a77d0da500bea2bc7ee76bdde4ebda00aa6054aa8 SHA512 ad367d7e7bcb2225094d132df77d91e7401026af02f4ede14a2a4fc5cf78f0cfa1e4400f16f43a669faa2f0e444d36c3745e3c9df3d9114d62fee070c4c99414
27 +DIST snakeyaml-2.0.tar.gz 405458 BLAKE2B 69d81e0b23080ff86c1f6fe8a924a504d627c353bf9c026703ef54f14e572458e77c501415260667bcb18008ee96ca99cab7ed43c004d36fed781500f09054cf SHA512 ef4da2ae5f5e6cd7b68aabb0d37a4fdbd33be899cd1d4dad3210cc791ca85af57661f623898449841b930eaffc9e61cef337efa4e6371710307ef3758f0af329
28
29 diff --git a/dev-java/snakeyaml/snakeyaml-2.0.ebuild b/dev-java/snakeyaml/snakeyaml-2.0.ebuild
30 new file mode 100644
31 index 000000000000..9066dbd63aba
32 --- /dev/null
33 +++ b/dev-java/snakeyaml/snakeyaml-2.0.ebuild
34 @@ -0,0 +1,76 @@
35 +# Copyright 1999-2023 Gentoo Authors
36 +# Distributed under the terms of the GNU General Public License v2
37 +
38 +EAPI=8
39 +
40 +JAVA_PKG_IUSE="doc source test"
41 +MAVEN_ID="org.yaml:snakeyaml:2.0"
42 +JAVA_TESTING_FRAMEWORKS="junit-4"
43 +
44 +inherit java-pkg-2 java-pkg-simple
45 +
46 +DESCRIPTION="YAML 1.1 parser and emitter for Java"
47 +HOMEPAGE="https://bitbucket.org/snakeyaml/snakeyaml"
48 +SRC_URI="https://bitbucket.org/${PN}/${PN}/get/${P}.tar.gz"
49 +S="${WORKDIR}/snakeyaml-snakeyaml-59ddbb3304bb"
50 +
51 +LICENSE="Apache-2.0"
52 +SLOT="2"
53 +KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~x86"
54 +
55 +# Compile dependencies
56 +# POM: pom.xml
57 +# test? joda-time:joda-time:2.11.2 -> >=dev-java/joda-time-2.11.2:0
58 +# test? junit:junit:4.13.2 -> >=dev-java/junit-4.13.2:4
59 +# test? org.apache.velocity:velocity-engine-core:2.3 -> >=dev-java/velocity-2.3:0
60 +# test? org.projectlombok:lombok:1.18.24 -> !!!groupId-not-found!!!
61 +
62 +DEPEND="
63 + >=virtual/jdk-11:*
64 + test? (
65 + dev-java/velocity:0
66 + dev-java/joda-time:0
67 + )
68 +"
69 +
70 +RDEPEND=">=virtual/jre-1.8:*"
71 +
72 +JAVA_SRC_DIR="src/main/java"
73 +JAVA_TEST_GENTOO_CLASSPATH="joda-time,junit-4,velocity"
74 +JAVA_TEST_RESOURCE_DIRS="src/test/resources"
75 +JAVA_TEST_SRC_DIR="src/test/java"
76 +
77 +# Workaround for https://bugs.gentoo.org/900433
78 +# src/main/java9/org/yaml/snakeyaml/internal/Logger.java:16:
79 +# error: duplicate class: org.yaml.snakeyaml.internal.Logger
80 +src_prepare() {
81 + java-pkg-2_src_prepare
82 + mv src/main/java{9,}/module-info.java || die
83 +}
84 +
85 +src_test() {
86 + export EnvironmentKey1="EnvironmentValue1"
87 + export EnvironmentEmpty=""
88 +
89 + # Not packaged org.projectlombok:lombok - https://bugs.gentoo.org/868684
90 + rm src/test/java/org/yaml/snakeyaml/env/EnvLombokTest.java || die # Tests run: 1
91 + rm src/test/java/org/yaml/snakeyaml/issues/issue387/YamlExecuteProcessContextTest.java || die # Tests run: 1
92 + rm src/test/java/org/yaml/snakeyaml/env/ApplicationProperties.java || die # No tests # import lombok.
93 +
94 + # https://bugs.gentoo.org/871744
95 + pushd src/test/java || die
96 + local JAVA_TEST_RUN_ONLY=$(find * -name "*Test.java" \
97 + ! -name "StressTest.java" \
98 + ! -name "ParallelTest.java" \
99 + ! -name "AbstractTest.java" \
100 + ! -name "PyImportTest.java" \
101 + ! -name "Fuzzer50355Test.java" \
102 + ! -name "ContextClassLoaderTest.java" \
103 + )
104 + popd
105 +
106 + JAVA_TEST_RUN_ONLY="${JAVA_TEST_RUN_ONLY//.java}"
107 + JAVA_TEST_RUN_ONLY="${JAVA_TEST_RUN_ONLY//\//.}"
108 +
109 + java-pkg-simple_src_test
110 +}