From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 0C7831581B9 for ; Fri, 03 Oct 2025 16:27:32 +0000 (UTC) Received: from lists.gentoo.org (bobolink.gentoo.org [140.211.166.189]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519) (No client certificate requested) (Authenticated sender: relay-lists.gentoo.org@gentoo.org) by smtp.gentoo.org (Postfix) with ESMTPSA id E4263341FC1 for ; Fri, 03 Oct 2025 16:27:31 +0000 (UTC) Received: from bobolink.gentoo.org (localhost [127.0.0.1]) by bobolink.gentoo.org (Postfix) with ESMTP id 2130511056D; Fri, 03 Oct 2025 16:27:15 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519) (No client certificate requested) by bobolink.gentoo.org (Postfix) with ESMTPS id 1BF4811056D for ; Fri, 03 Oct 2025 16:27:15 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id E3D3E341F92 for ; Fri, 03 Oct 2025 16:27:11 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 5B99A3A91 for ; Fri, 03 Oct 2025 16:27:08 +0000 (UTC) From: "Sam James" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sam James" Message-ID: <1759508662.d6c574a8138523e59995c174e34e94fb52f0893a.sam@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: dev-java/protobuf-java/ X-VCS-Repository: repo/gentoo X-VCS-Files: dev-java/protobuf-java/Manifest dev-java/protobuf-java/protobuf-java-4.32.1.ebuild X-VCS-Directories: dev-java/protobuf-java/ X-VCS-Committer: sam X-VCS-Committer-Name: Sam James X-VCS-Revision: d6c574a8138523e59995c174e34e94fb52f0893a X-VCS-Branch: master Date: Fri, 03 Oct 2025 16:27:08 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 179c6715-774e-4229-b72d-babc0d5632b5 X-Archives-Hash: 3ef49af478d9f06da8e347ac715d04c9 commit: d6c574a8138523e59995c174e34e94fb52f0893a Author: Volkmar W. Pogatzki pogatzki net> AuthorDate: Mon Apr 21 15:25:42 2025 +0000 Commit: Sam James gentoo org> CommitDate: Fri Oct 3 16:24:22 2025 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d6c574a8 dev-java/protobuf-java: add 4.32.1 - Skips 4.31.1, 4.32.0 - Uses dev-java/truth instead of the previously pre-built bundled jar. Closes: https://bugs.gentoo.org/894252 Signed-off-by: Volkmar W. Pogatzki pogatzki.net> Part-of: https://github.com/gentoo/gentoo/pull/43473 Signed-off-by: Sam James gentoo.org> dev-java/protobuf-java/Manifest | 1 + dev-java/protobuf-java/protobuf-java-4.32.1.ebuild | 155 +++++++++++++++++++++ 2 files changed, 156 insertions(+) diff --git a/dev-java/protobuf-java/Manifest b/dev-java/protobuf-java/Manifest index 146bdc90e3df..cb0c3ac12f60 100644 --- a/dev-java/protobuf-java/Manifest +++ b/dev-java/protobuf-java/Manifest @@ -1,5 +1,6 @@ DIST protobuf-29.3.tar.gz 9348951 BLAKE2B 8d37daac6f0d832e5bff5c56b9be73fce1fe016ca4e905f4c66d8fea20fabbee54a6be2c824f503d40f8492a4ec6280a539c454de9a118b69ebc57f2afe3d965 SHA512 0c776133f5789d21baa8860cb41e7926a162d74810a01722b762a78f93e559494e903fcaa092515bfe2ce057fd065a5dd000b316edb1af32c2ef9dbadf02b4c6 DIST protobuf-29.4.tar.gz 9350942 BLAKE2B fd3b81905e26db2ec3b54eaf30cf250db2894f91d5da73130106f6778f4e2f13b690961eecb8f5b8c23ac72428753611cd9bf719da986083e09ab32160e25314 SHA512 c888cb9961d58b7fb11a3363ff4d2684605cdd79756712f407ffe5f275569bf69b4370f1d2a0e20775646745cddd41a9b510f1c1981be4e969c9acf0dc2ba734 DIST protobuf-30.2.tar.gz 9506934 BLAKE2B 3a7d6bfa38500b16b1ce52b244fd9448fe7be2933a77224a1423a67e3ae3155846c0974ee1b6c579f6050f60b7784ace21b149b3cbdff2ef1e6bf954acbb1b51 SHA512 555d1b18d175eeaf17f3879f124d33080f490367840d35b34bfc4e4a5b383bf6a1d09f1570acb6af9c53ac4940a14572d46423b6e3dd0c712e7802c986fb6be6 +DIST protobuf-32.1.tar.gz 9676391 BLAKE2B f6c1faa260ecb57c0a1a5d4be7d56e431cac9e325a02b86d9eecd0318a0964618063db218a4720fcb1121614016f112ba00880a5b743a5c34f19f79ea4420735 SHA512 e7f8fe01912ba30cc7ce101beac1cfbd089bcb57b159a57d4d90cabd1b29d978ad322f0607e1b955617f035a6b68d4e7bc940fa4afa67d255a21f513a2c62172 DIST truth-1.1.3.jar 243021 BLAKE2B a59149038c62ef5dd352b13d4b393e1b7715fbafe5ed86ec2d16d722c738a31dcdca10132fc73b17b367ac4309e5407ba2e489f8d4c8fbca60ce5f35ae75d1e3 SHA512 f29a9fb070aff8a32358a7b6c8998c0095de5d8d68afa7f7bac759c7050309deff929e767657ecbbefd96163460f10255ca01bc567ab30df4834b9d916a4fae8 DIST truth-1.4.4.jar 274574 BLAKE2B b8ada1085b9f463daf82827a3f080d599719846eed8b68a3c4341b087d8e86d1fc690820eaaab900531ac4cb75b928542215d622b1e93cb268d43f02daf248e2 SHA512 f6b817bd148a4dae757b836d9b9ddc6812a079bebd8febfc34504fc252c8ca2fe895e6978f697d9c64e7255d32611994246dd691a6d3cbea47b3a9bcdb53e282 diff --git a/dev-java/protobuf-java/protobuf-java-4.32.1.ebuild b/dev-java/protobuf-java/protobuf-java-4.32.1.ebuild new file mode 100644 index 000000000000..4493a281fb9f --- /dev/null +++ b/dev-java/protobuf-java/protobuf-java-4.32.1.ebuild @@ -0,0 +1,155 @@ +# Copyright 2008-2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +JAVA_PKG_IUSE="doc source test" +JAVA_TESTING_FRAMEWORKS="junit-4" +MAVEN_ID="com.google.protobuf:protobuf-java:${PV}" + +inherit cmake java-pkg-2 java-pkg-simple + +DESCRIPTION="Core Protocol Buffers library" +HOMEPAGE="https://protobuf.dev" +MY_PV4="${PV#4.}" +MY_PV="${MY_PV4/_rc/-rc}" +MY_P="protobuf-${MY_PV}.tar.gz" +SRC_URI="https://github.com/protocolbuffers/protobuf/releases/download/v${MY_PV}/${MY_P}" +S="${WORKDIR}/protobuf-${MY_PV}" + +LICENSE="BSD" +SLOT="0" +KEYWORDS="~amd64" +IUSE="system-protoc" + +BDEPEND=" + system-protoc? ( ~dev-libs/protobuf-${MY_PV4}:0[protoc] ) + !system-protoc? ( >=dev-cpp/abseil-cpp-20250512.1:= ) +" + +DEPEND=" + >=virtual/jdk-1.8:* + test? ( + >=dev-java/guava-33.4.8:0 + dev-java/mockito:4 + dev-java/snakeyaml:0 + dev-java/testparameterinjector:0 + dev-java/truth:0 + ) +" + +RDEPEND=">=virtual/jre-1.8:*" + +JAVA_AUTOMATIC_MODULE_NAME="com.google.protobuf" +JAVA_JAR_FILENAME="protobuf.jar" +JAVA_RESOURCE_DIRS="java/core/src/main/resources" +JAVA_SRC_DIR="java/core/src/main/java" +JAVA_TEST_GENTOO_CLASSPATH="guava,junit-4,mockito-4,snakeyaml" +JAVA_TEST_RESOURCE_DIRS="java/core/src/main/resources" +JAVA_TEST_SRC_DIR="java/core/src/test/java" + +run-protoc() { + if use system-protoc; then + protoc "$1" + else + "${BUILD_DIR}/protoc" "$1" + fi +} + +src_prepare() { + # If the corrsponding version of system-protoc is not available we build protoc locally + if ! use system-protoc; then + cmake_src_prepare + fi + java-pkg-2_src_prepare + + # ${S}/java/core/generate-sources-build.xml + einfo "Replace variables in generate-sources-build.xml" + sed \ + -e 's:${generated.sources.dir}:java/core/src/main/java:' \ + -e 's:${protobuf.java_source.dir}:java/core/src/main/resources:' \ + -e 's:${protobuf.source.dir}:src:' \ + -e 's:^.*value="::' -e 's:\"/>::' \ + -e '/project\|echo\|mkdir\|exec/d' \ + -i java/core/generate-sources-build.xml || die "sed to sources failed" + + # ${S}/java/core/generate-test-sources-build.xml + einfo "Replace variables in generate-test-sources-build.xml" + sed \ + -e 's:${generated.testsources.dir}:java/core/src/test/java:' \ + -e 's:${protobuf.source.dir}:src:' \ + -e 's:${test.proto.dir}:java/core/src/test/proto:' \ + -e 's:^.*value="::' -e 's:\"/>::' \ + -e '/project\|mkdir\|exec\|Also generate/d' \ + -i java/core/generate-test-sources-build.xml || die "sed to test sources failed" + + # Split the file in two parts, one for each run-protoc call + awk '/--java_out/{x="test-sources-build-"++i;}{print > x;}' \ + java/core/generate-test-sources-build.xml || die + + # We add some *.proto files to the 'test-sources-build-1' file which + # are needed to avoid compilation errors on related test classes. + cat <<-EOF >> test-sources-build-1 || die "append test-sources-build-1" + src/google/protobuf/edition_unittest.proto + src/google/protobuf/unittest_delimited.proto + src/google/protobuf/unittest_delimited_import.proto + src/google/protobuf/unittest_import_option.proto + java/core/src/test/proto/com/google/protobuf/large_open_enum.proto + EOF +} + +src_configure() { + local mycmakeargs=( + -Dprotobuf_BUILD_TESTS=OFF + -Dprotobuf_LOCAL_DEPENDENCIES_ONLY=ON + ) + if ! use system-protoc; then + cmake_src_configure + fi +} + +src_compile() { + if ! use system-protoc; then + cmake_src_compile + fi + + einfo "Run protoc to generate sources" + run-protoc @java/core/generate-sources-build.xml \ + || die "protoc sources failed" + + java-pkg-simple_src_compile +} + +src_test() { + # Note: Annotation processing is enabled because one or more processors were found + # on the class path. A future release of javac may disable annotation processing + # unless at least one processor is specified by name (-processor), or a search + # path is specified (--processor-path, --processor-module-path), or annotation + # processing is enabled explicitly (-proc:only, -proc:full). + JAVA_GENTOO_CLASSPATH_EXTRA+=":$(java-pkg_getjars --build-only testparameterinjector,truth)" + + einfo "Running protoc on first part of generate-test-sources-build.xml" + # java/core/src/test/proto/com/google/protobuf/test_check_utf8.proto:15:1: + # Import "google/protobuf/java_features.proto" was not found or had errors. + cp {java/core/src/main/resources,src}/google/protobuf/java_features.proto || die + run-protoc @test-sources-build-1 \ + || die "run-protoc test-sources-build-1 failed" + + einfo "Running protoc on second part of generate-test-sources-build.xml" + run-protoc @test-sources-build-2 \ + || die "run-protoc test-sources-build-2 failed" + + einfo "Running tests" + # Invalid test class 'map_test.MapInitializationOrderTest': + # 1. Test class should have exactly one public constructor + # Invalid test class 'proto2_unittest.CachedFieldSizeTest': + # 1. Test class should have exactly one public constructor + local JAVA_TEST_RUN_ONLY=$(find "${JAVA_TEST_SRC_DIR}" \ + -path "**/*Test.java" \ + ! -path "**/Abstract*Test.java" \ + ! -name "MapInitializationOrderTest.java" \ + ! -name 'CachedFieldSizeTest.java' -printf "%P\n") + JAVA_TEST_RUN_ONLY="${JAVA_TEST_RUN_ONLY//.java}" + JAVA_TEST_RUN_ONLY="${JAVA_TEST_RUN_ONLY//\//.}" + java-pkg-simple_src_test +}