Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 3 Oct 2025 09:27:39 GMT
From:      Yuri Victorovich <yuri@FreeBSD.org>
To:        ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org
Subject:   git: b9f9e89cce1c - main - devel/py-cgen: New port: C/C++ source generation from an AST
Message-ID:  <202510030927.5939RdEB017254@gitrepo.freebsd.org>

index | next in thread | raw e-mail

The branch main has been updated by yuri:

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

commit b9f9e89cce1ca9886e8d9faeb7c5d15ee39b7ee4
Author:     Yuri Victorovich <yuri@FreeBSD.org>
AuthorDate: 2025-10-03 06:43:45 +0000
Commit:     Yuri Victorovich <yuri@FreeBSD.org>
CommitDate: 2025-10-03 09:27:32 +0000

    devel/py-cgen: New port: C/C++ source generation from an AST
---
 devel/Makefile          |  1 +
 devel/py-cgen/Makefile  | 27 +++++++++++++++++++++++++++
 devel/py-cgen/distinfo  |  3 +++
 devel/py-cgen/pkg-descr | 10 ++++++++++
 4 files changed, 41 insertions(+)

diff --git a/devel/Makefile b/devel/Makefile
index 154d5c7e7fa9..3594aabda146 100644
--- a/devel/Makefile
+++ b/devel/Makefile
@@ -4646,6 +4646,7 @@
     SUBDIR += py-cfgv
     SUBDIR += py-cfn-lint
     SUBDIR += py-cftime
+    SUBDIR += py-cgen
     SUBDIR += py-chai
     SUBDIR += py-chainmap
     SUBDIR += py-characteristic
diff --git a/devel/py-cgen/Makefile b/devel/py-cgen/Makefile
new file mode 100644
index 000000000000..9c194c2749a5
--- /dev/null
+++ b/devel/py-cgen/Makefile
@@ -0,0 +1,27 @@
+PORTNAME=	cgen
+DISTVERSION=	2025.1
+CATEGORIES=	devel python
+MASTER_SITES=	PYPI
+PKGNAMEPREFIX=	${PYTHON_PKGNAMEPREFIX}
+
+MAINTAINER=	yuri@FreeBSD.org
+COMMENT=	C/C++ source generation from an AST
+WWW=		https://github.com/inducer/cgen
+
+LICENSE=	MIT
+LICENSE_FILE=	${WRKSRC}/LICENSE
+
+BUILD_DEPENDS=	${PYTHON_PKGNAMEPREFIX}hatchling>0:devel/py-hatchling@${PY_FLAVOR}
+RUN_DEPENDS=	${PYTHON_PKGNAMEPREFIX}numpy>=1.6,1:math/py-numpy@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}pytools>=2022.1.14:devel/py-pytools@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}typing-extensions>=4.5:devel/py-typing-extensions@${PY_FLAVOR}
+TEST_DEPENDS=	${PYTHON_PKGNAMEPREFIX}ruff>0:devel/py-ruff@${PY_FLAVOR}
+
+USES=		python
+USE_PYTHON=	pep517 autoplist concurrent pytest
+
+NO_ARCH=	yes
+
+# tests as of 2025.1: 1 passed in 2.02s
+
+.include <bsd.port.mk>
diff --git a/devel/py-cgen/distinfo b/devel/py-cgen/distinfo
new file mode 100644
index 000000000000..1150810e9a33
--- /dev/null
+++ b/devel/py-cgen/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1734976997
+SHA256 (cgen-2025.1.tar.gz) = 79f01e010d49c13e58b4ca8f2d4996a6b7178968f5f2d906262733480ae7a2d4
+SIZE (cgen-2025.1.tar.gz) = 19236
diff --git a/devel/py-cgen/pkg-descr b/devel/py-cgen/pkg-descr
new file mode 100644
index 000000000000..ea1150c484a5
--- /dev/null
+++ b/devel/py-cgen/pkg-descr
@@ -0,0 +1,10 @@
+cgen offers a simple abstract syntax tree for C and related languages
+(C++/CUDA/OpenCL) to allow structured code generation from Python.
+
+cgen can be used to generate C code programmatically, which is useful for:
+- Code generators
+- Domain-specific language compilers
+- High-performance computing applications
+- GPU kernel generation (CUDA/OpenCL)
+
+To represent mathematical expressions, cgen can be used with pymbolic.


home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202510030927.5939RdEB017254>