aboutsummaryrefslogtreecommitdiffstats
path: root/testing/ocaml-csv/APKBUILD
blob: 193e137d6360f6ceb946fc38c282fed2ed305d9e (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
65
# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
# TODO: Build csv-lwt (?).
pkgname=ocaml-csv
_pkgname=csv
pkgver=2.1
pkgrel=0
pkgdesc="OCaml library for reading and writing CSV files"
url="https://github.com/Chris00/ocaml-csv"
arch="all !x86 !armhf !s390x"  # limited by ocaml abuild
license="LGPL-2.1-or-later"
depends="ocaml-runtime"
depends_dev="$pkgname=$pkgver-r$pkgrel"
makedepends="dune ocaml ocaml-findlib opam"
subpackages="$pkgname-dev csvtool"
source="$pkgname-$pkgver.tar.bz2::https://github.com/Chris00/$pkgname/releases/download/$pkgver/csv-$pkgver.tbz"
builddir="$srcdir/$_pkgname-$pkgver"
options="textrels !check"  # FIXME check requires package lwt

build() {
	cd "$builddir"
	jbuilder build -p csv @install
}

package() {
	cd "$builddir"

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

	cd "$pkgdir"

	# Remove annotation files, some generated code (?) and sources.
	find usr/lib/ocaml \
		-name '*.cmt' -delete \
		-o -name '*.cmti' -delete \
		-o -name '*.ml-gen' -delete \
		-o -name '*.ml' -delete

	# Contains just a readme and changelog.
	rm -Rf usr/doc
}

dev() {
	local sitelib="usr/lib/ocaml/$_pkgname"

	default_dev

	cd "$pkgdir"/$sitelib
	mkdir -p "$subpkgdir"/$sitelib
	mv *.cmx *.cmxa *.mli "$subpkgdir"/$sitelib/
}

csvtool() {
	pkgdesc="A command line tool for handling CSV files"
	depends=""

	mkdir -p "$subpkgdir"/usr
	mv "$pkgdir"/usr/bin "$subpkgdir"/usr/
}

sha512sums="8810d6c151b8ec1d6b070fac32c579267e57d1ed66f2249378d7ed513fb53919e3554e8f4cfe9cb6bfc74f35ec051e99458b7d215839e2a88fa3d301f3775b70  ocaml-csv-2.1.tar.bz2"