# Maintainer: Vesa Kaihlavirta <vegai@iki.fi>
# Contributor: Angelo Theodorou <encelo@users.sourceforge.net>

pkgname=warzone2100
pkgver=3.3.0
pkgrel=1
pkgdesc="3D realtime strategy game on a future Earth"
url="https://wz2100.net/"
arch=('x86_64')
license=('GPL')
depends=('sdl2' 'glew' 'fribidi' 'openal' 'libvorbis' 'libtheora' 'physfs' 'ttf-dejavu' 'qt5-script' 'xorg-xrandr')
makedepends=('gawk' 'flex' 'zip' 'unzip' 'asciidoc' 'mesa' 'cmake')
source=(https://github.com/Warzone2100/warzone2100/releases/download/${pkgver}/warzone2100-${pkgver}_src.tar.xz)
sha256sums=('cc48c8128d17a499e833996470d843855389d9fc985c71f05be08901f33116e8')

prepare() {
  mkdir -p build
}

build() {
  cd build

  cmake ../${pkgname} \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DCMAKE_INSTALL_LIBDIR=lib \
    -DWZ_DISTRIBUTOR="ArchLinux"
  make
}

package() {
  cd build

  make DESTDIR=${pkgdir} install
}
