aboutsummaryrefslogtreecommitdiffstats
path: root/testing/ocaml-result/APKBUILD
blob: 2f6f29506e14258825a2fad13f5adf331cf2386f (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
# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=ocaml-result
_pkgname=result
pkgver=1.4
pkgrel=0
pkgdesc="Compat result type"
url="https://github.com/janestreet/result"
arch="all !x86 !armhf !armv7 !s390x"  # limited by ocaml
license="BSD-3-Clause"
depends="ocaml-runtime"
makedepends="dune ocaml ocaml-findlib opam"
options="!check"  # no tests provided
subpackages="$pkgname-dev"
source="$pkgname-$pkgver.tar.gz::https://github.com/janestreet/$_pkgname/archive/$pkgver/result-$pkgver.tar.gz"
builddir="$srcdir/$_pkgname-$pkgver"

build() {
	jbuilder build @install
}

package() {
	mkdir -p "$pkgdir"/usr/lib/ocaml
	jbuilder install \
		--destdir="$pkgdir" \
		--prefix=/usr \
		--libdir=/usr/lib/ocaml

	# Remove annotation files.
	rm "$pkgdir"/usr/lib/ocaml/$_pkgname/*.cmt

	# Contains just a readme and changelog.
	rm -Rf "$pkgdir"/usr/doc
}

dev() {
	default_dev
	depends="$pkgname=$pkgver-r$pkgrel"
	local sitelib="usr/lib/ocaml/$_pkgname"

	cd "$pkgdir"/$sitelib

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

sha512sums="2e709fee6ceb54463c3989a90aed351c5b48f7a5edce9ccbba4d163cbfb795a19393be0d75885e762d4609961a64e273bb298b94bd3858dc2c20de9396b655d3  ocaml-result-1.4.tar.gz"