summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: cd08281e5b6084727e2159e2ab23f1b0a9c7796c (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.9'
_commit='a525d4902c9fb71e6acd84ee1f2ab8e1f3eefb10'
pkgrel='1'
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=('e6ddc76658a63a2016af94b18bebf191e0c99642bbc1433ded8f92835e2fccb6eba100c4c146a7e375bfdb6ff9e4acf2d7c29ec0febd6cdcbad471e9694a185c')
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"
}