From ac9394069c67040ea265f6d760ac0da6f0dfb747 Mon Sep 17 00:00:00 2001 From: Tomas Popela Date: Thu, 6 Jun 2024 12:40:59 +0200 Subject: [PATCH] Update to 1.4.1 Resolves: RHEL-33603 --- 12402.patch | 96 ----------------------------------------------------- meson.spec | 5 +-- sources | 2 +- 3 files changed, 2 insertions(+), 101 deletions(-) delete mode 100644 12402.patch diff --git a/12402.patch b/12402.patch deleted file mode 100644 index b639d7e..0000000 --- a/12402.patch +++ /dev/null @@ -1,96 +0,0 @@ -From ddcc8b038c325cec8e1a0517b1b16e06213419b0 Mon Sep 17 00:00:00 2001 -From: Ralf Gommers -Date: Wed, 13 Dec 2023 15:03:07 +0100 -Subject: [PATCH] Don't use the removed importlib.resources.path with Python - 3.13+ - ---- - mesonbuild/dependencies/python.py | 8 +++++++- - mesonbuild/mesondata.py | 11 +++++++---- - mesonbuild/modules/python.py | 7 +++++-- - 3 files changed, 19 insertions(+), 7 deletions(-) - -diff --git a/mesonbuild/dependencies/python.py b/mesonbuild/dependencies/python.py -index fe778af..55d9c1a 100644 ---- a/mesonbuild/dependencies/python.py -+++ b/mesonbuild/dependencies/python.py -@@ -15,6 +15,7 @@ from __future__ import annotations - - import functools, json, os, textwrap - from pathlib import Path -+import sys - import typing as T - - from .. import mesonlib, mlog -@@ -112,8 +113,13 @@ class BasicPythonExternalProgram(ExternalProgram): - # Sanity check, we expect to have something that at least quacks in tune - - import importlib.resources -+ if sys.version_info >= (3, 13): -+ traversable = importlib.resources.files('mesonbuild.scripts').joinpath('python_info.py') -+ context_mgr = importlib.resources.as_file(traversable) -+ else: -+ context_mgr = importlib.resources.path('mesonbuild.scripts', 'python_info.py') - -- with importlib.resources.path('mesonbuild.scripts', 'python_info.py') as f: -+ with context_mgr as f: - cmd = self.get_command() + [str(f)] - env = os.environ.copy() - env['SETUPTOOLS_USE_DISTUTILS'] = 'stdlib' -diff --git a/mesonbuild/mesondata.py b/mesonbuild/mesondata.py -index da641fd..0f93a67 100644 ---- a/mesonbuild/mesondata.py -+++ b/mesonbuild/mesondata.py -@@ -16,6 +16,7 @@ from __future__ import annotations - - import importlib.resources - from pathlib import PurePosixPath, Path -+import sys - import typing as T - - if T.TYPE_CHECKING: -@@ -27,10 +28,12 @@ class DataFile: - - def write_once(self, path: Path) -> None: - if not path.exists(): -- data = importlib.resources.read_text( # [ignore encoding] it's on the next lines, Mr. Lint -- ('mesonbuild' / self.path.parent).as_posix().replace('/', '.'), -- self.path.name, -- encoding='utf-8') -+ -+ package = ('mesonbuild' / self.path.parent).as_posix().replace('/', '.') -+ if sys.version_info >= (3, 13): -+ data = importlib.resources.files(package).joinpath(self.path.name).read_text(encoding='utf-8') -+ else: -+ data = importlib.resources.read_text(package, self.path.name, encoding='utf-8') - path.write_text(data, encoding='utf-8') - - def write_to_private(self, env: 'Environment') -> Path: -diff --git a/mesonbuild/modules/python.py b/mesonbuild/modules/python.py -index ec95374..926a09b 100644 ---- a/mesonbuild/modules/python.py -+++ b/mesonbuild/modules/python.py -@@ -13,7 +13,7 @@ - # limitations under the License. - from __future__ import annotations - --import copy, json, os, shutil, re -+import copy, json, os, shutil, re, sys - import typing as T - - from . import ExtensionModule, ModuleInfo -@@ -407,7 +407,10 @@ class PythonModule(ExtensionModule): - import importlib.resources - pycompile = os.path.join(self.interpreter.environment.get_scratch_dir(), 'pycompile.py') - with open(pycompile, 'wb') as f: -- f.write(importlib.resources.read_binary('mesonbuild.scripts', 'pycompile.py')) -+ if sys.version_info >= (3, 13): -+ f.write(importlib.resources.files('mesonbuild.scripts').joinpath('pycompile.py').read_bytes()) -+ else: -+ f.write(importlib.resources.read_binary('mesonbuild.scripts', 'pycompile.py')) - - for i in self.installations.values(): - if isinstance(i, PythonExternalProgram) and i.run_bytecompile[i.info['version']]: --- -2.43.0 - diff --git a/meson.spec b/meson.spec index c5f06df..36485d7 100644 --- a/meson.spec +++ b/meson.spec @@ -6,7 +6,7 @@ %bcond_with check Name: meson -Version: 1.3.1 +Version: 1.4.1 Release: %autorelease Summary: High productivity build system @@ -14,9 +14,6 @@ License: Apache-2.0 URL: https://mesonbuild.com/ Source: https://github.com/mesonbuild/meson/releases/download/%{version_no_tilde .}/meson-%{version_no_tilde %{quote:}}.tar.gz -# Don't use the removed importlib.resources.path with Python 3.13+ -Patch: https://github.com/mesonbuild/meson/pull/12402.patch - BuildArch: noarch BuildRequires: python3-devel diff --git a/sources b/sources index a85ad78..7a3a1c9 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (meson-1.3.1.tar.gz) = 6e694beb70329535faca9405358c04e2fd5a490b0c0d2678d5831b7de3477e0fcf4f6a242f1bc6218da04ac4f6e096ee53cdf273c6b6a38a35d370e8c16694ba +SHA512 (meson-1.4.1.tar.gz) = 2616bcca70d5554407d4852aa3494e05e53aa8a33f58859ada42750221922fcb6ea7f3452844883f4800d77eed4a7289b061324871218f052219b3caa02dcc9e