git: a88290ec739d - main - devel/ocaml-ppx_optcomp: New port

From: Muhammad Moinur Rahman <bofh_at_FreeBSD.org>
Date: Sun, 28 Jun 2026 22:09:23 UTC
The branch main has been updated by bofh:

URL: https://cgit.FreeBSD.org/ports/commit/?id=a88290ec739d1bb93a2b2d9bbff610c8e2adc12f

commit a88290ec739d1bb93a2b2d9bbff610c8e2adc12f
Author:     Benjamin Jacobs <freebsd@dev.thsi.be>
AuthorDate: 2026-06-28 19:09:43 +0000
Commit:     Muhammad Moinur Rahman <bofh@FreeBSD.org>
CommitDate: 2026-06-28 22:08:52 +0000

    devel/ocaml-ppx_optcomp: New port
    
    Ppx_optcomp is an PPX OCaml syntax extention to introduce conditional
    compilation in OCaml sources. It includes a simple expression language
    to evaluate condition predicates.
    
    WWW: https://github.com/janestreet/ppx_optcomp
---
 devel/Makefile                    |  1 +
 devel/ocaml-ppx_optcomp/Makefile  | 43 +++++++++++++++++++++++++++++++++++++++
 devel/ocaml-ppx_optcomp/distinfo  |  3 +++
 devel/ocaml-ppx_optcomp/pkg-descr |  3 +++
 devel/ocaml-ppx_optcomp/pkg-plist | 27 ++++++++++++++++++++++++
 5 files changed, 77 insertions(+)

diff --git a/devel/Makefile b/devel/Makefile
index 6f9d51e8623c..6e2363f9a586 100644
--- a/devel/Makefile
+++ b/devel/Makefile
@@ -1823,6 +1823,7 @@
     SUBDIR += ocaml-ppx_deriving
     SUBDIR += ocaml-ppx_hash
     SUBDIR += ocaml-ppx_js_style
+    SUBDIR += ocaml-ppx_optcomp
     SUBDIR += ocaml-ppx_sexp_conv
     SUBDIR += ocaml-ppx_yojson_conv
     SUBDIR += ocaml-ppx_yojson_conv_lib
