diff --git a/cxxtools-2.2.1-gcc11.patch b/cxxtools-2.2.1-gcc11.patch new file mode 100644 index 0000000..a4cb9d0 --- /dev/null +++ b/cxxtools-2.2.1-gcc11.patch @@ -0,0 +1,30 @@ +--- include/cxxtools/char.h.orig 2021-01-29 19:43:52.324969183 +0100 ++++ include/cxxtools/char.h 2021-01-29 19:48:25.881311623 +0100 +@@ -68,9 +68,7 @@ + typedef int32_t value_type; + + //! Constructs a character with a value of 0. +- Char() +- : _value(0) +- {} ++ Char() = default; + + //! Constructs a character using the given char as base for the character value. + Char(char ch) +@@ -336,14 +334,14 @@ + inline char_traits::char_type* + char_traits::move(char_type* s1, const char_type* s2, int_type n) + { +- return (cxxtools::Char*)std::memmove(s1, s2, n * sizeof(cxxtools::Char)); ++ return static_cast(std::memmove(static_cast(s1), static_cast(s2), n * sizeof(cxxtools::Char))); + } + + + inline char_traits::char_type* + char_traits::copy(char_type* s1, const char_type* s2, size_t n) + { +- return (cxxtools::Char*)std::memcpy(s1, s2, n * sizeof(cxxtools::Char)); ++ return static_cast(std::memcpy(static_cast(s1), static_cast(s2), n * sizeof(cxxtools::Char))); + } + + diff --git a/cxxtools-float.patch b/cxxtools-float.patch index e847fea..7f3b11f 100644 --- a/cxxtools-float.patch +++ b/cxxtools-float.patch @@ -1,6 +1,6 @@ -diff -up cxxtools-2.2.1/include/cxxtools/serializationinfo.h.than cxxtools-2.2.1/include/cxxtools/serializationinfo.h ---- cxxtools-2.2.1/include/cxxtools/serializationinfo.h.than 2016-04-29 17:56:47.199954811 +0200 -+++ cxxtools-2.2.1/include/cxxtools/serializationinfo.h 2016-04-29 17:59:22.002914734 +0200 +diff -up include/cxxtools/serializationinfo.h.than cxxtools-2.2.1/include/cxxtools/serializationinfo.h +--- include/cxxtools/serializationinfo.h.than 2016-04-29 17:56:47.199954811 +0200 ++++ include/cxxtools/serializationinfo.h 2016-04-29 17:59:22.002914734 +0200 @@ -181,9 +181,9 @@ class CXXTOOLS_API SerializationInfo { value = static_cast(_getUInt("unsigned long long", std::numeric_limits::max())); } #endif diff --git a/cxxtools.spec b/cxxtools.spec index 7551625..af91ae1 100644 --- a/cxxtools.spec +++ b/cxxtools.spec @@ -1,18 +1,21 @@ Name: cxxtools Version: 2.2.1 -Release: 24%{?dist} +Release: 25%{?dist} Summary: A collection of general-purpose C++ classes Epoch: 1 License: LGPLv2+ URL: http://www.tntnet.org/cxxtools.html Source0: http://www.tntnet.org/download/cxxtools-%{version}.tar.gz -Patch0: cxxtools-2.2-arm.patch +Patch0: %{name}-2.2-arm.patch # https://github.com/maekitalo/cxxtools/commit/86d4bb1881172752a80b706f9cc5fb0ebfa1b04e -Patch1: cxxtools-float.patch +Patch1: %{name}-float.patch +# https://github.com/maekitalo/cxxtools/commit/b773c01fc13d2ae67abc0839888e383be23562fd +# https://github.com/maekitalo/cxxtools/commit/607073936f5ce1b1c348d432c19234863a072cc7 +Patch2: %{name}-%{version}-gcc11.patch +BuildRequires: make BuildRequires: gcc BuildRequires: gcc-c++ -BuildRequires: make Provides: bundled(md5-polstra) %description @@ -27,9 +30,7 @@ Development files for %{name} %prep -%setup -q -%patch0 -p0 -b .arm -%patch1 -p1 -b .float +%autosetup -p0 -n %{name}-%{version} # fix spurious executable perm find -name "*.cpp" -exec chmod -x {} \; @@ -49,12 +50,10 @@ find -name "*.h" -exec chmod -x {} \; --with-atomictype=pthread \ %endif %{nil} -make %{?_smp_mflags} - +%make_build CXXFLAGS="-std=gnu++14 -fPIE" %install -rm -rf $RPM_BUILD_ROOT -make install DESTDIR=$RPM_BUILD_ROOT +%make_install # Find and remove all la files find $RPM_BUILD_ROOT -type f -name "*.la" -exec rm -f {} ';' @@ -76,6 +75,10 @@ find $RPM_BUILD_ROOT -type f -name "*.la" -exec rm -f {} ';' %{_includedir}/cxxtools/ %changelog +* Fri Jan 29 2021 Martin Gansser - 1:2.2.1-25 +- Add %%{name}-%%{version}-gcc11.patch +- Add CXXFLAGS "-std=gnu++14 -fPIE" as this code is not C++17 ready + * Tue Jan 26 2021 Fedora Release Engineering - 1:2.2.1-24 - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild