# Contributor: Jakub Jirutka # Maintainer: omni pkgname=ocaml-yojson _pkgname=yojson pkgver=2.0.2 pkgrel=2 pkgdesc="JSON parsing and pretty-printing library for OCaml" url="https://github.com/ocaml-community/yojson" arch="all !riscv64" # limited by ocaml aport license="BSD-3-Clause" depends="ocaml-seq" depends_dev="$pkgname=$pkgver-r$pkgrel ocaml-seq-dev" makedepends="$depends_dev dune ocaml ocaml-cppo ocaml-findlib" subpackages="$pkgname-dev" source="$pkgname-$pkgver.tar.gz::https://github.com/ocaml-community/yojson/archive/$pkgver.tar.gz" builddir="$srcdir/$_pkgname-$pkgver" options="!check" # tests need alcotest library # 32-bit archs case "$CARCH" in arm*|x86) options="$options textrels" ;; esac build() { export OCAMLPATH=/usr/lib/ocaml dune build @install -p yojson } check() { dune runtest } package() { dune install \ --destdir="$pkgdir" \ --prefix=/usr \ --libdir=/usr/lib/ocaml \ yojson # There's just a readme and changelog. rm -Rf "$pkgdir"/usr/doc # Don't package ydump tool for now. rm -Rf "$pkgdir"/usr/bin } dev() { default_dev cd "$pkgdir" local path; for path in $(find usr/lib/ocaml \( \ -name '*.cmt' -o \ -name '*.cmti' -o \ -name '*.cmx' -o \ -name '*.cmxa' -o \ -name '*.ml' -o \ -name '*.mli' \ \)) do amove "$path" done } sha512sums=" 61e8084d66d62d05a7802ee82a414807a76959ce6e0b14fd01f1c9c71ea69976d8a2cf3d5718e4059da4161786136a08624cd8470693ef2893b862efa7d6ffd2 ocaml-yojson-2.0.2.tar.gz "