summaryrefslogtreecommitdiff
path: root/games/wesnoth
diff options
context:
space:
mode:
authorWilly Sudiarto Raharjo <willysr@slackware-id.org>2013-06-03 12:39:06 -0500
committerRobby Workman <rworkman@slackbuilds.org>2013-06-04 00:11:32 -0500
commitf17ecd0783d08d658be2afb38a35ae228d7423ac (patch)
tree09180ee0b8b498873b7291f8f30f8635fb20d92a /games/wesnoth
parent671f3b1661020901c29212ffe2884bce60e24428 (diff)
downloadslackbuilds-f17ecd0783d08d658be2afb38a35ae228d7423ac.tar.gz
games/wesnoth: Fix segfault using upstream patch
Signed-off-by: Robby Workman <rworkman@slackbuilds.org>
Diffstat (limited to 'games/wesnoth')
-rw-r--r--games/wesnoth/fix-segfault.patch43
-rw-r--r--games/wesnoth/wesnoth.SlackBuild11
2 files changed, 53 insertions, 1 deletions
diff --git a/games/wesnoth/fix-segfault.patch b/games/wesnoth/fix-segfault.patch
new file mode 100644
index 0000000000..882231d99e
--- /dev/null
+++ b/games/wesnoth/fix-segfault.patch
@@ -0,0 +1,43 @@
+From bbd7f62a426e321034c7bdf9054152fc159e517a Mon Sep 17 00:00:00 2001
+From: "J. Tyne" <jt_coding@verizon.net>
+Date: Thu, 13 Dec 2012 14:22:35 +0000
+Subject: [PATCH] Change some implicit conversions to return const references
+ to objects...
+
+...instead of temporary objects.
+
+Fixes bug #20360.
+---
+ src/shared_object.hpp | 2 +-
+ src/tstring.hpp | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/shared_object.hpp b/src/shared_object.hpp
+index 89be3b8..a6099a8 100644
+--- a/src/shared_object.hpp
++++ b/src/shared_object.hpp
+@@ -51,7 +51,7 @@ class shared_object {
+ val_->count++;
+ }
+
+- operator T() const {
++ operator const T &() const {
+ assert(valid());
+ return val_->val;
+ }
+diff --git a/src/tstring.hpp b/src/tstring.hpp
+index a391d58..f4664f5 100644
+--- a/src/tstring.hpp
++++ b/src/tstring.hpp
+@@ -145,7 +145,7 @@ class t_string :
+ static t_string from_serialized(const std::string& string) { return t_string(base::from_serialized(string)); }
+ std::string to_serialized() const { return get().to_serialized(); }
+
+- operator t_string_base() const { return get(); }
++ operator const t_string_base &() const { return get(); }
+
+ t_string operator+(const t_string& o) const { return get() + o.get(); }
+ t_string operator+(const std::string& o) const { return get() + o; }
+--
+1.8.1.6
+
diff --git a/games/wesnoth/wesnoth.SlackBuild b/games/wesnoth/wesnoth.SlackBuild
index e216827b35..f5acbe9dba 100644
--- a/games/wesnoth/wesnoth.SlackBuild
+++ b/games/wesnoth/wesnoth.SlackBuild
@@ -27,7 +27,7 @@
PRGNAM=wesnoth
VERSION=${VERSION:-1.10.6}
-BUILD=${BUILD:-1}
+BUILD=${BUILD:-2}
TAG=${TAG:-_SBo}
if [ -z "$ARCH" ]; then
@@ -88,6 +88,15 @@ find . \
CFLAGS="$SLKCFLAGS" \
CXXFLAGS="$SLKCFLAGS" \
+# Fix build problem on future GCC 4.8.0
+sed -i 's/-Werror//' CMakeLists.txt
+
+# Fix segfault
+# Upstream bug report and patch
+# https://gna.org/bugs/index.php?20742
+# https://github.com/wesnoth/wesnoth-old/commit/bbd7f6.patch
+patch -p1 < $CWD/fix-segfault.patch
+
cmake \
-DCMAKE_C_FLAGS:STRING="$SLKCFLAGS" \
-DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS" \