forked from pool/python-mypy
- Add mypy-1.14.1-gcc15.patch from upstream to fix gcc15 compile
time error OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-mypy?expand=0&rev=31
This commit is contained in:
38
mypy-1.14.1-gcc15.patch
Normal file
38
mypy-1.14.1-gcc15.patch
Normal file
@@ -0,0 +1,38 @@
|
||||
|
||||
github.com/python/mypy/issues/18698
|
||||
github.com/python/mypy/pull/18699
|
||||
github.com/python/mypy/commit/0808624
|
||||
|
||||
From 0808624c67331f52c2d503ad8afe4f1087b0371c Mon Sep 17 00:00:00 2001
|
||||
From: "Michael R. Crusoe" <1330696+mr-c@users.noreply.github.com>
|
||||
Date: Tue, 18 Feb 2025 00:45:37 +0100
|
||||
Subject: [PATCH] pythoncapi_compat: don't define Py_NULL if it is already
|
||||
defined (#18699)
|
||||
|
||||
Fixes: #18698
|
||||
|
||||
This is a naive fix for the gcc 15 error when compiling for Python 3.12
|
||||
---
|
||||
mypyc/lib-rt/pythoncapi_compat.h | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
Index: mypy-1.14.1/mypyc/lib-rt/pythoncapi_compat.h
|
||||
===================================================================
|
||||
--- mypy-1.14.1.orig/mypyc/lib-rt/pythoncapi_compat.h 2024-12-30 15:26:58.000000000 +0100
|
||||
+++ mypy-1.14.1/mypyc/lib-rt/pythoncapi_compat.h 2025-05-05 16:10:16.167068167 +0200
|
||||
@@ -30,6 +30,7 @@
|
||||
# define _Py_CAST(type, expr) ((type)(expr))
|
||||
#endif
|
||||
|
||||
+#ifndef _Py_NULL
|
||||
// Static inline functions should use _Py_NULL rather than using directly NULL
|
||||
// to prevent C++ compiler warnings. On C23 and newer and on C++11 and newer,
|
||||
// _Py_NULL is defined as nullptr.
|
||||
@@ -39,6 +40,7 @@
|
||||
#else
|
||||
# define _Py_NULL NULL
|
||||
#endif
|
||||
+#endif
|
||||
|
||||
// Cast argument to PyObject* type.
|
||||
#ifndef _PyObject_CAST
|
||||
@@ -1,3 +1,9 @@
|
||||
-------------------------------------------------------------------
|
||||
Mon May 5 13:29:04 UTC 2025 - Friedrich Haubensak <hsk17@mail.de>
|
||||
|
||||
- Add mypy-1.14.1-gcc15.patch from upstream to fix gcc15 compile
|
||||
time error
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon May 5 12:58:47 UTC 2025 - Matej Cepl <mcepl@cepl.eu>
|
||||
|
||||
|
||||
@@ -29,10 +29,12 @@ URL: https://www.mypy-lang.org/
|
||||
Source0: https://files.pythonhosted.org/packages/source/m/mypy/mypy-%{version}.tar.gz
|
||||
# Source0: mypy-%%{version}.tar.gz
|
||||
# License Source1: Apache-2.0. Only for the test suite, not packaged here.
|
||||
Source1: https://files.pythonhosted.org/packages/source/t/types-psutil/types_psutil-%{types_psutil_version}.tar.gz
|
||||
Source1: https://files.pythonhosted.org/packages/source/t/types_psutil/types_psutil-%{types_psutil_version}.tar.gz
|
||||
# License Source2: Apache-2.0. Only for the test suite, not packaged here.
|
||||
Source2: https://files.pythonhosted.org/packages/source/t/types-setuptools/types_setuptools-%{types_setuptools_version}.tar.gz
|
||||
Source2: https://files.pythonhosted.org/packages/source/t/types_setuptools/types_setuptools-%{types_setuptools_version}.tar.gz
|
||||
Source99: python-mypy-rpmlintrc
|
||||
# PATCH-FIX-UPSTREAM
|
||||
Patch1: mypy-1.14.1-gcc15.patch
|
||||
BuildRequires: %{python_module exceptiongroup}
|
||||
BuildRequires: %{python_module mypy_extensions >= 1.0.0}
|
||||
BuildRequires: %{python_module pip}
|
||||
@@ -85,14 +87,13 @@ and union types.
|
||||
|
||||
%prep
|
||||
%setup -q -a1 -n mypy-%{version}
|
||||
%setup -T -D -a2 -n mypy-%{version}
|
||||
%setup -q -T -D -a2 -n mypy-%{version}
|
||||
%autopatch -p1
|
||||
|
||||
sed -i '/env python3/d' ./mypy/stubgenc.py
|
||||
sed -i '/env python3/d' ./mypy/stubgen.py
|
||||
|
||||
mkdir mystubs
|
||||
ls -l types_*
|
||||
mv types_setuptools-%{types_setuptools_version}/setuptools-stubs* mystubs/
|
||||
mv types_psutil-%{types_psutil_version}/psutil-stubs* mystubs/
|
||||
|
||||
|
||||
Reference in New Issue
Block a user