# Maintainer: Celeste <cielesti@protonmail.com>
maintainer="Celeste <cielesti@protonmail.com>"
pkgname=ocaml5-gccjit
pkgver=0.3.2.1_git20240713
_gitrev=3171ad5da1308580fba115dbbb149258415e5991
pkgrel=0
pkgdesc="OCaml bindings for libgccjit"
url="https://github.com/lukstafi/ocaml-gccjit"
# armhf, armv7, x86: native mode not available
arch="all !armhf !armv7 !x86"
license="MIT"
depends="ocaml5-ctypes"
makedepends="dune libgccjit-dev ocaml5"
subpackages="$pkgname-doc"
source="https://github.com/lukstafi/ocaml-gccjit/archive/$_gitrev/ocaml-gccjit-$_gitrev.tar.gz"
builddir="$srcdir/ocaml-gccjit-$_gitrev"
options="!check" # requires unpackaged ppx_expect

build() {
	dune build --release --verbose
}

check() {
	dune runtest --build-dir=.testenv --verbose
}

package() {
	dune install --destdir="$pkgdir"

	mv -v "$pkgdir"/usr/share/doc/gccjit "$pkgdir"/usr/share/doc/$pkgname
}

sha512sums="
506c33cae8fb31f241fa7929c4b4b884400026e3912a816597517d27a3a0a55425cd5f84113728084a767d75666b0a491c269f75007788cb44cd7b30c1064c49  ocaml-gccjit-3171ad5da1308580fba115dbbb149258415e5991.tar.gz
"
