summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 22944e7f710dc79c3c1d628a18d47d1301bd29ba (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
# Maintainer: Daniel Peukert <daniel@peukert.cc>
_projectname='iter'
pkgname="ocaml-$_projectname"
pkgver='1.8'
_commit='4f47de66fe63868487004b0f0b1d100c9dcbe1c3'
pkgrel='2'
pkgdesc='Simple iterator abstract datatype for OCaml'
arch=('x86_64' 'aarch64')
url="https://github.com/c-cube/$_projectname"
license=('BSD-2-Clause')
depends=('ocaml>=4.08.0')
makedepends=('git' 'dune>=2.0.0')
checkdepends=('ocaml-mdx>=1.3.0' 'ocaml-ounit' 'ocaml-qcheck')
options=('!strip')
source=("$pkgname-$pkgver::git+$url#commit=$_commit?signed")
b2sums=('36b34c7a8ec2dfc8bc75b68af163eb27dcdaa2c4be57322ebb11faa0aa5a3bcb4b70e68f8464068dfb9b24cdd3cdfa01b92cc87d0f7a15c9a3d7605b26c3a55b')
validpgpkeys=('1370978BC81E9735DFE727E1EBFFF6F283F3A2B4') # Simon Cruanes <simon.cruanes.2007@m4x.org> (https://github.com/c-cube.gpg)

_sourcedirectory="$pkgname-$pkgver"

build() {
	cd "$srcdir/$_sourcedirectory/"
	dune build --release --verbose
}

check() {
	cd "$srcdir/$_sourcedirectory/"
	dune runtest --release --verbose
}

package() {
	cd "$srcdir/$_sourcedirectory/"
	DESTDIR="$pkgdir" dune install --prefix '/usr' --libdir '/usr/lib/ocaml' --docdir '/usr/share/doc' --mandir '/usr/share/man' --release --verbose

	for _folder in "$pkgdir/usr/share/doc/"*; do
		mv "$_folder" "$pkgdir/usr/share/doc/ocaml-$(basename "$_folder")"
	done

	install -dm755 "$pkgdir/usr/share/licenses/$pkgname"
	ln -sf "/usr/share/doc/$pkgname/LICENSE" "$pkgdir/usr/share/licenses/$pkgname/BSD-2-Clause"
}