aboutsummaryrefslogtreecommitdiff
path: root/devel/py-cgen
diff options
context:
space:
mode:
Diffstat (limited to 'devel/py-cgen')
-rw-r--r--devel/py-cgen/Makefile27
-rw-r--r--devel/py-cgen/distinfo3
-rw-r--r--devel/py-cgen/pkg-descr10
3 files changed, 40 insertions, 0 deletions
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.