diff options
Diffstat (limited to 'gnu/packages/python-compression.scm')
| -rw-r--r-- | gnu/packages/python-compression.scm | 78 |
1 files changed, 41 insertions, 37 deletions
diff --git a/gnu/packages/python-compression.scm b/gnu/packages/python-compression.scm index 66691cac7ca..c5c59946aef 100644 --- a/gnu/packages/python-compression.scm +++ b/gnu/packages/python-compression.scm | |||
| @@ -739,44 +739,49 @@ directly from the command line.") | |||
| 739 | (define-public bitshuffle | 739 | (define-public bitshuffle |
| 740 | (package | 740 | (package |
| 741 | (name "bitshuffle") | 741 | (name "bitshuffle") |
| 742 | (version "0.3.5") | 742 | (version "0.5.2") |
| 743 | (source (origin | 743 | (source (origin |
| 744 | (method url-fetch) | 744 | (method url-fetch) |
| 745 | (uri (pypi-uri "bitshuffle" version)) | 745 | (uri (pypi-uri "bitshuffle" version)) |
| 746 | (sha256 | 746 | (sha256 |
| 747 | (base32 | 747 | (base32 |
| 748 | "1823x61kyax4dc2hjmc1xraskxi1193y8lvxd03vqv029jrj8cjy")) | 748 | "139xz3m2m8sal8riicvmb9i0sq4085s2hc6c148bwhmzpnvky3nw")) |
| 749 | (modules '((guix build utils))) | 749 | (modules '((guix build utils))) |
| 750 | (snippet | 750 | (snippet |
| 751 | '(begin | 751 | '(begin |
| 752 | ;; TODO Remove bundled libraries: lz4, lzf, and zstd. | ||
| 752 | ;; Remove generated Cython files. | 753 | ;; Remove generated Cython files. |
| 753 | (delete-file "bitshuffle/h5.c") | 754 | (delete-file "bitshuffle/h5.c") |
| 754 | (delete-file "bitshuffle/ext.c") | 755 | (delete-file "bitshuffle/ext.c"))))) |
| 755 | #t)))) | 756 | (build-system pyproject-build-system) |
| 756 | (build-system python-build-system) | ||
| 757 | (arguments | 757 | (arguments |
| 758 | `(#:tests? #f ; fail: https://github.com/h5py/h5py/issues/769 | 758 | (list |
| 759 | #:phases | 759 | #:test-flags |
| 760 | (modify-phases %standard-phases | 760 | ;; FileNotFoundError: [Errno 2] Unable to synchronously open file |
| 761 | (add-after 'unpack 'fix-neon-detection | 761 | ;; (unable to open file: name = |
| 762 | ;; Neon is only for aarch64 ATM | 762 | ;; '/tmp/<...>/tests/data/regression_0.1.3.h5', errno = 2, error message |
| 763 | ;; see: https://github.com/kiyo-masui/bitshuffle/pull/73 | 763 | ;; = 'No such file or directory', flags = 0, o_flags = 0) |
| 764 | (lambda _ | 764 | #~(list "--deselect=tests/test_regression.py::TestAll::test_regression") |
| 765 | (substitute* "src/bitshuffle_core.c" | 765 | #:phases |
| 766 | (("#define USEARMNEON") | 766 | #~(modify-phases %standard-phases |
| 767 | "#ifdef __aarch64__\n#define USEARMNEON\n#endif")) | 767 | (add-before 'build 'pre-build |
| 768 | #t)) | 768 | ;; TODO: Check how to build on other architectures. |
| 769 | (add-after 'unpack 'dont-build-native | 769 | ;; Taken form .github/workflows/wheels.yml. |
| 770 | (lambda _ | 770 | (lambda _ |
| 771 | (substitute* "setup.py" | 771 | #$@(if (target-x86-64?) |
| 772 | (("'-march=native', ") "")) | 772 | '((setenv "BITSHUFFLE_ARCH" "haswell") |
| 773 | #t))))) | 773 | (setenv "CIBW_SKIP" "pp* *musllinux* cp311-macosx*") |
| 774 | (inputs | 774 | (setenv "CIBW_ARCHS" "x86_64")) |
| 775 | `(("numpy" ,python-numpy) | 775 | '()) |
| 776 | ("h5py" ,python-h5py) | 776 | (setenv "HDF5_DIR" #$(this-package-input "hdf5"))))))) |
| 777 | ("hdf5" ,hdf5))) | ||
| 778 | (native-inputs | 777 | (native-inputs |
| 779 | `(("cython" ,python-cython))) | 778 | (list python-cython |
| 779 | python-pytest | ||
| 780 | python-setuptools)) | ||
| 781 | (inputs | ||
| 782 | (list python-numpy | ||
| 783 | python-h5py | ||
| 784 | hdf5)) | ||
| 780 | (home-page "https://github.com/kiyo-masui/bitshuffle") | 785 | (home-page "https://github.com/kiyo-masui/bitshuffle") |
| 781 | (synopsis "Filter for improving compression of typed binary data") | 786 | (synopsis "Filter for improving compression of typed binary data") |
| 782 | (description "Bitshuffle is an algorithm that rearranges typed, binary data | 787 | (description "Bitshuffle is an algorithm that rearranges typed, binary data |
| @@ -789,15 +794,15 @@ algorithm within the Numpy framework.") | |||
| 789 | (name "bitshuffle-for-snappy") | 794 | (name "bitshuffle-for-snappy") |
| 790 | (build-system gnu-build-system) | 795 | (build-system gnu-build-system) |
| 791 | (arguments | 796 | (arguments |
| 792 | (substitute-keyword-arguments (package-arguments bitshuffle) | 797 | (list |
| 793 | ((#:tests? _ #f) #f) | 798 | #:tests? #f |
| 794 | ((#:phases phases) | 799 | #:phases |
| 795 | `(modify-phases %standard-phases | 800 | #~(modify-phases %standard-phases |
| 796 | (replace 'configure | 801 | (replace 'configure |
| 797 | (lambda* (#:key outputs #:allow-other-keys) | 802 | (lambda _ |
| 798 | (with-output-to-file "Makefile" | 803 | (with-output-to-file "Makefile" |
| 799 | (lambda _ | 804 | (lambda _ |
| 800 | (format #t "\ | 805 | (format #t "\ |
| 801 | libbitshuffle.so: src/bitshuffle.o src/bitshuffle_core.o src/iochain.o lz4/lz4.o | 806 | libbitshuffle.so: src/bitshuffle.o src/bitshuffle_core.o src/iochain.o lz4/lz4.o |
| 802 | \tgcc -O3 -ffast-math -std=c99 -o $@ -shared -fPIC $^ | 807 | \tgcc -O3 -ffast-math -std=c99 -o $@ -shared -fPIC $^ |
| 803 | 808 | ||
| @@ -816,8 +821,7 @@ install: libbitshuffle.so | |||
| 816 | \tinstall -m644 src/bitshuffle_core.h $(INCLUDEDIR) | 821 | \tinstall -m644 src/bitshuffle_core.h $(INCLUDEDIR) |
| 817 | \tinstall -m644 src/iochain.h $(INCLUDEDIR) | 822 | \tinstall -m644 src/iochain.h $(INCLUDEDIR) |
| 818 | \tinstall -m644 lz4/lz4.h $(INCLUDEDIR) | 823 | \tinstall -m644 lz4/lz4.h $(INCLUDEDIR) |
| 819 | " (assoc-ref outputs "out")))) | 824 | " #$output)))))))) |
| 820 | #t)))))) | ||
| 821 | (inputs '()) | 825 | (inputs '()) |
| 822 | (native-inputs '()))) | 826 | (native-inputs '()))) |
| 823 | 827 | ||
