From 7ac8e4e66e16fdf7b4aaa08354405ae5a554915c8ffa3d53db25574b34851053 Mon Sep 17 00:00:00 2001 From: Fridrich Strba Date: Wed, 27 Sep 2023 07:06:22 +0000 Subject: [PATCH] OBS-URL: https://build.opensuse.org/package/show/Java:packages/jurand?expand=0&rev=2 --- jurand-cxx20.patch | 34 ++++++++++++++++++++++++++++++++++ jurand.changes | 9 +++++++++ jurand.spec | 19 ++++++++++++++++++- 3 files changed, 61 insertions(+), 1 deletion(-) create mode 100644 jurand-cxx20.patch diff --git a/jurand-cxx20.patch b/jurand-cxx20.patch new file mode 100644 index 0000000..e259088 --- /dev/null +++ b/jurand-cxx20.patch @@ -0,0 +1,34 @@ +diff -urEbwB jurand-1.3.1.orig/Makefile jurand-1.3.1/Makefile +--- jurand-1.3.1.orig/Makefile 2023-09-27 07:17:18.384159160 +0200 ++++ jurand-1.3.1/Makefile 2023-09-27 08:55:18.229794175 +0200 +@@ -12,7 +12,8 @@ + test: test.sh test-compile + @./$< + +-CXXFLAGS += -g -std=c++2a -Isrc -Wall -Wextra -Wpedantic ++CXXFLAGS += -g -std=gnu++2a -Isrc -Wall -Wextra -Wpedantic -D_GLIBCXX_USE_CXX11_ABI=1 ++LDFLAGS += -pthread + + $(eval $(call Variable_rule,target/compile_flags,$(CXX) $(CXXFLAGS))) + $(eval $(call Variable_rule,target/link_flags,$(CXX) $(LDFLAGS) $(LDLIBS))) +diff -urEbwB jurand-1.3.1.orig/src/java_symbols.hpp jurand-1.3.1/src/java_symbols.hpp +--- jurand-1.3.1.orig/src/java_symbols.hpp 2023-09-27 07:17:18.384159160 +0200 ++++ jurand-1.3.1/src/java_symbols.hpp 2023-09-27 08:42:56.218651442 +0200 +@@ -630,14 +630,14 @@ + + if (not parameters.in_place_) + { +- auto osyncstream = std::osyncstream(std::cout); ++ auto oss = std::osyncstream(std::cout); + + if (not path.empty()) + { +- osyncstream << path.native() << ":\n"; ++ oss << path.native() << ":\n"; + } + +- osyncstream.write(content.c_str(), content.size()); ++ oss.write(content.c_str(), content.size()); + } + else if (content.size() < original_content.size()) + { diff --git a/jurand.changes b/jurand.changes index bf9a5ea..fb9ccb4 100644 --- a/jurand.changes +++ b/jurand.changes @@ -1,3 +1,12 @@ +------------------------------------------------------------------- +Wed Sep 27 07:04:00 UTC 2023 - Fridrich Strba + +- Added patch: + * jurand-cxx20.patch + + fix name class between osyncstream variable and + std::osyncstream + + allow building on SLE-12-SP5 and SLE-15-SP2 + ------------------------------------------------------------------- Wed Sep 27 05:00:00 UTC 2023 - Fridrich Strba diff --git a/jurand.spec b/jurand.spec index f07b327..ab7b709 100644 --- a/jurand.spec +++ b/jurand.spec @@ -16,19 +16,26 @@ # +%{!?_rpmmacrodir:%global _rpmmacrodir %{_rpmconfigdir}/macros.d} %{!?make_build:%global make_build make %{?_smp_mflags}} Name: jurand Version: 1.3.1 Release: 0 Summary: A tool for manipulating Java symbols License: Apache-2.0 +Group: Development/Languages/Java URL: https://github.com/fedora-java/jurand Source0: https://github.com/fedora-java/jurand/archive/refs/tags/%{version}.tar.gz#/%{name}-%{version}.tar.gz +Patch0: jurand-cxx20.patch BuildRequires: asciidoc BuildRequires: diffutils -BuildRequires: gcc-c++ BuildRequires: make BuildRequires: xmlto +%if 0%{?suse_version} > 1599 +BuildRequires: gcc-c++ +%else +BuildRequires: gcc11-c++ +%endif %description The tool can be used for patching .java sources in cases where using sed is @@ -37,8 +44,14 @@ rather than applying simple regular expressions on the source code. %prep %setup -q +%patch0 -p1 %build + +%if 0%{?suse_version} <= 1599 +export CXX=g++-11 +export CC=gcc-11 +%endif %make_build test-compile manpages %install @@ -50,6 +63,10 @@ export mandir=%{_mandir}/man7 ./install.sh %check +%if 0%{?suse_version} <= 1599 +export CXX=g++-11 +export CC=gcc-11 +%endif %make_build test %files -f target/installed_files