From 6fdd2133b77f0832efa5f312d59083be2346a14b Mon Sep 17 00:00:00 2001 From: Artur Frenszek-Iwicki Date: Feb 20 2022 01:26:36 +0000 Subject: Add a patch to fix build failures with gcc-12 --- diff --git a/0002-fix-gcc12-memcpy-restrict-warnings.patch b/0002-fix-gcc12-memcpy-restrict-warnings.patch new file mode 100644 index 0000000..27c7592 --- /dev/null +++ b/0002-fix-gcc12-memcpy-restrict-warnings.patch @@ -0,0 +1,21 @@ +--- colobot-0.2.0--orig/src/ui/controls/list.cpp 2021-08-21 22:57:34.000000000 +0200 ++++ colobot-0.2.0--patched/src/ui/controls/list.cpp 2022-02-20 02:25:45.319049328 +0100 +@@ -660,11 +660,17 @@ + m_totalLine = i+1; // expands the list + + m_items.resize(m_totalLine); + if ( name.empty() ) ++ { ++#pragma GCC diagnostic ignored "-Wrestrict" + m_items[i].text = " "; +- else ++#pragma GCC diagnostic pop ++ } ++ else ++ { + m_items[i].text = name; ++ } + + UpdateButton(); + UpdateScroll(); + } diff --git a/colobot.spec b/colobot.spec index 6a3a569..3e5d947 100644 --- a/colobot.spec +++ b/colobot.spec @@ -2,7 +2,7 @@ Name: colobot %global orgname info.colobot.Colobot Version: 0.2.0 -Release: 3%{?dist} +Release: 4%{?dist} Summary: A video game that teaches programming in a fun way License: GPLv3 @@ -50,6 +50,9 @@ Patch0: 0000-do-not-translate-default-player-name.patch # Fix test compilation failure due to C++ "One Definition Rule" violation Patch1: 0001-fix-test-compile-failure.patch +# Fix compilation failures due to GCC12 -Wrestrict warnings +# See: https://bugzilla.redhat.com/show_bug.cgi?id=2047428 +Patch2: 0002-fix-gcc12-memcpy-restrict-warnings.patch # Tests fail on ARM architectures. Needs some investigation. %ifarch %{arm} aarch64 @@ -114,9 +117,7 @@ Music files used by Colobot Gold. %prep -%setup -q -n colobot-%{gittag} -%patch0 -p1 -%patch1 -p1 +%autosetup -n colobot-%{gittag} -p1 rm -rf ./data cp %{SOURCE1} ./data.tgz @@ -182,10 +183,9 @@ sed -e 's|%{name}.desktop|%{orgname}.desktop|' -i %{buildroot}%{_metainfodir}/%{ # Run unit tests. The test suite includes tests for parsing the .ini file, # hence the test runner requires a colobot.ini file to read. mkdir test-run-dir -cp -a \ +cp -a --target-directory ./test-run-dir \ test/unit/common/colobot.ini \ - %{_vpath_builddir}/colobot_ut \ - ./test-run-dir + %{_vpath_builddir}/colobot_ut pushd test-run-dir ./colobot_ut popd @@ -221,6 +221,9 @@ appstream-util validate-relax --nonet %{buildroot}%{_metainfodir}/%{orgname}.app %changelog +* Sun Feb 20 2022 Artur Frenszek-Iwicki - 0.2.0-4 +- Add a patch to fix build failures with gcc-12 + * Thu Feb 10 2022 Orion Poplawski - 0.2.0-3 - Rebuild for glew 2.2