2019-08-06 22:43:46 +02:00
|
|
|
#
|
2023-01-23 13:54:52 +01:00
|
|
|
# spec file
|
2019-08-06 22:43:46 +02:00
|
|
|
#
|
2024-01-02 22:06:28 +01:00
|
|
|
# Copyright (c) 2024 SUSE LLC
|
2019-08-06 22:43:46 +02:00
|
|
|
#
|
|
|
|
# All modifications and additions to the file contributed by third parties
|
|
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
|
|
# upon. The license for this file, and modifications and additions to the
|
|
|
|
# file, is the same license as for the pristine package itself (unless the
|
|
|
|
# license for the pristine package is not an Open Source License, in which
|
|
|
|
# case the license is the MIT License). An "Open Source License" is a
|
|
|
|
# license that conforms to the Open Source Definition (Version 1.9)
|
|
|
|
# published by the Open Source Initiative.
|
|
|
|
|
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
|
|
|
#
|
|
|
|
|
|
|
|
|
2020-08-28 11:21:22 +02:00
|
|
|
%global flavor @BUILD_FLAVOR@%{nil}
|
|
|
|
%if "%{flavor}" == "test"
|
|
|
|
%define psuffix -test
|
|
|
|
%bcond_without test
|
|
|
|
%else
|
|
|
|
%define psuffix %{nil}
|
|
|
|
%bcond_with test
|
|
|
|
%endif
|
2023-01-23 13:54:52 +01:00
|
|
|
|
2020-08-28 11:21:22 +02:00
|
|
|
Name: python-imagecodecs%{psuffix}
|
2024-01-03 19:35:24 +01:00
|
|
|
Version: 2024.1.1
|
2019-08-06 22:43:46 +02:00
|
|
|
Release: 0
|
|
|
|
Summary: Image transformation, compression, and decompression codecs
|
|
|
|
License: BSD-3-Clause
|
2021-03-11 16:26:27 +01:00
|
|
|
URL: https://github.com/cgohlke/imagecodecs/
|
2019-08-06 22:43:46 +02:00
|
|
|
Source: https://files.pythonhosted.org/packages/source/i/imagecodecs/imagecodecs-%{version}.tar.gz
|
2021-03-11 16:26:27 +01:00
|
|
|
Source1: imagecodecs_distributor_setup.py
|
2024-01-25 13:33:55 +01:00
|
|
|
ExcludeArch: %ix86 %arm32 ppc s390
|
2024-01-03 19:35:24 +01:00
|
|
|
BuildRequires: %{python_module Cython >= 3}
|
2023-01-23 13:54:52 +01:00
|
|
|
BuildRequires: %{python_module base >= 3.8}
|
|
|
|
BuildRequires: %{python_module numpy-devel}
|
|
|
|
BuildRequires: %{python_module pip}
|
|
|
|
BuildRequires: %{python_module setuptools}
|
|
|
|
BuildRequires: %{python_module wheel}
|
2020-08-28 11:21:22 +02:00
|
|
|
BuildRequires: dos2unix
|
|
|
|
BuildRequires: fdupes
|
2021-02-02 01:09:38 +01:00
|
|
|
BuildRequires: python-rpm-macros
|
2023-01-23 13:54:52 +01:00
|
|
|
Requires: python-numpy
|
2020-08-28 11:21:22 +02:00
|
|
|
Requires(post): update-alternatives
|
2021-07-01 15:13:31 +02:00
|
|
|
Requires(postun):update-alternatives
|
2020-08-28 11:21:22 +02:00
|
|
|
Recommends: python-Pillow
|
|
|
|
Recommends: python-blosc
|
|
|
|
Recommends: python-lz4
|
2022-10-10 09:26:06 +02:00
|
|
|
Recommends: python-matplotlib >= 3.3
|
2021-07-01 15:13:31 +02:00
|
|
|
Recommends: python-numcodecs
|
2023-01-23 13:54:52 +01:00
|
|
|
Recommends: python-tifffile
|
2020-08-28 11:21:22 +02:00
|
|
|
Recommends: python-zstd
|
|
|
|
%if %{with test}
|
2021-02-02 01:09:38 +01:00
|
|
|
BuildRequires: %{python_module Brotli}
|
2019-08-06 22:43:46 +02:00
|
|
|
BuildRequires: %{python_module Pillow}
|
|
|
|
BuildRequires: %{python_module blosc}
|
2021-02-02 01:09:38 +01:00
|
|
|
BuildRequires: %{python_module czifile}
|
2023-09-14 11:46:45 +02:00
|
|
|
BuildRequires: %{python_module dask-array}
|
|
|
|
BuildRequires: %{python_module dask-delayed}
|
|
|
|
BuildRequires: %{python_module dask}
|
2020-08-28 11:21:22 +02:00
|
|
|
BuildRequires: %{python_module imagecodecs >= %{version}}
|
2019-08-06 22:43:46 +02:00
|
|
|
BuildRequires: %{python_module lz4}
|
2022-10-10 09:26:06 +02:00
|
|
|
BuildRequires: %{python_module matplotlib >= 3.3}
|
2021-07-01 15:13:31 +02:00
|
|
|
BuildRequires: %{python_module numcodecs}
|
2023-01-23 13:54:52 +01:00
|
|
|
BuildRequires: %{python_module pytest-xdist}
|
2019-08-06 22:43:46 +02:00
|
|
|
BuildRequires: %{python_module pytest}
|
2021-02-02 01:09:38 +01:00
|
|
|
BuildRequires: %{python_module python-snappy}
|
2019-08-06 22:43:46 +02:00
|
|
|
BuildRequires: %{python_module scikit-image}
|
2023-01-23 13:54:52 +01:00
|
|
|
BuildRequires: %{python_module tifffile}
|
2021-07-01 15:13:31 +02:00
|
|
|
BuildRequires: %{python_module zarr}
|
2019-08-06 22:43:46 +02:00
|
|
|
BuildRequires: %{python_module zstd}
|
2021-03-11 16:26:27 +01:00
|
|
|
# libraries and python modules not (yet) available:
|
2021-02-02 01:09:38 +01:00
|
|
|
#BuildRequires: %%{python_module bitshuffle}
|
|
|
|
#BuildRequires: %%{python_module lzf}
|
2021-03-11 16:26:27 +01:00
|
|
|
# The zopfli library is linked. User can pip install zopflipy, if needed.
|
2021-02-02 01:09:38 +01:00
|
|
|
#BuildRequires: %%{python_module zopflipy}
|
2023-03-26 18:57:03 +02:00
|
|
|
# The lzfse library is linked. User can pip install pyliblzfse, if needed.
|
|
|
|
#BuildRequires: %%{python_module pyliblzfse}
|
2020-08-28 11:21:22 +02:00
|
|
|
%else
|
2021-03-11 16:26:27 +01:00
|
|
|
BuildRequires: CharLS-devel
|
2024-01-25 13:33:19 +01:00
|
|
|
BuildRequires: brunsli-devel
|
2021-03-11 16:26:27 +01:00
|
|
|
BuildRequires: dav1d-devel
|
2019-08-06 22:43:46 +02:00
|
|
|
BuildRequires: gcc-c++
|
2020-08-28 11:00:57 +02:00
|
|
|
BuildRequires: giflib-devel
|
2019-08-06 22:43:46 +02:00
|
|
|
BuildRequires: jxrlib-devel
|
2024-01-03 19:35:24 +01:00
|
|
|
BuildRequires: libaec-devel >= 1.1
|
2021-03-11 16:26:27 +01:00
|
|
|
BuildRequires: libaom-devel
|
2021-01-22 08:19:43 +01:00
|
|
|
BuildRequires: libdeflate-devel
|
2020-08-28 11:00:57 +02:00
|
|
|
BuildRequires: libzopfli-devel
|
2023-01-23 13:54:52 +01:00
|
|
|
BuildRequires: lzfse-devel
|
|
|
|
BuildRequires: lzham_codec-devel
|
2019-08-06 22:43:46 +02:00
|
|
|
BuildRequires: pkgconfig
|
2021-03-11 16:26:27 +01:00
|
|
|
BuildRequires: rav1e-devel
|
2020-08-28 11:00:57 +02:00
|
|
|
BuildRequires: snappy-devel
|
2023-03-26 18:57:03 +02:00
|
|
|
BuildRequires: sz2-devel
|
2019-08-06 22:43:46 +02:00
|
|
|
BuildRequires: pkgconfig(blosc)
|
2023-03-26 18:57:03 +02:00
|
|
|
BuildRequires: pkgconfig(blosc2) >= 2.7.1
|
2019-08-06 22:43:46 +02:00
|
|
|
BuildRequires: pkgconfig(bzip2)
|
2021-07-01 15:13:31 +02:00
|
|
|
BuildRequires: pkgconfig(cfitsio)
|
2024-01-03 19:35:24 +01:00
|
|
|
BuildRequires: pkgconfig(lcms2) >= 2.16
|
2023-09-14 11:46:45 +02:00
|
|
|
BuildRequires: pkgconfig(libavif) >= 1.0.0
|
2020-08-28 11:00:57 +02:00
|
|
|
BuildRequires: pkgconfig(libbrotlicommon)
|
2022-10-10 09:26:06 +02:00
|
|
|
BuildRequires: pkgconfig(libheif)
|
2023-03-26 18:57:03 +02:00
|
|
|
# Beta, not available in minimum version
|
|
|
|
#BuildRequires: pkgconfig(libturbojpeg) >= 2.1.91
|
2024-01-03 19:35:24 +01:00
|
|
|
BuildRequires: pkgconfig(libjxl) >= 0.9
|
2019-08-06 22:43:46 +02:00
|
|
|
BuildRequires: pkgconfig(liblz4)
|
|
|
|
BuildRequires: pkgconfig(liblzma)
|
|
|
|
BuildRequires: pkgconfig(libopenjp2)
|
|
|
|
BuildRequires: pkgconfig(libpng)
|
2020-08-28 11:00:57 +02:00
|
|
|
BuildRequires: pkgconfig(libtiff-4)
|
2019-08-06 22:43:46 +02:00
|
|
|
BuildRequires: pkgconfig(libwebp)
|
|
|
|
BuildRequires: pkgconfig(libzstd)
|
|
|
|
BuildRequires: pkgconfig(zlib)
|
2021-07-01 15:13:31 +02:00
|
|
|
BuildRequires: pkgconfig(zlib-ng)
|
2021-03-11 16:26:27 +01:00
|
|
|
%ifnarch %ix86 %arm
|
2021-07-01 15:13:31 +02:00
|
|
|
# Note that upstream deprecated 32-bit as a whole
|
2023-03-26 18:57:03 +02:00
|
|
|
# 64-bit only.
|
2021-03-11 16:26:27 +01:00
|
|
|
BuildRequires: zfp-devel
|
2023-03-26 18:57:03 +02:00
|
|
|
BuildRequires: pkgconfig(SvtAv1Dec)
|
|
|
|
BuildRequires: pkgconfig(SvtAv1Enc)
|
2020-08-28 11:21:22 +02:00
|
|
|
%endif
|
2021-03-11 16:26:27 +01:00
|
|
|
%endif
|
2019-08-06 22:43:46 +02:00
|
|
|
%python_subpackages
|
|
|
|
|
|
|
|
%description
|
|
|
|
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.
|
|
|
|
|
2021-03-11 16:26:27 +01:00
|
|
|
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).
|
2019-08-06 22:43:46 +02:00
|
|
|
|
|
|
|
%prep
|
|
|
|
%setup -q -n imagecodecs-%{version}
|
2021-03-11 16:26:27 +01:00
|
|
|
# the patch from github requires unix line endings to apply
|
|
|
|
dos2unix tests/test_imagecodecs.py
|
2023-09-14 11:46:45 +02:00
|
|
|
dos2unix imagecodecs/libavif.pxd
|
|
|
|
dos2unix imagecodecs/_avif.pyx
|
|
|
|
dos2unix imagecodecs/imagecodecs.py
|
2020-08-28 11:00:57 +02:00
|
|
|
%autopatch -p1
|
2022-10-10 09:26:06 +02:00
|
|
|
|
2021-03-11 16:26:27 +01:00
|
|
|
cp %SOURCE1 ./
|
2019-08-06 22:43:46 +02:00
|
|
|
dos2unix README.rst
|
2023-01-23 13:54:52 +01:00
|
|
|
# These libraries are not linked to, (check SOURCE1)
|
|
|
|
rm imagecodecs/licenses/LICENSE-brunsli
|
|
|
|
rm imagecodecs/licenses/LICENSE-jetraw
|
|
|
|
rm imagecodecs/licenses/LICENSE-lerc
|
|
|
|
rm imagecodecs/licenses/LICENSE-mozjpeg
|
2019-08-06 22:43:46 +02:00
|
|
|
|
|
|
|
%build
|
2020-08-28 11:21:22 +02:00
|
|
|
%if !%{with test}
|
2019-08-06 22:43:46 +02:00
|
|
|
export CFLAGS="%{optflags}"
|
2021-07-01 15:13:31 +02:00
|
|
|
export INCDIR="%{_includedir}"
|
2023-01-23 13:54:52 +01:00
|
|
|
%pyproject_wheel
|
2020-08-28 11:21:22 +02:00
|
|
|
%endif
|
2019-08-06 22:43:46 +02:00
|
|
|
|
|
|
|
%install
|
2020-08-28 11:21:22 +02:00
|
|
|
%if !%{with test}
|
2023-01-23 13:54:52 +01:00
|
|
|
%pyproject_install
|
2020-05-25 15:34:25 +02:00
|
|
|
%python_clone -a %{buildroot}%{_bindir}/imagecodecs
|
2019-08-06 22:43:46 +02:00
|
|
|
%{python_expand rm -rf %{buildroot}%{$python_sitearch}/imagecodecs/licenses/
|
|
|
|
%fdupes %{buildroot}%{$python_sitearch}
|
|
|
|
}
|
2020-08-28 11:21:22 +02:00
|
|
|
%endif
|
2019-08-06 22:43:46 +02:00
|
|
|
|
|
|
|
%check
|
2020-08-28 11:21:22 +02:00
|
|
|
%if %{with test}
|
2023-01-23 13:54:52 +01:00
|
|
|
# All heif tests fail because of unsupported filetypes (openSUSE does not ship patentend codec support with libheif)
|
|
|
|
donttest="heif"
|
2023-03-26 18:57:03 +02:00
|
|
|
# no webp and lerc support in libtiff, jpeg8 disabled in imagecodecs
|
|
|
|
donttest="$donttest or (test_tiff and (webp or lerc or jpeg))"
|
2024-01-03 19:35:24 +01:00
|
|
|
donttest+=" or test_cms"
|
2023-01-23 13:54:52 +01:00
|
|
|
%ifarch %ix86 %arm32
|
|
|
|
donttest="$donttest or spng"
|
|
|
|
%endif
|
2023-03-26 18:57:03 +02:00
|
|
|
%pytest_arch -n auto tests -rsXfE --doctest-modules %{$python_sitearch}/imagecodecs/imagecodecs.py -k "not ($donttest ${$python_donttest})"
|
2020-08-28 11:21:22 +02:00
|
|
|
%endif
|
2019-08-06 22:43:46 +02:00
|
|
|
|
2020-08-28 11:21:22 +02:00
|
|
|
%if !%{with test}
|
2020-05-25 15:34:25 +02:00
|
|
|
%post
|
|
|
|
%python_install_alternative imagecodecs
|
|
|
|
|
|
|
|
%postun
|
|
|
|
%python_uninstall_alternative imagecodecs
|
|
|
|
|
2019-08-06 22:43:46 +02:00
|
|
|
%files %{python_files}
|
|
|
|
%license LICENSE imagecodecs/licenses/*
|
|
|
|
%doc README.rst
|
2020-05-25 15:34:25 +02:00
|
|
|
%python_alternative %{_bindir}/imagecodecs
|
2023-01-23 13:54:52 +01:00
|
|
|
%{python_sitearch}/imagecodecs-%{version}.dist-info/
|
2022-10-10 09:26:06 +02:00
|
|
|
%{python_sitearch}/imagecodecs/
|
2020-08-28 11:21:22 +02:00
|
|
|
%endif
|
2019-08-06 22:43:46 +02:00
|
|
|
|
|
|
|
%changelog
|