# Contributor: rubicon # Maintainer: pkgname=ocaml-omod _pkgname=omod pkgver=0.0.3 pkgrel=2 pkgdesc="Lookup and load installed OCaml modules" url="https://erratique.ch/software/omod" arch="all !riscv64" # limited by ocaml aport license="ISC" depends="ocaml-runtime cmd:ocamlc ocaml-compiler-libs $pkgname-bin" depends_dev="$pkgname=$pkgver-r$pkgrel" makedepends=" ocaml ocamlbuild ocaml-findlib ocaml-topkg ocaml-cmdliner-dev cmd:opam-installer " options="!check" # no tests provided subpackages="$pkgname-bin $pkgname-dev" source="$pkgname-$pkgver.tar.bz2::https://erratique.ch/software/omod/releases/omod-$pkgver.tbz fix-cache-dir.patch " 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 \ --lib-dir "$(ocamlc -where)" } package() { opam-installer -i \ --prefix="$pkgdir"/usr \ --libdir="$pkgdir/$_ocamldir" \ --docdir="$builddir"/.omit \ $_pkgname.install } bin() { pkgdesc="$pkgdesc (standalone binary)" depends="cmd:ocamlc" amove usr/bin/omod } dev() { default_dev 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 } sha512sums=" 4f53b8cdd054dc1a6813427452a91294e0bbcfefe948fc1caec47be136dbcecf13112bf2b620fa2f667592b04b28df74e3bf012ea0fb0038c1da4217155ca626 ocaml-omod-0.0.3.tar.bz2 a53e77bc22f6b8a45b664973c648234155c5b3e1cd3526ac0713e91cf6d40bede7e8f084684203c027495c70d7ccf8ebf678a4cbe13e61f22eaa5444a2a1987d fix-cache-dir.patch "