dev-ml/ocaml-cstruct: build only enabled targets, should fix bug #623742
authorAlexis Ballier <aballier@gentoo.org>
Tue, 4 Jul 2017 06:58:42 +0000 (08:58 +0200)
committerAlexis Ballier <aballier@gentoo.org>
Tue, 4 Jul 2017 06:58:42 +0000 (08:58 +0200)
Package-Manager: Portage-2.3.6, Repoman-2.3.2

dev-ml/ocaml-cstruct/ocaml-cstruct-3.0.2.ebuild

index 388db7e25424bd4eecbf803cf5d10e76c63bd304..39b192f16a3ce9fe17576b2a87eef0bd0112ba2c 100644 (file)
@@ -38,6 +38,22 @@ DEPEND="
        ${RDEPEND}
 "
 
+get_targets() {
+       local tgt="cstruct,cstruct-unix"
+       use lwt && tgt+=",cstruct-lwt"
+       use async && tgt+=",cstruct-async"
+       use ppx && tgt+=",ppx_cstruct"
+       echo "${tgt}"
+}
+
+src_compile() {
+       jbuilder build -p $(get_targets) || die
+}
+
+src_test() {
+       jbuilder runtest -p $(get_targets) || die
+}
+
 oinstall() {
        opam-installer -i \
                --prefix="${ED}/usr" \