aboutsummaryrefslogtreecommitdiffstats
path: root/testing/ocaml-csv/APKBUILD
diff options
context:
space:
mode:
authorJakub Jirutka <jakub@jirutka.cz>2018-02-07 16:07:30 +0100
committerJakub Jirutka <jakub@jirutka.cz>2018-02-07 16:11:25 +0100
commitba6c3a614ee75841846af024637a03f47024e5b4 (patch)
tree99ca4751b2f6021b5a805561ca8974eaba36bd23 /testing/ocaml-csv/APKBUILD
parent32c3ea7c918f4083be4b5e27cbed8e28fdf5929e (diff)
downloadaports-ba6c3a614ee75841846af024637a03f47024e5b4.tar.gz
aports-ba6c3a614ee75841846af024637a03f47024e5b4.tar.bz2
aports-ba6c3a614ee75841846af024637a03f47024e5b4.tar.xz
testing/ocaml-csv: new aport
https://github.com/Chris00/ocaml-csv OCaml library for reading and writing CSV files
Diffstat (limited to 'testing/ocaml-csv/APKBUILD')
-rw-r--r--testing/ocaml-csv/APKBUILD66
1 files changed, 66 insertions, 0 deletions
diff --git a/testing/ocaml-csv/APKBUILD b/testing/ocaml-csv/APKBUILD
new file mode 100644
index 0000000000..7c257de167
--- /dev/null
+++ b/testing/ocaml-csv/APKBUILD
@@ -0,0 +1,66 @@
+# Contributor: Jakub Jirutka <jakub@jirutka.cz>
+# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
+# TODO: Build csv-lwt (?).
+pkgname=ocaml-csv
+_pkgname=csv
+pkgver=2.0
+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"
+depends_dev="$pkgname=$pkgver-r$pkgrel"
+makedepends="dune ocaml ocaml-findlib-dev opam"
+subpackages="$pkgname-dev $pkgname-doc csvtool"
+source="$pkgname-$pkgver.tar.bz2::https://github.com/Chris00/$pkgname/releases/download/$pkgver/csv-$pkgver.tbz"
+builddir="$srcdir/$_pkgname-$pkgver"
+options="!check" # FIXME 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 compiled tests and some generated code (?).
+ find usr/lib/ocaml \
+ -name '*.cmt' -delete \
+ -o -name '*.cmti' -delete \
+ -o -name '*.ml-gen' -delete
+
+ # Move docs to proper location.
+ mkdir -p usr/share/doc
+ mv usr/doc/csv usr/share/doc/$pkgname
+ rmdir usr/doc
+}
+
+dev() {
+ local sitelib="usr/lib/ocaml/$_pkgname"
+
+ default_dev
+
+ cd "$pkgdir"/$sitelib
+ mkdir -p "$subpkgdir"/$sitelib
+ mv *.cmx *.cmxa *.ml *.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="00d01e333cbaf9abfc45b3c5e028c33d7631a5de1d594881f1cb3eef0314f115830a3a5b30ee1489ff987f26f716adc3fe17566ecfe285820d81e91985cf00f8 ocaml-csv-2.0.tar.bz2"