dev-ml/ezjsonm: use dune.eclass functions

Simplify the ebuild, by introducing OCAML_SUBPACKAGES and use
dune-compile and dune-install from dune.eclass that accept a list of
packages.

Signed-off-by: Thomas Bracht Laumann Jespersen <t@laumann.xyz>
This commit is contained in:
Thomas Bracht Laumann Jespersen
2026-05-17 07:49:49 +02:00
parent 0e2a50c009
commit 10c7b304ef

View File

@@ -1,4 +1,4 @@
# Copyright 2025 Gentoo Authors # Copyright 2025-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2 # Distributed under the terms of the GNU General Public License v2
EAPI=8 EAPI=8
@@ -26,21 +26,23 @@ RDEPEND="${DEPEND}"
RESTRICT="test" RESTRICT="test"
OCAML_SUBPACKAGES=(
ezjsonm
)
src_prepare() { src_prepare() {
default default
use lwt && OCAML_SUBPACKAGES+=( ezjsonm-lwt )
# test libs and binaries are built unconditionally otherwise # test libs and binaries are built unconditionally otherwise
rm lib_test/dune rm lib_test/dune
} }
src_compile() { src_compile() {
local pkgs="ezjsonm" dune-compile ${OCAML_SUBPACKAGES[@]}
if use lwt ; then
pkgs="${pkgs},ezjsonm-lwt"
fi
dune build --only-packages "${pkgs}" -j $(makeopts_jobs) --profile release || die
} }
src_install() { src_install() {
dune_src_install ezjsonm dune-install ${OCAML_SUBPACKAGES[@]}
use lwt && dune_src_install ezjsonm-lwt
} }