# Maintainer: Jürgen Hötzel <juergen@archlinux.org>

pkgname=ocaml-integers
pkgver=0.7.0
pkgrel=10
pkgdesc='Various signed and unsigned integer types for OCaml'
arch=('x86_64' 'aarch64')
url=https://github.com/ocamllabs/ocaml-integers
license=('custom')
options=('!strip' '!debug')
depends=('ocaml-stdlib-shims')
makedepends=('dune' 'ocaml-topkg' 'ocaml-findlib' 'ocaml-compiler-libs' 'ocamlbuild' 'opam')
source=("$pkgname-$pkgver.tar.gz::https://github.com/ocamllabs/$pkgname/archive/$pkgver.tar.gz")
sha256sums=('8bb517fa9a1818246eb8c4ce34ee1489fbebb4b92defa3a25d13cab8d23ec685')


build() {
  cd ${pkgname}-$pkgver
  dune build --profile release
}

package() {
  cd ${pkgname}-$pkgver

  opam-installer --prefix="${pkgdir}/usr" \
		 --libdir="${pkgdir}$(ocamlc -where)" \
		 --docdir="${pkgdir}/usr/share/doc" \
		 --stubsdir="${pkgdir}$(ocamlc -where)/stublibs" \
		 ./_build/default/integers.install
  install -Dm644 LICENSE.md "${pkgdir}/usr/share/licenses/${pkgname}"/LICENSE.md
}
