Accepting request 1188317 from devel:languages:python

OBS-URL: https://build.opensuse.org/request/show/1188317
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-imagecodecs?expand=0&rev=15
This commit is contained in:
Ana Guerrero 2024-07-19 13:26:54 +00:00 committed by Git OBS Bridge
commit 6848bc531c
6 changed files with 74 additions and 32 deletions

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:fde46bd698d008255deef5411c59b35c0e875295e835bf6079f7e2ab22f216eb
size 9452821

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:0f3e94b7f51e2f78287b7ffae82cd850b1007639148894538274fa50bd179886
size 9459867

View File

@ -0,0 +1,40 @@
# openSUSE extension setup to build python-imagecodecs
import os
import subprocess
import sys
def customize_build(EXTENSIONS, OPTIONS):
print(f"Building with custom OpenSUSE config ({__file__})")
includedir = os.getenv("INCDIR",'') + '/'
del EXTENSIONS['apng'] # png-apng library not available
del EXTENSIONS['brunsli'] # graphics/brunsli not in Factory
del EXTENSIONS['jetraw'] # jetraw library not available
del EXTENSIONS['lerc'] # LERC library not available
del EXTENSIONS['lz4f'] # requires static linking
del EXTENSIONS['lzo'] # lzokay not available
del EXTENSIONS['mozjpeg'] # Win32 only
del EXTENSIONS['pcodec'] # not available in Factory
del EXTENSIONS['sperr'] # not available in Factory
EXTENSIONS['avif']['libraries'] = [
'avif',
'aom',
'dav1d',
'rav1e',
'sharpyuv',
'SvtAv1Enc',
]
openjpeg_inc = subprocess.check_output(
['pkgconf', '--variable=includedir', 'libopenjp2'],
text=True,
).strip()
EXTENSIONS['jpeg2k']['include_dirs'].append(openjpeg_inc)
EXTENSIONS['jpegxr']['include_dirs'].append(includedir + 'jxrlib')
EXTENSIONS['jpegxl']['libraries'] = ['jxl', 'jxl_threads']
EXTENSIONS['rcomp']['include_dirs'].append(includedir + 'cfitsio')
EXTENSIONS['zopfli']['include_dirs'].append(includedir + 'zopfli')
EXTENSIONS['lzham']['libraries'] = ['lzhamdll']

View File

