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

pkgname=eclib
pkgver=20210625
pkgrel=2
pkgdesc='Includes mwrank (for 2-descent on elliptic curves over Q) and modular symbol code used to create the elliptic curve database'
arch=(x86_64)
url='https://github.com/JohnCremona/eclib/'
license=(GPL)
depends=(flint pari boost-libs)
makedepends=(boost)
source=(https://github.com/JohnCremona/eclib/releases/download/$pkgver/$pkgname-$pkgver.tar.bz2)
sha256sums=('7c0dcc3f3fcbf90dfdb00f30c4060e528c251d172039df15178b69b01188e810')

build() {
  cd $pkgname-$pkgver
  ./configure --prefix=/usr --with-flint=/usr --with-boost
  sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool # Fix overlinking
  make
}

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