# Maintainer: Eric Belanger <eric@archlinux.org>
# Contributor: Tom Newsom <Jeepster@gmx.co.uk>

pkgname=plib
pkgver=1.8.5
pkgrel=10
pkgdesc="Set of libraries to write games and other realtime interactive applications"
arch=(armv7h aarch64 x86_64)
url="http://plib.sourceforge.net/"
license=('custom:LGPL')
makedepends=('mesa-libgl' 'libxi' 'libxmu')
source=(http://plib.sourceforge.net/dist/$pkgname-$pkgver.tar.gz)
options=('staticlibs' '!lto')
md5sums=('47a6fbf63668c1eed631024038b2ea90')
sha1sums=('c2cf7e3e1e58f7b63dae4bb21e4fa82c3e4d4cfc')

build() {
  cd $pkgname-$pkgver

  CXXFLAGS+=' -fPIC'
  CFLAGS+=' -fPIC'
  LDFLAGS+=' -fPIC'
  # The old configure script does not recognize aarch64...
  autoreconf -i -f
  ./configure --prefix=/usr
  make
}

package() {
  cd $pkgname-$pkgver

  make DESTDIR="${pkgdir}" install
  install -D -m644 COPYING "${pkgdir}/usr/share/licenses/$pkgname/COPYING"
}
