git: 739135b628ee - main - astro/py-fitsio: Add py-fitsio 1.2.4

From: Po-Chuan Hsieh <sunpoet_at_FreeBSD.org>
Date: Sun, 08 Sep 2024 18:41:59 UTC
The branch main has been updated by sunpoet:

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

commit 739135b628eef9a3e7ff1ed5223905467c316f12
Author:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
AuthorDate: 2024-09-08 17:47:22 +0000
Commit:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
CommitDate: 2024-09-08 18:36:53 +0000

    astro/py-fitsio: Add py-fitsio 1.2.4
    
    fitsio is a python extension written in c and python. Data are read into
    numerical python arrays.
    
    Some Features:
    - Read from and write to image, binary, and ascii table extensions.
    - Read arbitrary subsets of table columns and rows without loading all the data
      to memory.
    - Read image subsets without reading the whole image. Write subsets to existing
      images.
    - Write and read variable length table columns.
    - Read images and tables using slice notation similar to numpy arrays. This is
      like a more powerful memmap, since it is column-aware for tables.
    - Append rows to an existing table. Delete row sets and row ranges. Resize
      tables, or insert rows.
    - Query the columns and rows in a table.
    - Read and write header keywords.
    - Read and write images in tile-compressed format (RICE,GZIP,PLIO,HCOMPRESS).
    - Read/write gzip files directly. Read unix compress (.Z,.zip) and bzip2 (.bz2)
      files.
    - TDIM information is used to return array columns in the correct shape.
    - Write and read string table columns, including array columns of arbitrary
      shape.
    - Read and write complex, bool (logical), unsigned integer, signed bytes types.
    - Write checksums into the header and verify them.
    - Insert new columns into tables in-place.
    - Iterate over rows in a table. Data are buffered for efficiency.
    - python 3 support, including python 3 strings
---
 astro/Makefile            |  1 +
 astro/py-fitsio/Makefile  | 35 +++++++++++++++++++++++++++++++++++
 astro/py-fitsio/distinfo  |  3 +++
 astro/py-fitsio/pkg-descr | 27 +++++++++++++++++++++++++++
 4 files changed, 66 insertions(+)

diff --git a/astro/Makefile b/astro/Makefile
index 6b8556b1ccfb..85dc5da594c3 100644
--- a/astro/Makefile
+++ b/astro/Makefile
@@ -88,6 +88,7 @@
     SUBDIR += py-astropy-helpers
     SUBDIR += py-ephem
     SUBDIR += py-extension-helpers
+    SUBDIR += py-fitsio
     SUBDIR += py-horoscopegenerator
     SUBDIR += py-indiweb
     SUBDIR += py-jplephem
diff --git a/astro/py-fitsio/Makefile b/astro/py-fitsio/Makefile
new file mode 100644
index 000000000000..65bd0d5e0665
--- /dev/null
+++ b/astro/py-fitsio/Makefile
@@ -0,0 +1,35 @@
+PORTNAME=	fitsio
+PORTVERSION=	1.2.4
+CATEGORIES=	astro python
+MASTER_SITES=	PYPI
+PKGNAMEPREFIX=	${PYTHON_PKGNAMEPREFIX}
+
+MAINTAINER=	sunpoet@FreeBSD.org
+COMMENT=	Full featured python library to read from and write to FITS files
+WWW=		https://github.com/esheldon/fitsio
+
+LICENSE=	GPLv2
+LICENSE_FILE=	${WRKSRC}/LICENSE.txt
+
+BUILD_DEPENDS=	${PYTHON_PKGNAMEPREFIX}numpy>=0,1:math/py-numpy@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}setuptools>=0:devel/py-setuptools@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}wheel>=0:devel/py-wheel@${PY_FLAVOR}
+LIB_DEPENDS=	libcfitsio.so:astro/cfitsio
+RUN_DEPENDS=	${PYTHON_PKGNAMEPREFIX}numpy>=0,1:math/py-numpy@${PY_FLAVOR}
+
+USES=		python
+USE_PYTHON=	autoplist concurrent pep517
+
+MAKE_ENV=	FITSIO_USE_SYSTEM_FITSIO=yes \
+		FITSIO_SYSTEM_FITSIO_INCLUDEDIR=${LOCALBASE}/include \
+		FITSIO_SYSTEM_FITSIO_LIBDIR=${LOCALBASE}/lib
+
+# Clean up bundled libraries
+post-patch:
+	@${RM} -r ${WRKSRC}/cfitsio-*/
+	@${RM} -r ${WRKSRC}/zlib/
+
+post-install:
+	${FIND} ${STAGEDIR}${PYTHON_SITELIBDIR} -name '*.so' -exec ${STRIP_CMD} {} +
+
+.include <bsd.port.mk>
diff --git a/astro/py-fitsio/distinfo b/astro/py-fitsio/distinfo
new file mode 100644
index 000000000000..0871af8f7ac8
--- /dev/null
+++ b/astro/py-fitsio/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1725559527
+SHA256 (fitsio-1.2.4.tar.gz) = d57fe347c7657dc1f78c7969a55ecb4fddb717ae1c66d9d22046c171203ff678
+SIZE (fitsio-1.2.4.tar.gz) = 4533680
diff --git a/astro/py-fitsio/pkg-descr b/astro/py-fitsio/pkg-descr
new file mode 100644
index 000000000000..87d01278d530
--- /dev/null
+++ b/astro/py-fitsio/pkg-descr
@@ -0,0 +1,27 @@
+fitsio is a python extension written in c and python. Data are read into
+numerical python arrays.
+
+Some Features:
+- Read from and write to image, binary, and ascii table extensions.
+- Read arbitrary subsets of table columns and rows without loading all the data
+  to memory.
+- Read image subsets without reading the whole image. Write subsets to existing
+  images.
+- Write and read variable length table columns.
+- Read images and tables using slice notation similar to numpy arrays. This is
+  like a more powerful memmap, since it is column-aware for tables.
+- Append rows to an existing table. Delete row sets and row ranges. Resize
+  tables, or insert rows.
+- Query the columns and rows in a table.
+- Read and write header keywords.
+- Read and write images in tile-compressed format (RICE,GZIP,PLIO,HCOMPRESS).
+- Read/write gzip files directly. Read unix compress (.Z,.zip) and bzip2 (.bz2)
+  files.
+- TDIM information is used to return array columns in the correct shape.
+- Write and read string table columns, including array columns of arbitrary
+  shape.
+- Read and write complex, bool (logical), unsigned integer, signed bytes types.
+- Write checksums into the header and verify them.
+- Insert new columns into tables in-place.
+- Iterate over rows in a table. Data are buffered for efficiency.
+- python 3 support, including python 3 strings