# Maintainer: Antonio Rojas <arojas@archlinux.org>
# Contributor: Rémy Oudompheng <oudomphe@clipper.ens.fr>
# Contributor: Alessandro "jakedust" Andrioni <jakedust@gmail.com>

pkgname=flint
pkgver=2.5.2
pkgrel=27
pkgdesc="A C library for doing number theory"
arch=(x86_64)
url="http://www.flintlib.org"
license=(GPL)
depends=(mpfr ntl)
source=("http://www.flintlib.org/flint-$pkgver.tar.gz" flint-pie-hardening-conflict.patch)
sha256sums=('cbf1fe0034533c53c5c41761017065f85207a1b770483e98b2392315f6575e87'
            '0e8ba7b48d70c703e511d71d4e59b6b359273c480b01f02879ca0aaaaa5395c3')

prepare() {
  cd $pkgname-$pkgver
# Fix build with PIE
  patch -p1 -i ../flint-pie-hardening-conflict.patch
}

build() {
  cd $pkgname-$pkgver
  ./configure --prefix=/usr --with-gmp=/usr --with-mpfr=/usr --with-ntl=/usr
  make
}

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