FindPython: Add support for Python 3.15

This commit is contained in:
Karolina Surma 2025-10-24 12:19:19 +02:00 committed by ngompa
commit 997fcb73fd
2 changed files with 57 additions and 0 deletions

53
cmake-python315.patch Normal file
View file

@ -0,0 +1,53 @@
From 6f962241806a2b7ab5921861bb63d6585a014e6a Mon Sep 17 00:00:00 2001
From: Karolina Surma <ksurma@redhat.com>
Date: Fri, 24 Oct 2025 12:07:54 +0200
Subject: [PATCH] FindPython: Add support for Python 3.15
---
Modules/FindPython/Support.cmake | 2 +-
Modules/FindPythonInterp.cmake | 2 +-
Modules/FindPythonLibs.cmake | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/Modules/FindPython/Support.cmake b/Modules/FindPython/Support.cmake
index 6d981a770d9..28f1bbf3936 100644
--- a/Modules/FindPython/Support.cmake
+++ b/Modules/FindPython/Support.cmake
@@ -24,7 +24,7 @@ if (NOT DEFINED _${_PYTHON_PREFIX}_REQUIRED_VERSION_MAJOR)
message (FATAL_ERROR "FindPython: INTERNAL ERROR")
endif()
if (_${_PYTHON_PREFIX}_REQUIRED_VERSION_MAJOR EQUAL "3")
- set(_${_PYTHON_PREFIX}_VERSIONS 3.14 3.13 3.12 3.11 3.10 3.9 3.8 3.7 3.6 3.5 3.4 3.3 3.2 3.1 3.0)
+ set(_${_PYTHON_PREFIX}_VERSIONS 3.15 3.14 3.13 3.12 3.11 3.10 3.9 3.8 3.7 3.6 3.5 3.4 3.3 3.2 3.1 3.0)
elseif (_${_PYTHON_PREFIX}_REQUIRED_VERSION_MAJOR EQUAL "2")
set(_${_PYTHON_PREFIX}_VERSIONS 2.7 2.6 2.5 2.4 2.3 2.2 2.1 2.0)
else()
diff --git a/Modules/FindPythonInterp.cmake b/Modules/FindPythonInterp.cmake
index 1f09f7f5c0c..81d61a84ba5 100644
--- a/Modules/FindPythonInterp.cmake
+++ b/Modules/FindPythonInterp.cmake
@@ -117,7 +117,7 @@ unset(_Python_NAMES)
set(_PYTHON1_VERSIONS 1.6 1.5)
set(_PYTHON2_VERSIONS 2.7 2.6 2.5 2.4 2.3 2.2 2.1 2.0)
-set(_PYTHON3_VERSIONS 3.14 3.13 3.12 3.11 3.10 3.9 3.8 3.7 3.6 3.5 3.4 3.3 3.2 3.1 3.0)
+set(_PYTHON3_VERSIONS 3.15 3.14 3.13 3.12 3.11 3.10 3.9 3.8 3.7 3.6 3.5 3.4 3.3 3.2 3.1 3.0)
if(PythonInterp_FIND_VERSION)
if(PythonInterp_FIND_VERSION_COUNT GREATER 1)
diff --git a/Modules/FindPythonLibs.cmake b/Modules/FindPythonLibs.cmake
index 869c113ca74..272b1760988 100644
--- a/Modules/FindPythonLibs.cmake
+++ b/Modules/FindPythonLibs.cmake
@@ -168,7 +168,7 @@ set(CMAKE_FIND_FRAMEWORK LAST)
set(_PYTHON1_VERSIONS 1.6 1.5)
set(_PYTHON2_VERSIONS 2.7 2.6 2.5 2.4 2.3 2.2 2.1 2.0)
-set(_PYTHON3_VERSIONS 3.14 3.13 3.12 3.11 3.10 3.9 3.8 3.7 3.6 3.5 3.4 3.3 3.2 3.1 3.0)
+set(_PYTHON3_VERSIONS 3.15 3.14 3.13 3.12 3.11 3.10 3.9 3.8 3.7 3.6 3.5 3.4 3.3 3.2 3.1 3.0)
if(PythonLibs_FIND_VERSION)
if(PythonLibs_FIND_VERSION_COUNT GREATER 1)
--
GitLab

View file

@ -118,6 +118,10 @@ Source5: %{name}.req
# https://bugzilla.redhat.com/show_bug.cgi?id=822796
Patch100: %{name}-findruby.patch
# Add Python 3.15 to cmake config
# https://gitlab.kitware.com/cmake/cmake/-/merge_requests/11350
Patch102: %{name}-python315.patch
# Patch for renaming on EPEL
%if 0%{?name_suffix:1}
Patch1: %{name}-rename.patch