# Maintainer: Sven-Hendrik Haase <svenstaro@archlinux.org>
# Contributor: Johan Rehnberg <cleanrock@gmail.com>

pkgname=naev
pkgver=0.12.6
pkgrel=1
pkgdesc='2D action/rpg space game'
arch=('x86_64')
url="https://github.com/naev/naev"
license=('GPL3')
depends=('glu' 'openal' 'libvorbis' 'sdl2' 'sdl2_image' 'sdl2_mixer' 'libgl' 'libxml2' 'freetype2'
         'libpng' 'libzip' 'luajit' 'glpk' 'physfs' 'libunibreak' 'suitesparse' 'cblas'
         'cmark' 'enet')
makedepends=('freeglut' 'zip' 'meson' 'git' 'python-yaml')
source=("https://github.com/naev/naev/releases/download/v$pkgver/naev-$pkgver-source.tar.xz")
sha512sums=('4d28e9caa26e4c6328b33f17e7c101bc80c6f30540f8d148e7441a9193a3a1a7ee647d501acde7b72b60a9e60ef66774363fdeacefa7c2b7522e278ed44017d2')

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

  meson setup -Dprefix=/usr -Dndata_path=/usr/share/naev/ndata -Dblas=cblas build .
  cd build
  meson compile
}

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

  DESTDIR="$pkgdir" meson install
  rm -r "$pkgdir"/usr/{include,lib}
}
