aboutsummaryrefslogtreecommitdiffstats
path: root/testing/ocaml-ppx_gen_rec/APKBUILD
blob: a71e4d90630ce85ae67cd3dd78387985619a8782 (plain) (blame)
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
# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=ocaml-ppx_gen_rec
_pkgname=ppx_gen_rec
pkgver=1.0.0
pkgrel=0
pkgdesc="OCaml preprocessor that generates a recursive module"
url="https://github.com/flowtype/ocaml-ppx_gen_rec"
arch="all !x86 !armhf !armv7 !s390x"  # limited by ocaml aport
license="MIT"
depends="ocaml-runtime ocaml-migrate-parsetree"
makedepends="dune ocaml ocaml-compiler-libs ocaml-findlib ocaml-migrate-parsetree-dev opam"
options="!check"  # no tests provided
subpackages="$pkgname-dev"
source="https://github.com/flowtype/$pkgname/archive/v$pkgver/$pkgname-$pkgver.tar.gz"
builddir="$srcdir/$pkgname-$pkgver"

build() {
	cd "$builddir"
	jbuilder build @install
}

package() {
	cd "$builddir"

	mkdir -p "$pkgdir"/usr/lib/ocaml
	jbuilder install \
		--destdir="$pkgdir/usr" \
		--libdir="$pkgdir/usr/lib/ocaml"

	# There's just a readme and changelog.
	rm -Rf "$pkgdir"/usr/doc

	# Remove annotation files and sources.
	cd "$pkgdir"/usr/lib/ocaml/$_pkgname
	rm -f *.cmt* *.ml
}

dev() {
	default_dev

	depends="$pkgname=$pkgver-r$pkgrel"
	local sitelib="usr/lib/ocaml/$_pkgname"

	cd "$pkgdir"/$sitelib

	mkdir -p "$subpkgdir"/$sitelib
	mv *.cmx *.cmxa *.mli "$subpkgdir"/$sitelib/
}

sha512sums="7eb5f131646e984e7e5bd2765604f532772bb2f706fec607581ee10f1ebae4ffb3e032da93550c1ffa7e024690ed06bc2d7355cf66949198ec853ac60fdd5a8e  ocaml-ppx_gen_rec-1.0.0.tar.gz"