dev-ml/uri: tests and useflags

Signed-off-by: Alessandro Barbieri <lssndrbarbieri@gmail.com>
This commit is contained in:
Alessandro Barbieri
2022-04-05 17:00:53 +02:00
parent bb0d3460c7
commit b3c8b07dc3
2 changed files with 35 additions and 8 deletions

View File

@@ -9,4 +9,8 @@
<upstream>
<remote-id type="github">mirage/ocaml-uri</remote-id>
</upstream>
<use>
<flag name="re">This is an OCaml implementation of the RFC3986 specification for parsing URI or URLs</flag>
<flag name="sexp">ocaml-uri with sexp support</flag>
</use>
</pkgmetadata>

View File

@@ -3,7 +3,7 @@
EAPI=8
inherit dune
inherit dune multiprocessing
DESCRIPTION="RFC3986 URI parsing library for OCaml"
HOMEPAGE="https://github.com/mirage/ocaml-uri"
@@ -13,19 +13,42 @@ S="${WORKDIR}/ocaml-${P}"
LICENSE="ISC"
SLOT="0/${PV}"
KEYWORDS="~amd64"
IUSE="ocamlopt"
IUSE="ocamlopt re sexp test"
RDEPEND="
dev-ml/angstrom
dev-ml/ppx_sexp_conv
dev-ml/re
dev-ml/sexplib0
dev-ml/stringext
re? (
dev-ml/re
)
sexp? (
dev-ml/ppx_sexp_conv
dev-ml/sexplib0
)
"
DEPEND="${RDEPEND}"
DEPEND="
${RDEPEND}
test? (
dev-ml/ounit
dev-ml/ppx_sexp_conv
)
"
RESTRICT="!test? ( test )"
src_compile() {
local pkgs="uri"
for u in sexp re ; do
if use ${u} ; then
pkgs="${pkgs},uri-${u}"
fi
done
dune build --only-packages "${pkgs}" -j $(makeopts_jobs) --profile release || die
}
src_install() {
dune_src_install uri
dune_src_install uri-re
dune_src_install uri-sexp
use re && dune_src_install uri-re
use sexp && dune_src_install uri-sexp
}