aboutsummaryrefslogtreecommitdiffstats
path: root/testing/ocaml-hkdf/APKBUILD
diff options
context:
space:
mode:
Diffstat (limited to 'testing/ocaml-hkdf/APKBUILD')
-rw-r--r--testing/ocaml-hkdf/APKBUILD83
1 files changed, 83 insertions, 0 deletions
diff --git a/testing/ocaml-hkdf/APKBUILD b/testing/ocaml-hkdf/APKBUILD
new file mode 100644
index 00000000000..9b54721127c
--- /dev/null
+++ b/testing/ocaml-hkdf/APKBUILD
@@ -0,0 +1,83 @@
+# Contributor: rubicon <rubicon@mailo.com>
+# Maintainer: Celeste <cielesti@protonmail.com>
+pkgname=ocaml-hkdf
+_pkgname=hkdf
+pkgver=1.0.4
+pkgrel=2
+pkgdesc="HMAC-based Extract-and-Expand Key Derivation Function (RFC 5869)"
+url="https://github.com/hannesm/ocaml-hkdf"
+arch="all !riscv64 !loongarch64" # ocaml
+license="BSD-2-Clause"
+depends_dev="
+ $pkgname=$pkgver-r$pkgrel
+ ocaml-cstruct-dev
+ ocaml-mirage-crypto-dev
+ "
+makedepends="$depends_dev dune ocaml"
+checkdepends="ocaml-alcotest-dev"
+options="!check"
+subpackages="$pkgname-dev"
+source="$pkgname-$pkgver.tar.bz2::https://github.com/hannesm/ocaml-hkdf/releases/download/v$pkgver/hkdf-v$pkgver.tbz"
+builddir="$srcdir/$_pkgname-v$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="
+d08e50857f7761572adc4d382975fde5808898c1d92d9e6e943a496cba8780ffabe1edf67844063b70d9727c0fe10b24391e001a3f65c978a5326ac82199cc88 ocaml-hkdf-1.0.4.tar.bz2
+"