aboutsummaryrefslogtreecommitdiffstats
path: root/testing/ocaml-fmt/APKBUILD
diff options
context:
space:
mode:
Diffstat (limited to 'testing/ocaml-fmt/APKBUILD')
-rw-r--r--testing/ocaml-fmt/APKBUILD85
1 files changed, 85 insertions, 0 deletions
diff --git a/testing/ocaml-fmt/APKBUILD b/testing/ocaml-fmt/APKBUILD
new file mode 100644
index 00000000000..2b7d09c157e
--- /dev/null
+++ b/testing/ocaml-fmt/APKBUILD
@@ -0,0 +1,85 @@
+# Contributor: rubicon <rubicon@mailo.com>
+# Maintainer: Celeste <cielesti@protonmail.com>
+pkgname=ocaml-fmt
+_pkgname=fmt
+pkgver=0.9.0
+pkgrel=2
+pkgdesc="OCaml Format pretty-printer combinators"
+url="https://erratique.ch/software/fmt"
+arch="all !riscv64 !loongarch64" # ocaml
+license="ISC"
+depends_dev="$pkgname=$pkgver-r$pkgrel"
+makedepends="
+ ocaml
+ ocaml-findlib
+ ocaml-topkg
+ ocamlbuild
+ ocaml-cmdliner-dev
+ ocaml-compiler-libs
+ cmd:opam-installer
+ "
+options="!check" # no tests provided
+subpackages="$pkgname-dev"
+source="$pkgname-$pkgver.tar.bz2::https://erratique.ch/software/fmt/releases/fmt-$pkgver.tbz"
+builddir="$srcdir/$_pkgname-$pkgver"
+_ocamldir=usr/lib/ocaml
+
+# 32-bit archs
+case "$CARCH" in
+ arm*|x86) options="$options textrels" ;;
+esac
+
+build() {
+ ocaml pkg/pkg.ml build \
+ --with-base-unix true \
+ --with-cmdliner true
+}
+
+package() {
+ opam-installer -i \
+ --prefix="$pkgdir/usr" \
+ --libdir="$pkgdir/$_ocamldir" \
+ --docdir="$builddir/.omit" \
+ $_pkgname.install
+}
+
+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="
+66cf4b8bb92232a091dfda5e94d1c178486a358cdc34b1eec516d48ea5acb6209c0dfcb416f0c516c50ddbddb3c94549a45e4a6d5c5fd1c81d3374dec823a83b ocaml-fmt-0.9.0.tar.bz2
+"