diff options
Diffstat (limited to 'community/dune/APKBUILD')
-rw-r--r-- | community/dune/APKBUILD | 107 |
1 files changed, 75 insertions, 32 deletions
diff --git a/community/dune/APKBUILD b/community/dune/APKBUILD index e8f0a5e43d0..62c218f2024 100644 --- a/community/dune/APKBUILD +++ b/community/dune/APKBUILD @@ -1,52 +1,95 @@ # Contributor: Jakub Jirutka <jakub@jirutka.cz> -# Maintainer: Jakub Jirutka <jakub@jirutka.cz> -# NOTE: Upstream is slowly renaming jbuilder to dune. +# Contributor: omni <omni+alpine@hack.org> +# Maintainer: Celeste <cielesti@protonmail.com> pkgname=dune -pkgver=1.10.0 +pkgver=3.15.2 pkgrel=0 pkgdesc="A composable build system for OCaml (formerly Jbuilder)" -url="https://github.com/ocaml/dune" -arch="all !x86 !armhf !armv7 !mips !mips64" # limited by ocaml abuild -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" -source="$pkgname-$pkgver.tar.gz::https://github.com/ocaml/$pkgname/archive/$pkgver.tar.gz" -builddir="$srcdir/$pkgname-$pkgver" +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() { - cd "$builddir" - 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() { - cd "$builddir" - make test + ./dune.exe runtest --verbose } -# dune's makefile has a "make install" target. Tragically, it uses -# opam-install(er) to install itself. Even more tragically, opam now requires -# dune to build. Therefore as a workaround we can just manually install things -# ourselves - dune is *mostly* just a binary, making this easy. package() { - cd "$builddir" + ./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" - mkdir -p "$pkgdir"/usr/bin \ - "$pkgdir"/usr/lib/ocaml/jbuilder \ - "$pkgdir"/usr/share/doc/$pkgname \ - "$pkgdir"/usr/share/man/man1 + 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" +} - # The files to install are stored in _boot as symlinks; - # dereference them. - cd _boot/install/default - cp -aL bin/jbuilder "$pkgdir"/usr/bin/ - cp -aL lib/dune/* "$pkgdir"/usr/lib/ocaml/jbuilder/ - cp -aL doc/dune/* "$pkgdir"/usr/share/doc/$pkgname/ - cp -aL man/man1/* "$pkgdir"/usr/share/man/man1/ +scan_python3_dependency() { + local controldir="$2" datadir="$3" - ln -s jbuilder "$pkgdir"/usr/bin/dune + ocaml4-abuild-find requires \ + "$datadir"/usr/lib/ocaml \ + "$controldir" } -sha512sums="15c3f5da31ae6062e41cb9e4137b740f8b227b1e59b0f00b9b2f7705bbe517da184835be007e6bb980e3615ce2ac71de67bdda92605caee1cbc0a27f34f67a1e dune-1.10.0.tar.gz" +sha512sums=" +a15658e439984e0256aedd67b5107d8a347c73752566e8e76f5cf5ef807c3761747f5443bd042d0434a26f73ab18ab283eaf705f797ca31737b45530251210e6 dune-3.15.2.tar.gz +" |