Date: Friday, October 21, 2022 @ 20:10:38
Author: foutrelis
Revision: 1333288
Fix build with GCC 12
Added:
widelands/trunk/widelands-1.0-gcc12-werror.patch
Modified:
widelands/trunk/PKGBUILD
----------------------------------+
PKGBUILD | 3 +++
widelands-1.0-gcc12-werror.patch | 29 +++++++++++++++++++++++++++++
2 files changed, 32 insertions(+)
Modified: PKGBUILD
===================================================================
--- PKGBUILD 2022-10-21 20:05:10 UTC (rev 1333287)
+++ PKGBUILD 2022-10-21 20:10:38 UTC (rev 1333288)
@@ -14,12 +14,15 @@
makedepends=('cmake' 'boost' 'mesa' 'ninja' 'git')
replaces=('widelands-data')
source=("$pkgname-$pkgver.tar.gz::https://github.com/widelands/widelands/archive/refs/tags/v${pkgver}.tar.gz"
+ widelands-1.0-gcc12-werror.patch
https://github.com/widelands/widelands/commit/316eaea209754368a57f445ea4dd016ecf8eded6.patch)
sha512sums=('1092750944a8669682097dfbd2b578cdb8fab377f32cb81ce8d85b9d9b2e8ae8c4c73500c0a89be649b360fd7e086e19595eba37cecb8d64679e46f7da13e46e'
+
'a303972d15f2ad2fb895992358759f7a3006c81c875afbbbac4cf4ec76ca93d3ad93754b26eea2315bd9c82f2967912019759117c7004843d659d2d767c2f7ee'
'1b236bf06173aeadd07a3b0074b5ec3e6577923e4c6595587504f73d2c729586f03cc5a8fd256a0cb98ed7f586deb09df534fc8300f15d3a259e64435838e317')
prepare() {
cd $pkgname-$pkgver
+ patch -Np1 -i "$srcdir"/widelands-1.0-gcc12-werror.patch # patch from Gentoo
patch -Np1 -i "$srcdir"/316eaea209754368a57f445ea4dd016ecf8eded6.patch
}
Added: widelands-1.0-gcc12-werror.patch
===================================================================
--- widelands-1.0-gcc12-werror.patch (rev 0)
+++ widelands-1.0-gcc12-werror.patch 2022-10-21 20:10:38 UTC (rev 1333288)
@@ -0,0 +1,29 @@
+Drop -Werror= (uninitialized cause issues from gcc-12) and also backport
+fix for the offending variable.
+
+Note: upstream changed how -Werror is handled next release, currently pass
+a hard non-specific -Werror and disables it for gcc-12 (review on bump, see
+commit/PR below).
+
+https://bugs.gentoo.org/859277
+https://github.com/widelands/widelands/pull/5415
+https://github.com/widelands/widelands/commit/e4da6d624
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -312,8 +312,2 @@
+ if(NOT MSVC)
+- # Turn some warnings into errors.
+- wl_add_flag(WL_COMPILE_DIAGNOSTICS "-Werror=format-security")
+- wl_add_flag(WL_COMPILE_DIAGNOSTICS "-Werror=return-type")
+- wl_add_flag(WL_COMPILE_DIAGNOSTICS "-Werror=shadow")
+- wl_add_flag(WL_COMPILE_DIAGNOSTICS "-Werror=uninitialized")
+-
+ wl_add_flag(WL_GENERIC_CXX_FLAGS "-std=c++11")
+--- a/src/editor/editorinteractive.h
++++ b/src/editor/editorinteractive.h
+@@ -87,4 +87,4 @@
+ EditorIncreaseResourcesTool increase_resources;
+- EditorSetPortSpaceTool set_port_space;
+ EditorUnsetPortSpaceTool unset_port_space;
++ EditorSetPortSpaceTool set_port_space;
+ EditorSetOriginTool set_origin;