aboutsummaryrefslogtreecommitdiffstats
path: root/community/dune/APKBUILD
blob: 2bc5b7c54bd71a1c746187452d2347b99b038c82 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: omni <omni+alpine@hack.org>
pkgname=dune
pkgver=3.2.0
pkgrel=1
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 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="
a90ac689d97acab956fd96f16f7c6cfdc95d01785fc14f0d3c8ab39231ff78e8941d2db2fa8cbfaa39bbed8f865e11b628aacae1b22df49512a57d0263c0dca4  dune-3.2.0.tar.gz
"