# Contributor: Jakub Jirutka # Maintainer: omni pkgname=dune pkgver=3.9.1 pkgrel=0 pkgdesc="A composable build system for OCaml (formerly Jbuilder)" url="https://dune.build/" arch="all !riscv64" # limited by ocaml aport license="Apache-2.0" checkdepends="bash" makedepends="ocaml" provides="jbuilder=$pkgver-r$pkgrel" subpackages="$pkgname-doc $pkgname-emacs::noarch $pkgname-configurator" source="$pkgname-$pkgver.tar.gz::https://github.com/ocaml/dune/archive/$pkgver.tar.gz" options="!check" # FIXME requires ocaml-menhir # 32-bit archs case "$CARCH" in arm*|x86) options="$options textrels" ;; esac prepare() { default_prepare # This allows 'dune --version' to output the correct version instead of "n/a" sed -i "/^(name dune)/a (version $pkgver)" dune-project # This enables dune-configurator to use the vendored csexp module sed -i 's/stdune.csexp/dune-configurator.csexp/' vendor/csexp/src/dune } build() { ./configure --libdir="$(ocamlc -where)" \ --bindir="/usr/bin" --sbindir="/usr/sbin" --etcdir="/etc" \ --mandir="/usr/share/man" --docdir="/usr/share/doc" \ --datadir="/usr/share" ocaml boot/bootstrap.ml --verbose ./dune.exe build \ -p dune,dune-configurator \ --profile dune-bootstrap --verbose } check() { ./dune.exe runtest --verbose } package() { ./dune.exe install \ --destdir="$pkgdir" \ dune dune-configurator # Duplicate of usr/share/doc/dune rm -Rf "$pkgdir"/usr/share/doc/dune-configurator } emacs() { depends="$pkgname" install_if="$pkgname=$pkgver-r$pkgrel emacs" pkgdesc="Emacs plugins for $pkgname" amove usr/share/emacs } configurator() { pkgdesc="System config helper for the Dune OCaml build system" depends="ocaml" provides="$subpkgname-dev=$pkgver-r$pkgrel" amove usr/lib/ocaml/"$subpkgname" } sha512sums=" c997ec2205fa5391acbca9e196387cec1af69d3aed4cebe21d82edbe66bd91fda0c742e7ff2e3ffb8df88e2e379bbff68028574664cf375d04f4d3f3f2102f3b dune-3.9.1.tar.gz "