# Maintainer: Antonio Rojas <arojas@archlinux.org>

pkgname=e-antic
pkgver=1.0.3
pkgrel=1
pkgdesc='Embedded algebraic number fields (on top of antic)'
arch=(x86_64)
url='https://github.com/flatsurf/e-antic/'
license=(LGPL)
depends=(arb antic)
makedepends=(boost)
source=(https://github.com/flatsurf/e-antic/releases/download/$pkgver/$pkgname-$pkgver.tar.gz)
sha256sums=('eea1dc66fed5962425bc7d2c5ccecb50d25c082b1d84276fa3838bfa96d9cb62')

build() {
  cd $pkgname-$pkgver
  ./configure \
    --prefix=/usr \
    --without-benchmark \
    --without-byexample \
    --without-pytest \
    --without-doc
# https://bugzilla.gnome.org/show_bug.cgi?id=655517
  sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libeantic/libtool
  make
}

check() {
  cd $pkgname-$pkgver
  make check
}

package() {
  cd $pkgname-$pkgver
  make DESTDIR="$pkgdir" install

  install -Dm644 "$srcdir"/$pkgname-$pkgver/COPYING "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
}
