diff options
Diffstat (limited to 'community/dune/APKBUILD')
-rw-r--r-- | community/dune/APKBUILD | 84 |
1 files changed, 69 insertions, 15 deletions
diff --git a/community/dune/APKBUILD b/community/dune/APKBUILD index f62612999cb..62c218f2024 100644 --- a/community/dune/APKBUILD +++ b/community/dune/APKBUILD @@ -1,32 +1,57 @@ # Contributor: Jakub Jirutka <jakub@jirutka.cz> -# Maintainer: omni <omni+alpine@hack.org> +# Contributor: omni <omni+alpine@hack.org> +# Maintainer: Celeste <cielesti@protonmail.com> pkgname=dune -pkgver=2.8.5 +pkgver=3.15.2 pkgrel=0 pkgdesc="A composable build system for OCaml (formerly Jbuilder)" -url="https://github.com/ocaml/dune" -arch="all !mips64" # limited by ocaml aport -license="Apache-2.0" +url="https://dune.build/" +arch="all !riscv64 !loongarch64" # ocaml +license="MIT" checkdepends="bash" -makedepends="ocaml ocaml-compiler-libs ocaml-findlib-dev" +makedepends="ocaml" provides="jbuilder=$pkgver-r$pkgrel" -subpackages="$pkgname-doc $pkgname-emacs::noarch" +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() { - make release + ./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() { - make test + ./dune.exe runtest --verbose } package() { - DESTDIR="$pkgdir" make install + ./dune.exe install \ + --destdir="$pkgdir" \ + dune dune-configurator - # Fix docs location - mv "$pkgdir"/usr/doc "$pkgdir"/usr/man "$pkgdir"/usr/share + # Duplicate of usr/share/doc/dune + rm -Rf "$pkgdir"/usr/share/doc/dune-configurator } emacs() { @@ -34,8 +59,37 @@ emacs() { install_if="$pkgname=$pkgver-r$pkgrel emacs" pkgdesc="Emacs plugins for $pkgname" - mkdir -p "$subpkgdir"/usr/share/ - mv "$pkgdir"/usr/share/emacs/ "$subpkgdir"/usr/share/emacs/ + amove usr/share/emacs +} + +configurator() { + pkgdesc="System config helper for the Dune OCaml build system" + provides="$subpkgname-dev=$pkgver-r$pkgrel" + + amove usr/lib/ocaml/"$subpkgname" +} + +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="4d0d8611aeb945afdff4319d7195e3b84e1896e64010a2809ca59d3e0721eded3e7c560cf28ea19c93f5a82b1843d97165751060a6b2425c8db9a7cfc17d6e32 dune-2.8.5.tar.gz" +sha512sums=" +a15658e439984e0256aedd67b5107d8a347c73752566e8e76f5cf5ef807c3761747f5443bd042d0434a26f73ab18ab283eaf705f797ca31737b45530251210e6 dune-3.15.2.tar.gz +" |