aboutsummaryrefslogtreecommitdiffstats
path: root/testing/ocaml-lwt/APKBUILD
blob: 5a0c2f9da969a4d85897665772219573199cbc24 (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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=ocaml-lwt
_pkgname=lwt
pkgver=3.2.1
pkgrel=4
pkgdesc="OCaml promises and concurrent I/O"
url="https://github.com/ocsigen/lwt"
arch="all !x86 !armhf !s390x"  # limited by ocaml aport
license="LGPL-2.1-or-later-WITH-linking-exception BSD-3-Clause"
depends="ocaml-runtime
	ocaml-migrate-parsetree
	ocaml-ppx_tools_versioned
	ocaml-result
	"
depends_dev="libev-dev"
makedepends="$depends_dev
	dune
	ocaml
	ocaml-compiler-libs
	ocaml-cppo-dev
	ocaml-findlib
	ocaml-migrate-parsetree-dev
	ocaml-ppx_tools_versioned-dev
	ocaml-react-dev
	ocaml-result-dev
	opam
	"
subpackages="$pkgname-dev $pkgname-doc $pkgname-react"
source="$pkgname-$pkgver.tar.gz::https://github.com/ocsigen/$_pkgname/archive/$pkgver.tar.gz
	result_lseek_noinline.patch"
builddir="$srcdir/$_pkgname-$pkgver"

build() {
	cd "$builddir"

	ocaml src/util/configure.ml \
		-use-libev true \
		-use-camlp4 false

	jbuilder build -p lwt,lwt_react @install
}

check() {
	cd "$builddir"

	jbuilder runtest -p lwt,lwt_react
}

package() {
	cd "$builddir"

	ocaml src/util/install_filter.ml

	local name; for name in lwt lwt_react; do
		opam-installer -i \
			--prefix="$pkgdir/usr" \
			--libdir="$pkgdir/$(ocamlc -where)" \
			--docdir="$pkgdir/usr/share/doc/$pkgname" \
			--mandir="$pkgdir/usr/share/man" \
			$name.install
	done

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

	# Remove sources (all have corresponding .mli file).
	rm -Rf "$pkgdir"/usr/lib/ocaml/$_pkgname*/*.ml
}

react() {
	pkgdesc="$pkgdesc (for FRP)"
	depends="$pkgname=$pkgver-r$pkgrel ocaml-react"

	mkdir -p "$subpkgdir"/usr/lib/ocaml
	mv "$pkgdir"/usr/lib/ocaml/${_pkgname}_react "$subpkgdir"/usr/lib/ocaml/
}

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

	cd "$pkgdir"/$sitelib

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

sha512sums="ddea7561c12b0c7f1ee557462766c2f04d08b9e452fac14a906c17aba643be90299a6aa0aee20dfc16031eca4f557bfc0e7f6779643eeaee2337129f77da836d  ocaml-lwt-3.2.1.tar.gz
dc3abce70b3ad022066e8023a9b37346df0ecbbc6351186cc24b569189142ad3e7e32f27c33a4378f11ec8c40df5c96f4c37190ca4797bc228ca8943f53cf5bf  result_lseek_noinline.patch"