diff options
Diffstat (limited to 'testing/ocaml-cstruct/APKBUILD')
-rw-r--r-- | testing/ocaml-cstruct/APKBUILD | 88 |
1 files changed, 88 insertions, 0 deletions
diff --git a/testing/ocaml-cstruct/APKBUILD b/testing/ocaml-cstruct/APKBUILD new file mode 100644 index 00000000000..6d7a231db6a --- /dev/null +++ b/testing/ocaml-cstruct/APKBUILD @@ -0,0 +1,88 @@ +# Contributor: rubicon <rubicon@mailo.com> +# Maintainer: Celeste <cielesti@protonmail.com> +pkgname=ocaml-cstruct +_pkgname=cstruct +pkgver=6.1.0 +pkgrel=3 +pkgdesc="Access C-like structures directly from OCaml" +url="https://github.com/mirage/ocaml-cstruct" +arch="all !riscv64 !loongarch64" # ocaml +license="ISC" +depends_dev=" + $pkgname=$pkgver-r$pkgrel + ocaml-fmt-dev + ocaml-lwt-dev + ocaml-ppxlib-dev + ocaml-sexplib-dev + " +makedepends="$depends_dev dune ocaml" +checkdepends="ocaml-alcotest-dev ocaml-crowbar-dev" +options="!check" +subpackages="$pkgname-dev" +source="$pkgname-$pkgver.tar.bz2::https://github.com/mirage/ocaml-cstruct/releases/download/v$pkgver/cstruct-$pkgver.tbz" +builddir="$srcdir/$_pkgname-$pkgver" +_ocamldir=usr/lib/ocaml + +# 32-bit archs +case "$CARCH" in + arm*|x86) options="$options textrels" ;; +esac + +build() { + dune build \ + -p cstruct,cstruct-sexp,cstruct-unix,cstruct-lwt,ppx_cstruct \ + --verbose +} + +check() { + dune runtest --verbose +} + +package() { + dune install \ + --destdir="$pkgdir" \ + --docdir=/.omit \ + cstruct cstruct-sexp cstruct-unix cstruct-lwt ppx_cstruct + rm -Rf "$pkgdir"/.omit +} + +dev() { + default_dev + + cd "$pkgdir" + + local path; find $_ocamldir \( \ + -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=" +24620eb8dd37b7508a6adbad19fe21b44739a1bd641827b4fdd74e642991647fb814cabdf44195199bdb5208cac182580c55dce511bf22ad595d56a140cc0584 ocaml-cstruct-6.1.0.tar.bz2 +" |