aboutsummaryrefslogtreecommitdiffstats
path: root/testing/merlin/APKBUILD
blob: 032fe8bf448dde49ce1285158d2890093284aef9 (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
# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=merlin
pkgver=3.0.5
pkgrel=0
pkgdesc="Context sensitive completion for OCaml"
url="https://ocaml.github.io/merlin/"
arch="all !x86 !armhf !armv7 !s390x !mips !mips64"  # limited by ocaml aport
license="MIT"
depends="ocaml ocaml-findlib"
makedepends="
	ocaml
	ocaml-findlib-dev
	ocaml-yojson-dev
	"
options="!check"  # XXX: tests are broken, see https://github.com/ocaml/merlin/issues/766
subpackages="$pkgname-emacs::noarch $pkgname-vim::noarch"
source="$pkgname-$pkgver.tar.gz::https://github.com/ocaml/$pkgname/archive/v$pkgver.tar.gz"
builddir="$srcdir/$pkgname-$pkgver"

build() {
	cd "$builddir"
	./configure --prefix /usr
	make
}

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

package() {
	cd "$builddir"
	make DESTDIR="$pkgdir" install
}

emacs() {
	pkgdesc="$pkgdesc in Emacs"
	depends="$pkgname=$pkgver-r$pkgrel"
	install_if="$pkgname=$pkgver-r$pkgrel emacs"

	_submv usr/share/emacs
}

vim() {
	pkgdesc="$pkgdesc in vim"
	depends="$pkgname=$pkgver-r$pkgrel"
	install_if="$pkgname=$pkgver-r$pkgrel vim"

	_submv usr/share/ocamlmerlin/vim
}

_submv() {
	local path="$1"
	mkdir -p "$subpkgdir"/${path%/*}
	mv "$pkgdir"/$path "$subpkgdir"/${path%/*}/
	rmdir -p "$pkgdir"/${path%/*} 2>/dev/null || true
}

sha512sums="bc9790d72caaec2824fe66c3ed439961a00285cd3f7e59cea8f16283a4f489a89d8ac231d2d0da1000e0f03fa6f7b52c04fa4aff6459df5bd17322693493088d  merlin-3.0.5.tar.gz"