aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuri Victorovich <yuri@FreeBSD.org>2024-07-21 07:05:23 +0000
committerYuri Victorovich <yuri@FreeBSD.org>2024-07-21 08:49:13 +0000
commit8ba5333df123e9b774e77aafaced6a7f09fa20c0 (patch)
tree245e20ccd32e007c6611551984112c49d3d1838d
parent8b40ea6aed378f9bd14c135ff1ebcfa4bed37901 (diff)
misc/py-natten: New port: Neighborhood Attention Extension
-rw-r--r--misc/Makefile1
-rw-r--r--misc/py-natten/Makefile35
-rw-r--r--misc/py-natten/distinfo3
-rw-r--r--misc/py-natten/pkg-descr2
4 files changed, 41 insertions, 0 deletions
diff --git a/misc/Makefile b/misc/Makefile
index 50c996620935..b926b4a3282d 100644
--- a/misc/Makefile
+++ b/misc/Makefile
@@ -454,6 +454,7 @@
SUBDIR += py-mmsegmentation
SUBDIR += py-molequeue
SUBDIR += py-mxnet
+ SUBDIR += py-natten
SUBDIR += py-npTDMS
SUBDIR += py-numcodecs
SUBDIR += py-onnx
diff --git a/misc/py-natten/Makefile b/misc/py-natten/Makefile
new file mode 100644
index 000000000000..7204fcc70488
--- /dev/null
+++ b/misc/py-natten/Makefile
@@ -0,0 +1,35 @@
+PORTNAME= natten
+DISTVERSION= 0.17.1
+CATEGORIES= misc python
+MASTER_SITES= PYPI
+PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
+
+MAINTAINER= yuri@FreeBSD.org
+COMMENT= Neighborhood Attention Extension
+WWW= https://shi-labs.com/natten/
+
+LICENSE= MIT
+LICENSE_FILE= ${WRKSRC}/LICENSE
+
+BUILD_DEPENDS= cmake:devel/cmake-core \
+ pybind11>0:devel/pybind11 \
+ ${PYTHON_PKGNAMEPREFIX}pytorch>=2.0.0:misc/py-pytorch@${PY_FLAVOR}
+LIB_DEPENDS= libabsl_str_format_internal.so:devel/abseil \
+ libprotobuf.so:devel/protobuf
+RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}packaging>=0:devel/py-packaging@${PY_FLAVOR} \
+ ${PYTHON_PKGNAMEPREFIX}pytorch>=2.0.0:misc/py-pytorch@${PY_FLAVOR}
+
+USES= python
+USE_PYTHON= distutils autoplist
+
+post-install:
+ # strip binary
+ @${STRIP_CMD} ${STAGEDIR}${PYTHON_SITELIBDIR}/natten/libnatten${PYTHON_EXT_SUFFIX}.so
+ # delete stray files, see https://github.com/SHI-Labs/NATTEN/issues/152
+ @${RM} -r \
+ ${STAGEDIR}${PYTHON_SITELIBDIR}/CMakeFiles \
+ ${STAGEDIR}${PYTHON_SITELIBDIR}/CMakeCache.txt \
+ ${STAGEDIR}${PYTHON_SITELIBDIR}/cmake_install.cmake \
+ ${STAGEDIR}${PYTHON_SITELIBDIR}/Makefile
+
+.include <bsd.port.mk>
diff --git a/misc/py-natten/distinfo b/misc/py-natten/distinfo
new file mode 100644
index 000000000000..55316d7ac669
--- /dev/null
+++ b/misc/py-natten/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1721530370
+SHA256 (natten-0.17.1.tar.gz) = a2142722faa41fa3ae6d22e91ed527b2a6da5c4fe09a006f36d68edccaf9c643
+SIZE (natten-0.17.1.tar.gz) = 10848470
diff --git a/misc/py-natten/pkg-descr b/misc/py-natten/pkg-descr
new file mode 100644
index 000000000000..f23cf2ed757a
--- /dev/null
+++ b/misc/py-natten/pkg-descr
@@ -0,0 +1,2 @@
+NATTEN is an open-source project dedicated to providing fast implementations
+for Neighborhood Attention, a sliding window self-attention mechanism.