From nobody Sat Mar 23 14:57:50 2024 X-Original-To: dev-commits-ports-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V22PB2WKzz5F840; Sat, 23 Mar 2024 14:57:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4V22PB1nCvz58N0; Sat, 23 Mar 2024 14:57:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1711205870; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HyMiqNiX4RDWCw3UZaFR6sWRGIOBwvnmRp1OJHkvmKk=; b=FFbQodDSfeMDhAv0/qmQwPR8f2jt1lnK50vzhFdqS5QPtmxw3u5IQMtOEl+aWDWxHuGvoj QvP+JyJ8rIvvwawIze0RTgUZujUcde5JYgG9deEUsX6txnCFH7h7EtTjQek+W3c4gU3PVd ST4PKNL5jbYTj81Dedonm3d0FJejlfysQrsTk/SgVG4qA5yS08SvKnVmahod/7dTs8+ikh 955jDLQ/VA8lktgAksY22AyvNsb4sT4f1L9CtonPDXdeOclK0VmK16gcaRSNi0i5vkr217 V9E1RaE6f3SZvuDkGaqmEp08Y4qkOCn8Vb8YJAZLPf/0LV12FpyueOFWYcTSGg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1711205870; a=rsa-sha256; cv=none; b=B8XhJGl0IyJaN94C5ZqtB0qjXctkNUAoxt7jbz6jlHTxV8pD22CkoJrPcaXDASryFf705F SF60MBmKkO5+5Wah6s3iHUxhuFwELDEzCV1JTxmCXbZGhDeEvchH/tkdmfB6Q7gsLO53zA BvvVS4ZRYjsVp544Ma6jnGt6Yg/kdVCsMaog2fNxMoanX6E9JbGJrjRhBSb6xdW4IAzoBW da2iZDnGWrh8GmLnHK0pT/2mpRmMiS8NHi8cLCCelrYdKP6DHbxeA0KC6kGzlD+mGUC06h G5dFBqXGsQxfr/d89tFXYDKKb0Rp3DWUZvVghL3V5mHD81YuB08nun+FqHcN0w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1711205870; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HyMiqNiX4RDWCw3UZaFR6sWRGIOBwvnmRp1OJHkvmKk=; b=h4tECm05QVOxzHAUywNQlb1HtmsFB3QZC/vqt9IPX+sU1qFtERgMlMjaTOlK9lbXGBP+w5 0Bn23zVjhBVQLNOesaBhYezWjMknl3R2pSAYgoPeyrx1kr5kZToaia2c5l/kF+gkdgFdnH N42uqDntYqMBRQ7vM2YqfyjrRQBCfiPYB9SNTjsaWjeizhwnkcKpF3Qoc64ntiLwF96YoN zpayq1saSZ3QENJkptnnTPwjYrSdYMJpgijlKy8GNY7UOL31XwzSF8hNlRXSLK+cFBpY4h fHNE/R6i3JMDiLOTSEkt0pVOQvqhVm+jwBzXfO0rISA8ZAZKmD9WHcs79Avlng== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V22PB1HLKzsgw; Sat, 23 Mar 2024 14:57:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 42NEvouQ084085; Sat, 23 Mar 2024 14:57:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 42NEvoU6084082; Sat, 23 Mar 2024 14:57:50 GMT (envelope-from git) Date: Sat, 23 Mar 2024 14:57:50 GMT Message-Id: <202403231457.42NEvoU6084082@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Po-Chuan Hsieh Subject: git: c8b4d6d391f8 - main - archivers/py-bitshuffle: Add py-bitshuffle 0.5.1 List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-main@freebsd.org X-BeenThere: dev-commits-ports-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: sunpoet X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c8b4d6d391f8967509242e2538efc7371def0026 Auto-Submitted: auto-generated The branch main has been updated by sunpoet: URL: https://cgit.FreeBSD.org/ports/commit/?id=c8b4d6d391f8967509242e2538efc7371def0026 commit c8b4d6d391f8967509242e2538efc7371def0026 Author: Po-Chuan Hsieh AuthorDate: 2024-03-23 14:14:53 +0000 Commit: Po-Chuan Hsieh CommitDate: 2024-03-23 14:30:36 +0000 archivers/py-bitshuffle: Add py-bitshuffle 0.5.1 Bitshuffle is an algorithm that rearranges typed, binary data for improving compression, as well as a python/C package that implements this algorithm within the Numpy framework. The library can be used along side HDF5 to compress and decompress datasets and is integrated through the dynamically loaded filters framework. Bitshuffle is HDF5 filter number 32008. Algorithmically, Bitshuffle is closely related to HDF5's Shuffle filter except it operates at the bit level instead of the byte level. Arranging a typed data array in to a matrix with the elements as the rows and the bits within the elements as the columns, Bitshuffle "transposes" the matrix, such that all the least-significant-bits are in a row, etc. This does not in itself compress data, only rearranges it for more efficient compression. To perform the actual compression you will need a compression library. Bitshuffle has been designed to be well matched to Marc Lehmann's LZF as well as LZ4 and ZSTD. Note that because Bitshuffle modifies the data at the bit level, sophisticated entropy reducing compression libraries such as GZIP and BZIP are unlikely to achieve significantly better compression than simpler and faster duplicate-string-elimination algorithms such as LZF, LZ4 and ZSTD. Bitshuffle thus includes routines (and HDF5 filter options) to apply LZ4 and ZSTD compression to each block after shuffling. --- archivers/Makefile | 1 + archivers/py-bitshuffle/Makefile | 28 ++++++++++++++++++++++ archivers/py-bitshuffle/distinfo | 3 +++ .../py-bitshuffle/files/patch-lzf-lzf_filter.c | 14 +++++++++++ archivers/py-bitshuffle/files/patch-pyproject.toml | 11 +++++++++ archivers/py-bitshuffle/files/patch-setup.py | 11 +++++++++ archivers/py-bitshuffle/pkg-descr | 23 ++++++++++++++++++ 7 files changed, 91 insertions(+) diff --git a/archivers/Makefile b/archivers/Makefile index 35ecf91c7bb8..28342893c70d 100644 --- a/archivers/Makefile +++ b/archivers/Makefile @@ -178,6 +178,7 @@ SUBDIR += ppunpack SUBDIR += pxz SUBDIR += py-acefile + SUBDIR += py-bitshuffle SUBDIR += py-blosc2 SUBDIR += py-borgbackup SUBDIR += py-borgbackup11 diff --git a/archivers/py-bitshuffle/Makefile b/archivers/py-bitshuffle/Makefile new file mode 100644 index 000000000000..5d89c913325e --- /dev/null +++ b/archivers/py-bitshuffle/Makefile @@ -0,0 +1,28 @@ +PORTNAME= bitshuffle +PORTVERSION= 0.5.1 +CATEGORIES= archivers python +MASTER_SITES= PYPI +PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} + +MAINTAINER= sunpoet@FreeBSD.org +COMMENT= Bitshuffle filter for improving typed data compression +WWW= https://github.com/kiyo-masui/bitshuffle + +LICENSE= MIT +LICENSE_FILE= ${WRKSRC}/LICENSE + +BUILD_DEPENDS= ${PYTHON_PKGNAMEPREFIX}h5py>=2.4.0:science/py-h5py@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}numpy>=0,1:math/py-numpy@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}setuptools>=0.7:devel/py-setuptools@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}wheel>=0:devel/py-wheel@${PY_FLAVOR} +RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}h5py>=2.4.0:science/py-h5py@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}numpy>=1.6.1,1:math/py-numpy@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}setuptools>=0.7:devel/py-setuptools@${PY_FLAVOR} + +USES= pkgconfig python +USE_PYTHON= autoplist concurrent cython pep517 + +post-install: + ${FIND} ${STAGEDIR}${PYTHON_SITELIBDIR} -name '*.so' -exec ${STRIP_CMD} {} + + +.include diff --git a/archivers/py-bitshuffle/distinfo b/archivers/py-bitshuffle/distinfo new file mode 100644 index 000000000000..c8a2e59bc658 --- /dev/null +++ b/archivers/py-bitshuffle/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1710712300 +SHA256 (bitshuffle-0.5.1.tar.gz) = 988f224739aa6858475a4c59172968c7b51cc657d2249580c8f96848708fbae3 +SIZE (bitshuffle-0.5.1.tar.gz) = 229441 diff --git a/archivers/py-bitshuffle/files/patch-lzf-lzf_filter.c b/archivers/py-bitshuffle/files/patch-lzf-lzf_filter.c new file mode 100644 index 000000000000..2b15f0ebac8c --- /dev/null +++ b/archivers/py-bitshuffle/files/patch-lzf-lzf_filter.c @@ -0,0 +1,14 @@ +--- lzf/lzf_filter.c.orig 2022-11-26 00:17:16 UTC ++++ lzf/lzf_filter.c +@@ -51,11 +51,7 @@ + macro H5_USE_16_API is set + */ + +-#if H5_VERS_MAJOR == 1 && H5_VERS_MINOR == 8 && (H5_VERS_RELEASE < 3 || !H5_USE_16_API) + #define H5PY_H5Z_NEWCLS 1 +-#else +-#define H5PY_H5Z_NEWCLS 0 +-#endif + + size_t lzf_filter(unsigned flags, size_t cd_nelmts, + const unsigned cd_values[], size_t nbytes, diff --git a/archivers/py-bitshuffle/files/patch-pyproject.toml b/archivers/py-bitshuffle/files/patch-pyproject.toml new file mode 100644 index 000000000000..620e4c320914 --- /dev/null +++ b/archivers/py-bitshuffle/files/patch-pyproject.toml @@ -0,0 +1,11 @@ +--- pyproject.toml.orig 2022-11-26 00:17:16 UTC ++++ pyproject.toml +@@ -3,7 +3,7 @@ requires = [ + requires = [ + "setuptools>=0.7", + "Cython>=0.19", +- "oldest-supported-numpy", ++ "numpy", + "h5py>=2.4.0", + ] + diff --git a/archivers/py-bitshuffle/files/patch-setup.py b/archivers/py-bitshuffle/files/patch-setup.py new file mode 100644 index 000000000000..f96dcdf556d3 --- /dev/null +++ b/archivers/py-bitshuffle/files/patch-setup.py @@ -0,0 +1,11 @@ +--- setup.py.orig 2022-11-26 00:17:16 UTC ++++ setup.py +@@ -371,7 +371,7 @@ class build_ext(build_ext_): + else: + openmpflag = "-fopenmp" + archi = platform.machine() +- if archi in ("i386", "x86_64"): ++ if archi in ("amd64", "i386", "x86_64"): + compileflags = COMPILE_FLAGS + ["-march=%s" % self.march] + else: + compileflags = COMPILE_FLAGS + ["-mcpu=%s" % self.march] diff --git a/archivers/py-bitshuffle/pkg-descr b/archivers/py-bitshuffle/pkg-descr new file mode 100644 index 000000000000..e54c4df001da --- /dev/null +++ b/archivers/py-bitshuffle/pkg-descr @@ -0,0 +1,23 @@ +Bitshuffle is an algorithm that rearranges typed, binary data for improving +compression, as well as a python/C package that implements this algorithm within +the Numpy framework. + +The library can be used along side HDF5 to compress and decompress datasets and +is integrated through the dynamically loaded filters framework. Bitshuffle is +HDF5 filter number 32008. + +Algorithmically, Bitshuffle is closely related to HDF5's Shuffle filter except +it operates at the bit level instead of the byte level. Arranging a typed data +array in to a matrix with the elements as the rows and the bits within the +elements as the columns, Bitshuffle "transposes" the matrix, such that all the +least-significant-bits are in a row, etc. + +This does not in itself compress data, only rearranges it for more efficient +compression. To perform the actual compression you will need a compression +library. Bitshuffle has been designed to be well matched to Marc Lehmann's LZF +as well as LZ4 and ZSTD. Note that because Bitshuffle modifies the data at the +bit level, sophisticated entropy reducing compression libraries such as GZIP and +BZIP are unlikely to achieve significantly better compression than simpler and +faster duplicate-string-elimination algorithms such as LZF, LZ4 and ZSTD. +Bitshuffle thus includes routines (and HDF5 filter options) to apply LZ4 and +ZSTD compression to each block after shuffling.