diff --git a/dev-ml/cstruct/Manifest b/dev-ml/cstruct/Manifest index 2ad60d23e5..62c35a90cf 100644 --- a/dev-ml/cstruct/Manifest +++ b/dev-ml/cstruct/Manifest @@ -1 +1 @@ -DIST ocaml-ctruct-6.0.1.tar.gz 243082 BLAKE2B 874ba34583bbc8b53c5b50ba038e2aa423fd704711194dcf99899239015d5fb383242b1d4654c1be2705fd80465e6da7e8eaa5265eceebca7b09dc036d4ebf40 SHA512 2f696b9dca1426d57f60fd4e997ee0c89b1af1a49e186e08c16911ceb03e9f89518a63faf4407b4a7e3c5f391d51979019e47a77f33961624d767a9e36146ca4 +DIST cstruct-6.0.1.tar.gz 243082 BLAKE2B 874ba34583bbc8b53c5b50ba038e2aa423fd704711194dcf99899239015d5fb383242b1d4654c1be2705fd80465e6da7e8eaa5265eceebca7b09dc036d4ebf40 SHA512 2f696b9dca1426d57f60fd4e997ee0c89b1af1a49e186e08c16911ceb03e9f89518a63faf4407b4a7e3c5f391d51979019e47a77f33961624d767a9e36146ca4 diff --git a/dev-ml/cstruct/cstruct-6.0.1.ebuild b/dev-ml/cstruct/cstruct-6.0.1.ebuild index b6db64c461..b345f920c7 100644 --- a/dev-ml/cstruct/cstruct-6.0.1.ebuild +++ b/dev-ml/cstruct/cstruct-6.0.1.ebuild @@ -3,35 +3,72 @@ EAPI=8 -inherit dune +inherit dune multiprocessing DESCRIPTION="Map OCaml arrays onto C-like structs" HOMEPAGE="https://github.com/mirage/ocaml-cstruct" -SRC_URI="https://github.com/mirage/ocaml-cstruct/archive/v${PV}.tar.gz -> ocaml-ctruct-${PV}.tar.gz" -S="${WORKDIR}/ocaml-cstruct-${PV}" +SRC_URI="https://github.com/mirage/ocaml-cstruct/archive/v${PV}.tar.gz -> ${P}.tar.gz" +S="${WORKDIR}/ocaml-${P}" LICENSE="ISC" SLOT="0/${PV}" KEYWORDS="~amd64" -IUSE="ocamlopt" +IUSE="async lwt ocamlopt ppx sexp test unix" RDEPEND=" >=dev-lang/ocaml-4.08.0 >=dev-ml/fmt-0.8.9 - dev-ml/async - dev-ml/async_unix - dev-ml/core - dev-ml/lwt - dev-ml/sexplib - dev-ml/ppxlib + + async? ( + dev-ml/async + dev-ml/async_unix + dev-ml/core + ) + lwt? ( + dev-ml/base-unix + dev-ml/lwt + ) + ppx? ( + dev-ml/ppxlib + dev-ml/stdlib-shims + ) + sexp? ( dev-ml/sexplib ) + unix? ( dev-ml/base-unix ) " -DEPEND="${RDEPEND}" +DEPEND=" + ${RDEPEND} + test? ( + dev-ml/alcotest + dev-ml/crowbar + dev-ml/ocaml-migrate-parsetree + dev-ml/ounit + dev-ml/ppx_sexp_conv + dev-ml/cppo + dev-ml/lwt + ) +" + +RESTRICT="!test? ( test )" +REQUIRED_USE=" + ppx? ( sexp ) + test? ( sexp ppx ) +" + +src_compile() { + local pkgs="cstruct" + for u in async lwt ppx sexp unix ; do + if use ${u} ; then + pkgs="${pkgs},cstruct-${u}" + fi + done + dune build --only-packages "${pkgs}" -j $(makeopts_jobs) --profile release || die +} src_install() { - dune_src_install cstruct-async - dune_src_install cstruct-lwt - dune_src_install cstruct-sexp - dune_src_install cstruct-unix dune_src_install cstruct - dune_src_install ppx_cstruct + use async && dune_src_install cstruct-async + use lwt && dune_src_install cstruct-lwt + use sexp && dune_src_install cstruct-sexp + use unix && dune_src_install cstruct-unix + use ppx && dune_src_install ppx_cstruct } diff --git a/dev-ml/cstruct/metadata.xml b/dev-ml/cstruct/metadata.xml index e689615f67..0f3f50ae21 100644 --- a/dev-ml/cstruct/metadata.xml +++ b/dev-ml/cstruct/metadata.xml @@ -2,11 +2,18 @@ - co-mainteiners welcome + co-maintainers welcome lssndrbarbieri@gmail.com Alessandro Barbieri mirage/ocaml-cstruct + + provide Async Pipe and Bigstring support + provide Lwt variants of read/write functions + a PPX syntax extension + serialisers into s-expression format of Cstructs + provide Unix variations of the read/write functions using file descriptors +