summaryrefslogtreecommitdiff
path: root/community/wesnoth
diff options
context:
space:
mode:
Diffstat (limited to 'community/wesnoth')
-rw-r--r--community/wesnoth/PKGBUILD52
-rw-r--r--community/wesnoth/wesnoth-1.8.6-boost-foreach.patch70
-rw-r--r--community/wesnoth/wesnoth-libpng-1.4.0.patch24
-rw-r--r--community/wesnoth/wesnoth.install9
-rw-r--r--community/wesnoth/wesnoth.tmpfiles.conf1
-rwxr-xr-xcommunity/wesnoth/wesnothd.rc.d40
6 files changed, 196 insertions, 0 deletions
diff --git a/community/wesnoth/PKGBUILD b/community/wesnoth/PKGBUILD
new file mode 100644
index 000000000..19e8c83f5
--- /dev/null
+++ b/community/wesnoth/PKGBUILD
@@ -0,0 +1,52 @@
+# $Id$
+# Maintainer: Sven-Hendrik Haase <sh@lutzhaase.com>
+# Contributor: Jan de Groot <jgc@archlinux.org>
+# Contributor: Tobias Powalowski <tpowa@archlinux.org>
+# Contributor: Jacobo Arvelo <unix4all@ya.com>
+# Contributor: Douglas Soares de Andrade <douglas@archlinux.org>
+
+pkgname=wesnoth
+pkgver=1.10
+pkgrel=1
+pkgdesc="A turn-based strategy game on a fantasy world"
+arch=('i686' 'x86_64')
+license=('GPL')
+url="http://www.wesnoth.org/"
+depends=('sdl_ttf' 'sdl_net' 'sdl_mixer' 'sdl_image' 'fribidi' 'boost-libs' 'pango' 'lua' "wesnoth-data" 'dbus-core' 'python2')
+makedepends=('boost' 'cmake')
+install=wesnoth.install
+options=(!emptydirs)
+source=(http://downloads.sourceforge.net/sourceforge/$pkgname/$pkgname-$pkgver.tar.bz2
+ wesnoth.tmpfiles.conf
+ wesnothd.rc.d)
+md5sums=('707daa13e2f5b3976d9b169aab62dc29'
+ 'b8122f5054e3895c9c054e87460869dc'
+ '85659b47d22dfdf4e4d046556973fc3e')
+
+build() {
+ cd "$srcdir/$pkgname-$pkgver"
+
+ mkdir build && cd build
+ cmake .. \
+ -DCMAKE_INSTALL_PREFIX=/usr \
+ -DENABLE_OMP=ON \
+ -DENABLE_TOOLS=ON \
+ -DMANDIR=share/man \
+ -DFIFO_DIR=/var/run/wesnothd
+ make
+}
+
+package() {
+ cd "$srcdir/$pkgname-$pkgver"
+
+ cd build
+ make DESTDIR="$pkgdir" install
+
+ rm -r $pkgdir/usr/share/applications
+ rm -r $pkgdir/usr/share/doc
+ rm -r $pkgdir/usr/share/pixmaps
+ rm -r $pkgdir/usr/share/wesnoth
+
+ install -Dm644 "$srcdir/wesnoth.tmpfiles.conf" "$pkgdir/usr/lib/tmpfiles.d/wesnoth.conf"
+ install -Dm755 "$srcdir/wesnothd.rc.d" "$pkgdir/etc/rc.d/wesnothd"
+}
diff --git a/community/wesnoth/wesnoth-1.8.6-boost-foreach.patch b/community/wesnoth/wesnoth-1.8.6-boost-foreach.patch
new file mode 100644
index 000000000..5aee3118c
--- /dev/null
+++ b/community/wesnoth/wesnoth-1.8.6-boost-foreach.patch
@@ -0,0 +1,70 @@
+--- wesnoth-1.8.6/src/gui/widgets/tree_view_node.cpp~ 2011-07-21 23:05:56.594879049 +0200
++++ wesnoth-1.8.6/src/gui/widgets/tree_view_node.cpp 2011-07-21 23:28:07.540358742 +0200
+@@ -238,6 +238,17 @@ void ttree_view_node::clear()
+
+ struct ttree_view_node_implementation
+ {
++ template<class W, class It>
++ static W* find_at_aux(It begin, It end,
++ const tpoint& coordinate, const bool must_be_active) {
++ for (It it = begin; it != end; ++it) {
++ if(W* widget = it->find_at(coordinate, must_be_active)) {
++ return widget;
++ }
++ }
++ return NULL;
++ }
++
+ template<class W>
+ static W* find_at(
+ typename tconst_duplicator<W, ttree_view_node>::type&
+@@ -255,13 +266,9 @@ struct ttree_view_node_implementation
+ }
+
+ typedef typename tconst_duplicator<W, ttree_view_node>::type thack;
+- foreach(thack& node, tree_view_node.children_) {
+- if(W* widget = node.find_at(coordinate, must_be_active)) {
+- return widget;
+- }
+- }
+-
+- return NULL;
++ return find_at_aux<W>(tree_view_node.children_.begin(),
++ tree_view_node.children_.end(),
++ coordinate, must_be_active);
+ }
+ };
+
+@@ -313,7 +320,9 @@ tpoint ttree_view_node::get_current_size
+ return size;
+ }
+
+- foreach(const ttree_view_node& node, children_) {
++ for (boost::ptr_vector<ttree_view_node>::const_iterator it
++ = children_.begin (); it != children_.end (); ++it) {
++ const ttree_view_node& node = *it;
+
+ if(node.grid_.get_visible() == twidget::INVISIBLE) {
+ continue;
+@@ -344,7 +353,9 @@ tpoint ttree_view_node::get_unfolded_siz
+ size.x += (get_indention_level() - 1) * tree_view().indention_step_size_;
+ }
+
+- foreach(const ttree_view_node& node, children_) {
++ for (boost::ptr_vector<ttree_view_node>::const_iterator it
++ = children_.begin (); it != children_.end (); ++it) {
++ const ttree_view_node& node = *it;
+
+ if(node.grid_.get_visible() == twidget::INVISIBLE) {
+ continue;
+@@ -378,7 +389,9 @@ tpoint ttree_view_node::calculate_best_s
+
+ DBG_GUI_L << LOG_HEADER << " own grid best size " << best_size << ".\n";
+
+- foreach(const ttree_view_node& node, children_) {
++ for (boost::ptr_vector<ttree_view_node>::const_iterator it
++ = children_.begin (); it != children_.end (); ++it) {
++ const ttree_view_node& node = *it;
+
+ if(node.grid_.get_visible() == twidget::INVISIBLE) {
+ continue;
diff --git a/community/wesnoth/wesnoth-libpng-1.4.0.patch b/community/wesnoth/wesnoth-libpng-1.4.0.patch
new file mode 100644
index 000000000..338f467af
--- /dev/null
+++ b/community/wesnoth/wesnoth-libpng-1.4.0.patch
@@ -0,0 +1,24 @@
+diff -Nur wesnoth-1.8.orig/src/tools/exploder_utils.cpp wesnoth-1.8/src/tools/exploder_utils.cpp
+--- wesnoth-1.8.orig/src/tools/exploder_utils.cpp 2010-01-01 15:16:49.000000000 +0200
++++ wesnoth-1.8/src/tools/exploder_utils.cpp 2010-04-08 17:38:03.066201123 +0300
+@@ -174,8 +174,8 @@
+ //TODO: review whether providing NULL error handlers is something
+ //sensible
+ png_struct* png_ptr = png_create_write_struct
+- (PNG_LIBPNG_VER_STRING, reinterpret_cast<png_voidp>(png_voidp_NULL),
+- png_error_ptr_NULL, png_error_ptr_NULL);
++ (PNG_LIBPNG_VER_STRING, reinterpret_cast<png_voidp>(NULL),
++ NULL, NULL);
+ if(!png_ptr)
+ throw exploder_failure("Unable to initialize the png write structure");
+
+--- wesnoth-1.8.orig/src/tools/exploder_utils.cpp.libpng 2011-11-06 14:44:26.618711420 -0600
++++ wesnoth-1.8/src/tools/exploder_utils.cpp 2011-11-06 14:57:12.150006511 -0600
+@@ -15,6 +15,7 @@
+ #include "exploder_utils.hpp"
+ #include "game_config.hpp"
+ #include "serialization/string_utils.hpp"
++#include <zlib.h>
+ #include <png.h>
+
+ exploder_point::exploder_point(const std::string &s)
diff --git a/community/wesnoth/wesnoth.install b/community/wesnoth/wesnoth.install
new file mode 100644
index 000000000..4f1e419ae
--- /dev/null
+++ b/community/wesnoth/wesnoth.install
@@ -0,0 +1,9 @@
+# arg 1: the new package version
+post_install() {
+cat << EOF
+Note:
+==> If you experience sound problems try setting your SDL_AUDIODRIVER environment variable to "dma"
+==> eg. export SDL_AUDIODRIVER="dma" ; wesnoth
+==> If "dma" doesn't work,other options are: dsp,alsa,artsc,esd,nas try to find the right output.
+EOF
+}
diff --git a/community/wesnoth/wesnoth.tmpfiles.conf b/community/wesnoth/wesnoth.tmpfiles.conf
new file mode 100644
index 000000000..3ec0f6013
--- /dev/null
+++ b/community/wesnoth/wesnoth.tmpfiles.conf
@@ -0,0 +1 @@
+D /run/wesnothd 0700 root root -
diff --git a/community/wesnoth/wesnothd.rc.d b/community/wesnoth/wesnothd.rc.d
new file mode 100755
index 000000000..95e312b7b
--- /dev/null
+++ b/community/wesnoth/wesnothd.rc.d
@@ -0,0 +1,40 @@
+#!/bin/bash
+
+. /etc/rc.conf
+. /etc/rc.d/functions
+
+PID=$(pidof -o %PPID /usr/bin/wesnothd)
+
+case "$1" in
+ start)
+ stat_busy "Starting Wesnoth Server Daemon"
+ [[ -d /var/run/wesnothd ]] || mkdir /var/run/wesnothd
+ [ -z "$PID" ] && /usr/bin/wesnothd -d &> /dev/null
+ if [ $? -gt 0 ]; then
+ stat_fail
+ else
+ PID=$(pidof -o %PPID /usr/bin/wesnothd)
+ echo $PID > /var/run/wesnotd/pid
+ add_daemon wesnothd
+ stat_done
+ fi
+ ;;
+ stop)
+ stat_busy "Stopping Wesnoth Server Daemon"
+ [ ! -z "$PID" ] && kill $PID &> /dev/null
+ if [ $? -gt 0 ]; then
+ stat_fail
+ else
+ rm_daemon wesnothd
+ stat_done
+ fi
+ ;;
+ restart)
+ $0 stop
+ sleep 1
+ $0 start
+ ;;
+ *)
+ echo "usage: $0 {start|stop|restart}"
+esac
+exit 0