# $Id: PKGBUILD 122991 2014-11-23 12:09:00Z svenstaro $
# Maintainer: Sven-Hendrik Haase <sh@lutzhaase.com>
# Contributor: Matthew Bowra-Dean <matthew@ijw.co.nz>
pkgname=openra
pkgver=20141029
pkgrel=1
pkgdesc="An open-source implementation of the Red Alert engine using .NET/mono and OpenGL"
arch=('any')
url="http://open-ra.org"
license=('GPL3')
install=openra.install
depends=('mono' 'ttf-dejavu' 'openal' 'libgl' 'freetype2' 'sdl2' 'lua51' 'hicolor-icon-theme' 'gtk-update-icon-cache' 'desktop-file-utils' 'xdg-utils' 'zenity')
makedepends=('git' 'unzip')
optdepends=('nvidia-cg-toolkit: for using the alternative Cg renderer')
options=(!strip)
source=("git+https://github.com/OpenRA/OpenRA.git#tag=release-${pkgver}"
        "https://github.com/OpenRA/OpenRA/pull/6931.patch")
md5sums=('SKIP'
         '38552127001404181ac5ab01e75929ff')

prepare() {
  cd OpenRA

  patch -Np1 < $srcdir/6931.patch

  make version
}

build() {
  cd OpenRA

  ./configure
  make cli-dependencies
  make core
  make tools
}

package() {
  cd OpenRA

  make prefix=/usr DESTDIR="$pkgdir" install-all
  make prefix=/usr DESTDIR="$pkgdir" install-linux-shortcuts
}
