# POWER Maintainer: Alexander Baldeck <alex.bldck@gmail.com>
# Maintainer: Konstantin Gizdov <arch at kge dot pw>
_pkgname='bigarray-compat'
pkgname="ocaml-${_pkgname}"
pkgver=1.1.0
pkgrel=3
pkgdesc="Compatibility library to use Stdlib.Bigarray when possible"
arch=(x86_64 powerpc64le powerpc64 powerpc riscv64)
url="https://github.com/mirage/bigarray-compat"
license=('Apache')
depends=("ocaml")
makedepends=("ocaml-compiler-libs" "dune")
source=("https://github.com/mirage/${pkgname#ocaml-}/archive/refs/tags/v${pkgver}.tar.gz")
sha512sums=('bbd9c2b319930db832ae8d41844ef81e74ced9f745f32981f2efcc9777220d55e1e5d6dc2965e9e1a6ed5e0d56ad27c672289f8dc28fbe2658f3230cbda5a800')

build() {
    cd "${srcdir}/${_pkgname}-${pkgver}"
    dune build -p $_pkgname
}

package() {
    cd "${srcdir}/${_pkgname}-${pkgver}"
    DESTDIR="${pkgdir}" dune install --prefix "/usr" --libdir "/usr/lib/ocaml"

    install -dm755 "${pkgdir}/usr/share/"
    mv "${pkgdir}/usr/doc" "${pkgdir}/usr/share/"
}
