diff options
Diffstat (limited to 'testing/ocaml-duration/APKBUILD')
-rw-r--r-- | testing/ocaml-duration/APKBUILD | 79 |
1 files changed, 79 insertions, 0 deletions
diff --git a/testing/ocaml-duration/APKBUILD b/testing/ocaml-duration/APKBUILD new file mode 100644 index 00000000000..40bdfe125bc --- /dev/null +++ b/testing/ocaml-duration/APKBUILD @@ -0,0 +1,79 @@ +# Contributor: rubicon <rubicon@mailo.com> +# Maintainer: Celeste <cielesti@protonmail.com> +pkgname=ocaml-duration +_pkgname=duration +pkgver=0.2.0 +pkgrel=2 +pkgdesc="Conversions to various time units" +url="https://github.com/hannesm/duration" +arch="all !riscv64 !loongarch64" # ocaml +license="ISC" +depends_dev="$pkgname=$pkgver-r$pkgrel" +makedepends="dune ocaml" +checkdepends="ocaml-alcotest-dev" +options="!check" +subpackages="$pkgname-dev" +source="$pkgname-$pkgver.tar.bz2::https://github.com/hannesm/duration/releases/download/$pkgver/duration-$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 --release --verbose +} + +check() { + dune runtest --verbose +} + +package() { + dune install \ + --destdir="$pkgdir" \ + --docdir=/.omit + 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=" +6a259ca406739bfc6020c7de767e39c2a7ee06169aa1966d43d426b2a54fc69b81be6465d04b9bd8fbbbbfd9ebe1c82a1cbfbf62100a37eb0f7403f6cf53e3b8 ocaml-duration-0.2.0.tar.bz2 +" |