# Contributor: rubicon # Maintainer: pkgname=ocp-indent pkgver=1.8.2 pkgrel=1 pkgdesc="OCaml source code indenter" url="http://www.typerex.org/ocp-indent.html" arch="all !riscv64" # limited by ocaml aport license="LGPL-2.1-only-WITH-linking-exception" _depends_ocaml="ocaml-runtime ocaml-findlib" depends_dev="ocaml-cmdliner-dev ocaml-findlib-dev" makedepends="$depends_dev dune ocaml" subpackages=" $pkgname-doc $pkgname-emacs::noarch $pkgname-vim::noarch ocaml-$pkgname-dev:_libdev ocaml-$pkgname:_lib " source="$pkgname-$pkgver.tar.gz::https://github.com/OCamlPro/ocp-indent/archive/$pkgver.tar.gz" _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" } emacs() { pkgdesc="$pkgdesc for Emacs" depends="$pkgname=$pkgver-r$pkgrel" install_if="$pkgname=$pkgver-r$pkgrel emacs" amove usr/share/emacs } vim() { pkgdesc="$pkgdesc for vim" depends="$pkgname=$pkgver-r$pkgrel" install_if="$pkgname=$pkgver-r$pkgrel vim" amove usr/share/ocp-indent/vim } _libdev() { pkgdesc="$pkgdesc (development files)" depends="$depends_dev ocaml-$pkgname=$pkgver-r$pkgrel" cd "$pkgdir" local path; for path in $(find $_ocamldir \( \ -name '*.cmt' -o \ -name '*.cmti' -o \ -name '*.cmx' -o \ -name '*.cmxa' -o \ -name '*.ml' -o \ -name '*.mli' \ \)) do amove "$path" done } _lib() { pkgdesc="$pkgdesc (library)" depends="$_depends_ocaml" amove usr/lib/ocaml } sha512sums=" c5f8b63d6d3baabbadffba159d485f54f6e903eaa59a58b6df509e12e679b5b63a1cf7734d336d6b3456ea6ac74e42c58889199f2a3ed584566589d0c9bbfef5 ocp-indent-1.8.2.tar.gz "