git: 9e122cc43f5a - main - science/py-pnetcdf: Add py-pnetcdf 1.0.0

From: Po-Chuan Hsieh <sunpoet_at_FreeBSD.org>
Date: Tue, 28 Jan 2025 17:06:25 UTC
The branch main has been updated by sunpoet:

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

commit 9e122cc43f5abee5d6e3e34953ec3586ae75dea7
Author:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
AuthorDate: 2025-01-28 16:50:06 +0000
Commit:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
CommitDate: 2025-01-28 17:04:43 +0000

    science/py-pnetcdf: Add py-pnetcdf 1.0.0
    
    PnetCDF-Python is a Python interface to PnetCDF, a high-performance I/O library
    for accessing NetCDF files in parallel. It can provide MPI-based parallel python
    programs to achieve a scalable I/O performance.
---
 science/Makefile                              |  1 +
 science/py-pnetcdf/Makefile                   | 30 +++++++++++++++++++++++++++
 science/py-pnetcdf/distinfo                   |  3 +++
 science/py-pnetcdf/files/patch-pyproject.toml | 11 ++++++++++
 science/py-pnetcdf/pkg-descr                  |  3 +++
 5 files changed, 48 insertions(+)

diff --git a/science/Makefile b/science/Makefile
index 80f95512340d..7c4802f84815 100644
--- a/science/Makefile
+++ b/science/Makefile
@@ -394,6 +394,7 @@
     SUBDIR += py-periodictable
     SUBDIR += py-phono3py
     SUBDIR += py-phonopy
+    SUBDIR += py-pnetcdf
     SUBDIR += py-pupynere
     SUBDIR += py-py3Dmol
     SUBDIR += py-pyaixi
diff --git a/science/py-pnetcdf/Makefile b/science/py-pnetcdf/Makefile
new file mode 100644
index 000000000000..3bede6cc5d26
--- /dev/null
+++ b/science/py-pnetcdf/Makefile
@@ -0,0 +1,30 @@
+PORTNAME=	pnetcdf
+PORTVERSION=	1.0.0
+CATEGORIES=	science python
+MASTER_SITES=	PYPI
+PKGNAMEPREFIX=	${PYTHON_PKGNAMEPREFIX}
+
+MAINTAINER=	sunpoet@FreeBSD.org
+COMMENT=	Object-oriented python interface to the PnetCDF library
+WWW=		https://github.com/Parallel-NetCDF/PnetCDF-Python
+
+LICENSE=	MIT
+
+BUILD_DEPENDS=	${PYTHON_PKGNAMEPREFIX}mpi4py-mpich>=3.1.4:net/py-mpi4py-mpich@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}numpy>=0,1:math/py-numpy@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}packaging>=23.1:devel/py-packaging@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}setuptools>=61:devel/py-setuptools@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}wheel>=0:devel/py-wheel@${PY_FLAVOR}
+LIB_DEPENDS=	libpnetcdf.so:science/pnetcdf@mpich
+RUN_DEPENDS=	${PYTHON_PKGNAMEPREFIX}mpi4py-mpich>=3.1.4:net/py-mpi4py-mpich@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}numpy>=0,1:math/py-numpy@${PY_FLAVOR}
+
+USES=		localbase mpi:mpich python
+USE_PYTHON=	autoplist concurrent cython cython_run pep517
+
+CFLAGS+=	-I${MPI_HOME}/include
+
+post-install:
+	${FIND} ${STAGEDIR}${PYTHON_SITELIBDIR} -name '*.so' -exec ${STRIP_CMD} {} +
+
+.include <bsd.port.mk>
diff --git a/science/py-pnetcdf/distinfo b/science/py-pnetcdf/distinfo
new file mode 100644
index 000000000000..5d81ea515129
--- /dev/null
+++ b/science/py-pnetcdf/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1736671165
+SHA256 (pnetcdf-1.0.0.tar.gz) = b2de14944e921a10072b7b51e7f4664c7aa175dd54c3d61f50bd88c902a673cb
+SIZE (pnetcdf-1.0.0.tar.gz) = 87294
diff --git a/science/py-pnetcdf/files/patch-pyproject.toml b/science/py-pnetcdf/files/patch-pyproject.toml
new file mode 100644
index 000000000000..34c8eb10ccbc
--- /dev/null
+++ b/science/py-pnetcdf/files/patch-pyproject.toml
@@ -0,0 +1,11 @@
+--- pyproject.toml.orig	2024-09-10 15:35:50 UTC
++++ pyproject.toml
+@@ -2,7 +2,7 @@ requires = [
+ requires = [
+     "Cython>=0.29",
+     "numpy",
+-    "setuptools>=65",
++    "setuptools>=61",
+     "mpi4py>=3.1.4",
+     "packaging>=23.1",
+     "wheel"
diff --git a/science/py-pnetcdf/pkg-descr b/science/py-pnetcdf/pkg-descr
new file mode 100644
index 000000000000..9c342b89aea7
--- /dev/null
+++ b/science/py-pnetcdf/pkg-descr
@@ -0,0 +1,3 @@
+PnetCDF-Python is a Python interface to PnetCDF, a high-performance I/O library
+for accessing NetCDF files in parallel. It can provide MPI-based parallel python
+programs to achieve a scalable I/O performance.