# Maintainer: Konstantin Gizdov <arch at kge dot pw>
# Contributor: Oliver Bandel <oliver@first.in-berlin.de>

pkgname=ocaml-zarith
provides=('zarith')
pkgver=1.12
pkgrel=1
pkgdesc='Implements arithmetic and logical operations over arbitrary-precision integers and rational numbers'
url='https://github.com/ocaml/Zarith'
arch=('x86_64')
license=('GPL2')
depends=('gmp')
makedepends=('ocaml>=4.12.0' 'ocaml-findlib' )
source=("https://github.com/ocaml/Zarith/archive/release-${pkgver}.tar.gz")
sha256sums=('cc32563c3845c86d0f609c86d83bf8607ef12354863d31d3bffc0dacf1ed2881')

build() {
  cd Zarith-release-${pkgver}

  ./configure -installdir "${pkgdir}/usr/lib/ocaml" # install ignores DESTDIR
  make -j1
}

package() {
  cd Zarith-release-${pkgver}

  mkdir -p "${pkgdir}/usr/lib/ocaml"
  OCAMLFIND_LDCONF=ignore make install
}
