From d079e4d82d3c6e95a7374a11e15a739d51a074e20621b7ea25d0d28f983ee974 Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Thu, 25 Jan 2024 12:33:19 +0000 Subject: [PATCH 1/5] Accepting request 1140550 from home:Guillaume_G:branches:devel:languages:python - Add brunsli-devel as new dependency (fixes aarch64 build) OBS-URL: https://build.opensuse.org/request/show/1140550 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-imagecodecs?expand=0&rev=30 --- python-imagecodecs.changes | 5 +++++ python-imagecodecs.spec | 1 + 2 files changed, 6 insertions(+) diff --git a/python-imagecodecs.changes b/python-imagecodecs.changes index 1acee2b..8ff59db 100644 --- a/python-imagecodecs.changes +++ b/python-imagecodecs.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Mon Jan 22 10:05:23 UTC 2024 - Guillaume GARDET + +- Add brunsli-devel as new dependency (fixes aarch64 build) + ------------------------------------------------------------------- Wed Jan 3 18:33:00 UTC 2024 - Dirk Müller diff --git a/python-imagecodecs.spec b/python-imagecodecs.spec index d1043fa..90aa3f7 100644 --- a/python-imagecodecs.spec +++ b/python-imagecodecs.spec @@ -80,6 +80,7 @@ BuildRequires: %{python_module zstd} #BuildRequires: %%{python_module pyliblzfse} %else BuildRequires: CharLS-devel +BuildRequires: brunsli-devel BuildRequires: dav1d-devel BuildRequires: gcc-c++ BuildRequires: giflib-devel From 95989b50e23155575463af16b4d1e18e9c0469699d2bc62cad9dd5bbe1c6ba52 Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Thu, 25 Jan 2024 12:33:55 +0000 Subject: [PATCH 2/5] - remove 32bit builds OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-imagecodecs?expand=0&rev=31 --- python-imagecodecs.changes | 5 +++++ python-imagecodecs.spec | 1 + 2 files changed, 6 insertions(+) diff --git a/python-imagecodecs.changes b/python-imagecodecs.changes index 8ff59db..d2b1a8e 100644 --- a/python-imagecodecs.changes +++ b/python-imagecodecs.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Thu Jan 25 12:33:46 UTC 2024 - Dirk Müller + +- remove 32bit builds + ------------------------------------------------------------------- Mon Jan 22 10:05:23 UTC 2024 - Guillaume GARDET diff --git a/python-imagecodecs.spec b/python-imagecodecs.spec index 90aa3f7..071eeaa 100644 --- a/python-imagecodecs.spec +++ b/python-imagecodecs.spec @@ -33,6 +33,7 @@ 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 +ExcludeArch: %ix86 %arm32 ppc s390 BuildRequires: %{python_module Cython >= 3} BuildRequires: %{python_module base >= 3.8} BuildRequires: %{python_module numpy-devel} From 967c3510f949d736d08cd2b8f21523cd5a3eb0c1a92d2ba684cd85e3720f4092 Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Mon, 18 Mar 2024 12:27:43 +0000 Subject: [PATCH 3/5] - drop brunsli-devel as dependency until it actually ends up in factory OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-imagecodecs?expand=0&rev=32 --- python-imagecodecs.changes | 6 ++++++ python-imagecodecs.spec | 5 ++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/python-imagecodecs.changes b/python-imagecodecs.changes index d2b1a8e..3bb21cd 100644 --- a/python-imagecodecs.changes +++ b/python-imagecodecs.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Mon Mar 18 12:27:11 UTC 2024 - Dirk Müller + +- drop brunsli-devel as dependency until it actually ends up + in factory + ------------------------------------------------------------------- Thu Jan 25 12:33:46 UTC 2024 - Dirk Müller diff --git a/python-imagecodecs.spec b/python-imagecodecs.spec index 071eeaa..ffe80bd 100644 --- a/python-imagecodecs.spec +++ b/python-imagecodecs.spec @@ -1,5 +1,5 @@ # -# spec file +# spec file for package python-imagecodecs # # Copyright (c) 2024 SUSE LLC # @@ -45,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 @@ -81,7 +81,6 @@ BuildRequires: %{python_module zstd} #BuildRequires: %%{python_module pyliblzfse} %else BuildRequires: CharLS-devel -BuildRequires: brunsli-devel BuildRequires: dav1d-devel BuildRequires: gcc-c++ BuildRequires: giflib-devel From 769e707a33dcd6bae5e2202a22132ddb986cc767903d1014dd7ce127f015f987 Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Mon, 18 Mar 2024 13:44:29 +0000 Subject: [PATCH 4/5] M python-imagecodecs.spec Diff for working copy: . Index: python-imagecodecs.spec =================================================================== --- python-imagecodecs.spec (revision e87904b57a6b1535aabaced45c4bc670) +++ python-imagecodecs.spec (working copy) @@ -95,6 +95,7 @@ BuildRequires: rav1e-devel BuildRequires: snappy-devel BuildRequires: sz2-devel +BuildRequires: xz-devel BuildRequires: pkgconfig(blosc) BuildRequires: pkgconfig(blosc2) >= 2.7.1 BuildRequires: pkgconfig(bzip2) OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-imagecodecs?expand=0&rev=33 --- python-imagecodecs.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/python-imagecodecs.spec b/python-imagecodecs.spec index ffe80bd..4850264 100644 --- a/python-imagecodecs.spec +++ b/python-imagecodecs.spec @@ -95,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) From 84e882b2369981af726f4f5c6c3bf0dcc771c34bb9c5d75a4b41d4ca2f7067e2 Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Mon, 18 Mar 2024 19:46:13 +0000 Subject: [PATCH 5/5] - replace imagecodecs_distributor_setup.py with skip-rare-codecs.patch: this setuptools hook does not get called anymore with PEP517 builds OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-imagecodecs?expand=0&rev=34 --- imagecodecs_distributor_setup.py | 49 -------------------------------- python-imagecodecs.changes | 7 +++++ python-imagecodecs.spec | 14 ++------- skip-rare-codecs.patch | 11 +++++++ 4 files changed, 21 insertions(+), 60 deletions(-) delete mode 100644 imagecodecs_distributor_setup.py create mode 100644 skip-rare-codecs.patch 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