# Contributor: Jakub Jirutka # Maintainer: Jakub Jirutka pkgname=ocaml-lwt _pkgname=lwt pkgver=3.2.1 pkgrel=4 pkgdesc="OCaml promises and concurrent I/O" url="https://github.com/ocsigen/lwt" arch="all !x86 !armhf !s390x" # limited by ocaml aport license="LGPL-2.1-or-later-WITH-linking-exception BSD-3-Clause" depends="ocaml-runtime ocaml-migrate-parsetree ocaml-ppx_tools_versioned ocaml-result " depends_dev="libev-dev" makedepends="$depends_dev dune ocaml ocaml-compiler-libs ocaml-cppo-dev ocaml-findlib ocaml-migrate-parsetree-dev ocaml-ppx_tools_versioned-dev ocaml-react-dev ocaml-result-dev opam " subpackages="$pkgname-dev $pkgname-doc $pkgname-react" source="$pkgname-$pkgver.tar.gz::https://github.com/ocsigen/$_pkgname/archive/$pkgver.tar.gz result_lseek_noinline.patch" builddir="$srcdir/$_pkgname-$pkgver" build() { cd "$builddir" ocaml src/util/configure.ml \ -use-libev true \ -use-camlp4 false jbuilder build -p lwt,lwt_react @install } check() { cd "$builddir" jbuilder runtest -p lwt,lwt_react } package() { cd "$builddir" ocaml src/util/install_filter.ml local name; for name in lwt lwt_react; do opam-installer -i \ --prefix="$pkgdir/usr" \ --libdir="$pkgdir/$(ocamlc -where)" \ --docdir="$pkgdir/usr/share/doc/$pkgname" \ --mandir="$pkgdir/usr/share/man" \ $name.install done # Remove annotation files. rm -Rf "$pkgdir"/usr/lib/ocaml/$_pkgname*/*.cmt* # Remove sources (all have corresponding .mli file). rm -Rf "$pkgdir"/usr/lib/ocaml/$_pkgname*/*.ml } react() { pkgdesc="$pkgdesc (for FRP)" depends="$pkgname=$pkgver-r$pkgrel ocaml-react" mkdir -p "$subpkgdir"/usr/lib/ocaml mv "$pkgdir"/usr/lib/ocaml/${_pkgname}_react "$subpkgdir"/usr/lib/ocaml/ } dev() { default_dev depends="$depends $pkgname=$pkgver-r$pkgrel $pkgname-react=$pkgver-r$pkgrel" local sitelib="usr/lib/ocaml/$_pkgname" cd "$pkgdir"/$sitelib mkdir -p "$subpkgdir"/$sitelib mv *.cmx *.cmxa *.mli "$subpkgdir"/$sitelib/ } sha512sums="ddea7561c12b0c7f1ee557462766c2f04d08b9e452fac14a906c17aba643be90299a6aa0aee20dfc16031eca4f557bfc0e7f6779643eeaee2337129f77da836d ocaml-lwt-3.2.1.tar.gz dc3abce70b3ad022066e8023a9b37346df0ecbbc6351186cc24b569189142ad3e7e32f27c33a4378f11ec8c40df5c96f4c37190ca4797bc228ca8943f53cf5bf result_lseek_noinline.patch"