aboutsummaryrefslogtreecommitdiffstats
path: root/testing/ocaml-qcheck/APKBUILD
blob: 0d1b68b454de27fac9b999fd31cfb1ecfbfc007f (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
# Contributor: Andy Li <andy@onthewings.net>
# Maintainer: Andy Li <andy@onthewings.net>
pkgname=ocaml-qcheck
_pkgname=qcheck
pkgver=0.12
pkgrel=1
pkgdesc="QuickCheck inspired property-based testing for OCaml"
url="https://github.com/c-cube/qcheck"
arch="all !x86 !armhf !armv7 !s390x !mips !mips64"  # limited by ocaml aport
license="BSD-2-Clause"
depends="ocaml-runtime"
depends_dev="$pkgname=$pkgver-r$pkgrel"
makedepends="dune ocaml ocaml-findlib ocaml-ounit-dev"
subpackages="$pkgname-dev"
source="$pkgname-$pkgver.tar.gz::$url/archive/$pkgver.tar.gz"
builddir="$srcdir/$_pkgname-$pkgver"

build() {
	dune build @install -p qcheck,qcheck-core,qcheck-ounit -j1 --no-buffer --verbose
}

check() {
	dune runtest --no-buffer
}

package() {
	mkdir -p "$pkgdir"/usr/lib/ocaml
	dune install \
		--destdir="$pkgdir" \
		qcheck qcheck-core qcheck-ounit

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

	# Remove annotation files and sources.
	local path; for path in $(find "$pkgdir"/usr/lib/ocaml \
		-name '*.cmt' \
		-o -name '*.ml')
	do
		rm "$path"
	done
}

dev() {
	default_dev

	cd "$pkgdir"

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

sha512sums="a8b844d66b65fdc8cd1cb2ff1a84801815501559dccac5e4188593f5b294ca318f7de971987ce810b6f7840a292999a98ea8beb1e2c989ee3abd78314fca3ad3  ocaml-qcheck-0.12.tar.gz"