aboutsummaryrefslogtreecommitdiffstats
path: root/testing/ocaml-alcotest/APKBUILD
diff options
context:
space:
mode:
Diffstat (limited to 'testing/ocaml-alcotest/APKBUILD')
-rw-r--r--testing/ocaml-alcotest/APKBUILD102
1 files changed, 102 insertions, 0 deletions
diff --git a/testing/ocaml-alcotest/APKBUILD b/testing/ocaml-alcotest/APKBUILD
new file mode 100644
index 00000000000..a5e934c527c
--- /dev/null
+++ b/testing/ocaml-alcotest/APKBUILD
@@ -0,0 +1,102 @@
+# Contributor: rubicon <rubicon@mailo.com>
+# Maintainer: Celeste <cielesti@protonmail.com>
+pkgname=ocaml-alcotest
+_pkgname=alcotest-js
+pkgver=1.5.0
+pkgrel=3
+pkgdesc="Lightweight and colourful test framework"
+url="https://github.com/mirage/alcotest"
+arch="all !riscv64" # restricted by ocaml
+license="ISC"
+depends_dev="$pkgname=$pkgver-r$pkgrel"
+makedepends="
+ dune
+ ocaml
+ ocaml-astring-dev
+ ocaml-cmdliner-dev
+ ocaml-findlib
+ ocaml-fmt-dev
+ ocaml-logs-dev
+ ocaml-re-dev
+ ocaml-seq-dev
+ ocaml-stdlib-shims
+ ocaml-uutf-dev
+ ocaml-lwt-dev
+ ocaml-ocplib-endian-dev
+ ocaml-mmap-dev
+ ocaml-bigarray-compat-dev
+ "
+options="!check"
+checkdepends="ocaml-result-dev"
+provides="$pkgname-lwt=$pkgver-r$pkgrel"
+subpackages="$pkgname-dev"
+source="$pkgname-$pkgver.tar.bz2::https://github.com/mirage/alcotest/releases/download/$pkgver/alcotest-js-$pkgver.tbz"
+builddir="$srcdir/$_pkgname-$pkgver"
+
+# 32-bit archs
+case "$CARCH" in
+ arm*|x86) options="$options textrels" ;;
+esac
+
+build() {
+ export OCAMLPATH=/usr/lib/ocaml
+ dune build \
+ -p alcotest,alcotest-lwt \
+ @install --no-buffer --verbose
+}
+
+check() {
+ dune runtest --no-buffer --verbose
+}
+
+package() {
+ dune install \
+ --destdir="$pkgdir" \
+ --prefix=/usr \
+ --libdir=/usr/lib/ocaml \
+ alcotest alcotest-lwt
+
+ rm -Rf "$pkgdir"/usr/doc
+}
+
+dev() {
+ default_dev
+ provides="$pkgname-lwt-dev=$pkgver-r$pkgrel"
+
+ cd "$pkgdir"
+
+ local path; find usr/lib/ocaml \( \
+ -name '*.cmt' -o \
+ -name '*.cmti' -o \
+ -name '*.ml' -o \
+ -name '*.mli' \
+ \) | while read -r path
+ do
+ amove "$path"
+ done
+}
+
+prepare_py_provides() {
+ local datadir="${subpkgdir:-$pkgdir}"
+ local pkgbasedir=${pkgbasedir:-"$startdir/pkg"}
+ local controldir="$pkgbasedir"/.control.${subpkgname:-$pkgname}
+
+ options_has "!tracedeps" && return 0
+
+ ocaml4-abuild-find provides \
+ "$datadir"/usr/lib/ocaml \
+ "$controldir" \
+ "$pkgver-r$pkgrel"
+}
+
+scan_python3_dependency() {
+ local controldir="$2" datadir="$3"
+
+ ocaml4-abuild-find requires \
+ "$datadir"/usr/lib/ocaml \
+ "$controldir"
+}
+
+sha512sums="
+1aea91de40795ec4f6603d510107e4b663c1a94bd223f162ad231316d8595e9e098cabbe28a46bdcb588942f3d103d8377373d533bcc7413ba3868a577469b45 ocaml-alcotest-1.5.0.tar.bz2
+"