diff options
author | Jakub Jirutka <jakub@jirutka.cz> | 2018-03-08 18:07:05 +0100 |
---|---|---|
committer | Jakub Jirutka <jakub@jirutka.cz> | 2018-03-08 18:11:06 +0100 |
commit | bc3c94ae351fae738490ed15d200ebd1a339fb1c (patch) | |
tree | fe9b6a89025cf8f6d35f53e23be150bafb5bfd40 /testing | |
parent | 8077d43efcbc75b341427da1faa28d9b9a01d844 (diff) | |
download | aports-bc3c94ae351fae738490ed15d200ebd1a339fb1c.tar.bz2 aports-bc3c94ae351fae738490ed15d200ebd1a339fb1c.tar.xz |
testing/utop: new aport
https://github.com/diml/utop
Universal toplevel for OCaml
Diffstat (limited to 'testing')
-rw-r--r-- | testing/utop/APKBUILD | 115 |
1 files changed, 115 insertions, 0 deletions
diff --git a/testing/utop/APKBUILD b/testing/utop/APKBUILD new file mode 100644 index 0000000000..1c5cc571ce --- /dev/null +++ b/testing/utop/APKBUILD @@ -0,0 +1,115 @@ +# Contributor: Jakub Jirutka <jakub@jirutka.cz> +# Maintainer: Jakub Jirutka <jakub@jirutka.cz> +pkgname=utop +pkgver=2.1.0 +pkgrel=0 +pkgdesc="Universal toplevel for OCaml" +url="https://github.com/diml/utop" +arch="all" +license="BSD-3-Clause" +depends=" + ocaml-$pkgname=$pkgver-r$pkgrel + $pkgname-common=$pkgver-r$pkgrel + " +_depends_ocaml=" + ocaml + ocaml-camomile + ocaml-findlib>=1.7.2 + ocaml-lambda-term + ocaml-lwt + ocaml-lwt-react + ocaml-react + " +makedepends=" + dune + ocaml-camomile-dev + ocaml-cppo + ocaml-findlib-dev + ocaml-lambda-term-dev + ocaml-lwt-dev + ocaml-react-dev + opam + " +subpackages=" + $pkgname-full:_full + $pkgname-common:_common:noarch + $pkgname-doc + $pkgname-emacs + ocaml-$pkgname-dev:_libdev + ocaml-$pkgname:_lib + " +source="$pkgname-$pkgver.tar.bz2::https://github.com/diml/$pkgname/releases/download/$pkgver/$pkgname-$pkgver.tbz" +builddir="$srcdir/$pkgname-$pkgver" + +build() { + cd "$builddir" + jbuilder build --verbose @install +} + +check() { + cd "$builddir" + jbuilder runtest +} + +package() { + cd "$builddir" + + opam-installer -i \ + --prefix="$pkgdir/usr" \ + --libdir="$pkgdir/usr/lib/ocaml" \ + --docdir="$pkgdir/doc" \ + --mandir="$pkgdir/usr/share/man" \ + $pkgname.install + + # There's just a readme and changelog. + rm -Rf "$pkgdir"/doc + + # Remove annotation files and sources. + cd "$pkgdir"/usr/lib/ocaml/$pkgname + rm -f *.cmt* *.ml +} + +_full() { + pkgdesc="$pkgdesc (non-expunged)" + + _submv usr/bin/utop-full +} + +_common() { + pkgdesc="Common files for utop and utop-full" + depends="" + + _submv usr/share/$pkgname +} + +emacs() { + pkgdesc="utop plugin for Emacs" + depends="$pkgname=$pkgver-r$pkgrel" + install_if="$pkgname=$pkgver-r$pkgrel emacs" + + _submv usr/share/emacs +} + +_libdev() { + pkgdesc="$pkgdesc (development files)" + depends="ocaml-$pkgname=$pkgver-r$pkgrel" + local sitelib="usr/lib/ocaml/$pkgname" + + _submv $sitelib/*.mli +} + +_lib() { + pkgdesc="$pkgdesc (library)" + depends="$_depends_ocaml" + + _submv usr/lib/ocaml +} + +_submv() { + local path="$1" + mkdir -p "$subpkgdir"/${path%/*} + mv "$pkgdir"/$path "$subpkgdir"/${path%/*}/ + rmdir -p "$pkgdir"/${path%/*} 2>/dev/null || true +} + +sha512sums="5c18daad46569fccbaadebd258be8afa5c0499853b026260f12f6dec3b05c77875d555fb538a7008a994d9e4b7731128927a6cc1fece455dfe227954ee12372c utop-2.1.0.tar.bz2" |