pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/mk Changes in OCaml support:



details:   https://anonhg.NetBSD.org/pkgsrc/rev/ff11dd2f47b3
branches:  trunk
changeset: 365114:ff11dd2f47b3
user:      jaapb <jaapb%pkgsrc.org@localhost>
date:      Tue Jul 11 09:54:21 2017 +0000

description:
Changes in OCaml support:
- added support for TOPKG
- installation through OPAM install files now possible
- oasis support improved

diffstat:

 mk/ocaml.mk |  59 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++---
 1 files changed, 56 insertions(+), 3 deletions(-)

diffs (103 lines):

diff -r 1012792214e1 -r ff11dd2f47b3 mk/ocaml.mk
--- a/mk/ocaml.mk       Tue Jul 11 09:52:26 2017 +0000
+++ b/mk/ocaml.mk       Tue Jul 11 09:54:21 2017 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: ocaml.mk,v 1.11 2016/12/30 11:45:28 jaapb Exp $
+# $NetBSD: ocaml.mk,v 1.12 2017/07/11 09:54:21 jaapb Exp $
 #
 # This Makefile fragment handles the common variables used by OCaml packages.
 #
@@ -24,6 +24,10 @@
 # package uses oasis.dynrun
 # OCAML_USE_OPAM
 # package uses OPAM
+# OCAML_USE_TOPKG
+# package uses topkg [implies OCAML_USE_FINDLIB]
+# OCAML_TOPKG_DOCDIR
+# different targets for topkg (bytecode, optional bytecode, native)
 # OASIS_BUILD_ARGS
 # arguments for oasis build
 # Set by this file:
@@ -44,6 +48,7 @@
        OCAML_USE_OASIS \
        OCAML_USE_OASIS_DYNRUN \
        OCAML_USE_OPAM \
+       OCAML_USE_TOPKG \
        OCAML_BUILD_ARGS
 _DEF_VARS.ocaml=       \
        OCAML_USE_OPT_COMPILER
@@ -62,6 +67,18 @@
 # Default value of OCAML_USE_OPAM
 OCAML_USE_OPAM?= no
 
+# Default value of OCAML_USE_TOPKG
+OCAML_USE_TOPKG?=      no
+
+OCAML_TOPKG_NAME?=     ${PKGBASE:S/^ocaml-//}
+OCAML_TOPKG_DOCDIR?=   ${PREFIX}/share/doc
+
+OCAML_TOPKG_NAME?=     ${PKGBASE:S/^ocaml-//}
+
+OCAML_TOPKG_TARGETS?=  # empty
+OCAML_TOPKG_OPTIONAL_TARGETS?= # empty
+OCAML_TOPKG_NATIVE_TARGETS?=   # empty
+
 # Default value of OASIS_BUILD_ARGS
 OASIS_BUILD_ARGS?=     # empty
 
@@ -98,6 +115,18 @@
 .endif
 .endif
 
+# Configure stuff for OPAM
+.if ${OCAML_USE_OPAM} == "yes"
+.include "../../misc/ocaml-opam/buildlink3.mk"
+.endif
+
+# Configure stuff for TOPKG
+.if ${OCAML_USE_TOPKG} == "yes"
+.include "../../misc/ocaml-topkg/buildlink3.mk"
+OCAML_USE_FINDLIB=     yes
+INSTALLATION_DIRS+=    ${OCAML_SITELIBDIR}/${OCAML_TOPKG_NAME}
+.endif
+
 # Value for OCAML_SITELIBDIR
 OCAML_SITELIBDIR=      lib/ocaml/site-lib
 MAKE_ENV+=     OCAML_SITELIBDIR="${OCAML_SITELIBDIR}"
@@ -155,10 +184,34 @@
 # Redefine install target
 do-install:
        ${RUN} cd ${WRKSRC} && \
-               ${OASIS_EXEC} -install
+               ${OASIS_EXEC} -install --destdir ${DESTDIR} --prefix ${PREFIX}
 .endif
 
-# Add dependency to ocaml.
+#
+# topkg targets
+#
+.if ${OCAML_USE_TOPKG} == "yes"
+
+do-build:
+       ${RUN} cd ${WRKSRC} && \
+               ${SETENV} ${MAKE_ENV} ocaml pkg/pkg.ml build
+
+.endif # topkg
+
+#
+# opam targets
+#
+.if ${OCAML_USE_OPAM} == "yes" 
+
+do-install:
+       ${RUN} cd ${WRKSRC} && opam-installer -i --prefix ${DESTDIR}${PREFIX} \
+               --libdir ${OCAML_SITELIBDIR} \
+               --docdir ${DESTDIR}/${OCAML_TOPKG_DOCDIR} \
+               ${OCAML_TOPKG_NAME}.install
+
+.endif # topkg-opam
+
+# Add dependency on ocaml.
 .include "../../lang/ocaml/buildlink3.mk"
 
 .endif # OCAML_MK



Home | Main Index | Thread Index | Old Index