aboutsummaryrefslogtreecommitdiffstats
path: root/community/dune/APKBUILD
blob: 64c98c5f678b4f6fe85ac58ea23e32eae9eeae68 (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
# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
# NOTE: Upstream is slowly renaming jbuilder to dune.
pkgname=dune
pkgver=1.0_beta191
_pkgver=1.0+beta19.1
pkgrel=0
pkgdesc="A composable build system for OCaml (formerly Jbuilder)"
url="https://github.com/ocaml/dune"
arch="all !x86 !armhf !s390x"  # limited by ocaml abuild
license="Apache-2.0"
checkdepends="bash"
makedepends="ocaml ocaml-findlib-dev"
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/+/-}"
options="!check"  # FIXME requires ocaml-menhir

build() {
	cd "$builddir"
	make release
}

check() {
	cd "$builddir"
	make test
}

# 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"

	mkdir -p "$pkgdir"/usr/bin \
		"$pkgdir"/usr/lib/ocaml/jbuilder \
		"$pkgdir"/usr/share/doc/$pkgname \
		"$pkgdir"/usr/share/man/man1

	# The files to install are stored in _build as symlinks;
	# dereference them.
	cd _build/install/default
	cp -aL bin/jbuilder "$pkgdir"/usr/bin/
	cp -aL lib/jbuilder/* "$pkgdir"/usr/lib/ocaml/jbuilder/
	cp -aL doc/jbuilder/* "$pkgdir"/usr/share/doc/$pkgname/
	cp -aL man/man1/* "$pkgdir"/usr/share/man/man1/

	ln -s jbuilder "$pkgdir"/usr/bin/dune
}

sha512sums="1454f4cb88e346d30a74d94815dbd9a6ab2ed3edf399d83f204db461533d912ee3a2d804e39a8d2742f221c6d8be74634561760579009db9a182fb3e57f65a98  dune-1.0_beta191.tar.gz"