# $Id: PKGBUILD 132388 2015-04-28 11:43:40Z bpiotrowski $
# Maintainer: Alexander Rødseth <rodseth@gmail.com>
# Contributor: Jaroslaw Swierczynski <swiergot@aur.archlinux.org>
# Contributor: Roman Kyrylych <Roman.Kyrylych@gmail.com>

pkgname=glob2
pkgver=0.9.4.4
pkgrel=24
pkgdesc='Globulation 2 is an innovative Real-Time Strategy (RTS) game which reduces micro-management by automatically assigning tasks to units'
arch=('x86_64' 'i686')
url='http://www.globulation2.org/'
license=('GPL3')
depends=('boost-libs' 'sdl_net' 'sdl_image' 'sdl_ttf' 'libvorbis' 'speex' 'glu'
         'fribidi' 'xdg-utils' 'libgl' 'hicolor-icon-theme')
makedepends=('scons' 'boost' 'mesa')
install=glob2.install
source=("http://dl.sv.nongnu.org/releases/$pkgname/${pkgver%.*}/$pkgname-$pkgver.tar.gz"
        "glob2-0.9.4.1-gcc44.patch" fix-ftbfs-gcc49.diff)
sha256sums=('0f4d898ec6b05ce27b4a12ef242cc26571304b90d2509932a4743c71311314b8'
            '3a0cfc06696d1aaf2d7948b5f6a09a8ce96492767039dc09bfc25182b92d7b7a'
            '2bf0e51ca5de8c6f4910b68522a0265e07bb32beefe13b9912b59e5954c5bfba')

prepare() {
  cd "$pkgname-$pkgver"

  patch -p0 -i "$srcdir/glob2-0.9.4.1-gcc44.patch"
  patch -p1 -i "$srcdir/fix-ftbfs-gcc49.diff"
}

build() {
  cd "$pkgname-$pkgver"

  scons LINKFLAGS="-lboost_system"
}

package () {
  cd "$pkgname-$pkgver"

  scons install BINDIR="$pkgdir/usr/bin" INSTALLDIR="$pkgdir/usr/share"
  find "$pkgdir/usr/share" -type f -exec chmod 644 '{}' \;
  install -Dm644 "data/icons/$pkgname-icon-48x48.png" \
    "$pkgdir/usr/share/pixmaps/$pkgname-icon-48x48.png"
}

# vim:set ts=2 sw=2 et:
