diff --git a/imagecodecs_distributor_setup.py b/imagecodecs_distributor_setup.py deleted file mode 100644 index de2f803..0000000 --- a/imagecodecs_distributor_setup.py +++ /dev/null @@ -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'] - \ No newline at end of file diff --git a/python-imagecodecs.changes b/python-imagecodecs.changes index 3bb21cd..a5ecda1 100644 --- a/python-imagecodecs.changes +++ b/python-imagecodecs.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Mon Mar 18 19:45:10 UTC 2024 - Dirk Müller + +- 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 diff --git a/python-imagecodecs.spec b/python-imagecodecs.spec index 4850264..05012fd 100644 --- a/python-imagecodecs.spec +++ b/python-imagecodecs.spec @@ -32,7 +32,7 @@ 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} @@ -139,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 @@ -181,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} diff --git a/skip-rare-codecs.patch b/skip-rare-codecs.patch new file mode 100644 index 0000000..c10c2b2 --- /dev/null +++ b/skip-rare-codecs.patch @@ -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