aboutsummaryrefslogtreecommitdiffstats
path: root/testing/ocaml-camomile/APKBUILD
blob: d8f03279a1e483b3cb8ffc83bc5bf22dac4e8017 (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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=ocaml-camomile
_pkgname=camomile
pkgver=0.8.7
pkgrel=2
pkgdesc="A Unicode library for OCaml"
url="https://github.com/yoriyuki/Camomile"
# x86, armhf, s390x: limited by ocaml aport
# ppc64le: https://github.com/yoriyuki/Camomile/issues/39. Workaround by setting hard and soft stack limits
arch="all !x86 !armhf !s390x"
license="LGPL-2.0-or-later"
depends="$pkgname-data=$pkgver-r$pkgrel ocaml-runtime"
makedepends="dune ocaml ocaml-compiler-libs ocaml-cppo ocaml-findlib opam"
subpackages="$pkgname-dev $pkgname-data::noarch"
source="$pkgname-$pkgver.tar.gz::https://github.com/yoriyuki/$_pkgname/archive/rel-$pkgver.tar.gz"
builddir="$srcdir/Camomile-rel-$pkgver"

build() {
        if [ "$CARCH" = "ppc64le" ]; then
                ulimit -Hs unlimited
                ulimit -Ss 65536
        fi
	cd "$builddir"
	jbuilder build @install
}

check() {
	cd "$builddir"
	jbuilder runtest
}

package() {
	cd "$builddir"

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

	cd "$pkgdir"

	# There's just a readme.
	rm -Rf usr/doc

	# Remove annotation files and sources.
	rm -Rf usr/lib/ocaml/$_pkgname/*.cmt*
	rm -Rf usr/lib/ocaml/$_pkgname/*.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/
}

data() {
	pkgdesc="$pkgdesc (data files)"
	depends=""

	mkdir -p "$subpkgdir"/usr/share
	mv "$pkgdir"/usr/share/$_pkgname "$subpkgdir"/usr/share/
}

sha512sums="a8db2086030b703e1ada0e2cc195e1c6338946439b3a6b6a05febb3a0d24388add9fe06961025e043181a885bb085e33cebc8027c66c7dbbe1cc30e18df27cf2  ocaml-camomile-0.8.7.tar.gz"