Skip to content

Commit

Permalink
archivers/py-blosc2: Add py-blosc2 2.2.0
Browse files Browse the repository at this point in the history
C-Blosc2 is the new major version of C-Blosc, and is backward compatible with
both the C-Blosc1 API and its in-memory format. Python-Blosc2 is a Python
package that wraps C-Blosc2, the newest version of the Blosc compressor.

Currently Python-Blosc2 already reproduces the API of Python-Blosc, so it can be
used as a drop-in replacement. However, there are a few exceptions for a full
compatibility.

In addition, Python-Blosc2 aims to leverage the new C-Blosc2 API so as to
support super-chunks, multi-dimensional arrays (NDArray), serialization and
other bells and whistles introduced in C-Blosc2. Although this is always and
endless process, we have already catch up with most of the C-Blosc2 API
capabilities.

Note: Python-Blosc2 is meant to be backward compatible with Python-Blosc data.
That means that it can read data generated with Python-Blosc, but the opposite
is not true (i.e. there is no forward compatibility).
  • Loading branch information
sunpoet committed Apr 18, 2023
1 parent 44d1cd0 commit 30dd3d5
Show file tree
Hide file tree
Showing 5 changed files with 71 additions and 0 deletions.
1 change: 1 addition & 0 deletions archivers/Makefile
Expand Up @@ -177,6 +177,7 @@
SUBDIR += ppunpack
SUBDIR += pxz
SUBDIR += py-acefile
SUBDIR += py-blosc2
SUBDIR += py-borgbackup
SUBDIR += py-borgbackup11
SUBDIR += py-brotli
Expand Down
41 changes: 41 additions & 0 deletions archivers/py-blosc2/Makefile
@@ -0,0 +1,41 @@
PORTNAME= blosc2
PORTVERSION= 2.2.0
CATEGORIES= archivers python
MASTER_SITES= PYPI
PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}

MAINTAINER= sunpoet@FreeBSD.org
COMMENT= Python wrapper for the C-Blosc2 library
WWW= https://github.com/Blosc/python-blosc2

LICENSE= BSD3CLAUSE
LICENSE_FILE= ${WRKSRC}/LICENSE.txt

BUILD_DEPENDS= cmake:devel/cmake-core \
ninja:devel/ninja \
${PYTHON_PKGNAMEPREFIX}numpy>=0,1:math/py-numpy@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}scikit-build>=0:devel/py-scikit-build@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}setuptools>=0:devel/py-setuptools@${PY_FLAVOR}
LIB_DEPENDS= libblosc2.so:archivers/c-blosc2
RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}msgpack>=0:devel/py-msgpack@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}ndindex>=1.4:math/py-ndindex@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}numpy>=1.20.3,1:math/py-numpy@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}py-cpuinfo>=0:sysutils/py-py-cpuinfo@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}rich>=0:textproc/py-rich@${PY_FLAVOR}

USES= pkgconfig python:3.8+
USE_PYTHON= autoplist concurrent cython pep517

MAKE_ENV= CMAKE_ARGS=-DUSE_SYSTEM_BLOSC2=ON

post-extract:
@${RM} ${WRKSRC}/blosc2/c-blosc2/blosc/shuffle-avx2.c.orig

post-patch:
# Clean up bundled libraries
@${RM} -r ${WRKSRC}/blosc2/c-blosc2/

post-install:
${FIND} ${STAGEDIR}${PYTHON_SITELIBDIR} -name '*.so' -exec ${STRIP_CMD} {} +

.include <bsd.port.mk>
3 changes: 3 additions & 0 deletions archivers/py-blosc2/distinfo
@@ -0,0 +1,3 @@
TIMESTAMP = 1681052880
SHA256 (blosc2-2.2.0.tar.gz) = 4cf3893fe85da4bd899ecf7a457fd09b2212fad256182100108de7a92b88aa87
SIZE (blosc2-2.2.0.tar.gz) = 4135248
9 changes: 9 additions & 0 deletions archivers/py-blosc2/files/patch-pyproject.toml
@@ -0,0 +1,9 @@
--- pyproject.toml.orig 2023-04-04 10:26:30 UTC
+++ pyproject.toml
@@ -1,5 +1,5 @@
[build-system]
-requires = ["setuptools", "scikit-build", "cython", "cmake", "ninja", "oldest-supported-numpy"]
+requires = ["setuptools", "scikit-build", "cython", "numpy"]

[tool.cibuildwheel]
skip = "cp36-* cp37-* pp37-* *-manylinux_i686 *_ppc64le *_s390x *-musllinux*"
17 changes: 17 additions & 0 deletions archivers/py-blosc2/pkg-descr
@@ -0,0 +1,17 @@
C-Blosc2 is the new major version of C-Blosc, and is backward compatible with
both the C-Blosc1 API and its in-memory format. Python-Blosc2 is a Python
package that wraps C-Blosc2, the newest version of the Blosc compressor.

Currently Python-Blosc2 already reproduces the API of Python-Blosc, so it can be
used as a drop-in replacement. However, there are a few exceptions for a full
compatibility.

In addition, Python-Blosc2 aims to leverage the new C-Blosc2 API so as to
support super-chunks, multi-dimensional arrays (NDArray), serialization and
other bells and whistles introduced in C-Blosc2. Although this is always and
endless process, we have already catch up with most of the C-Blosc2 API
capabilities.

Note: Python-Blosc2 is meant to be backward compatible with Python-Blosc data.
That means that it can read data generated with Python-Blosc, but the opposite
is not true (i.e. there is no forward compatibility).

0 comments on commit 30dd3d5

Please sign in to comment.