Accepting request 1159128 from devel:languages:python

- replace imagecodecs_distributor_setup.py with
  skip-rare-codecs.patch: this setuptools hook does not get
  called anymore with PEP517 builds

- drop brunsli-devel as dependency until it actually ends up
  in factory

- remove 32bit builds

- Add brunsli-devel as new dependency (fixes aarch64 build)

OBS-URL: https://build.opensuse.org/request/show/1159128
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-imagecodecs?expand=0&rev=14
This commit is contained in:
Ana Guerrero 2024-03-19 16:29:34 +00:00 committed by Git OBS Bridge
commit f6330ec6fa
4 changed files with 41 additions and 62 deletions

View File

@ -1,49 +0,0 @@
# openSUSE extension setup to build python-imagecodecs
import os
import subprocess
import sys
def customize_build(EXTENSIONS, OPTIONS):
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['jpeg8'] # jpeg8 / libjegturbo 2.1.91 is beta and not available
del EXTENSIONS['lerc'] # LERC library not available
del EXTENSIONS['lz4f'] # requires static linking
del EXTENSIONS['mozjpeg'] # Win32 only
EXTENSIONS['avif']['libraries'] = [
'avif',
'aom',
'dav1d',
'rav1e',
]
if sys.maxsize < 2**63 - 1:
# no zfp on 32-bit platforms
del EXTENSIONS['zfp']
# avif tests fail on 32-bit
del EXTENSIONS['avif']
# spng build fail on 32-bit
del EXTENSIONS['spng']
else:
EXTENSIONS['avif']['libraries'].extend([
'SvtAv1Enc',
'SvtAv1Dec',
])
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,26 @@
-------------------------------------------------------------------
Mon Mar 18 19:45:10 UTC 2024 - Dirk Müller <dmueller@suse.com>
- replace imagecodecs_distributor_setup.py with
skip-rare-codecs.patch: this setuptools hook does not get
called anymore with PEP517 builds
-------------------------------------------------------------------
Mon Mar 18 12:27:11 UTC 2024 - Dirk Müller <dmueller@suse.com>
- drop brunsli-devel as dependency until it actually ends up
in factory
-------------------------------------------------------------------
Thu Jan 25 12:33:46 UTC 2024 - Dirk Müller <dmueller@suse.com>
- remove 32bit builds
-------------------------------------------------------------------
Mon Jan 22 10:05:23 UTC 2024 - Guillaume GARDET <guillaume.gardet@opensuse.org>
- Add brunsli-devel as new dependency (fixes aarch64 build)
-------------------------------------------------------------------
Wed Jan 3 18:33:00 UTC 2024 - Dirk Müller <dmueller@suse.com>

View File

@ -1,5 +1,5 @@
#
# spec file
# spec file for package python-imagecodecs
#
# Copyright (c) 2024 SUSE LLC
#
@ -32,7 +32,8 @@ 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
Source1: imagecodecs_distributor_setup.py
Patch1: skip-rare-codecs.patch
ExcludeArch: %ix86 %arm32 ppc s390
BuildRequires: %{python_module Cython >= 3}
BuildRequires: %{python_module base >= 3.8}
BuildRequires: %{python_module numpy-devel}
@ -44,7 +45,7 @@ BuildRequires: fdupes
BuildRequires: python-rpm-macros
Requires: python-numpy
Requires(post): update-alternatives
Requires(postun):update-alternatives
Requires(postun): update-alternatives
Recommends: python-Pillow
Recommends: python-blosc
Recommends: python-lz4
@ -94,6 +95,7 @@ BuildRequires: pkgconfig
BuildRequires: rav1e-devel
BuildRequires: snappy-devel
BuildRequires: sz2-devel
BuildRequires: xz-devel
BuildRequires: pkgconfig(blosc)
BuildRequires: pkgconfig(blosc2) >= 2.7.1
BuildRequires: pkgconfig(bzip2)
@ -137,15 +139,7 @@ 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
dos2unix imagecodecs/libavif.pxd
dos2unix imagecodecs/_avif.pyx
dos2unix imagecodecs/imagecodecs.py
%autopatch -p1
cp %SOURCE1 ./
%autosetup -p1 -n imagecodecs-%{version}
dos2unix README.rst
# These libraries are not linked to, (check SOURCE1)
rm imagecodecs/licenses/LICENSE-brunsli
@ -179,7 +173,7 @@ donttest+=" or test_cms"
%ifarch %ix86 %arm32
donttest="$donttest or spng"
%endif
%pytest_arch -n auto tests -rsXfE --doctest-modules %{$python_sitearch}/imagecodecs/imagecodecs.py -k "not ($donttest ${$python_donttest})"
%pytest_arch -n auto tests -rsXfE -k "not ($donttest ${$python_donttest})"
%endif
%if !%{with test}

11
skip-rare-codecs.patch Normal file
View File

@ -0,0 +1,11 @@
--- 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