192 lines
10 KiB
RPMSpec
192 lines
10 KiB
RPMSpec
%global srcname imagecodecs
|
|
|
|
Name: python-imagecodecs
|
|
# Imagecodecs 2023.3.16 requires libjpeg-turbo 3, which is currently in beta:
|
|
# Imagecodecs 2023.1.23-2022.12.22 requires libtiff 4.5.0
|
|
Version: 2022.9.26
|
|
Release: 6%{?dist}
|
|
Summary: Image transformation, compression, and decompression codecs
|
|
|
|
License: BSD-3-Clause
|
|
URL: https://pypi.org/project/imagecodecs/
|
|
Source: %{pypi_source}
|
|
# Build configuration
|
|
Source1: imagecodecs_distributor_setup.py
|
|
Patch0: python-imagecodecs-noexcept.patch
|
|
|
|
BuildRequires: python3-devel
|
|
BuildRequires: python3-Cython
|
|
BuildRequires: gcc-c++
|
|
BuildRequires: blosc-devel
|
|
BuildRequires: blosc2-devel
|
|
BuildRequires: bzip2-devel
|
|
BuildRequires: cfitsio-devel
|
|
BuildRequires: CharLS-devel
|
|
BuildRequires: giflib-devel
|
|
BuildRequires: jxrlib-devel
|
|
BuildRequires: lcms2-devel
|
|
BuildRequires: libaec-devel
|
|
BuildRequires: libavif-devel
|
|
BuildRequires: libdeflate-devel
|
|
BuildRequires: libheif-devel
|
|
BuildRequires: libjpeg-turbo-devel
|
|
BuildRequires: liblerc-devel
|
|
BuildRequires: libpng-devel
|
|
BuildRequires: libtiff-devel
|
|
BuildRequires: libzstd-devel
|
|
BuildRequires: lz4-devel
|
|
# Uses 3rdparty source to use private function - https://github.com/cgohlke/imagecodecs/issues/77
|
|
#BuildRequires: openjpeg2-devel
|
|
BuildRequires: snappy-devel
|
|
BuildRequires: xz-devel
|
|
BuildRequires: zfp-devel
|
|
BuildRequires: zlib-ng-devel
|
|
BuildRequires: zopfli-devel
|
|
# Tests
|
|
BuildRequires: pytest
|
|
|
|
%global _description %{expand:
|
|
Imagecodecs is a Python library that provides block-oriented, in-memory
|
|
buffer transformation, compression, and decompression functions for use in
|
|
Tifffile, Czifile, Zarr, kerchunk, and other scientific image input/output
|
|
packages.
|
|
|
|
Decode and/or encode functions are implemented for Zlib (DEFLATE), GZIP,
|
|
ZStandard (ZSTD), Blosc, Brotli, Snappy, LZMA, BZ2, LZ4, LZ4F, LZ4HC, LZW,
|
|
LZF, LZFSE, LZHAM, PGLZ (PostgreSQL LZ), RCOMP (Rice), ZFP, AEC, SZIP, LERC,
|
|
NPY, PNG, APNG, GIF, TIFF, WebP, QOI, JPEG 8-bit, JPEG 12-bit, Lossless JPEG
|
|
(LJPEG, LJ92, JPEGLL), JPEG 2000 (JP2, J2K), JPEG LS, JPEG XL, JPEG XR (WDP,
|
|
HD Photo), MOZJPEG, AVIF, HEIF, RGBE (HDR), Jetraw, PackBits, Packed Integers,
|
|
Delta, XOR Delta, Floating Point Predictor, Bitorder reversal, Byteshuffle,
|
|
Bitshuffle, CMS (color space transformations), and Float24 (24-bit floating
|
|
point).}
|
|
|
|
%description %_description
|
|
|
|
%package -n python3-imagecodecs
|
|
Summary: %{summary}
|
|
|
|
%description -n python3-imagecodecs %_description
|
|
|
|
|
|
%prep
|
|
%autosetup -p1 -n imagecodecs-%{version}
|
|
# Copy in configuration
|
|
cp -a %SOURCE1 .
|
|
# Force regeneration of cython source
|
|
rm -f $(grep -rl '/\* Generated by Cython')
|
|
# I don't want to deal with 3rdparty sources
|
|
rm -r 3rdparty
|
|
|
|
%generate_buildrequires
|
|
%pyproject_buildrequires
|
|
|
|
|
|
%build
|
|
export CPPFLAGS=-I%{_includedir}/cfitsio
|
|
%pyproject_wheel
|
|
|
|
|
|
%install
|
|
%pyproject_install
|
|
%pyproject_save_files imagecodecs
|
|
|
|
|
|
%check
|
|
# tifffile is too old at this point to run the tifffile tests
|
|
# spng_encode appears to not be available with openjpeg2 disabled, but the test still tries to run
|
|
# Other deselected tests seem to be related to unsupported compression types
|
|
# A number of tests fail on s390x, ignore that for now
|
|
# TODO - tests/test_imagecodecs.py::test_cms_identity_transforms segfaults (various cases)
|
|
%pytest -v --deselect tests/test_imagecodecs.py::test_tifffile \
|
|
--deselect tests/test_imagecodecs.py::test_spng_encode \
|
|
--deselect tests/test_imagecodecs.py::test_cms_identity_transforms \
|
|
--deselect "tests/test_imagecodecs.py::test_image_roundtrips[heif-uint8-rgb-new-new-None]" \
|
|
--deselect "tests/test_imagecodecs.py::test_image_roundtrips[heif-uint8-rgb-new-new-5]" \
|
|
--deselect "tests/test_imagecodecs.py::test_image_roundtrips[heif-uint8-rgb-new-new--1]" \
|
|
--deselect "tests/test_imagecodecs.py::test_image_roundtrips[heif-uint8-rgb-new-out-None]" \
|
|
--deselect "tests/test_imagecodecs.py::test_image_roundtrips[heif-uint8-rgb-new-out-5]" \
|
|
--deselect "tests/test_imagecodecs.py::test_image_roundtrips[heif-uint8-rgb-new-out--1]" \
|
|
--deselect "tests/test_imagecodecs.py::test_image_roundtrips[heif-uint8-rgb-new-bytearray-None]" \
|
|
--deselect "tests/test_imagecodecs.py::test_image_roundtrips[heif-uint8-rgb-new-bytearray-5]" \
|
|
--deselect "tests/test_imagecodecs.py::test_image_roundtrips[heif-uint8-rgb-new-bytearray--1]" \
|
|
--deselect "tests/test_imagecodecs.py::test_image_roundtrips[heif-uint8-rgb-out-new-None]" \
|
|
--deselect "tests/test_imagecodecs.py::test_image_roundtrips[heif-uint8-rgb-out-new-5]" \
|
|
--deselect "tests/test_imagecodecs.py::test_image_roundtrips[heif-uint8-rgb-out-new--1]" \
|
|
--deselect "tests/test_imagecodecs.py::test_image_roundtrips[heif-uint8-rgb-out-out-None]" \
|
|
--deselect "tests/test_imagecodecs.py::test_image_roundtrips[heif-uint8-rgb-out-out-5]" \
|
|
--deselect "tests/test_imagecodecs.py::test_image_roundtrips[heif-uint8-rgb-out-out--1]" \
|
|
--deselect "tests/test_imagecodecs.py::test_image_roundtrips[heif-uint8-rgb-out-bytearray-None]" \
|
|
--deselect "tests/test_imagecodecs.py::test_image_roundtrips[heif-uint8-rgb-out-bytearray-5]" \
|
|
--deselect "tests/test_imagecodecs.py::test_image_roundtrips[heif-uint8-rgb-out-bytearray--1]" \
|
|
--deselect "tests/test_imagecodecs.py::test_image_roundtrips[heif-uint8-rgb-bytearray-new-None]" \
|
|
--deselect "tests/test_imagecodecs.py::test_image_roundtrips[heif-uint8-rgb-bytearray-new-5]" \
|
|
--deselect "tests/test_imagecodecs.py::test_image_roundtrips[heif-uint8-rgb-bytearray-new--1]" \
|
|
--deselect "tests/test_imagecodecs.py::test_image_roundtrips[heif-uint8-rgb-bytearray-out-None]" \
|
|
--deselect "tests/test_imagecodecs.py::test_image_roundtrips[heif-uint8-rgb-bytearray-out-5]" \
|
|
--deselect "tests/test_imagecodecs.py::test_image_roundtrips[heif-uint8-rgb-bytearray-out--1]" \
|
|
--deselect "tests/test_imagecodecs.py::test_image_roundtrips[heif-uint8-rgb-bytearray-bytearray-None]" \
|
|
--deselect "tests/test_imagecodecs.py::test_image_roundtrips[heif-uint8-rgb-bytearray-bytearray-5]" \
|
|
--deselect "tests/test_imagecodecs.py::test_image_roundtrips[heif-uint8-rgb-bytearray-bytearray--1]" \
|
|
--deselect "tests/test_imagecodecs.py::test_image_roundtrips[heif-uint8-rgba-new-new-None]" \
|
|
--deselect "tests/test_imagecodecs.py::test_image_roundtrips[heif-uint8-rgba-new-new-5]" \
|
|
--deselect "tests/test_imagecodecs.py::test_image_roundtrips[heif-uint8-rgba-new-new--1]" \
|
|
--deselect "tests/test_imagecodecs.py::test_image_roundtrips[heif-uint8-rgba-new-out-None]" \
|
|
--deselect "tests/test_imagecodecs.py::test_image_roundtrips[heif-uint8-rgba-new-out-5]" \
|
|
--deselect "tests/test_imagecodecs.py::test_image_roundtrips[heif-uint8-rgba-new-out--1]" \
|
|
--deselect "tests/test_imagecodecs.py::test_image_roundtrips[heif-uint8-rgba-new-bytearray-None]" \
|
|
--deselect "tests/test_imagecodecs.py::test_image_roundtrips[heif-uint8-rgba-new-bytearray-5]" \
|
|
--deselect "tests/test_imagecodecs.py::test_image_roundtrips[heif-uint8-rgba-new-bytearray--1]" \
|
|
--deselect "tests/test_imagecodecs.py::test_image_roundtrips[heif-uint8-rgba-out-new-None]" \
|
|
--deselect "tests/test_imagecodecs.py::test_image_roundtrips[heif-uint8-rgba-out-new-5]" \
|
|
--deselect "tests/test_imagecodecs.py::test_image_roundtrips[heif-uint8-rgba-out-new--1]" \
|
|
--deselect "tests/test_imagecodecs.py::test_image_roundtrips[heif-uint8-rgba-out-out-None]" \
|
|
--deselect "tests/test_imagecodecs.py::test_image_roundtrips[heif-uint8-rgba-out-out-5]" \
|
|
--deselect "tests/test_imagecodecs.py::test_image_roundtrips[heif-uint8-rgba-out-out--1]" \
|
|
--deselect "tests/test_imagecodecs.py::test_image_roundtrips[heif-uint8-rgba-out-bytearray-None]" \
|
|
--deselect "tests/test_imagecodecs.py::test_image_roundtrips[heif-uint8-rgba-out-bytearray-5]" \
|
|
--deselect "tests/test_imagecodecs.py::test_image_roundtrips[heif-uint8-rgba-out-bytearray--1]" \
|
|
--deselect "tests/test_imagecodecs.py::test_image_roundtrips[heif-uint8-rgba-bytearray-new-None]" \
|
|
--deselect "tests/test_imagecodecs.py::test_image_roundtrips[heif-uint8-rgba-bytearray-new-5]" \
|
|
--deselect "tests/test_imagecodecs.py::test_image_roundtrips[heif-uint8-rgba-bytearray-new--1]" \
|
|
--deselect "tests/test_imagecodecs.py::test_image_roundtrips[heif-uint8-rgba-bytearray-out-None]" \
|
|
--deselect "tests/test_imagecodecs.py::test_image_roundtrips[heif-uint8-rgba-bytearray-out-5]" \
|
|
--deselect "tests/test_imagecodecs.py::test_image_roundtrips[heif-uint8-rgba-bytearray-out--1]" \
|
|
--deselect "tests/test_imagecodecs.py::test_image_roundtrips[heif-uint8-rgba-bytearray-bytearray-None]" \
|
|
--deselect "tests/test_imagecodecs.py::test_image_roundtrips[heif-uint8-rgba-bytearray-bytearray-5]" \
|
|
--deselect "tests/test_imagecodecs.py::test_image_roundtrips[heif-uint8-rgba-bytearray-bytearray--1]" \
|
|
--deselect "tests/test_imagecodecs.py::test_tiff_files[gray.lerc.u1-False]" \
|
|
--deselect "tests/test_imagecodecs.py::test_tiff_files[gray.lerc.u1-True]" \
|
|
--deselect "tests/test_imagecodecs.py::test_tiff_files[rgb.tiled.lerc.u1-False]" \
|
|
--deselect "tests/test_imagecodecs.py::test_tiff_files[rgb.tiled.lerc.u1-True]" \
|
|
--deselect "tests/test_imagecodecs.py::test_numcodecs[heif-gray]" \
|
|
--deselect "tests/test_imagecodecs.py::test_numcodecs[heif-rgb]" \
|
|
%ifarch s390x
|
|
|| exit 0
|
|
%endif
|
|
|
|
%files -n python3-imagecodecs -f %{pyproject_files}
|
|
%license LICENSE
|
|
%doc README.*
|
|
%{_bindir}/imagecodecs
|
|
|
|
|
|
%changelog
|
|
* Wed Sep 04 2024 Orion Poplawski <orion@nwra.com> - 2022.9.26-6
|
|
- Add patch to fix FTBFS
|
|
- Ignore test segfault for now
|
|
|
|
* Wed Jan 31 2024 František Zatloukal <fzatlouk@redhat.com> - 2022.9.26-5
|
|
- Rebuilt for libavif 1.0.3
|
|
|
|
* Fri Jan 26 2024 Fedora Release Engineering <releng@fedoraproject.org> - 2022.9.26-4
|
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
|
|
|
|
* Mon Jan 22 2024 Fedora Release Engineering <releng@fedoraproject.org> - 2022.9.26-3
|
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
|
|
|
|
* Fri Jul 21 2023 Fedora Release Engineering <releng@fedoraproject.org> - 2022.9.26-2
|
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
|
|
|
|
* Fri Jun 02 2023 Orion Poplawski <orion@nwra.com> - 2022.9.26-1
|
|
- Initial Fedora package
|