1 |
commit: 4d19bc8b00130761c4a62c4476f8879ef97adb2f |
2 |
Author: Thibaud CANALE <thican <AT> thican <DOT> net> |
3 |
AuthorDate: Thu Oct 27 18:47:28 2022 +0000 |
4 |
Commit: Sam James <sam <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Oct 30 22:04:49 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4d19bc8b |
7 |
|
8 |
dev-java/protobuf-java: add 3.21.9-r1 |
9 |
|
10 |
Bug: https://bugs.gentoo.org/878467 |
11 |
|
12 |
Didn’t suppress previous revision because already stabilized on x86. |
13 |
|
14 |
Restores features available in other bindings: |
15 |
- parent version in SRC_URI to avoid the download of two tar.gz |
16 |
archives instead of one, |
17 |
- patch system more valuable for users, |
18 |
- parent's _SUB_slot value for consistency with main library. |
19 |
|
20 |
Does not restore variable for MAVEN_ID, burden of maintenance it |
21 |
requires manual updating. |
22 |
Does not restore live ("9999") version, kept in dedicated ebuild. |
23 |
|
24 |
Signed-off-by: Thibaud CANALE <thican <AT> thican.net> |
25 |
Closes: https://github.com/gentoo/gentoo/pull/27990 |
26 |
Signed-off-by: Sam James <sam <AT> gentoo.org> |
27 |
|
28 |
dev-java/protobuf-java/Manifest | 1 + |
29 |
.../protobuf-java/protobuf-java-3.21.9-r1.ebuild | 98 ++++++++++++++++++++++ |
30 |
2 files changed, 99 insertions(+) |
31 |
|
32 |
diff --git a/dev-java/protobuf-java/Manifest b/dev-java/protobuf-java/Manifest |
33 |
index 7aeb6eae7a73..86f5dda32428 100644 |
34 |
--- a/dev-java/protobuf-java/Manifest |
35 |
+++ b/dev-java/protobuf-java/Manifest |
36 |
@@ -1,2 +1,3 @@ |
37 |
+DIST protobuf-21.9.tar.gz 5110670 BLAKE2B a4f5b7f58e1c5904ca990b100a72992f6f56177b28773f8de8c99e4158391d33cfb8aa8575915887fc9ae4294faf81d4ff6b470bc07b394bfd5885a09ba0fafe SHA512 6954b42d21921e630173b7848c056ab95635627d8eddec960f3db2ddda13eedde00520a9b350722e76e2998649eb8ebe10758e1db938b6a91e38ff3295b1b7c1 |
38 |
DIST protobuf-3.19.3.tar.gz 5293258 BLAKE2B c05b70ffca97f7166ea6a511a36907eed125edf1ebf17f908718221d9b851be84dfb2b1b39973f2faf35f6ade630e6ba4f9e8b91b8fbc922c5db97079323ee6e SHA512 1c003e7cbc8eae6a038f46e688b401ee202ba47f502561e909df79770f6e8b7daf3dc1ccc727e31bfb5b52cd04cb4fef7d2d2a28d650c13f396872ad4aa076c6 |
39 |
DIST protobuf-3.21.9.tar.gz 5112917 BLAKE2B 1788652e89ccb77feeaf2a3f4ce8e8554b29c1bccf3f58d79c66f3e5f080659a9b7eb4f2b4a07ce640549749f376deaf725d20e19674348b5bce9168aad5d095 SHA512 d54843a4ed66edf6cab7262849216b909313d70e9758aa7f00d02902c576396f0a77bb224fe2ce408da37aefaf7da9f568dea7bda4e397fc1e3666c8aaf9cb0f |
40 |
|
41 |
diff --git a/dev-java/protobuf-java/protobuf-java-3.21.9-r1.ebuild b/dev-java/protobuf-java/protobuf-java-3.21.9-r1.ebuild |
42 |
new file mode 100644 |
43 |
index 000000000000..a24c805333e0 |
44 |
--- /dev/null |
45 |
+++ b/dev-java/protobuf-java/protobuf-java-3.21.9-r1.ebuild |
46 |
@@ -0,0 +1,98 @@ |
47 |
+# Copyright 2008-2022 Gentoo Authors |
48 |
+# Distributed under the terms of the GNU General Public License v2 |
49 |
+ |
50 |
+EAPI=8 |
51 |
+ |
52 |
+JAVA_PKG_IUSE="doc source test" |
53 |
+MAVEN_ID="com.google.protobuf:protobuf-java:3.21.9" |
54 |
+# Tests not enabled, depend on com.google.truth which is not packaged |
55 |
+# https://github.com/protocolbuffers/protobuf/blob/v21.9/java/core/pom.xml#L35-L40 |
56 |
+# JAVA_TESTING_FRAMEWORKS="junit-4" |
57 |
+ |
58 |
+inherit edo java-pkg-2 java-pkg-simple |
59 |
+ |
60 |
+PARENT_PN="${PN/-java/}" |
61 |
+PARENT_PV="$(ver_cut 2-)" |
62 |
+PARENT_P="${PARENT_PN}-${PARENT_PV}" |
63 |
+PARENT_SUBSLOT="32" |
64 |
+ |
65 |
+DESCRIPTION="Google's Protocol Buffers - Java bindings" |
66 |
+HOMEPAGE="https://developers.google.com/protocol-buffers/" |
67 |
+SRC_URI=" |
68 |
+ https://github.com/protocolbuffers/protobuf/archive/v${PARENT_PV}.tar.gz |
69 |
+ -> ${PARENT_P}.tar.gz |
70 |
+" |
71 |
+ |
72 |
+LICENSE="BSD" |
73 |
+SLOT="0" |
74 |
+KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~x86 ~amd64-linux ~x86-linux ~x64-macos" |
75 |
+ |
76 |
+DEPEND=" |
77 |
+ >=virtual/jdk-1.8:* |
78 |
+ test? ( |
79 |
+ dev-java/guava:0 |
80 |
+ dev-java/mockito:4 |
81 |
+ ) |
82 |
+" |
83 |
+RDEPEND=">=virtual/jre-1.8:*" |
84 |
+ |
85 |
+BDEPEND="dev-libs/protobuf:0/${PARENT_SUBSLOT}" |
86 |
+ |
87 |
+S="${WORKDIR}/${PARENT_P}/java" |
88 |
+ |
89 |
+JAVA_AUTOMATIC_MODULE_NAME="com.google.protobuf" |
90 |
+JAVA_JAR_FILENAME="protobuf.jar" |
91 |
+JAVA_RESOURCE_DIRS="core/src/main/resources" |
92 |
+JAVA_SRC_DIR="core/src/main/java" |
93 |
+ |
94 |
+JAVA_TEST_GENTOO_CLASSPATH="guava,junit-4,mockito-4" |
95 |
+JAVA_TEST_RESOURCE_DIRS="../src" |
96 |
+JAVA_TEST_SRC_DIR="core/src/test/java" |
97 |
+ |
98 |
+# Same than PATCHES but from repository's root directory, |
99 |
+# please see function `src_prepare` below. |
100 |
+# Simplier for users IMHO. |
101 |
+PARENT_PATCHES=( |
102 |
+) |
103 |
+ |
104 |
+# Here for patches within "java/" subdirectory. |
105 |
+PATCHES=( |
106 |
+) |
107 |
+ |
108 |
+src_prepare() { |
109 |
+ pushd "${WORKDIR}/${PARENT_P}" > /dev/null || die |
110 |
+ [[ -n "${PARENT_PATCHES[@]}" ]] && eapply "${PARENT_PATCHES[@]}" |
111 |
+ eapply_user |
112 |
+ popd > /dev/null || die |
113 |
+ |
114 |
+ # Same than default without the eapply_user part, this last is kept |
115 |
+ # for the parent directory. |
116 |
+ # It looks like function java-pkg-2_src_prepare doesn’t call "default". |
117 |
+ [[ -n "${PATCHES[@]}" ]] && eapply "${PATCHES[@]}" |
118 |
+ |
119 |
+ # Remove bundled jars |
120 |
+ java-pkg_clean |
121 |
+ |
122 |
+ java-pkg-2_src_prepare |
123 |
+ |
124 |
+ # There is also compiler/plugin, but not in this list because in a subdirectory |
125 |
+ core_protos=( any api descriptor duration empty field_mask source_context struct timestamp type wrappers ) |
126 |
+ |
127 |
+ # Copy resources from ../src/google/protobuf according to |
128 |
+ # https://github.com/protocolbuffers/protobuf/blob/v21.9/java/core/pom.xml#L45-L61 |
129 |
+ mkdir -p "${JAVA_RESOURCE_DIRS}/google/protobuf/compiler" || die |
130 |
+ local core_proto |
131 |
+ for core_proto in "${core_protos[@]}"; do |
132 |
+ cp "../src/google/protobuf/${core_proto}.proto" \ |
133 |
+ "${JAVA_RESOURCE_DIRS}/google/protobuf" \ |
134 |
+ || die |
135 |
+ done |
136 |
+ cp {../src,"${JAVA_RESOURCE_DIRS}"}/google/protobuf/compiler/plugin.proto || die |
137 |
+ |
138 |
+ # Generate 146 .java files according to |
139 |
+ # https://github.com/protocolbuffers/protobuf/blob/v21.9/java/core/generate-sources-build.xml |
140 |
+ for core_proto in "${core_protos[@]}" compiler/plugin; do |
141 |
+ edo "${BROOT}/usr/bin/protoc" \ |
142 |
+ --java_out="${JAVA_SRC_DIR}" -I../src ../src/google/protobuf/"${core_proto}".proto |
143 |
+ done |
144 |
+} |