# Maintainer: Santiago Torres-Arias <santiago@archlinux.org>
# Contributor: Alexander F. Rødseth <xyproto@archlinux.org>
# Contributor: Giovanni Scafora <giovanni@archlinux.org>
# Contributor: Adam Griffiths <adam_griffithsAATTdart.net.au>

pkgname=ode
pkgver=0.16.2
pkgrel=2
pkgdesc='High performance library for simulating rigid body dynamics'
arch=('x86_64')
url='https://bitbucket.org/odedevs/ode/'
license=('BSD' 'LGPL')
source=("https://bitbucket.org/odedevs/$pkgname/downloads/$pkgname-$pkgver.tar.gz")
sha256sums=('b26aebdcb015e2d89720ef48e0cb2e8a3ca77915f89d853893e7cc861f810f22')

prepare() {
  cd $pkgname-$pkgver

  ./bootstrap
}

build() {
  cd $pkgname-$pkgver

  export CXXFLAGS='-w -Ofast -fpermissive'

  ./configure \
    --prefix=/usr \
    --enable-shared \
    --enable-double-precision \
    --enable-libccd \
    --enable-ou \
    --enable-silent-rules
  make
}

package() {
  cd $pkgname-$pkgver

  DESTDIR="$pkgdir" make install

  install -Dm644 ou/LICENSE-BSD.TXT "$pkgdir/usr/share/licenses/$pkgname/LICENSE-BSD.TXT"
  install -Dm644 GIMPACT/GIMPACT-LICENSE-BSD.TXT "$pkgdir/usr/share/licenses/$pkgname/GIMPACT-LICENSE-BSD.TXT"
  install -Dm644 libccd/BSD-LICENSE "$pkgdir/usr/share/licenses/$pkgname/BSD-LICENSE"
}

# getver: bitbucket.org/odedevs/ode/raw/tip/configure.ac
# vim: ts=2 sw=2 et:
