14
0

Accepting request 878211 from home:bnavigator:branches:devel:languages:python

- Update to version 2021.2.26
  Pass 4915 tests. Support X2 and X4 floating point predictors
  (found in DNG).
- enable additional codecs through imagecodecs_distributor_setup.py
- Add imagecodecs-pr15-test_jpegls.patch
  gh#cgohlke/imagecodecs#15
- disable builds for big-endian platforms as per upstream README

OBS-URL: https://build.opensuse.org/request/show/878211
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-imagecodecs?expand=0&rev=14
This commit is contained in:
2021-03-11 15:26:27 +00:00
committed by Git OBS Bridge
parent 9488f3439b
commit b8f177977f
6 changed files with 110 additions and 11 deletions

View File

@@ -28,13 +28,16 @@
%define skip_python2 1
%define skip_python36 1
Name: python-imagecodecs%{psuffix}
Version: 2021.1.28
Version: 2021.2.26
Release: 0
Summary: Image transformation, compression, and decompression codecs
License: BSD-3-Clause
URL: https://www.lfd.uci.edu/~gohlke/
URL: https://github.com/cgohlke/imagecodecs/
Source: https://files.pythonhosted.org/packages/source/i/imagecodecs/imagecodecs-%{version}.tar.gz
Source1: imagecodecs_distributor_setup.py
Patch0: always-cythonize.patch
# PATCH-FIX-UPSTREAM imagecodecs-pr15-test_jpegls.patch -- gh#cgohlke/imagecodecs#15
Patch1: https://github.com/cgohlke/imagecodecs/pull/15.patch#/imagecodecs-pr15-test_jpegls.patch
BuildRequires: %{python_module Cython >= 0.29.19}
BuildRequires: %{python_module numpy-devel >= 1.15.1}
BuildRequires: %{python_module setuptools >= 18.0}
@@ -63,22 +66,28 @@ BuildRequires: %{python_module python-snappy}
BuildRequires: %{python_module scikit-image}
BuildRequires: %{python_module tifffile >= 2020.5.25}
BuildRequires: %{python_module zstd}
# not (yet) available:
# libraries and python modules not (yet) available:
#BuildRequires: %%{python_module bitshuffle}
#BuildRequires: %%{python_module lzf}
# The zopfli library is linked. User can pip install zopflipy, if needed.
#BuildRequires: %%{python_module zopflipy}
%else
BuildRequires: CharLS-devel
BuildRequires: dav1d-devel
BuildRequires: gcc-c++
BuildRequires: giflib-devel
BuildRequires: jxrlib-devel
BuildRequires: libaec-devel
BuildRequires: libaom-devel
BuildRequires: libdeflate-devel
BuildRequires: libzopfli-devel
BuildRequires: pkgconfig
BuildRequires: rav1e-devel
BuildRequires: snappy-devel
BuildRequires: pkgconfig(blosc)
BuildRequires: pkgconfig(bzip2)
BuildRequires: pkgconfig(lcms2)
BuildRequires: pkgconfig(libavif)
BuildRequires: pkgconfig(libbrotlicommon)
BuildRequires: pkgconfig(libjpeg)
BuildRequires: pkgconfig(liblz4)
@@ -89,7 +98,13 @@ BuildRequires: pkgconfig(libtiff-4)
BuildRequires: pkgconfig(libwebp)
BuildRequires: pkgconfig(libzstd)
BuildRequires: pkgconfig(zlib)
%ifnarch %ix86 %arm
# zfp is 64 bit only. Note that upstream deprecated 32-bit as a whole
BuildRequires: zfp-devel
%endif
%endif
# Upstream: big endian is not supported
ExcludeArch: s390x ppc64
%python_subpackages
%description
@@ -97,20 +112,27 @@ Imagecodecs is a Python library that provides block-oriented, in-memory buffer
transformation, compression, and decompression functions for use in the
tifffile, czifile, and other scientific imaging modules.
Decode and/or encode functions are currently implemented for Zlib DEFLATE,
ZStandard, Blosc, LZMA, BZ2, LZ4, LZW, LZF, ZFP, NPY, PNG, WebP, JPEG 8-bit,
JPEG 12-bit, JPEG SOF3, JPEG LS, JPEG 2000, JPEG XR, PackBits, Packed Integers,
Delta, XOR Delta, Floating Point Predictor, and Bitorder reversal.
Decode and/or encode functions are implemented for Zlib (DEFLATE), GZIP,
ZStandard (ZSTD), Blosc, Brotli, Snappy, LZMA, BZ2, LZ4, LZ4F, LZ4HC, LZW, LZF,
ZFP, AEC, LERC, NPY, PNG, GIF, TIFF, WebP, JPEG 8-bit, JPEG 12-bit, Lossless
JPEG (LJPEG, SOF3), JPEG 2000, JPEG LS, JPEG XR, JPEG XL, AVIF, PackBits, Packed
Integers, Delta, XOR Delta, Floating Point Predictor, Bitorder reversal,
Bitshuffle, and Float24 (24-bit floating point).
%prep
%setup -q -n imagecodecs-%{version}
# the patch from github requires unix line endings to apply
dos2unix tests/test_imagecodecs.py
%autopatch -p1
cp %SOURCE1 ./
dos2unix README.rst
# https://github.com/cgohlke/imagecodecs/pull/15#issuecomment-795744838
ldd %{_libdir}/libblosc.so.1 | grep -q libsnappy && sed -i "s/if not IS_CG and compressor == 'snappy'/if False/" tests/test_imagecodecs.py
%build
%if !%{with test}
export CFLAGS="%{optflags}"
export INCDIR="%{_includedir}"
%python_build
%endif