pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/mk Adding jbuilder support to ocaml.mk



details:   https://anonhg.NetBSD.org/pkgsrc/rev/ed9a7c726998
branches:  trunk
changeset: 365670:ed9a7c726998
user:      jaapb <jaapb%pkgsrc.org@localhost>
date:      Sun Jul 23 12:20:46 2017 +0000

description:
Adding jbuilder support to ocaml.mk

diffstat:

 mk/ocaml.mk |  35 ++++++++++++++++++++++++++++++++++-
 1 files changed, 34 insertions(+), 1 deletions(-)

diffs (86 lines):

diff -r 40252274919c -r ed9a7c726998 mk/ocaml.mk
--- a/mk/ocaml.mk       Sun Jul 23 12:13:13 2017 +0000
+++ b/mk/ocaml.mk       Sun Jul 23 12:20:46 2017 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: ocaml.mk,v 1.12 2017/07/11 09:54:21 jaapb Exp $
+# $NetBSD: ocaml.mk,v 1.13 2017/07/23 12:20:46 jaapb Exp $
 #
 # This Makefile fragment handles the common variables used by OCaml packages.
 #
@@ -26,6 +26,8 @@
 # package uses OPAM
 # OCAML_USE_TOPKG
 # package uses topkg [implies OCAML_USE_FINDLIB]
+# OCAML_USE_JBUILDER
+# package uses jbuilder [implies OCAML_USE_OPAM]
 # OCAML_TOPKG_DOCDIR
 # different targets for topkg (bytecode, optional bytecode, native)
 # OASIS_BUILD_ARGS
@@ -47,8 +49,16 @@
        OCAML_FINDLIB_REGISTER \
        OCAML_USE_OASIS \
        OCAML_USE_OASIS_DYNRUN \
+       OASIS_BUILD_ARGS \
        OCAML_USE_OPAM \
        OCAML_USE_TOPKG \
+       OCAML_TOPKG_NAME \
+       OCAML_TOPKG_DOCDIR \
+       OCAML_TOPKG_TARGETS \
+       OCAML_TOPKG_OPTIONAL_TARGETS \
+       OCAML_USE_JBUILDER \
+       JBUILDER_BUILD_FLAGS \
+       JBUILDER_BUILD_TARGETS \
        OCAML_BUILD_ARGS
 _DEF_VARS.ocaml=       \
        OCAML_USE_OPT_COMPILER
@@ -70,6 +80,9 @@
 # Default value of OCAML_USE_TOPKG
 OCAML_USE_TOPKG?=      no
 
+# Default value of OCAML_USE_JBUILDER
+OCAML_USE_JBUILDER?=   no
+
 OCAML_TOPKG_NAME?=     ${PKGBASE:S/^ocaml-//}
 OCAML_TOPKG_DOCDIR?=   ${PREFIX}/share/doc
 
@@ -79,6 +92,9 @@
 OCAML_TOPKG_OPTIONAL_TARGETS?= # empty
 OCAML_TOPKG_NATIVE_TARGETS?=   # empty
 
+JBUILDER_BUILD_FLAGS?= # empty
+JBUILDER_BUILD_TARGETS?=       @install
+
 # Default value of OASIS_BUILD_ARGS
 OASIS_BUILD_ARGS?=     # empty
 
@@ -127,6 +143,12 @@
 INSTALLATION_DIRS+=    ${OCAML_SITELIBDIR}/${OCAML_TOPKG_NAME}
 .endif
 
+# Configure stuff for JBUILDER
+.if ${OCAML_USE_JBUILDER} == "yes"
+.include "../../devel/ocaml-jbuilder/buildlink3.mk"
+OCAML_USE_OPAM=        yes
+.endif
+
 # Value for OCAML_SITELIBDIR
 OCAML_SITELIBDIR=      lib/ocaml/site-lib
 MAKE_ENV+=     OCAML_SITELIBDIR="${OCAML_SITELIBDIR}"
@@ -211,6 +233,17 @@
 
 .endif # topkg-opam
 
+#
+# jbuilder targets
+#
+.if ${OCAML_USE_JBUILDER} == "yes"
+
+do-build:
+       ${RUN} cd ${WRKSRC} && jbuilder build -j ${MAKE_JOBS} \
+               ${JBUILDER_BUILD_FLAGS} ${JBUILDER_BUILD_TARGETS}
+
+.endif # topkg-jbuilder
+
 # Add dependency on ocaml.
 .include "../../lang/ocaml/buildlink3.mk"
 



Home | Main Index | Thread Index | Old Index