diff options
Diffstat (limited to 'dev-java/gson')
-rw-r--r-- | dev-java/gson/Manifest | 4 | ||||
-rw-r--r-- | dev-java/gson/files/gson-2.10.2-GsonVersionDiagnosticsTest.patch | 13 | ||||
-rw-r--r-- | dev-java/gson/gson-2.10.2_pre20231128.ebuild | 87 |
3 files changed, 104 insertions, 0 deletions
diff --git a/dev-java/gson/Manifest b/dev-java/gson/Manifest index 1e940c570417..516b18b1f0cb 100644 --- a/dev-java/gson/Manifest +++ b/dev-java/gson/Manifest @@ -1,3 +1,7 @@ +AUX gson-2.10.2-GsonVersionDiagnosticsTest.patch 615 BLAKE2B ac75e23e48885403f61cd0b078984a7210576fc2567086a9d9af99a212471cead5d2d5961bb6b7958fb956eda6c348c08124c6e2c6cbc7afac6ff6a36b82a424 SHA512 c363625a645df1a7c3db737db39cc2e163fe4975b6bb51930b805ba359e61509e41397022d689874b6fa100917f6dd936c13c8c6457137f55370b48de35e2bed +DIST gson-2.10.2_pre20231128.tar.gz 451312 BLAKE2B d16e0510e0806fd33e8d49b5a8fb73e969b89acb2598ca34a43faa97a09debc99466ab472176d60d617aa20b2190884def25881f0bf651e96be2c1bb9a976d70 SHA512 37f2073e5eee2cb85626040552ac750f4917abd05e3b7944c30a2d5ace6888424870a95a0ceba89bf2dadf9ab33e6bbae1591509b84f35aba4521780764c0877 DIST gson-parent-2.10.1.tar.gz 394777 BLAKE2B e118a7c39b17c4119b4140f3c105fef4c3cb07580dbc530d9bfd59edc4f152f62ac5ff93db1a3861c73758e369ecef4f8ed4e94d556869291469764ea848bbbd SHA512 074f40f7f9aa48daf5b5a3ec371713db02f6f8fceb959b01e8a16732862645d2350f3276ab7ff8021d48082f890b53c6e80d992af6af4b74e4646f85494b8e70 +DIST truth-1.1.3.jar 243021 BLAKE2B a59149038c62ef5dd352b13d4b393e1b7715fbafe5ed86ec2d16d722c738a31dcdca10132fc73b17b367ac4309e5407ba2e489f8d4c8fbca60ce5f35ae75d1e3 SHA512 f29a9fb070aff8a32358a7b6c8998c0095de5d8d68afa7f7bac759c7050309deff929e767657ecbbefd96163460f10255ca01bc567ab30df4834b9d916a4fae8 EBUILD gson-2.10.1.ebuild 1681 BLAKE2B 0e91cb624f1883f43f20551f30f17195456678f089d5d89f436b9459b5155ab94f48f17a61ee57de82954e05251110eb567fa541b2b2ee3c7dba1fb994769512 SHA512 b8748b2a22a6c25e7bb22cc6ba8ed048f09b8ff92a26c2783c91d818bd5c3af05cb2ea8fb46584d34c606f16f957443658c23b04427a18864ffa8135709784db +EBUILD gson-2.10.2_pre20231128.ebuild 2355 BLAKE2B 1e5938480b49458d72080b3d1af9fd6fdfd89558f2e34ea04886a0b73beb378da46d457e0d74d74333af85472f6f7d888c870239a4400ce4ea651e402865a535 SHA512 e3c9499f2660d75eb3ddf356ec47abc4089de3e06f5ce97db1a57c412474404fc7341cad2eeaf11b0441c58d5e7cdc51a83217328c3162add55efd389356cd86 MISC metadata.xml 630 BLAKE2B e4732be361d93273cb3c6084e4fa596def785aa6b0cd747f3cc65b9d9b693666e60188c6b30c0e7a234cca56239b9d22c14eaf21af7958f818de3a6b4b246729 SHA512 063d42b12383dde777dfdea7fb884423bdf3e377aa585b4b46d6d2581e81cd943e0a444792997c87d3443fa4516d211d9c3f78e5702b7376cda63718f14f6504 diff --git a/dev-java/gson/files/gson-2.10.2-GsonVersionDiagnosticsTest.patch b/dev-java/gson/files/gson-2.10.2-GsonVersionDiagnosticsTest.patch new file mode 100644 index 000000000000..9feeb0aa3797 --- /dev/null +++ b/dev-java/gson/files/gson-2.10.2-GsonVersionDiagnosticsTest.patch @@ -0,0 +1,13 @@ +support our versioning schemes + +--- a/src/test/java/com/google/gson/functional/GsonVersionDiagnosticsTest.java ++++ b/src/test/java/com/google/gson/functional/GsonVersionDiagnosticsTest.java +@@ -35,7 +35,7 @@ import org.junit.Test; + public class GsonVersionDiagnosticsTest { + // We require a patch number, even if it is .0, consistent with https://semver.org/#spec-item-2. + private static final Pattern GSON_VERSION_PATTERN = +- Pattern.compile("(\\(GSON \\d\\.\\d+\\.\\d)(?:[-.][A-Z]+)?\\)$"); ++ Pattern.compile("(\\(GSON \\d\\.\\d+\\.\\d)(?:[-.][A-Z]+|_[a-z]+[0-9]+)?\\)$"); + + private Gson gson; + diff --git a/dev-java/gson/gson-2.10.2_pre20231128.ebuild b/dev-java/gson/gson-2.10.2_pre20231128.ebuild new file mode 100644 index 000000000000..a8544b4d9312 --- /dev/null +++ b/dev-java/gson/gson-2.10.2_pre20231128.ebuild @@ -0,0 +1,87 @@ +# Copyright 1999-2023 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.code.gson:gson:${PV}" +JAVA_TESTING_FRAMEWORKS="junit-4" + +inherit java-pkg-2 java-pkg-simple + +DESCRIPTION="Gson JSON library" +HOMEPAGE="https://github.com/google/gson" +# SRC_URI="https://github.com/google/gson/archive/gson-parent-${PV}.tar.gz" +# S="${WORKDIR}/gson-gson-parent-${PV}/gson" +MY_COMMIT="b17b1a0e98dcaf4b61823e1f0c29dda44c0ea3d5" +SRC_URI="https://github.com/google/gson/archive/${MY_COMMIT}.tar.gz -> ${P}.tar.gz + test? ( https://repo1.maven.org/maven2/com/google/truth/truth/1.1.3/truth-1.1.3.jar )" +S="${WORKDIR}/gson-${MY_COMMIT}/gson" + +LICENSE="Apache-2.0" +SLOT="2.6" +KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~x86" + +DEPEND=" + dev-java/error-prone-annotations:0 + >=virtual/jdk-17:* + test? ( + dev-java/guava:0 + dev-java/guava-testlib:0 + )" +# src/test/java/com/google/gson/functional/Java17RecordTest.java:78: +# error: records are not supported in -source 11 +RDEPEND=">=virtual/jre-17:*" + +DOCS=( + ../CHANGELOG.md + ../GsonDesignDocument.md + ../README.md + ../Troubleshooting.md + ../UserGuide.md +) + +PATCHES=( "${FILESDIR}/gson-2.10.2-GsonVersionDiagnosticsTest.patch" ) + +JAVA_CLASSPATH_EXTRA="error-prone-annotations" +JAVA_RESOURCE_DIRS="src/main/resources" +JAVA_SRC_DIR=( + "src/main/java" + "src/main/java-templates" +) + +JAVA_TEST_EXCLUDES=( + # requires the test class to be obfuscated using proguard which we do not have atm + "com.google.gson.functional.EnumWithObfuscatedTest" + # testComGoogleGsonAnnotationsPackage(com.google.gson.regression.OSGiTest) + # junit.framework.AssertionFailedError: Cannot find com.google.gson OSGi bundle manifest + "com.google.gson.regression.OSGiTest" +) +JAVA_TEST_GENTOO_CLASSPATH=" + guava + guava-testlib + junit-4 +" +JAVA_TEST_RESOURCE_DIRS="src/test/resources" +JAVA_TEST_SRC_DIR="src/test/java" + +src_prepare() { + default #780585 + java-pkg-2_src_prepare + sed -e "s/\${project.version}/${PV}/g" \ + -i src/main/java-templates/com/google/gson/internal/GsonBuildConfig.java \ + || die "Failed to set version" +} + +src_compile() { + if ! use test; then + JAVA_PKG_WANT_SOURCE="1.8" + JAVA_PKG_WANT_TARGET="1.8" + fi + java-pkg-simple_src_compile +} + +src_test() { + JAVA_GENTOO_CLASSPATH_EXTRA="${DISTDIR}/truth-1.1.3.jar:testdata.jar" + java-pkg-simple_src_test +} |