@ -1,3 +1,17 @@
-------------------------------------------------------------------
Wed Jul 17 08:39:26 UTC 2024 - Ben Greiner <code@bnavigator.de>
- Update to 2024.6.1
* Pass 7486 tests.
* Fix segfault in sperr_decode.
* Fix segfault when strided-decoding into buffers with unexpected
shapes (#98).
* Fix jpeg2k_encoder output buffer too small (#101).
* Add PCODEC codec based on pcodec library.
* Support NumPy 2.
- Drop skip-rare-codecs.patch, restore and update
imagecodecs_distributor_setup.py
-------------------------------------------------------------------
Mon Mar 18 19:45:10 UTC 2024 - Dirk Müller <dmueller@suse.com>

View File

@ -26,13 +26,13 @@
%endif
Name: python-imagecodecs%{psuffix}
Version: 2024.1.1
Version: 2024.6.1
Release: 0
Summary: Image transformation, compression, and decompression codecs
License: BSD-3-Clause
URL: https://github.com/cgohlke/imagecodecs/
Source: https://files.pythonhosted.org/packages/source/i/imagecodecs/imagecodecs-%{version}.tar.gz
Patch1: skip-rare-codecs.patch
Source0: https://files.pythonhosted.org/packages/source/i/imagecodecs/imagecodecs-%{version}.tar.gz
Source1: imagecodecs_distributor_setup.py
ExcludeArch: %ix86 %arm32 ppc s390
BuildRequires: %{python_module Cython >= 3}
BuildRequires: %{python_module base >= 3.8}
@ -61,7 +61,7 @@ BuildRequires: %{python_module czifile}
BuildRequires: %{python_module dask-array}
BuildRequires: %{python_module dask-delayed}
BuildRequires: %{python_module dask}
BuildRequires: %{python_module imagecodecs >= %{version}}
BuildRequires: %{python_module imagecodecs = %{version}}
BuildRequires: %{python_module lz4}
BuildRequires: %{python_module matplotlib >= 3.3}
BuildRequires: %{python_module numcodecs}
@ -96,6 +96,7 @@ BuildRequires: rav1e-devel
BuildRequires: snappy-devel
BuildRequires: sz2-devel
BuildRequires: xz-devel
BuildRequires: zfp-devel
BuildRequires: pkgconfig(blosc)
BuildRequires: pkgconfig(blosc2) >= 2.7.1
BuildRequires: pkgconfig(bzip2)
@ -104,25 +105,20 @@ BuildRequires: pkgconfig(lcms2) >= 2.16
BuildRequires: pkgconfig(libavif) >= 1.0.0
BuildRequires: pkgconfig(libbrotlicommon)
BuildRequires: pkgconfig(libheif)
# Beta, not available in minimum version
#BuildRequires: pkgconfig(libturbojpeg) >= 2.1.91
# Tests fail if enabled
# BuildRequires: pkgconfig(libturbojpeg)
BuildRequires: pkgconfig(libjxl) >= 0.9
BuildRequires: pkgconfig(SvtAv1Enc)
BuildRequires: pkgconfig(liblz4)
BuildRequires: pkgconfig(liblzma)
BuildRequires: pkgconfig(libopenjp2)
BuildRequires: pkgconfig(libpng)
BuildRequires: pkgconfig(libsharpyuv)
BuildRequires: pkgconfig(libtiff-4)
BuildRequires: pkgconfig(libwebp)
BuildRequires: pkgconfig(libzstd)
BuildRequires: pkgconfig(zlib)
BuildRequires: pkgconfig(zlib-ng)
%ifnarch %ix86 %arm
# Note that upstream deprecated 32-bit as a whole
# 64-bit only.
BuildRequires: zfp-devel
BuildRequires: pkgconfig(SvtAv1Dec)
BuildRequires: pkgconfig(SvtAv1Enc)
%endif
%endif
%python_subpackages
@ -140,17 +136,23 @@ Bitshuffle, and Float24 (24-bit floating point).
%prep
%autosetup -p1 -n imagecodecs-%{version}
cp %{SOURCE1} ./
dos2unix README.rst
# 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-lzokay
rm imagecodecs/licenses/LICENSE-mozjpeg
rm imagecodecs/licenses/LICENSE-pcodec
rm imagecodecs/licenses/LICENSE-sperr
%build
%if !%{with test}
export CFLAGS="%{optflags}"
export INCDIR="%{_includedir}"
# make sure we can import Source1
export PYTHONPATH=$PWD:$PYTHONPATH
%pyproject_wheel
%endif
@ -167,12 +169,9 @@ export INCDIR="%{_includedir}"
%if %{with test}
# All heif tests fail because of unsupported filetypes (openSUSE does not ship patentend codec support with libheif)
donttest="heif"
# no webp and lerc support in libtiff, jpeg8 disabled in imagecodecs
donttest="$donttest or (test_tiff and (webp or lerc or jpeg))"
# no webp and lerc support in libtiff
donttest="$donttest or (test_tiff and (webp or lerc))"
donttest+=" or test_cms"
%ifarch %ix86 %arm32
donttest="$donttest or spng"
%endif
%pytest_arch -n auto tests -rsXfE -k "not ($donttest ${$python_donttest})"
%endif

View File

@ -1,11 +0,0 @@
--- imagecodecs-2024.1.1.orig/setup.py
+++ imagecodecs-2024.1.1/setup.py
@@ -246,7 +246,7 @@ def customize_build_default(EXTENSIONS,
del EXTENSIONS['sperr'] # sperr not commonly available
del EXTENSIONS['zlibng'] # zlib-ng library not commonly available
- if 'arch' not in platform.platform():
+ if True:
del EXTENSIONS['jpegls'] # CharLS 2.1 library not commonly available
del EXTENSIONS['jpegxl'] # jpeg-xl library not commonly available
del EXTENSIONS['brunsli'] # Brunsli library not commonly available