diff --git a/devel/ocaml-ppx_optcomp/Makefile b/devel/ocaml-ppx_optcomp/Makefile
new file mode 100644
index 000000000000..aae34032b8c7
--- /dev/null
+++ b/devel/ocaml-ppx_optcomp/Makefile
@@ -0,0 +1,43 @@
+PORTNAME=	ppx_optcomp
+DISTVERSIONPREFIX=	v
+DISTVERSION=	0.16.0
+CATEGORIES=	devel
+PKGNAMEPREFIX=	ocaml-
+
+MAINTAINER=	freebsd@dev.thsi.be
+COMMENT=	OCaml syntax extension for optional compilation
+WWW=		https://github.com/janestreet/ppx_optcomp
+
+LICENSE=	MIT
+LICENSE_FILE=	${WRKSRC}/LICENSE.md
+
+BUILD_DEPENDS=	${SA_DIR}/base/META:devel/ocaml-base \
+		${SA_DIR}/ppxlib/META:devel/ocaml-ppxlib \
+		${SA_DIR}/stdio/META:devel/ocaml-stdio
+RUN_DEPENDS=	${SA_DIR}/base/META:devel/ocaml-base \
+		${SA_DIR}/ppxlib/META:devel/ocaml-ppxlib \
+		${SA_DIR}/stdio/META:devel/ocaml-stdio
+
+USES=		ocaml:dune
+USE_GITHUB=	yes
+GH_ACCOUNT=	janestreet
+
+OPTIONS_DEFINE=	DOCS
+
+DOCSDIR=	${OCAML_DOCSDIR}/${PORTNAME}
+PORTDOCS=	CHANGES.md LICENSE.md README.md
+
+OPTIONS_DEFINE=	DOCS
+
+SA_DIR=		${LOCALBASE}/${OCAML_SITELIBDIR}
+
+post-patch:
+	@${REINPLACE_CMD} \
+		-e "s/(version v.*)/(version ${DISTVERSION})/" \
+		${WRKSRC}/dune-project
+
+post-install:
+	${STRIP_CMD} \
+		${STAGEDIR}${PREFIX}/${OCAML_SITELIBDIR}/ppx_optcomp/ppx_optcomp.cmxs
+
+.include <bsd.port.mk>
diff --git a/devel/ocaml-ppx_optcomp/distinfo b/devel/ocaml-ppx_optcomp/distinfo
new file mode 100644
index 000000000000..50ec756225a8
--- /dev/null
+++ b/devel/ocaml-ppx_optcomp/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1710626966
+SHA256 (janestreet-ppx_optcomp-v0.16.0_GH0.tar.gz) = 22782ce22423612eecf9bc49d36ba51dd32416feed7b28e81364fb27211aff02
+SIZE (janestreet-ppx_optcomp-v0.16.0_GH0.tar.gz) = 16789
diff --git a/devel/ocaml-ppx_optcomp/pkg-descr b/devel/ocaml-ppx_optcomp/pkg-descr
new file mode 100644
index 000000000000..49bab0d54289
--- /dev/null
+++ b/devel/ocaml-ppx_optcomp/pkg-descr
@@ -0,0 +1,3 @@
+Ppx_optcomp is an PPX OCaml syntax extention to introduce conditional
+compilation in OCaml sources. It includes a simple expression language
+to evaluate condition predicates.
diff --git a/devel/ocaml-ppx_optcomp/pkg-plist b/devel/ocaml-ppx_optcomp/pkg-plist
new file mode 100644
index 000000000000..f72f5df070ba
--- /dev/null
+++ b/devel/ocaml-ppx_optcomp/pkg-plist
@@ -0,0 +1,27 @@
+%%OCAML_SITELIBDIR%%/ppx_optcomp/META
+%%OCAML_SITELIBDIR%%/ppx_optcomp/cparser.ml
+%%OCAML_SITELIBDIR%%/ppx_optcomp/dune-package
+%%OCAML_SITELIBDIR%%/ppx_optcomp/interpreter.ml
+%%OCAML_SITELIBDIR%%/ppx_optcomp/opam
+%%OCAML_SITELIBDIR%%/ppx_optcomp/ppx_optcomp.a
+%%OCAML_SITELIBDIR%%/ppx_optcomp/ppx_optcomp.cma
+%%OCAML_SITELIBDIR%%/ppx_optcomp/ppx_optcomp.cmi
+%%OCAML_SITELIBDIR%%/ppx_optcomp/ppx_optcomp.cmt
+%%OCAML_SITELIBDIR%%/ppx_optcomp/ppx_optcomp.cmx
+%%OCAML_SITELIBDIR%%/ppx_optcomp/ppx_optcomp.cmxa
+%%OCAML_SITELIBDIR%%/ppx_optcomp/ppx_optcomp.cmxs
+%%OCAML_SITELIBDIR%%/ppx_optcomp/ppx_optcomp.ml
+%%OCAML_SITELIBDIR%%/ppx_optcomp/ppx_optcomp__.cmi
+%%OCAML_SITELIBDIR%%/ppx_optcomp/ppx_optcomp__.cmt
+%%OCAML_SITELIBDIR%%/ppx_optcomp/ppx_optcomp__.cmx
+%%OCAML_SITELIBDIR%%/ppx_optcomp/ppx_optcomp__.ml
+%%OCAML_SITELIBDIR%%/ppx_optcomp/ppx_optcomp__Cparser.cmi
+%%OCAML_SITELIBDIR%%/ppx_optcomp/ppx_optcomp__Cparser.cmt
+%%OCAML_SITELIBDIR%%/ppx_optcomp/ppx_optcomp__Cparser.cmx
+%%OCAML_SITELIBDIR%%/ppx_optcomp/ppx_optcomp__Interpreter.cmi
+%%OCAML_SITELIBDIR%%/ppx_optcomp/ppx_optcomp__Interpreter.cmt
+%%OCAML_SITELIBDIR%%/ppx_optcomp/ppx_optcomp__Interpreter.cmx
+%%OCAML_SITELIBDIR%%/ppx_optcomp/ppx_optcomp__Token.cmi
+%%OCAML_SITELIBDIR%%/ppx_optcomp/ppx_optcomp__Token.cmt
+%%OCAML_SITELIBDIR%%/ppx_optcomp/ppx_optcomp__Token.cmx
+%%OCAML_SITELIBDIR%%/ppx_optcomp/token.ml