aboutsummaryrefslogtreecommitdiffstats
path: root/testing/ocaml-re/APKBUILD
blob: fcf4dce951617cc1561d4b6918fb7c0987123717 (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
# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=ocaml-re
pkgver=1.7.3
pkgrel=0
pkgdesc="Pure OCaml regular expressions, with support for Perl and POSIX-style strings"
url="https://github.com/ocaml/ocaml-re"
arch="all !x86 !armhf !armv7 !s390x"  # limited by ocaml aport
license="LGPL-2.1-or-later"
depends="ocaml-runtime"
depends_dev="$pkgname=$pkgver-r$pkgrel"
checkdepends="ocaml-ounit-dev"
makedepends="dune ocaml ocaml-findlib ocamlbuild opam"
subpackages="$pkgname-dev"
source="$pkgname-$pkgver.tar.gz::https://github.com/ocaml/$pkgname/archive/$pkgver.tar.gz"
builddir="$srcdir/$pkgname-$pkgver"

build() {
	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 and changelog.
	rm -Rf usr/doc

	# Remove annotation files and sources.
	find usr/lib/ocaml \( \
		-name '*.cmt' -o \
		-name '*.cmti' -o \
		-name '*.ml' \) -delete
}

dev() {
	default_dev

	cd "$pkgdir"

	local path; for path in $(find usr/lib/ocaml/re \
		-name '*.cmx' -o \
		-name '*.cmxa' -o \
		-name '*.mli')
	do
		mkdir -p "${path%/*}"
		mv "$path" "$subpkgdir"/${path%/*}/
	done

}

sha512sums="3d161cb46fa0e855bfbae29b5b769f0054b51e4021f8a66ff8d6a9eee257ba4b02ab7202337d35c4ed2a033560a7b69676525f32cb18406881bed2e68db2ca55  ocaml-re-1.7.3.tar.gz"