diff options
author | Florian Schmaus <flow@gentoo.org> | 2022-10-28 08:51:11 +0200 |
---|---|---|
committer | Florian Schmaus <flow@gentoo.org> | 2022-10-28 08:54:01 +0200 |
commit | 1f351af5b3d2d7bc69285d5d1c547de7bdb5db98 (patch) | |
tree | effe1bb3c6c79aea3c05e7bb20f4f06dc2747c4d /dev-java/protobuf-java | |
parent | dev-java/tomcat-servlet-api: Stabilize 10.0.26 arm64, #878511 (diff) | |
download | gentoo-1f351af5b3d2d7bc69285d5d1c547de7bdb5db98.tar.gz gentoo-1f351af5b3d2d7bc69285d5d1c547de7bdb5db98.tar.bz2 gentoo-1f351af5b3d2d7bc69285d5d1c547de7bdb5db98.zip |
dev-java/protobuf-java: fix live ebuild, other fixes
Add missing 'local' declaration of for-loop variable. Align latest
ebuild with live ebuild. Use edo when generating .proto files.
Closes: https://bugs.gentoo.org/878469
Signed-off-by: Florian Schmaus <flow@gentoo.org>
Diffstat (limited to 'dev-java/protobuf-java')
-rw-r--r-- | dev-java/protobuf-java/protobuf-java-3.21.9.ebuild | 26 | ||||
-rw-r--r-- | dev-java/protobuf-java/protobuf-java-9999.ebuild | 16 |
2 files changed, 27 insertions, 15 deletions
diff --git a/dev-java/protobuf-java/protobuf-java-3.21.9.ebuild b/dev-java/protobuf-java/protobuf-java-3.21.9.ebuild index 96fc4a9564e1..60134da57091 100644 --- a/dev-java/protobuf-java/protobuf-java-3.21.9.ebuild +++ b/dev-java/protobuf-java/protobuf-java-3.21.9.ebuild @@ -9,7 +9,7 @@ MAVEN_ID="com.google.protobuf:protobuf-java:3.21.9" # https://github.com/protocolbuffers/protobuf/blob/v3.21.6/java/core/pom.xml#L35-L39" # JAVA_TESTING_FRAMEWORKS="junit-4" -inherit java-pkg-2 java-pkg-simple +inherit edo java-pkg-2 java-pkg-simple DESCRIPTION="Google's Protocol Buffers - Java bindings" HOMEPAGE="https://developers.google.com/protocol-buffers/" @@ -44,17 +44,25 @@ JAVA_TEST_SRC_DIR="core/src/test/java" src_prepare() { default 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/v3.21.6/java/core/pom.xml#L45-L61 - mkdir -p core/src/main/resources/google/protobuf/compiler || die - cp {../src,core/src/main/resources}/google/protobuf/compiler/plugin.proto || die - cp ../src/google/protobuf/{any,api,descriptor,duration,empty,field_mask,source_context,struct,timestamp,type,wrappers}.proto \ - "${JAVA_RESOURCE_DIRS}/google/protobuf" || die + 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/v3.21.6/java/core/generate-sources-build.xml - for proto in any api compiler/plugin descriptor duration empty field_mask source_context struct timestamp type wrappers; do - "${BROOT}/usr/bin/protoc" \ - --java_out=core/src/main/java -I../src ../src/google/protobuf/$proto.proto || die + # https://github.com/protocolbuffers/protobuf/blob/v21.7/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 } diff --git a/dev-java/protobuf-java/protobuf-java-9999.ebuild b/dev-java/protobuf-java/protobuf-java-9999.ebuild index ab4856250e05..f269a7bc8533 100644 --- a/dev-java/protobuf-java/protobuf-java-9999.ebuild +++ b/dev-java/protobuf-java/protobuf-java-9999.ebuild @@ -12,7 +12,7 @@ MAVEN_ID="com.google.protobuf:${PN}:3.21.7" # https://github.com/protocolbuffers/protobuf/blob/v21.7/java/core/pom.xml#L35-L40 # JAVA_TESTING_FRAMEWORKS="junit-4" -inherit java-pkg-2 java-pkg-simple +inherit edo java-pkg-2 java-pkg-simple PARENT_PN="${PN/-java/}" PARENT_PV="${PV}" @@ -92,14 +92,18 @@ src_prepare() { # Copy resources from ../src/google/protobuf according to # https://github.com/protocolbuffers/protobuf/blob/v21.7/java/core/pom.xml#L45-L61 mkdir -p "${JAVA_RESOURCE_DIRS}/google/protobuf/compiler" || die - cp "../src/google/protobuf/${core_protos[@]}.proto" \ - "${JAVA_RESOURCE_DIRS}/google/protobuf" || 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.7/java/core/generate-sources-build.xml - for proto in "${core_protos[@]}" compiler/plugin; do - "${BROOT}/usr/bin/protoc" \ - --java_out="${JAVA_SRC_DIR}" -I../src ../src/google/protobuf/"${proto}".proto || die + 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 } |