From c6d52575fa05a427ec51102efa8dfeed0976d094 Mon Sep 17 00:00:00 2001 From: Silvan Calarco Date: Fri, 5 Jan 2024 17:21:22 +0100 Subject: [PATCH] package created using the webbuild interface [release 1.1.0-1mamba;Mon Mar 15 2021] --- README.md | 2 + ...n-1.1.0-do_not_include_gtest_src_dir.patch | 19 +++++ rapidjson-1.1.0-gcc-10.2.0.patch | 31 +++++++ rapidjson.spec | 84 +++++++++++++++++++ 4 files changed, 136 insertions(+) create mode 100644 rapidjson-1.1.0-do_not_include_gtest_src_dir.patch create mode 100644 rapidjson-1.1.0-gcc-10.2.0.patch create mode 100644 rapidjson.spec diff --git a/README.md b/README.md index 1c647ff..8eec458 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,4 @@ # rapidjson +A fast JSON parser/generator for C++ with both SAX/DOM style API. + diff --git a/rapidjson-1.1.0-do_not_include_gtest_src_dir.patch b/rapidjson-1.1.0-do_not_include_gtest_src_dir.patch new file mode 100644 index 0000000..18e8e80 --- /dev/null +++ b/rapidjson-1.1.0-do_not_include_gtest_src_dir.patch @@ -0,0 +1,19 @@ +commit e61866f098098422462e8bc220506443e76c3bb0 +Author: Björn Esser +Date: Sun Apr 3 11:21:47 2016 +0200 + + do not include gtest_src_dir + +diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt +index 11c1b04..43377db 100644 +--- a/test/CMakeLists.txt ++++ b/test/CMakeLists.txt +@@ -8,7 +8,7 @@ IF(GTESTSRC_FOUND) + set(gtest_force_shared_crt ON) + endif() + +- add_subdirectory(${GTEST_SOURCE_DIR} ${CMAKE_BINARY_DIR}/googletest) ++# add_subdirectory(${GTEST_SOURCE_DIR} ${CMAKE_BINARY_DIR}/googletest) + include_directories(SYSTEM ${GTEST_INCLUDE_DIR}) + + set(TEST_LIBRARIES gtest gtest_main) diff --git a/rapidjson-1.1.0-gcc-10.2.0.patch b/rapidjson-1.1.0-gcc-10.2.0.patch new file mode 100644 index 0000000..9b10ae6 --- /dev/null +++ b/rapidjson-1.1.0-gcc-10.2.0.patch @@ -0,0 +1,31 @@ +commit c6c56d87ff12ba8100b261f371fdaa106f95fe14 +Author: Tom Hughes +Date: Tue Sep 1 19:24:03 2020 +0100 + + Avoid ambiguous operator errors in C++20 + + Derived from upstream commit ebcbd04484fcdaddbb9fd7798e76bbfb4ae8f840 + +diff --git a/include/rapidjson/document.h b/include/rapidjson/document.h +index e3e20dfb..1485321d 100644 +--- a/include/rapidjson/document.h ++++ b/include/rapidjson/document.h +@@ -168,12 +168,12 @@ public: + + //! @name relations + //@{ +- bool operator==(ConstIterator that) const { return ptr_ == that.ptr_; } +- bool operator!=(ConstIterator that) const { return ptr_ != that.ptr_; } +- bool operator<=(ConstIterator that) const { return ptr_ <= that.ptr_; } +- bool operator>=(ConstIterator that) const { return ptr_ >= that.ptr_; } +- bool operator< (ConstIterator that) const { return ptr_ < that.ptr_; } +- bool operator> (ConstIterator that) const { return ptr_ > that.ptr_; } ++ template bool operator==(const GenericMemberIterator& that) const { return ptr_ == that.ptr_; } ++ template bool operator!=(const GenericMemberIterator& that) const { return ptr_ != that.ptr_; } ++ template bool operator<=(const GenericMemberIterator& that) const { return ptr_ <= that.ptr_; } ++ template bool operator>=(const GenericMemberIterator& that) const { return ptr_ >= that.ptr_; } ++ template bool operator< (const GenericMemberIterator& that) const { return ptr_ < that.ptr_; } ++ template bool operator> (const GenericMemberIterator& that) const { return ptr_ > that.ptr_; } + //@} + + //! @name dereference diff --git a/rapidjson.spec b/rapidjson.spec new file mode 100644 index 0000000..59b4cdf --- /dev/null +++ b/rapidjson.spec @@ -0,0 +1,84 @@ +Name: rapidjson +Version: 1.1.0 +Release: 1mamba +Summary: A fast JSON parser/generator for C++ with both SAX/DOM style API +Group: System/Libraries +Vendor: openmamba +Distribution: openmamba +Packager: Silvan Calarco +URL: https://github.com/Tencent/rapidjson +Source: https://github.com/Tencent/rapidjson.git/v%{version}/rapidjson-%{version}.tar.bz2 +Patch0: rapidjson-1.1.0-gcc-10.2.0.patch +Patch1: rapidjson-1.1.0-do_not_include_gtest_src_dir.patch +License: MIT +## AUTOBUILDREQ-BEGIN +## AUTOBUILDREQ-END +BuildRequires: cmake + +%description +A fast JSON parser/generator for C++ with both SAX/DOM style API. + +%package -n lib%{name}-devel +Group: Development/Libraries +Summary: Development files for %{name} + +%description -n lib%{name}-devel +This package contains header files for developing applications that use %{name}. + +#% debug_package + +%prep +%setup -q +%patch0 -p1 +%patch1 -p1 + +# From Fedora +# Remove bundled code +rm -rf thirdparty + +# Convert DOS line endings to unix +for file in "license.txt" $(find example -type f -name *.c*) +do + sed -e "s/\r$//g" < ${file} > ${file}.new && \ + touch -r ${file} ${file}.new && \ + mv -f ${file}.new ${file} +done + +# Remove -march=native and -Werror from compile commands +find . -type f -name CMakeLists.txt -print0 | \ + xargs -0r sed -i -e "s/-march=native/ /g" -e "s/-Werror//g" + +%build +%cmake -d build \ + -DDOC_INSTALL_DIR=%{_docdir}/%{name} \ + -DGTESTSRC_FOUND=TRUE \ + -DGTEST_SOURCE_DIR=. + +%make + +%install +[ "%{buildroot}" != / ] && rm -rf "%{buildroot}" +%makeinstall -C build + +%clean +[ "%{buildroot}" != / ] && rm -rf "%{buildroot}" + +%files -n lib%{name}-devel +%defattr(-,root,root) +%dir %{_includedir}/rapidjson +%{_includedir}/rapidjson/*.h +%dir %{_includedir}/rapidjson/error +%{_includedir}/rapidjson/error/*.h +%dir %{_includedir}/rapidjson/internal +%{_includedir}/rapidjson/internal/*.h +%dir %{_includedir}/rapidjson/msinttypes +%{_includedir}/rapidjson/msinttypes/*.h +%dir %{_libdir}/cmake/RapidJSON +%{_libdir}/cmake/RapidJSON/RapidJSON*.cmake +%{_libdir}/pkgconfig/RapidJSON.pc +%dir %{_docdir}/%{name} +%{_docdir}/%{name}/* + +%changelog +* Mon Mar 15 2021 Silvan Calarco 1.1.0-1mamba +- package created using the webbuild interface