diff --git a/games/widelands/README b/games/widelands/README index c57c96549f..74aeec0218 100644 --- a/games/widelands/README +++ b/games/widelands/README @@ -1,5 +1,5 @@ Widelands is a strategy game based on Settlers II. -Requires SDL_gfx, p7zip and scons. If you want integration +Widelands requires SDL_gfx and lua. If you want integration with the GGZ Gaming Zone you will also need ggz-base-libs. All available at SlackBuilds.org. diff --git a/games/widelands/widelands.SlackBuild b/games/widelands/widelands.SlackBuild index e39f25eb7d..5c723a914e 100644 --- a/games/widelands/widelands.SlackBuild +++ b/games/widelands/widelands.SlackBuild @@ -22,15 +22,19 @@ # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -SRCNAM=Widelands -SRCVER=Build14 - -PRGNAM=$(echo $SRCNAM | tr [:upper:] [:lower:]) -VERSION=$(echo $SRCVER | tr [:upper:] [:lower:]) -ARCH=${ARCH:-i486} +PRGNAM=widelands +VERSION=build15 BUILD=${BUILD:-1} TAG=${TAG:-_SBo} +if [ -z "$ARCH" ]; then + case "$( uname -m )" in + i?86) ARCH=i486 ;; + arm*) ARCH=arm ;; + *) ARCH=$( uname -m ) ;; + esac +fi + CWD=$(pwd) TMP=${TMP:-/tmp/SBo} PKG=$TMP/package-$PRGNAM @@ -43,9 +47,10 @@ elif [ "$ARCH" = "i686" ]; then SLKCFLAGS="-O2 -march=i686 -mtune=i686" LIBDIRSUFFIX="" elif [ "$ARCH" = "x86_64" ]; then - # we need to deviate from the standard cflags here, as -O2 results - # in a segfault - SLKCFLAGS="-O0 -fPIC" + SLKCFLAGS="-O2 -fPIC" + LIBDIRSUFFIX="" +else + SLKCFLAGS="-O2" LIBDIRSUFFIX="" fi @@ -54,37 +59,42 @@ set -e rm -rf $PKG mkdir -p $TMP $PKG $OUTPUT cd $TMP -rm -rf $PRGNAM -7z x $CWD/$SRCNAM-$SRCVER-src.7z -cd $PRGNAM +rm -rf $PRGNAM-$VERSION-src +tar xvf $CWD/$PRGNAM-$VERSION-src.tar.bz2 +cd $PRGNAM-$VERSION-src chown -R root:root . chmod -R u+w,go+r-w,a-s . -scons \ - install_prefix="/usr" \ - bindir="bin" \ - datadir="share/games/widelands" \ - localedir="share/locale" \ - enable_ggz=${GGZ:-no} \ - extra_compile_flags="$(echo $SLKCFLAGS)" +# make locale install dir configurable +localedir="WLBUILD_INSTALL_LOCALEDIR" +old="$localedir \"\${CMAKE_INSTALL_PREFIX}/\${WL_INSTALL_DATADIR}/locale\"" +new="$localedir \${WL_INSTALL_LOCALEDIR}" +sed -i "s|$old|$new|" CMakeLists.txt -scons \ - install_prefix="$PKG/usr" \ - bindir="bin" \ - datadir="share/games/widelands" \ - localedir="share/locale" \ - enable_ggz=${GGZ:-no} \ - extra_compile_flags="$(echo $SLKCFLAGS)" \ - install +mkdir -p build1 +cd build1 + cmake \ + -DCMAKE_C_FLAGS:STRING="$SLKCFLAGS" \ + -DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS" \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DLIB_SUFFIX=${LIBDIRSUFFIX} \ + -DCMAKE_BUILD_TYPE=Release \ + -DWL_INSTALL_LOCALEDIR="/usr/share/locale" \ + -DWL_INSTALL_BINDIR="bin" \ + .. + make + make install DESTDIR=$PKG +cd .. mkdir -p $PKG/usr/share/applications -install -m 0644 $CWD/widelands.desktop $PKG/usr/share/applications/widelands.desktop +install -m 0644 $CWD/widelands.desktop \ + $PKG/usr/share/applications/widelands.desktop find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \ | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true -mkdir -p $PKG/usr/doc -mv $PKG/usr/share/games/widelands/doc $PKG/usr/doc/$PRGNAM-$VERSION +mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION +cp -a ChangeLog COPYING CREDITS WL_RELEASE $PKG/usr/doc/$PRGNAM-$VERSION/ cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild mkdir -p $PKG/install diff --git a/games/widelands/widelands.info b/games/widelands/widelands.info index 1603a5f34e..12e69efd96 100644 --- a/games/widelands/widelands.info +++ b/games/widelands/widelands.info @@ -1,8 +1,8 @@ PRGNAM="widelands" -VERSION="build14" +VERSION="build15" HOMEPAGE="http://www.widelands.org" -DOWNLOAD="http://downloads.sourceforge.net/widelands/Widelands-Build14-src.7z" -MD5SUM="06d63783b82b68af7af26198bc0a5afa" +DOWNLOAD="http://launchpad.net/widelands/build15/build15/+download/widelands-build15-src.tar.bz2" +MD5SUM="5b2e2d0913272f66055e424f91360b1d" DOWNLOAD_x86_64="" MD5SUM_x86_64="" MAINTAINER="Heinz Wiesinger"