diff options
author | Jakub Jirutka <jakub@jirutka.cz> | 2018-03-11 21:29:42 +0100 |
---|---|---|
committer | Jakub Jirutka <jakub@jirutka.cz> | 2018-03-11 21:37:44 +0100 |
commit | 0312a5e79157926a9484a1f85e3564c1defe494c (patch) | |
tree | 02f4056877bf391f61494a1845f8c0823cc00da5 /testing/js_of_ocaml/APKBUILD | |
parent | e3428832a355f789b419ddc7a4e64047b5172fe7 (diff) | |
download | aports-0312a5e79157926a9484a1f85e3564c1defe494c.tar.bz2 aports-0312a5e79157926a9484a1f85e3564c1defe494c.tar.xz |
testing/js_of_ocaml: new aport
http://ocsigen.org/js_of_ocaml/
Compiler from OCaml to Javascript
Diffstat (limited to 'testing/js_of_ocaml/APKBUILD')
-rw-r--r-- | testing/js_of_ocaml/APKBUILD | 173 |
1 files changed, 173 insertions, 0 deletions
diff --git a/testing/js_of_ocaml/APKBUILD b/testing/js_of_ocaml/APKBUILD new file mode 100644 index 0000000000..6d28f6d57e --- /dev/null +++ b/testing/js_of_ocaml/APKBUILD @@ -0,0 +1,173 @@ +# Contributor: Jakub Jirutka <jakub@jirutka.cz> +# Maintainer: Jakub Jirutka <jakub@jirutka.cz> +# TODO: Verify declared dependencies. +# TODO: Build with source-map support (needs yojson and base64) +pkgname=js_of_ocaml +pkgver=3.1.0 +pkgrel=0 +pkgdesc="Compiler from OCaml to Javascript" +url="http://ocsigen.org/js_of_ocaml/" +arch="all !x86 !armhf !s390x" # limited by ocaml aport +license="LGPL-2.0-or-later" +depends=" + $pkgname-compiler=$pkgver-r$pkgrel + ocaml-migrate-parsetree + ocaml-ppx_tools_versioned + ocaml-uchar + " +checkdepends="nodejs ocaml-deriving" +makedepends=" + bash + dune + ocaml + ocaml-camlp4-dev + ocaml-cmdliner-dev + ocaml-compiler-libs + ocaml-cppo-dev + ocaml-findlib-dev + ocaml-lwt-dev + ocaml-migrate-parsetree-dev + ocaml-ppx_deriving-dev + ocaml-ppx_tools-dev + ocaml-ppx_tools_versioned-dev + ocaml-react-dev + ocaml-reactivedata-dev + ocaml-result-dev + ocaml-tyxml-dev + ocaml-uchar-dev + ocamlbuild + opam + " +options="!check" # FIXME: needs additional dependencies +subpackages="$pkgname-dev $pkgname-doc" +source="$pkgname-$pkgver.tar.gz::https://github.com/ocsigen/$pkgname/archive/$pkgver.tar.gz" +builddir="$srcdir/$pkgname-$pkgver" + +for _i in camlp4 compiler lwt ocamlbuild ppx ppx_deriving_json toplevel tyxml; do + subpackages="$subpackages $pkgname-$_i" +done + +build() { + cd "$builddir" + jbuilder build @install @DEFAULT -j ${JOBS:-2} +} + +check() { + cd "$builddir" + jbuilder runtest +} + +package() { + cd "$builddir" + + mkdir -p "$pkgdir"/usr/lib/ocaml + jbuilder install \ + --destdir="$pkgdir"/usr \ + --libdir="$pkgdir"/usr/lib/ocaml + + cd "$pkgdir" + + _mv usr/man usr/share/ + + # There's just a readme and changelog. + rm -Rf usr/doc + + # These are just duplicates. + rm -f usr/bin/*.exe + + # Remove annotation files and sources. + find usr/lib/ocaml \ + \( -name '*.cmt' -o -name '*.cmti' -o -name '*.ml' \) \ + -a -delete +} + +dev() { + default_dev + + cd "$pkgdir" + + local path + for path in $(find usr/lib/ocaml/ -name '*.cmx' -o -name '*.cmxa' -o -name '*.mli'); do + _mv "$path" "$subpkgdir"/${path%/*}/ + done +} + +camlp4() { + pkgdesc="$pkgdesc (Camlp4 syntax extension)" + depends="ocaml-camlp4" + _subpackage +} + +compiler() { + pkgdesc="$pkgdesc (compiler)" + depends="ocaml ocaml-cmdliner ocaml-cppo ocaml-findlib" + + _subpackage + + cd "$pkgdir"/usr/bin + _mv js_of_ocaml jsoo_minify jsoo_link "$subpkgdir"/usr/bin/ +} + +lwt() { + pkgdesc="$pkgdesc (lwt)" + depends="$pkgname=$pkgver-r$pkgrel + $pkgname-ppx=$pkgver-r$pkgrel + ocaml-lwt" + _subpackage +} + +ocamlbuild() { + pkgdesc="$pkgdesc (OCamlbuild plugin)" + depends="ocamlbuild" + _subpackage +} + +ppx() { + pkgdesc="$pkgdesc (ppx syntax extensions)" + depends="$pkgname=$pkgver-r$pkgrel + ocaml-migrate-parsetree + ocaml-ppx_tools_versioned" + _subpackage +} + +ppx_deriving_json() { + pkgdesc="$pkgdesc ([@@deriving json])" + depends="$pkgname ocaml-ppx_tools ocaml-ppx_deriving" + _subpackage +} + +toplevel() { + pkgdesc="Web-based OCaml toplevel" + depends="$pkgname=$pkgver-r$pkgrel + $pkgname-compiler=$pkgver-r$pkgrel + $pkgname-ppx=$pkgver-r$pkgrel + ocaml-compiler-libs + ocaml-findlib" + + _subpackage + + cd "$pkgdir"/usr/bin + _mv jsoo_mkcmis jsoo_mktop jsoo_listunits "$subpkgdir"/usr/bin/ +} + +tyxml() { + pkgdesc="$pkgname (Tyxml)" + depends="$pkgname=$pkgver-r$pkgrel + $pkgname-ppx=$pkgver-r$pkgrel + ocaml-reactivedata + ocaml-tyxml" + _subpackage +} + +_subpackage() { + depends="ocaml-runtime $depends" + _mv "$pkgdir"/usr/lib/ocaml/$subpkgname "$subpkgdir"/usr/lib/ocaml/ +} + +_mv() { + local dest; for dest; do true; done # get last argument + mkdir -p "$dest" + mv "$@" +} + +sha512sums="63bd4961fbdc677cc992d253a7254a159d86c444b6aa5a8b2fac446925f35fbc8454865db167364cb2c2b7f02b113ebb0c0ac1cb5d2f7d7ae06519c68cdbc58a js_of_ocaml-3.1.0.tar.gz" |