git: c79c88017bf5 - main - Mk/**ocaml.mk: Convert remaining bsd.ocaml.mk to Uses/ocaml.mk
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 31 Dec 2024 07:42:25 UTC
The branch main has been updated by bofh:
URL: https://cgit.FreeBSD.org/ports/commit/?id=c79c88017bf5ed4603cd14c2890910f40f53c847
commit c79c88017bf5ed4603cd14c2890910f40f53c847
Author: Muhammad Moinur Rahman <bofh@FreeBSD.org>
AuthorDate: 2024-12-30 21:21:06 +0000
Commit: Muhammad Moinur Rahman <bofh@FreeBSD.org>
CommitDate: 2024-12-31 07:41:54 +0000
Mk/**ocaml.mk: Convert remaining bsd.ocaml.mk to Uses/ocaml.mk
- Instead of USE_OCAML=yes use USES=ocaml. If empty USES=ocaml implies
build and run
- Instead of USE_OCAMLFIND_PLIST use USES=ocaml:findplist which also
implies USES=ocaml:findlib
- Instead of USE_OCAML_CAMLP4 use USES=ocaml:camlp4
- Instead of USE_OCAML_FINDLIB use USES=ocaml:findlib
- Instead of USE_OCAML_LDCONFIG use USES=ocaml:ldconfig
- Instead of USE_OCAML_WASH use USES=ocaml:wash
- Instead of NO_OCAML_BUILDDEPENDS use USES=ocaml:run
- Instead of NO_OCAML_RUNDDEPENDS use USES=ocaml:build
- Instead of USE_OCAML_TK use USES=ocaml:tk which actually implies
USES=ocaml:tkbuild and USES=ocaml:tkrun
- Instead of NO_OCAMLTK_BUILDDEPENDS use USES=ocaml:tkrun
- Instead of NO_OCAMLTK_RUNDEPENDS use USES=ocaml:tkbuild
- USES=ocaml:dune remains unchanged
- Prepare to add/remove keywords easily
Approved by: mat (portmgr)
Reviewed by: freebsd@dev.thsi.be
Differential Revision: https://reviews.freebsd.org/D48227
---
CHANGES | 32 +++-
Mk/Uses/ocaml.mk | 298 ++++++++++++++++++++++++++++---
Mk/bsd.ocaml.mk | 198 --------------------
Mk/bsd.port.mk | 11 --
Mk/bsd.sanity.mk | 16 +-
archivers/ocaml-bz2/Makefile | 4 +-
archivers/ocaml-zip/Makefile | 7 +-
converters/ocaml-base64/Makefile | 3 +-
converters/ocaml-jsonm/Makefile | 3 +-
databases/ocaml-dbm/Makefile | 3 +-
databases/ocaml-mysql/Makefile | 7 +-
databases/ocaml-sqlite3/Makefile | 5 +-
devel/aifad/Makefile | 1 -
devel/coccinelle/Makefile | 4 +-
devel/menhir/Makefile | 1 -
devel/ocaml-annexlib/Makefile | 7 +-
devel/ocaml-astring/Makefile | 3 +-
devel/ocaml-base/Makefile | 4 +-
devel/ocaml-bos/Makefile | 3 +-
devel/ocaml-calendar/Makefile | 6 +-
devel/ocaml-camljava/Makefile | 2 +-
devel/ocaml-camlp-streams/Makefile | 1 -
devel/ocaml-camlp4/Makefile | 3 +-
devel/ocaml-camlp5/Makefile | 3 +-
devel/ocaml-camomile/Makefile | 3 +-
devel/ocaml-cfg/Makefile | 2 +-
devel/ocaml-classes/Makefile | 5 +-
devel/ocaml-cmdliner/Makefile | 5 +-
devel/ocaml-compiler-libs/Makefile | 1 -
devel/ocaml-cppo/Makefile | 2 +-
devel/ocaml-csexp/Makefile | 1 -
devel/ocaml-cstruct/Makefile | 4 +-
devel/ocaml-curses/Makefile | 4 +-
devel/ocaml-dolmen/Makefile | 1 -
devel/ocaml-domain-name/Makefile | 1 -
devel/ocaml-dune/Makefile | 5 +-
devel/ocaml-extlib/Makefile | 7 +-
devel/ocaml-findlib/Makefile | 5 +-
devel/ocaml-fmt/Makefile | 3 +-
devel/ocaml-fpath/Makefile | 4 +-
devel/ocaml-gen/Makefile | 1 -
devel/ocaml-hmap/Makefile | 3 +-
devel/ocaml-ipaddr/Makefile | 1 -
devel/ocaml-lacaml/Makefile | 4 +-
devel/ocaml-linol/Makefile | 1 -
devel/ocaml-logs/Makefile | 3 +-
devel/ocaml-lsp/Makefile | 2 -
devel/ocaml-lwt/Makefile | 4 +-
devel/ocaml-magic/Makefile | 5 +-
devel/ocaml-mtime/Makefile | 4 +-
devel/ocaml-ocamlbuild/Makefile | 3 +-
devel/ocaml-ocplib-endian/Makefile | 1 -
devel/ocaml-octavius/Makefile | 1 -
devel/ocaml-ounit/Makefile | 1 -
devel/ocaml-parmap/Makefile | 5 +-
devel/ocaml-parsexp/Makefile | 1 -
devel/ocaml-pcre/Makefile | 5 +-
devel/ocaml-pcre2/Makefile | 4 +-
devel/ocaml-pomap/Makefile | 2 +-
devel/ocaml-pp_loc/Makefile | 1 -
devel/ocaml-ppx-tools/Makefile | 7 +-
devel/ocaml-ppx_blob/Makefile | 1 -
devel/ocaml-ppx_compare/Makefile | 1 -
devel/ocaml-ppx_derivers/Makefile | 1 -
devel/ocaml-ppx_deriving/Makefile | 1 -
devel/ocaml-ppx_hash/Makefile | 1 -
devel/ocaml-ppx_js_style/Makefile | 1 -
devel/ocaml-ppx_sexp_conv/Makefile | 1 -
devel/ocaml-ppx_yojson_conv/Makefile | 1 -
devel/ocaml-ppx_yojson_conv_lib/Makefile | 1 -
devel/ocaml-ppxlib/Makefile | 1 -
devel/ocaml-psmt2-frontend/Makefile | 1 -
devel/ocaml-re/Makefile | 1 -
devel/ocaml-react/Makefile | 7 +-
devel/ocaml-res/Makefile | 2 +-
devel/ocaml-result/Makefile | 3 +-
devel/ocaml-rresult/Makefile | 3 +-
devel/ocaml-sdl/Makefile | 8 +-
devel/ocaml-sem/Makefile | 6 +-
devel/ocaml-sexplib/Makefile | 1 -
devel/ocaml-sexplib0/Makefile | 1 -
devel/ocaml-stdio/Makefile | 4 +-
devel/ocaml-topkg/Makefile | 4 +-
devel/ocaml-trace/Makefile | 2 -
devel/ocaml-type_conv/Makefile | 7 +-
devel/ocaml-uchar/Makefile | 2 +-
devel/ocaml-ulex/Makefile | 7 +-
devel/ocaml-uutf/Makefile | 4 +-
devel/ocaml-xstr/Makefile | 7 +-
devel/ocaml-xstrp4/Makefile | 7 +-
devel/omake/Makefile | 4 +-
ftp/ocaml-ocurl/Makefile | 7 +-
games/freetennis/Makefile | 3 +-
graphics/ocaml-cairo/Makefile | 4 +-
graphics/ocaml-images/Makefile | 4 +-
graphics/ocaml-lablgl/Makefile | 6 +-
lang/mtasc/Makefile | 4 +-
lang/ocaml-camlidl/Makefile | 3 +-
lang/ott/Makefile | 5 +-
math/alt-ergo/Makefile | 2 -
math/coq/Makefile | 5 +-
math/facile/Makefile | 4 +-
math/ocaml-farith/Makefile | 1 -
math/ocaml-num/Makefile | 3 +-
math/ocaml-ocamlgraph/Makefile | 3 +-
math/ocaml-ocplib-simplex/Makefile | 1 -
math/ocaml-zarith/Makefile | 6 +-
math/ocamlgsl/Makefile | 4 +-
math/orpie/Makefile | 1 -
math/teyjus/Makefile | 3 +-
net-p2p/mldonkey/Makefile | 4 +-
net/unison/Makefile | 4 +-
net/unison240/Makefile | 5 +-
net/unison248/Makefile | 4 +-
net/unison251/Makefile | 4 +-
print/texvc/Makefile | 5 +-
science/kalzium/Makefile | 4 +-
security/ocaml-cryptgps/Makefile | 6 +-
security/ocaml-cryptokit/Makefile | 4 +-
security/ocaml-lwt_ssl/Makefile | 1 -
security/ocaml-ssl/Makefile | 4 +-
sysutils/ledit/Makefile | 3 +-
textproc/ocaml-csv/Makefile | 7 +-
textproc/ocaml-expat/Makefile | 9 +-
textproc/ocaml-spelll/Makefile | 1 -
textproc/ocaml-text/Makefile | 8 +-
textproc/ocaml-yojson/Makefile | 1 -
textproc/sexp/Makefile | 1 -
x11-toolkits/ocaml-graphics/Makefile | 4 +-
x11-toolkits/ocaml-lablgtk2/Makefile | 7 +-
x11-toolkits/ocaml-lablgtk3/Makefile | 6 +-
x11-toolkits/ocaml-labltk/Makefile | 5 +-
132 files changed, 433 insertions(+), 561 deletions(-)
diff --git a/CHANGES b/CHANGES
index fcea611bda78..d5c37f30f68e 100644
--- a/CHANGES
+++ b/CHANGES
@@ -10,6 +10,28 @@ in the release notes and/or placed into UPDATING.
All ports committers are allowed to commit to this file.
+20241231:
+AUTHOR: bofh@FreeBSD.org
+
+ Converted remaining bsd.ocaml.mk to Uses/ocaml.mk
+
+ - Instead of USE_OCAML=yes use USES=ocaml. If empty USES=ocaml implies
+ build and run
+ - Instead of USE_OCAMLFIND_PLIST use USES=ocaml:findplist which also
+ implies USES=ocaml:findlib
+ - Instead of USE_OCAML_CAMLP4 use USES=ocaml:camlp4
+ - Instead of USE_OCAML_FINDLIB use USES=ocaml:findlib
+ - Instead of USE_OCAML_LDCONFIG use USES=ocaml:ldconfig
+ - Instead of USE_OCAML_WASH use USES=ocaml:wash
+ - Instead of NO_OCAML_BUILDDEPENDS use USES=ocaml:run
+ - Instead of NO_OCAML_RUNDDEPENDS use USES=ocaml:build
+ - Instead of USE_OCAML_TK use USES=ocaml:tk which actually implies
+ USES=ocaml:tkbuild and USES=ocaml:tkrun
+ - Instead of NO_OCAMLTK_BUILDDEPENDS use USES=ocaml:tkrun
+ - Instead of NO_OCAMLTK_RUNDEPENDS use USES=ocaml:tkbuild
+ - USES=ocaml:dune remains unchanged
+ - Prepare to add/remove keywords easily
+
20240408:
AUTHOR: flo@FreeBSD.org
@@ -442,7 +464,7 @@ AUTHOR: tcberner@FreeBSD.org
Ports that depend on mlt should now use USES=mlt:<version> to specify
their dependency.
- At the moment the supported version is 6, but will be extended to also
+ At the moment the supported version is 6, but will be extended to also
allow for selection of mlt 7 shortly.
20210604:
@@ -501,8 +523,8 @@ AUTHOR: pauamma@gundo.com
purpose, such as:
* course-writing or course-delivery applications,
* classroom or school management applications (eg, scheduling classes),
- * applications, utilities, or games primarily or substantially designed
- to help the user learn a specific topic or study in general, like typing
+ * applications, utilities, or games primarily or substantially designed
+ to help the user learn a specific topic or study in general, like typing
tutors, flashcard applications, or educational games.
20201110:
@@ -593,7 +615,7 @@ AUTHOR: mat@FreeBSD.org
USES=lua sets LUA_FLAVOR that needs to be used on all dependencies of
flavored lua ports, in a similar way as PHP or Python flavors.
-
+
20200115:
AUTHOR: bapt@FreeBSD.org
@@ -605,7 +627,7 @@ AUTHOR: bapt@FreeBSD.org
The ipv6 virtual category is gone, it does not make sense anymore in 2019
where the norm in applications is to have support both ipv4 and ipv6.
-
+
20191001:
AUTHOR: bapt@FreeBSD.org
diff --git a/Mk/Uses/ocaml.mk b/Mk/Uses/ocaml.mk
index 666c29078c19..fed0026ff72d 100644
--- a/Mk/Uses/ocaml.mk
+++ b/Mk/Uses/ocaml.mk
@@ -1,38 +1,186 @@
-# Provide support to use the Dune package builder for OCaml
+# Provide support for OCaml
+# Feature: ocaml
+# Usage: USES=ocaml or USES=ocaml:args
#
-# Feature: ocaml
-# Usage: USES=ocaml:dune
-# USE_OCAML=yes
+# Valid ARGS: build, camlp4, dune, findlib, findplist, ldconfig, tk, tkbuild, tkrun, wash
+# If empty, defaults to build and run
+#
+# build - Add ocamlc to BUILD|EXTRACT|PATCH_DEPENDS
+#
+# camlp4 - Use camlp4 to build
+#
+# dune - Use dune as a build system
+#
+# findlib - Set if port uses ocamlfind to install packages.
+# Package direcories will be automatically deleted
+#
+# findplist - Add contents of findlib target directories automatically
+#
+# ldconfig - Set if your port installs shared libraries into ocaml
+# site-lib dir. OCaml ld.conf file will be automatically
+# processed. When dune is used Dune may install stublibs in
+# site-lib package directory(ies) or in a single directory
+# below DUNE_LIBDIR.
+#
+# run - Add ocamlc to RUN_DEPENDS
+#
+# tk - Set if port needs ocaml-labltk which implies tkbuild and
+# tkrun
+#
+# tkbuild - Add labltk to BUILD|EXTRACT|PATCH_DEPENDS
+#
+# tkrun - Add labltk to RUN_DEPENDS
+#
+# wash - Set if your port wants to automatically
+# purge shared Ocaml dirs on uninstall. It's
+# useful when installing to non-standard PREFIX
#
# Variables that may be set by the port:
#
-# OCAML_PACKAGES List of packages to build and install, defaults to PORTNAME
+# OCAML_PKGDIRS - Directories under site-lib to be processed
+# if USES=ocaml:findlib specified.
+# Default: ${PORTNAME}
#
-# USE_OCAML_LDCONFIG Dune may install stublibs in site-lib package directory(ies)
-# OCAML_LDLIBS or in a single directory below DUNE_LIBDIR.
+# OCAML_LDLIBS - Directories under PREFIX to be automatically
+# added/removed from ld.conf
+# Default: ${OCAML_SITELIBDIR}/${PORTNAME}
#
-# Appends to: BUILD_DEPENDS, MAKE_ENV
+# OCAML_PACKAGES - List of packages to build and install, defaults to ${PORTNAME}
#
# MAINTAINER: freebsd@dev.thsi.be
.if !defined(_INCLUDE_USES_OCAML_MK)
_INCLUDE_USES_OCAML_MK= yes
-. if empty(ocaml_ARGS:Mdune)
-IGNORE= Incorrect 'USES+= ocaml:${ocaml_ARGS}' ocaml requires a single 'dune' argument (for now)
+_OCAML_VALID_ARGS= build camlp4 dune findlib findplist ldconfig tk tkbuild tkrun wash
+_OCAML_UNKNOWN_ARGS=
+. for arg in ${ocaml_ARGS}
+. if empty(_OCAML_VALID_ARGS:M${arg})
+_OCAML_UNKNOWN_ARGS+= ${arg}
+. endif
+. endfor
+. if !empty(_OCAML_UNKNOWN_ARGS)
+IGNORE= has unknown USES=ocaml arguments: ${_OCAML_UNKNOWN_ARGS}
. endif
-
-. if !defined(OCAML_include)
-.error USES=dune only works with USE_OCAML=yes
+. if ${ocaml_ARGS:Mfindplist} && ${ocaml_ARGS:Mfindlib}
+DEV_WARNING+= "USES=ocaml:findlib is included in USES=ocaml:findplist, so it is not needed"
+. endif
+. if empty(ocaml_ARGS)
+ocaml_ARGS= build,run
. endif
+. if !empty(ocaml_ARGS)
+.undef _USE_OCAML_BUILD
+.undef _USE_OCAML_CAMLP4
+.undef _USE_OCAML_DUNE
+.undef _USE_OCAML_FINDLIB
+.undef _USE_OCAML_FINDPLIST
+.undef _USE_OCAML_LDCONFIG
+.undef _USE_OCAML_RUN
+.undef _USE_OCAML_TKBUILD
+.undef _USE_OCAML_TKRUN
+.undef _USE_OCAML_WASH
+_OCAML_ARGS= ${ocaml_ARGS:S/,/ /g}
+. if ${_OCAML_ARGS:Mcamlp4}
+_USE_OCAML_CAMLP4= yes
+_OCAML_ARGS:= ${_OCAML_ARGS:Ncamlp4}
+. endif
+. if ${_OCAML_ARGS:Mdune}
+_USE_OCAML_DUNE= yes
+_OCAML_ARGS:= ${_OCAML_ARGS:Ndune}
+. endif
+. if ${_OCAML_ARGS:Mfindplist}
+_USE_OCAML_FINDPLIST= yes
+_OCAML_ARGS:= ${_OCAML_ARGS:Nfindplist}
+_OCAML_ARGS+= findlib
+. endif
+. if ${_OCAML_ARGS:Mfindlib}
+_USE_OCAML_FINDLIB= yes
+_OCAML_ARGS:= ${_OCAML_ARGS:Nfindlib}
+. endif
+. if ${_OCAML_ARGS:Mldconfig}
+_USE_OCAML_LDCONFIG= yes
+_OCAML_ARGS:= ${_OCAML_ARGS:Nldconfig}
+. endif
+. if ${_OCAML_ARGS:Mtk}
+_OCAML_ARGS+= tkbuild
+_OCAML_ARGS+= tkrun
+. endif
+. if ${_OCAML_ARGS:Mtkbuild}
+. if defined(NO_BUILD)
+IGNORE= Makefile error: NO_BUILD and USES=ocaml:tkbuild cannot be set at the same time
+. else
+_USE_OCAML_TKBUILD= yes
+_OCAML_ARGS:= ${_OCAML_ARGS:Ntkbuild}
+. endif
+. endif
+. if ${_OCAML_ARGS:Mtkrun}
+_USE_OCAML_TKRUN= yes
+_OCAML_ARGS:= ${_OCAML_ARGS:Ntkrun}
+. endif
+. if ${_OCAML_ARGS:Mwash}
+_USE_OCAML_WASH= yes
+_OCAML_ARGS:= ${_OCAML_ARGS:Nwash}
+. endif
+. if empty(_OCAML_ARGS)
+_OCAML_ARGS+= build
+_OCAML_ARGS+= run
+. endif
+. if ${_OCAML_ARGS:Mbuild}
+. if defined(NO_BUILD)
+IGNORE= Makefile error: NO_BUILD and USES=ocaml:build cannot be set at the same time
+. else
+_USE_OCAML_BUILD= yes
+. endif
+. endif
+. if ${_OCAML_ARGS:Mrun}
+_USE_OCAML_RUN= yes
+. endif
+. endif # !empty(ocaml_ARGS)
+
#
-# Dune builder port
+# OCaml programs location
+#
+OCAMLC?= ${LOCALBASE}/bin/ocamlc
+OCAMLC_OPT?= ${LOCALBASE}/bin/ocamlc.opt
+OCAMLCP?= ${LOCALBASE}/bin/ocamlcp
+OCAMLFIND?= ${LOCALBASE}/bin/ocamlfind
+CAMLP4?= ${LOCALBASE}/bin/camlp4
+OCAMLTK?= ${LOCALBASE}/bin/labltk
+
#
-DUNE_PORT?= devel/ocaml-dune
-DUNE_DEPEND?= ocaml-dune>=3.7.1_2:devel/ocaml-dune
+# OCaml library directory
+#
+OCAML_LIBDIR?= lib/ocaml
+
+#
+# Where to install site libraries
+#
+OCAML_SITELIBDIR?= ${OCAML_LIBDIR}/site-lib
-BUILD_DEPENDS+= ${DUNE_DEPEND}
+#
+# OCaml compiler port dependency
+#
+OCAMLC_PORT?= lang/ocaml
+OCAMLC_DEPEND?= ${OCAMLC}:${OCAMLC_PORT}
+
+#
+# OCaml package manager port dependency
+#
+OCAMLFIND_PORT?= devel/ocaml-findlib
+OCAMLFIND_DEPEND?= ${OCAMLFIND}:${OCAMLFIND_PORT}
+
+#
+# OCaml camlp4 port dependency
+#
+CAMLP4_PORT?= devel/ocaml-camlp4
+CAMLP4_DEPEND?= ${CAMLP4}:${CAMLP4_PORT}
+
+#
+# Dune builder port
+#
+. if defined(_USE_OCAML_DUNE)
+BUILD_DEPENDS+= ocaml-dune>=3.7.1_2:devel/ocaml-dune
DUNE_ARGS= --display=short --always-show-command-line \
--no-config -j ${MAKE_JOBS_NUMBER} --profile release \
@@ -50,8 +198,116 @@ DUNE_INSTALL_TARGETS?=
DUNE_LIBDIR?= ${OCAML_SITELIBDIR}
OCAML_PACKAGES?= ${PORTNAME}
DUNE_ROOT?= .
+# Left empty for default @install target
+ALL_TARGET?=
+. endif
+
+#
+# OCaml TK bindings dependency
+#
+OCAMLTK_PORT?= x11-toolkits/ocaml-labltk
+OCAMLTK_DEPENDS?= ${OCAMLTK}:${OCAMLTK_PORT}
+
+#
+# Common OCaml examples and documents location
+#
+OCAML_DOCSDIR= ${PREFIX}/share/doc/ocaml
+OCAML_EXAMPLESDIR= ${PREFIX}/share/examples/ocaml
+
+#
+# Location of OCaml ld.conf file
+#
+OCAML_LDCONF?= ${OCAML_LIBDIR}/ld.conf
+
+# ocaml-findlib-1.4.1_1 wants to edit our ld.conf file, which does not
+# work well with staging.
+. if defined(_USE_OCAML_LDCONFIG)
+. if !target(ocaml-ldconfig)
+OCAMLFIND_LDCONF?= /dev/null
+. endif
+. endif
+
+OCAMLFIND_DESTDIR?= ${PREFIX}/${OCAML_SITELIBDIR}
+OCAMLFIND_LDCONF?= ${PREFIX}/${OCAML_LDCONF}
+
+. if defined(_USE_OCAML_BUILD)
+EXTRACT_DEPENDS+= ${OCAMLC_DEPEND}
+PATCH_DEPENDS+= ${OCAMLC_DEPEND}
+BUILD_DEPENDS+= ${OCAMLC_DEPEND}
+. endif
+. if defined(_USE_OCAML_RUN)
+RUN_DEPENDS+= ${OCAMLC_DEPEND}
+. endif
+PLIST_SUB+= OCAML_SITELIBDIR="${OCAML_SITELIBDIR}"
-. if USE_OCAML_LDCONFIG
+. if defined(_USE_OCAML_FINDLIB)
+#
+# We'll additionally add ocamlfind to RUN_DEPENDS, since
+# if the port requires ocamlfind to install - it requires
+# some ocaml libraries and these libraries RUN_DEPENDS on
+# ocamlfind
+#
+BUILD_DEPENDS+= ${OCAMLFIND_DEPEND}
+RUN_DEPENDS+= ${OCAMLFIND_DEPEND}
+MAKE_ENV+= OCAMLFIND_DESTDIR="${STAGEDIR}${OCAMLFIND_DESTDIR}" \
+ OCAMLFIND_LDCONF="${OCAMLFIND_LDCONF}"
+
+#
+# Directories under site-lib to process automatically
+#
+OCAML_PKGDIRS?= ${PORTNAME}
+_USES_install+= 250:ocaml-pre-install 735:ocaml-findlib
+. if !target(ocaml-pre-install)
+ocaml-pre-install:
+ ${MKDIR} ${STAGEDIR}${OCAMLFIND_DESTDIR}
+. endif
+. if !target(ocaml-findlib)
+ocaml-findlib:
+. for DIR in ${OCAML_PKGDIRS}
+. if defined(_USE_OCAML_FINDPLIST)
+ @${FIND} ${STAGEDIR}${PREFIX}/${OCAML_SITELIBDIR}/${DIR}/ -type f -print | ${SED} -e \
+ 's,^${STAGEDIR}${PREFIX}/,,' >> ${TMPPLIST}
+. endif
+ @${ECHO_CMD} "@postunexec ${OCAMLFIND} remove ${DIR} 2>/dev/null" \
+ >> ${TMPPLIST}
+. endfor
+. endif
+. endif
+
+. if defined(_USE_OCAML_CAMLP4)
+BUILD_DEPENDS+= ${CAMLP4_DEPEND}
+. endif
+
+. if defined(_USE_OCAML_TKBUILD)
+EXTRACT_DEPENDS+= ${OCAMLTK_DEPENDS}
+PATCH_DEPENDS+= ${OCAMLTK_DEPENDS}
+BUILD_DEPENDS+= ${OCAMLTK_DEPENDS}
+. endif
+. if defined(_USE_OCAML_TKRUN)
+RUN_DEPENDS+= ${OCAMLTK_DEPENDS}
+. endif
+
+. if defined(_USE_OCAML_LDCONFIG)
+#
+# Directories under PREFIX for appending to ld.conf
+#
+OCAML_LDLIBS?= ${OCAML_SITELIBDIR}/${PORTNAME}
+_USES_install+= 740:ocaml-ldconfig
+. if !target(ocaml-ldconfig)
+ocaml-ldconfig:
+. for LIB in ${OCAML_LDLIBS}
+ @${ECHO_CMD} "@postexec ${ECHO_CMD} "%D/${LIB}" >> %D/${OCAML_LDCONF}" \
+ >> ${TMPPLIST}
+ @${ECHO_CMD} "@postunexec ${SED} -i \"\" -e '/${LIB:S#/#\/#g}/d' %D/${OCAML_LDCONF}" >> ${TMPPLIST}
+. endfor
+. endif
+. endif
+
+. if defined(_USE_OCAML_WASH)
+PLIST_FILES+= "@rmempty ${OCAML_LDCONF}"
+. endif
+
+. if defined(_USE_OCAML_LDCONFIG) && defined(_USE_OCAML_DUNE)
. if !empty(OCAML_LDLIBS)
. if ${OCAML_LDLIBS:[#]} > 1
. for _l in ${OCAML_LDLIBS}
@@ -68,13 +324,13 @@ DUNE_ENV+= DUNE_FREEBSD_STUBLIBS_RELATIVE_TO_LIBDIR=${OCAML_PACKAGES:[1]}
. endif
. endif
-# left empty for default @install target
-ALL_TARGET?=
+. if defined(_USE_OCAML_DUNE)
MAKE_ENV+= ${DUNE_ENV}
DO_MAKE_BUILD?= ${SETENVI} ${WRK_ENV} ${MAKE_ENV} ${DUNE_CMD} build ${DUNE_ARGS} ${DUNE_BUILD_ARGS}
+. endif
-. if !target(do-install) && !defined(NO_INSTALL)
+. if !target(do-install) && !defined(NO_INSTALL) && defined(_USE_OCAML_DUNE)
do-install:
@(cd ${INSTALL_WRKSRC} && ${SETENV} ${WRK_ENV} ${MAKE_ENV} ${FAKEROOT} ${DUNE_CMD} install ${DUNE_ARGS} ${DUNE_INSTALL_ARGS} ${DUNE_INSTALL_TARGETS})
. endif
diff --git a/Mk/bsd.ocaml.mk b/Mk/bsd.ocaml.mk
deleted file mode 100644
index 1dc29209e785..000000000000
--- a/Mk/bsd.ocaml.mk
+++ /dev/null
@@ -1,198 +0,0 @@
-# ex:ts=4
-#
-# $MBSDlabs: portmk/bsd.ocaml.mk,v 1.18 2006/08/06 18:47:23 stas Exp $
-#
-# bsd.ocaml.mk - Support for the Objective Caml language packages
-#
-# Author: Stanislav Sedov <ssedov@mbsd.msk.ru>
-#
-# Feel free to send any comments and suggestions to maintainer.
-#
-# Currently recognised variables are:
-#
-# USE_OCAML - Set if your port uses OCaml to build/install.
-# NO_OCAML_BUILDDEPENDS - Don't add ocamlc to BUILD|EXTRACT|PATCH_DEPENDS.
-# NO_OCAML_RUNDEPENDS - Don't add ocamlc to RUN_DEPENDS.
-# USE_OCAML_FINDLIB - Set if your port uses ocamlfind to install
-# packages. Package direcories will be
-# automatically deleted.
-# USE_OCAML_CAMLP4 - Set if your port uses camlp4 to build.
-# USE_OCAML_TK - Set if you port needs ocaml-labltk.
-# NO_OCAMLTK_BUILDDEPENDS - Don't add labltk to BUILD|EXTRACT|PATCH_DEPENDS.
-# NO_OCAMLTK_RUNDEPENDS - Don't add labltk to RUN_DEPENDS.
-# USE_OCAML_LDCONFIG - Set if your port installs shared libraries
-# into ocaml site-lib dir. OCaml ld.conf file
-# will be automatically processed.
-# USE_OCAMLFIND_PLIST - Add contents of findlib target directories
-# automatically.
-# USE_OCAML_WASH - Set if your port wants to automatically
-# purge shared Ocaml dirs on uninstall. It's
-# useful when installing to non-standard PREFIX
-# OCAML_PKGDIRS - Directories under site-lib to be processed
-# if USE_OCAML_FINDLIB specified.
-# Default: ${PORTNAME}
-# OCAML_LDLIBS - Directories under PREFIX to be automatically
-# added/removed from ld.conf
-# Default: ${OCAML_SITELIBDIR}/${PORTNAME}
-
-.if !defined(OCAML_include)
-
-OCAML_MAINTAINER= ports@FreeBSD.org
-OCAML_include= bsd.ocaml.mk
-
-#
-# OCaml programs location
-#
-OCAMLC?= ${LOCALBASE}/bin/ocamlc
-OCAMLC_OPT?= ${LOCALBASE}/bin/ocamlc.opt
-OCAMLCP?= ${LOCALBASE}/bin/ocamlcp
-OCAMLFIND?= ${LOCALBASE}/bin/ocamlfind
-CAMLP4?= ${LOCALBASE}/bin/camlp4
-OCAMLTK?= ${LOCALBASE}/bin/labltk
-
-#
-# OCaml library directory
-#
-OCAML_LIBDIR?= lib/ocaml
-
-#
-# Where to install site libraries
-#
-OCAML_SITELIBDIR?= ${OCAML_LIBDIR}/site-lib
-
-#
-# OCaml compiler port dependency
-#
-OCAMLC_PORT?= lang/ocaml
-OCAMLC_DEPEND?= ${OCAMLC}:${OCAMLC_PORT}
-
-#
-# OCaml package manager port dependency
-#
-OCAMLFIND_PORT?= devel/ocaml-findlib
-OCAMLFIND_DEPEND?= ${OCAMLFIND}:${OCAMLFIND_PORT}
-
-#
-# OCaml camlp4 port dependency
-#
-CAMLP4_PORT?= devel/ocaml-camlp4
-CAMLP4_DEPEND?= ${CAMLP4}:${CAMLP4_PORT}
-
-#
-# OCaml TK bindings dependency
-#
-OCAMLTK_PORT?= x11-toolkits/ocaml-labltk
-OCAMLTK_DEPENDS?= ${OCAMLTK}:${OCAMLTK_PORT}
-
-#
-# Common OCaml examples and documents location
-#
-OCAML_DOCSDIR= ${PREFIX}/share/doc/ocaml
-OCAML_EXAMPLESDIR= ${PREFIX}/share/examples/ocaml
-
-#
-# Location of OCaml ld.conf file
-#
-OCAML_LDCONF?= ${OCAML_LIBDIR}/ld.conf
-
-# ocaml-findlib-1.4.1_1 wants to edit our ld.conf file, which does not
-# work well with staging.
-. if defined(USE_OCAML_LDCONFIG)
-. if !target(ocaml-ldconfig)
-OCAMLFIND_LDCONF?= /dev/null
-. endif
-. endif
-
-OCAMLFIND_DESTDIR?= ${PREFIX}/${OCAML_SITELIBDIR}
-OCAMLFIND_LDCONF?= ${PREFIX}/${OCAML_LDCONF}
-
-. if defined(USE_OCAML)
-. if !defined(NO_OCAML_BUILDDEPENDS)
-EXTRACT_DEPENDS+= ${OCAMLC_DEPEND}
-PATCH_DEPENDS+= ${OCAMLC_DEPEND}
-BUILD_DEPENDS+= ${OCAMLC_DEPEND}
-. endif
-. if !defined(NO_OCAML_RUNDEPENDS)
-RUN_DEPENDS+= ${OCAMLC_DEPEND}
-. endif
-PLIST_SUB+= OCAML_SITELIBDIR="${OCAML_SITELIBDIR}"
-. endif
-
-. if defined(USE_OCAML_FINDLIB)
-#
-# We'll additionally add ocamlfind to RUN_DEPENDS, since
-# if the port requires ocamlfind to install - it requires
-# some ocaml libraries and these libraries RUN_DEPENDS on
-# ocamlfind
-#
-BUILD_DEPENDS+= ${OCAMLFIND_DEPEND}
-RUN_DEPENDS+= ${OCAMLFIND_DEPEND}
-MAKE_ENV+= OCAMLFIND_DESTDIR="${STAGEDIR}${OCAMLFIND_DESTDIR}" \
- OCAMLFIND_LDCONF="${OCAMLFIND_LDCONF}"
-
-#
-# Directories under site-lib to process automatically
-#
-OCAML_PKGDIRS?= ${PORTNAME}
-_USES_install+= 735:ocaml-findlib
-. if !target(ocaml-findlib)
-ocaml-findlib:
-. for DIR in ${OCAML_PKGDIRS}
-. if defined(USE_OCAMLFIND_PLIST)
- @${FIND} ${STAGEDIR}${PREFIX}/${OCAML_SITELIBDIR}/${DIR}/ -type f -print | ${SED} -e \
- 's,^${STAGEDIR}${PREFIX}/,,' >> ${TMPPLIST}
-. endif
- @${ECHO_CMD} "@postunexec ${OCAMLFIND} remove ${DIR} 2>/dev/null" \
- >> ${TMPPLIST}
-. endfor
-. endif
-. endif
-
-. if defined(USE_OCAML_CAMLP4)
-BUILD_DEPENDS+= ${CAMLP4_DEPEND}
-. endif
-
-. if defined(USE_OCAML_TK)
-. if !defined(NO_OCAMLTK_BUILDDEPENDS)
-EXTRACT_DEPENDS+= ${OCAMLTK_DEPENDS}
-PATCH_DEPENDS+= ${OCAMLTK_DEPENDS}
-BUILD_DEPENDS+= ${OCAMLTK_DEPENDS}
-. endif
-. if !defined(NO_OCAMLTK_RUNDEPENDS)
-RUN_DEPENDS+= ${OCAMLTK_DEPENDS}
-. endif
-. endif
-
-. if defined(USE_OCAML_LDCONFIG)
-#
-# Directories under PREFIX for appending to ld.conf
-#
-OCAML_LDLIBS?= ${OCAML_SITELIBDIR}/${PORTNAME}
-_USES_install+= 740:ocaml-ldconfig
-. if !target(ocaml-ldconfig)
-ocaml-ldconfig:
-. for LIB in ${OCAML_LDLIBS}
- @${ECHO_CMD} "@postexec ${ECHO_CMD} "%D/${LIB}" >> %D/${OCAML_LDCONF}" \
- >> ${TMPPLIST}
- @${ECHO_CMD} "@postunexec ${SED} -i \"\" -e '/${LIB:S#/#\/#g}/d' %D/${OCAML_LDCONF}" >> ${TMPPLIST}
-. endfor
-. endif
-. endif
-
-. if defined(USE_OCAML_WASH)
-PLIST_FILES+= "@rmempty ${OCAML_LDCONF}"
-. endif
-
-.endif #!defined(OCAML_include)
-
-.if defined(_POSTMKINCLUDED)
-
-. if defined(USE_OCAML_FINDLIB)
-
-pre-install: ${STAGEDIR}${OCAMLFIND_DESTDIR}
-${STAGEDIR}${OCAMLFIND_DESTDIR}:
- @${MKDIR} ${.TARGET}
-
-. endif
-
-.endif # _POSTMKINCLUDED
diff --git a/Mk/bsd.port.mk b/Mk/bsd.port.mk
index f5d56e8017a1..bbc0fe68ff19 100644
--- a/Mk/bsd.port.mk
+++ b/Mk/bsd.port.mk
@@ -360,9 +360,6 @@ FreeBSD_MAINTAINER= portmgr@FreeBSD.org
# USE_JAVA - If set, this port relies on the Java language.
# Implies inclusion of bsd.java.mk. (Also see
# that file for more information on USE_JAVA_*).
-# USE_OCAML - If set, this port relies on the OCaml language.
-# Implies inclusion of bsd.ocaml.mk. (Also see
-# that file for more information on USE_OCAML*).
##
# USE_GECKO - If set, this port uses the Gecko/Mozilla product.
# See bsd.gecko.mk for more details.
@@ -1409,10 +1406,6 @@ PKGCOMPATDIR?= ${LOCALBASE}/lib/compat/pkg
.include "${PORTSDIR}/Mk/bsd.java.mk"
. endif
-. if defined(USE_OCAML)
-.include "${PORTSDIR}/Mk/bsd.ocaml.mk"
-. endif
-
. if defined(USE_APACHE_BUILD)
USES+= apache:build,${USE_APACHE_BUILD:C/2([0-9])/2.\1/g}
. elif defined(USE_APACHE_RUN)
@@ -1936,10 +1929,6 @@ PKGPOSTDEINSTALL?= ${PKGDIR}/pkg-post-deinstall
.include "${PORTSDIR}/Mk/bsd.java.mk"
. endif
-. if defined(USE_OCAML)
-.include "${PORTSDIR}/Mk/bsd.ocaml.mk"
-. endif
-
. if defined(USE_WX) || defined(USE_WX_NOT)
.include "${PORTSDIR}/Mk/bsd.wx.mk"
. endif
diff --git a/Mk/bsd.sanity.mk b/Mk/bsd.sanity.mk
index 557b72a30509..f8bad3132290 100644
--- a/Mk/bsd.sanity.mk
+++ b/Mk/bsd.sanity.mk
@@ -210,7 +210,10 @@ SANITY_UNSUPPORTED= USE_OPENAL USE_FAM USE_MAKESELF USE_ZIP USE_LHA USE_CMAKE \
XORG_CAT CARGO_USE_GITHUB CARGO_USE_GITLAB CARGO_GIT_SUBDIR \
USE_RUBY USE_RUBY_EXTCONF USE_RUBY_SETUP RUBY_NO_BUILD_DEPENDS \
RUBY_NO_RUN_DEPENDS USE_APACHE USE_APACHE_BUILD USE_APACHE_RUN \
- USE_OPENLDAP WANT_OPENLDAP_VER
+ USE_OPENLDAP WANT_OPENLDAP_VER USE_OCAML USE_OCAML_CAMLP4 USE_OCAML_WASH \
+ USE_OCAML_TK NO_OCAMLTK_BUILDDEPENDS NO_OCAMLTK_RUNDEPENDS \
+ USE_OCAMLFIND_PLIST USE_OCAML_FINDLIB USE_OCAML_LDCONFIG \
+ NO_OCAML_BUILDDEPENDS NO_OCAML_RUNDEPENDS
SANITY_DEPRECATED= MLINKS \
USE_MYSQL WANT_MYSQL_VER \
PYDISTUTILS_INSTALLNOSINGLE
@@ -307,6 +310,17 @@ USE_RUBY_EXTCONF_ALT= USES=ruby:extconf
USE_RUBY_SETUP_ALT= USES=ruby:setup
RUBY_NO_BUILD_DEPENDS_ALT= USES=ruby:run
RUBY_NO_RUN_DEPENDS_ALT= USES=ruby:build
+USE_OCAMLFIND_PLIST_ALT= USES=ocaml:findplist
+USE_OCAML_ALT= USES=ocaml
+USE_OCAML_CAMLP4_ALT= USES=ocaml:camlp4
+USE_OCAML_FINDLIB_ALT= USES=ocaml:findlib
+USE_OCAML_LDCONFIG_ALT= USES=ocaml:ldconfig
+USE_OCAML_TK_ALT= USES=ocaml:tk
+USE_OCAML_WASH_ALT= USES=ocaml:wash
+NO_OCAMLTK_BUILDDEPENDS_ALT= USES=ocaml:tkrun
+NO_OCAMLTK_RUNDEPENDS_ALT= USES=ocaml:tkbuild
+NO_OCAML_BUILDDEPENDS_ALT= USES=ocaml:run
+NO_OCAML_RUNDEPENDS_ALT= USES=ocaml:build
.for a in ${SANITY_DEPRECATED}
. if defined(${a})
diff --git a/archivers/ocaml-bz2/Makefile b/archivers/ocaml-bz2/Makefile
index 02bbbf0630e0..aeb79dfde263 100644
--- a/archivers/ocaml-bz2/Makefile
+++ b/archivers/ocaml-bz2/Makefile
@@ -10,12 +10,10 @@ WWW= https://gitlab.com/irill/camlbz2
LICENSE= LGPL21 LGPL3
LICENSE_COMB= dual
-USES= ocaml:dune
+USES= ocaml:dune,ldconfig
USE_GITLAB= yes
GL_ACCOUNT= irill
GL_PROJECT= camlbz2
-USE_OCAML= yes
-USE_OCAML_LDCONFIG= yes
DOCSDIR= ${OCAML_DOCSDIR}/${PORTNAME}
EXAMPLESDIR= ${OCAML_EXAMPLESDIR}/${PORTNAME}
diff --git a/archivers/ocaml-zip/Makefile b/archivers/ocaml-zip/Makefile
index bbeb8a4736db..d57542721d11 100644
--- a/archivers/ocaml-zip/Makefile
+++ b/archivers/ocaml-zip/Makefile
@@ -12,17 +12,12 @@ WWW= https://github.com/xavierleroy/camlzip
LICENSE= LGPL21
LICENSE_FILE= ${WRKSRC}/LICENSE
-USES= gmake
+USES= gmake ocaml:findlib,ldconfig,wash
USE_GITHUB= yes
GH_ACCOUNT= xavierleroy
GH_PROJECT= camlzip
GH_TAGNAME= rel${PORTVERSION:S/.//}
-USE_OCAML= yes
-USE_OCAML_FINDLIB=yes
-USE_OCAML_LDCONFIG=yes
-USE_OCAML_WASH= yes
-
post-install:
${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/ocaml/site-lib/zip/zip.cmxs \
${STAGEDIR}${PREFIX}/lib/ocaml/site-lib/zip/dllcamlzip.so
diff --git a/converters/ocaml-base64/Makefile b/converters/ocaml-base64/Makefile
index 34bf203264af..cb594d457f56 100644
--- a/converters/ocaml-base64/Makefile
+++ b/converters/ocaml-base64/Makefile
@@ -23,7 +23,6 @@ USES= ocaml:dune
USE_GITHUB= yes
GH_ACCOUNT= mirage
GH_PROJECT= ocaml-base64
-USE_OCAML= yes
DOCSDIR= ${OCAML_DOCSDIR}/${PORTNAME}
PORTDOCS= CHANGES.md LICENSE.md README.md
@@ -43,7 +42,7 @@ post-install:
base64/base64.cmxs \
base64/rfc2045/base64_rfc2045.cmxs)
# this port never shipped stublibs
- # cleanup from older port's wrong USE_OCAML_LDCONFIG
+ # cleanup from older port's wrong USES=ocaml:ldconfig
@${ECHO_CMD} @postexec ${SED} -i "''" -e \
"'/^${PREFIX:S#/#\/#g}\/${OCAML_SITELIBDIR:S#/#\/#g}\/base64$$/d'" \
%D/${OCAML_LDCONF} >> ${TMPPLIST}
diff --git a/converters/ocaml-jsonm/Makefile b/converters/ocaml-jsonm/Makefile
index 90c7c549c7bb..5bf521d54a39 100644
--- a/converters/ocaml-jsonm/Makefile
+++ b/converters/ocaml-jsonm/Makefile
@@ -18,8 +18,7 @@ BUILD_DEPENDS= ocamlbuild:devel/ocaml-ocamlbuild \
${SA_DIR}/uutf/META:devel/ocaml-uutf
RUN_DEPENDS= ${SA_DIR}/uutf/META:devel/ocaml-uutf
-USES= tar:tbz
-USE_OCAML= yes
+USES= ocaml tar:tbz
SA_DIR= ${LOCALBASE}/${OCAML_SITELIBDIR}
OPTIONS_DEFINE= DOCS
diff --git a/databases/ocaml-dbm/Makefile b/databases/ocaml-dbm/Makefile
index ba9edf623e9b..09a0c2f39c45 100644
--- a/databases/ocaml-dbm/Makefile
+++ b/databases/ocaml-dbm/Makefile
@@ -12,10 +12,9 @@ WWW= https://github.com/ocaml/dbm
LICENSE= LGPL20 # with a special exception to clause 6
+USES= ocaml:ldconfig
USE_GITHUB= yes
-USE_OCAML= yes
GH_ACCOUNT= ocaml
-USE_OCAML_LDCONFIG= yes
DOCSDIR= ${OCAML_DOCSDIR}/${PORTNAME}
HAS_CONFIGURE= yes
diff --git a/databases/ocaml-mysql/Makefile b/databases/ocaml-mysql/Makefile
index 8767d52e7b20..96fa62a8c41d 100644
--- a/databases/ocaml-mysql/Makefile
+++ b/databases/ocaml-mysql/Makefile
@@ -12,13 +12,8 @@ WWW= http://ygrek.org.ua/p/ocaml-mysql/
LICENSE= LGPL21
-USES= gmake mysql
+USES= gmake ocaml:camlp4,findplist,ldconfig mysql
IGNORE_WITH_MYSQL= 80 81
-USE_OCAML= yes
-USE_OCAML_FINDLIB= yes
-USE_OCAML_CAMLP4= yes
-USE_OCAMLFIND_PLIST= yes
-USE_OCAML_LDCONFIG= yes
GNU_CONFIGURE= yes
diff --git a/databases/ocaml-sqlite3/Makefile b/databases/ocaml-sqlite3/Makefile
index 9ecf9a118310..194777bd2a25 100644
--- a/databases/ocaml-sqlite3/Makefile
+++ b/databases/ocaml-sqlite3/Makefile
@@ -14,14 +14,11 @@ LICENSE_PERMS= dist-mirror dist-sell pkg-mirror pkg-sell auto-accept
BUILD_DEPENDS= ocamlbuild:devel/ocaml-ocamlbuild
-USES= ocaml:dune pkgconfig sqlite
+USES= ocaml:dune,ldconfig pkgconfig sqlite
USE_GITHUB= yes
GH_ACCOUNT= mmottl
GH_PROJECT= ${PORTNAME}-ocaml
-USE_OCAML= yes
-USE_OCAML_LDCONFIG= yes
-
DOCSDIR= ${OCAML_DOCSDIR}/${PORTNAME}
PORTDOCS= CHANGES.md LICENSE.md README.md
*** 1866 LINES SKIPPED ***