From 90e5f1ad3a5a9abb34fd8966c63a951298d6e95ef6117dac66ac300cb0894f03 Mon Sep 17 00:00:00 2001 From: Fridrich Strba Date: Fri, 18 Mar 2022 20:27:43 +0000 Subject: [PATCH] OBS-URL: https://build.opensuse.org/package/show/Java:packages/hamcrest?expand=0&rev=49 --- hamcrest-1.3-build.patch | 8 +++-- hamcrest-matchers.patch | 66 ++++++++++++++++++++++++++++++++++++++++ hamcrest.changes | 10 ++++++ hamcrest.spec | 7 +++-- 4 files changed, 86 insertions(+), 5 deletions(-) create mode 100644 hamcrest-matchers.patch diff --git a/hamcrest-1.3-build.patch b/hamcrest-1.3-build.patch index 6eba76e..c8db337 100644 --- a/hamcrest-1.3-build.patch +++ b/hamcrest-1.3-build.patch @@ -24,15 +24,17 @@ index 1cfd4fb..5a7c740 100644 -+ windowtitle="Hamcrest" source="1.6" failonerror="yes"> ++ windowtitle="Hamcrest" source="1.8" failonerror="yes"> + -@@ -313,6 +314,7 @@ +@@ -313,7 +314,8 @@ + +- windowtitle="Hamcrest" source="1.6" failonerror="yes"> ++ windowtitle="Hamcrest" source="1.8" failonerror="yes"> + diff --git a/hamcrest-matchers.patch b/hamcrest-matchers.patch new file mode 100644 index 0000000..b90db8d --- /dev/null +++ b/hamcrest-matchers.patch @@ -0,0 +1,66 @@ +--- JavaHamcrest-hamcrest-java-1.3/hamcrest-core/src/main/java/org/hamcrest/core/AllOf.java 2022-03-18 20:35:38.293788586 +0100 ++++ JavaHamcrest-hamcrest-java-1.3/hamcrest-core/src/main/java/org/hamcrest/core/AllOf.java 2022-03-18 20:46:34.534452749 +0100 +@@ -57,7 +57,7 @@ + */ + @Factory + public static Matcher allOf(Matcher... matchers) { +- return allOf(Arrays.asList(matchers)); ++ return new AllOf(Arrays.asList(matchers)); + } + + /** +--- JavaHamcrest-hamcrest-java-1.3/hamcrest-core/src/main/java/org/hamcrest/core/AnyOf.java 2022-03-18 20:35:38.293788586 +0100 ++++ JavaHamcrest-hamcrest-java-1.3/hamcrest-core/src/main/java/org/hamcrest/core/AnyOf.java 2022-03-18 20:39:13.031315993 +0100 +@@ -47,7 +47,7 @@ + */ + @Factory + public static AnyOf anyOf(Matcher... matchers) { +- return anyOf(Arrays.asList(matchers)); ++ return new AnyOf(Arrays.asList(matchers)); + } + + /** +--- JavaHamcrest-hamcrest-java-1.3/hamcrest-library/src/main/java/org/hamcrest/collection/IsArrayContainingInAnyOrder.java 2022-03-18 20:35:38.297788614 +0100 ++++ JavaHamcrest-hamcrest-java-1.3/hamcrest-library/src/main/java/org/hamcrest/collection/IsArrayContainingInAnyOrder.java 2022-03-18 20:49:03.047502492 +0100 +@@ -55,7 +55,7 @@ + */ + @Factory + public static Matcher arrayContainingInAnyOrder(Matcher... itemMatchers) { +- return arrayContainingInAnyOrder(Arrays.asList(itemMatchers)); ++ return new IsArrayContainingInAnyOrder(Arrays.asList(itemMatchers)); + } + + /** +--- JavaHamcrest-hamcrest-java-1.3/hamcrest-library/src/main/java/org/hamcrest/collection/IsArrayContainingInOrder.java 2022-03-18 20:35:38.297788614 +0100 ++++ JavaHamcrest-hamcrest-java-1.3/hamcrest-library/src/main/java/org/hamcrest/collection/IsArrayContainingInOrder.java 2022-03-18 20:49:57.623888266 +0100 +@@ -69,7 +69,7 @@ + */ + @Factory + public static Matcher arrayContaining(Matcher... itemMatchers) { +- return arrayContaining(asList(itemMatchers)); ++ return new IsArrayContainingInOrder(asList(itemMatchers)); + } + + /** +--- JavaHamcrest-hamcrest-java-1.3/hamcrest-library/src/main/java/org/hamcrest/collection/IsIterableContainingInAnyOrder.java 2022-03-18 20:35:38.297788614 +0100 ++++ JavaHamcrest-hamcrest-java-1.3/hamcrest-library/src/main/java/org/hamcrest/collection/IsIterableContainingInAnyOrder.java 2022-03-18 20:56:50.738808383 +0100 +@@ -122,7 +122,7 @@ + */ + @Factory + public static Matcher> containsInAnyOrder(Matcher... itemMatchers) { +- return containsInAnyOrder(Arrays.asList(itemMatchers)); ++ return new IsIterableContainingInAnyOrder(Arrays.asList(itemMatchers)); + } + + /** +--- JavaHamcrest-hamcrest-java-1.3/hamcrest-library/src/main/java/org/hamcrest/collection/IsIterableContainingInOrder.java 2022-03-18 20:35:38.297788614 +0100 ++++ JavaHamcrest-hamcrest-java-1.3/hamcrest-library/src/main/java/org/hamcrest/collection/IsIterableContainingInOrder.java 2022-03-18 21:21:22.189211465 +0100 +@@ -138,7 +138,7 @@ + */ + @Factory + public static Matcher> contains(Matcher... itemMatchers) { +- return contains(asList(itemMatchers)); ++ return new IsIterableContainingInOrder(asList(itemMatchers)); + } + + /** diff --git a/hamcrest.changes b/hamcrest.changes index d9da33e..d51e6a0 100644 --- a/hamcrest.changes +++ b/hamcrest.changes @@ -1,3 +1,13 @@ +------------------------------------------------------------------- +Fri Mar 18 20:25:15 UTC 2022 - Fridrich Strba + +- Modified patch: + * hamcrest-1.3-build.patch + + Build with source/target levels 8 +- Added patch: + * hamcrest-matchers.patch + + Fix build with jdk17 + ------------------------------------------------------------------- Tue Jan 5 13:20:25 UTC 2021 - Pedro Monreal diff --git a/hamcrest.spec b/hamcrest.spec index 57388f2..5460a3d 100644 --- a/hamcrest.spec +++ b/hamcrest.spec @@ -1,7 +1,7 @@ # # spec file for package hamcrest # -# Copyright (c) 2021 SUSE LLC +# Copyright (c) 2022 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -39,8 +39,10 @@ Patch6: %{name}-%{version}-javadoc9.patch Patch7: %{name}-%{version}-javadoc10.patch Patch8: %{name}-%{version}-random-build-crash.patch Patch9: hamcrest-reproducible-builds.patch +Patch10: hamcrest-matchers.patch BuildRequires: ant BuildRequires: fdupes +BuildRequires: java-devel >= 1.8 BuildRequires: javapackages-local BuildRequires: qdox >= 2.0 Requires: %{name}-core = %{version}-%{release} @@ -114,12 +116,13 @@ rm -fr hamcrest-integration/src/main/java/org/hamcrest/EasyMock2Matchers.java %patch7 -p1 %patch8 -p1 %patch9 -p1 +%patch10 -p1 sed -i 's/\r//' LICENSE.txt %build export CLASSPATH=$(build-classpath qdox) -ant -Dant.build.javac.source=1.6 -Dant.build.javac.target=1.6 -Dversion=%{version} -Dbuild.sysclasspath=last clean core generator library bigjar javadoc +ant -Dant.build.javac.source=1.8 -Dant.build.javac.target=1.8 -Dversion=%{version} -Dbuild.sysclasspath=last clean core generator library bigjar javadoc # inject OSGi manifests jar ufm build/%{name}-core-%{version}.jar %{SOURCE8}