summaryrefslogtreecommitdiff
path: root/dev-java/protobuf-java
diff options
context:
space:
mode:
Diffstat (limited to 'dev-java/protobuf-java')
-rw-r--r--dev-java/protobuf-java/Manifest2
-rw-r--r--dev-java/protobuf-java/protobuf-java-3.21.9-r1.ebuild98
2 files changed, 100 insertions, 0 deletions
diff --git a/dev-java/protobuf-java/Manifest b/dev-java/protobuf-java/Manifest
index e6e06f18d61c..3857300f5d90 100644
--- a/dev-java/protobuf-java/Manifest
+++ b/dev-java/protobuf-java/Manifest
@@ -1,6 +1,8 @@
+DIST protobuf-21.9.tar.gz 5110670 BLAKE2B a4f5b7f58e1c5904ca990b100a72992f6f56177b28773f8de8c99e4158391d33cfb8aa8575915887fc9ae4294faf81d4ff6b470bc07b394bfd5885a09ba0fafe SHA512 6954b42d21921e630173b7848c056ab95635627d8eddec960f3db2ddda13eedde00520a9b350722e76e2998649eb8ebe10758e1db938b6a91e38ff3295b1b7c1
DIST protobuf-3.19.3.tar.gz 5293258 BLAKE2B c05b70ffca97f7166ea6a511a36907eed125edf1ebf17f908718221d9b851be84dfb2b1b39973f2faf35f6ade630e6ba4f9e8b91b8fbc922c5db97079323ee6e SHA512 1c003e7cbc8eae6a038f46e688b401ee202ba47f502561e909df79770f6e8b7daf3dc1ccc727e31bfb5b52cd04cb4fef7d2d2a28d650c13f396872ad4aa076c6
DIST protobuf-3.21.9.tar.gz 5112917 BLAKE2B 1788652e89ccb77feeaf2a3f4ce8e8554b29c1bccf3f58d79c66f3e5f080659a9b7eb4f2b4a07ce640549749f376deaf725d20e19674348b5bce9168aad5d095 SHA512 d54843a4ed66edf6cab7262849216b909313d70e9758aa7f00d02902c576396f0a77bb224fe2ce408da37aefaf7da9f568dea7bda4e397fc1e3666c8aaf9cb0f
EBUILD protobuf-java-3.19.3.ebuild 1451 BLAKE2B c0bad09302e1e52cff018223c055939e2d4335874f2be95e913705368926106c6967b5a98d7f0a392037060c040fd3116210f0d1de567dc17e66bfc252202e4b SHA512 a74e044d91db564a682f8d9b82fa73608fc10f2b0a917b1eb696375f5993e62cf03289a31b7e28aa27cbfdf027bf62160083ff39186d1f8333b52633ba5ed0fb
+EBUILD protobuf-java-3.21.9-r1.ebuild 3001 BLAKE2B c5f30f2bac7c55c9a9f523066aac3a3ef5acd54aaa093d1a0663effc6c3e866a75b9fa306e3537ade01a4f57a538b86a10927e96a33ec652292bc478e35eebc5 SHA512 b353ae17f20b12a75973ca0fee6d16092c19fc4ad1568d1672e287aa5937cc12408277a3857ea4f8624669f5e2d39ed717984b30a768dab783c3b672deebccfe
EBUILD protobuf-java-3.21.9.ebuild 2250 BLAKE2B aa87469f2d9d6e6dc53d11ef39c1c5e79ca958b2072762f3afb993a543e632632eb537aba96200b76ff245cc07bcf3b9f3661fc402820ffcb725050b92340faf SHA512 b8460526eac3a04da27c3eab28b459a377655eb1819c69f192bc599181bf2cf0d5beaabfdb677203a1cbd944d0acd55712504664f58b064e95d6b7f970e1c1ff
EBUILD protobuf-java-9999.ebuild 3078 BLAKE2B 837383cde2c29c4605564b30a071eeb8240c9a447a03cae8c63526d0c0011146faf0a914fe13c0cfe6952f49fef01c08e928fb7568a1f7930393ae851a87f484 SHA512 4be8eef3afd89a5e0248d4181d0ae7e1fdde18adfa9e7e3e9aa869e174adff77ce066ae346393d201ba585c7dd686b7ee0826ba9f76729f11569717b5655441c
MISC metadata.xml 625 BLAKE2B 13394b9a2148b9117ce719954591e79088f845ac1ceb667bbdd2645b989daadcfea09525f9dde68c405e3f1cce5cc1af32de9fb4dff629e4745e13fa92727dd7 SHA512 47f693db57dbde04f419ed65494d81b0a800c9ac49d790c9b794baef34fb1f876da29c5a0662c45aa3c01cecd34af648e196fb76110fcc0066198c59543049b3
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
new file mode 100644
index 000000000000..a24c805333e0
--- /dev/null
+++ b/dev-java/protobuf-java/protobuf-java-3.21.9-r1.ebuild
@@ -0,0 +1,98 @@
+# Copyright 2008-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+JAVA_PKG_IUSE="doc source test"
+MAVEN_ID="com.google.protobuf:protobuf-java:3.21.9"
+# Tests not enabled, depend on com.google.truth which is not packaged
+# https://github.com/protocolbuffers/protobuf/blob/v21.9/java/core/pom.xml#L35-L40
+# JAVA_TESTING_FRAMEWORKS="junit-4"
+
+inherit edo java-pkg-2 java-pkg-simple
+
+PARENT_PN="${PN/-java/}"
+PARENT_PV="$(ver_cut 2-)"
+PARENT_P="${PARENT_PN}-${PARENT_PV}"
+PARENT_SUBSLOT="32"
+
+DESCRIPTION="Google's Protocol Buffers - Java bindings"
+HOMEPAGE="https://developers.google.com/protocol-buffers/"
+SRC_URI="
+ https://github.com/protocolbuffers/protobuf/archive/v${PARENT_PV}.tar.gz
+ -> ${PARENT_P}.tar.gz
+"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~x86 ~amd64-linux ~x86-linux ~x64-macos"
+
+DEPEND="
+ >=virtual/jdk-1.8:*
+ test? (
+ dev-java/guava:0
+ dev-java/mockito:4
+ )
+"
+RDEPEND=">=virtual/jre-1.8:*"
+
+BDEPEND="dev-libs/protobuf:0/${PARENT_SUBSLOT}"
+
+S="${WORKDIR}/${PARENT_P}/java"
+
+JAVA_AUTOMATIC_MODULE_NAME="com.google.protobuf"
+JAVA_JAR_FILENAME="protobuf.jar"
+JAVA_RESOURCE_DIRS="core/src/main/resources"
+JAVA_SRC_DIR="core/src/main/java"
+
+JAVA_TEST_GENTOO_CLASSPATH="guava,junit-4,mockito-4"
+JAVA_TEST_RESOURCE_DIRS="../src"
+JAVA_TEST_SRC_DIR="core/src/test/java"
+
+# Same than PATCHES but from repository's root directory,
+# please see function `src_prepare` below.
+# Simplier for users IMHO.
+PARENT_PATCHES=(
+)
+
+# Here for patches within "java/" subdirectory.
+PATCHES=(
+)
+
+src_prepare() {
+ pushd "${WORKDIR}/${PARENT_P}" > /dev/null || die
+ [[ -n "${PARENT_PATCHES[@]}" ]] && eapply "${PARENT_PATCHES[@]}"
+ eapply_user
+ popd > /dev/null || die
+
+ # Same than default without the eapply_user part, this last is kept
+ # for the parent directory.
+ # It looks like function java-pkg-2_src_prepare doesn’t call "default".
+ [[ -n "${PATCHES[@]}" ]] && eapply "${PATCHES[@]}"
+
+ # Remove bundled jars
+ java-pkg_clean
+
+ java-pkg-2_src_prepare
+
+ # There is also compiler/plugin, but not in this list because in a subdirectory
+ core_protos=( any api descriptor duration empty field_mask source_context struct timestamp type wrappers )
+
+ # Copy resources from ../src/google/protobuf according to
+ # https://github.com/protocolbuffers/protobuf/blob/v21.9/java/core/pom.xml#L45-L61
+ mkdir -p "${JAVA_RESOURCE_DIRS}/google/protobuf/compiler" || die
+ local core_proto
+ for core_proto in "${core_protos[@]}"; do
+ cp "../src/google/protobuf/${core_proto}.proto" \
+ "${JAVA_RESOURCE_DIRS}/google/protobuf" \
+ || die
+ done
+ cp {../src,"${JAVA_RESOURCE_DIRS}"}/google/protobuf/compiler/plugin.proto || die
+
+ # Generate 146 .java files according to
+ # https://github.com/protocolbuffers/protobuf/blob/v21.9/java/core/generate-sources-build.xml
+ for core_proto in "${core_protos[@]}" compiler/plugin; do
+ edo "${BROOT}/usr/bin/protoc" \
+ --java_out="${JAVA_SRC_DIR}" -I../src ../src/google/protobuf/"${core_proto}".proto
+ done
+}