From 892d2b529b994c9087bb2fe0b509f105e74299d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20R=C3=B6hling?= Date: Thu, 24 Nov 2022 21:44:14 +0100 Subject: [PATCH] Prefer default Python version regardless of CMP0094 Closes: #1024625 --- .../0001-Prefer-default-Python-version.patch | 29 +++++++++++++++---- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/debian/patches/0001-Prefer-default-Python-version.patch b/debian/patches/0001-Prefer-default-Python-version.patch index 28d742a25..d3de52ca3 100644 --- a/debian/patches/0001-Prefer-default-Python-version.patch +++ b/debian/patches/0001-Prefer-default-Python-version.patch @@ -1,18 +1,37 @@ From: =?utf-8?q?Timo_R=C3=B6hling?= -Date: Fri, 18 Nov 2022 17:29:27 +0100 +Date: Thu, 24 Nov 2022 21:40:09 +0100 Subject: Prefer default Python version +This patch prefers /usr/bin/python3 as interpreter over all others, +subject to version restrictions. CMP0094 is forced to the NEW +behavior, because the OLD behavior will always end up with the newest +installed Python version. + Forwarded: not-needed --- - Modules/FindPython/Support.cmake | 2 +- + Modules/FindPython/Support.cmake | 9 ++------- Modules/FindPythonInterp.cmake | 1 + - 2 files changed, 2 insertions(+), 1 deletion(-) + 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/Modules/FindPython/Support.cmake b/Modules/FindPython/Support.cmake -index 7a127e4..8767908 100644 +index 7a127e4..cfa852d 100644 --- a/Modules/FindPython/Support.cmake +++ b/Modules/FindPython/Support.cmake -@@ -1436,7 +1436,7 @@ if (DEFINED ${_PYTHON_PREFIX}_FIND_UNVERSIONED_NAMES) +@@ -1250,12 +1250,7 @@ endif() + unset (${_PYTHON_PREFIX}_SOABI) + + # Define lookup strategy +-cmake_policy (GET CMP0094 _${_PYTHON_PREFIX}_LOOKUP_POLICY) +-if (_${_PYTHON_PREFIX}_LOOKUP_POLICY STREQUAL "NEW") +- set (_${_PYTHON_PREFIX}_FIND_STRATEGY "LOCATION") +-else() +- set (_${_PYTHON_PREFIX}_FIND_STRATEGY "VERSION") +-endif() ++set (_${_PYTHON_PREFIX}_FIND_STRATEGY "LOCATION") + if (DEFINED ${_PYTHON_PREFIX}_FIND_STRATEGY) + if (NOT ${_PYTHON_PREFIX}_FIND_STRATEGY MATCHES "^(VERSION|LOCATION)$") + message (AUTHOR_WARNING "Find${_PYTHON_PREFIX}: ${${_PYTHON_PREFIX}_FIND_STRATEGY}: invalid value for '${_PYTHON_PREFIX}_FIND_STRATEGY'. 'VERSION' or 'LOCATION' expected.") +@@ -1436,7 +1431,7 @@ if (DEFINED ${_PYTHON_PREFIX}_FIND_UNVERSIONED_NAMES) set (_${_PYTHON_PREFIX}_FIND_UNVERSIONED_NAMES ${${_PYTHON_PREFIX}_FIND_UNVERSIONED_NAMES}) endif() else()