Expand debian/patches/FindPython_fix_#580503.diff to cover #569321 too.

Actually a very small change: just also check if there is a specific
version requested, otherwise proceed as with the previous patch.

Signed-off-by: Kai Wasserbäch <debian@carbon-project.org>
ci/unstable
Kai Wasserbäch 15 years ago
parent 6ae03be2f1
commit 08958f98ad

5
debian/changelog vendored

@ -1,10 +1,11 @@
cmake (2.8.1-6) UNRELEASED; urgency=low
* debian/patches/FindPython_fix_#580503.diff: Added. (Closes: #580503)
* debian/patches/debian/patches/FindPython_fix_#569321_and_#580503.diff:
Added. (Closes: #569321, #580503)
* debian/cmake-data.NEWS: Document the changes of the new patch, so nobody
gets surprised.
-- Kai Wasserbäch <debian@carbon-project.org> Thu, 03 Jun 2010 15:20:02 +0200
-- Kai Wasserbäch <debian@carbon-project.org> Thu, 03 Jun 2010 16:25:20 +0200
cmake (2.8.1-5) unstable; urgency=low

@ -3,13 +3,12 @@ Changes in behaviour of FindPython{Interp,Libs}
If you're a user of the FindPythonInterp.cmake or FindPythonLibs.cmake script be
advised, that there is a change in its behaviour. From the 2.8.1-6 package
onwards the Debian version of these scripts will always return the requested
information for the default Python version in Debian. At the time of this
writing the scripts would return you Python version 2.5.
If - for whatever reason - you want the old behaviour (latest found version)
back, please add the following line before calling either
find_package(PythonInterp) or find_package(PythonLibs) (or both):
set(NO_DEBIAN_PY_DEFAULT true)
onwards the Debian version of these scripts will act like the following:
1. If you've defined CMAKE_PYTHON_VERSION with a specific version, say 2.6,
the script will only check for the requested version.
2. If no version was requested, we'll try to find the defaul Python version
for Debian and return that information.
3. If you want the old behaviour (return the latest version), then you'll
need to set NO_DEBIAN_PY_DEFAULT to true before calling either script.
-- Kai Wasserbäch <debian@carbon-project.org> Thu, 03 Jun 2010 15:15:59 +0200

@ -0,0 +1,88 @@
From: Kai Wasserbäch <debian@carbon-project.org>
Description: Make the Python CMake scripts more versatile in version handling.
The FindPython{Interp,Libs}.cmake scripts need to cater for a set version or,
failing that, in Debian, set the default version for Python in Debian.
.
This patch addresses both issues. (Closes: #569321, #580503)
.
Parts of this patch were sent upstream (the "request a specific version" part).
The part for requesting a specific version was written by Didier Raboud
<didier@raboud.com>.
Last-Update: 2010-06-03
Origin: vendor
Forwarded: yes
--- a/Modules/FindPythonInterp.cmake
+++ b/Modules/FindPythonInterp.cmake
@@ -19,19 +19,30 @@
# (To distributed this file outside of CMake, substitute the full
# License text for the above reference.)
-FIND_PROGRAM(PYTHON_EXECUTABLE
- NAMES python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python2.0 python1.6 python1.5 python
- PATHS
- [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.6\\InstallPath]
- [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.5\\InstallPath]
- [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.4\\InstallPath]
- [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.3\\InstallPath]
- [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.2\\InstallPath]
- [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.1\\InstallPath]
- [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.0\\InstallPath]
- [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\1.6\\InstallPath]
- [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\1.5\\InstallPath]
- )
+# The following was added for Debian by Kai Wasserbäch
+# <debian@carbon-project.org> in 2010 and based on suggestions and patches by
+# Didier Raboud <didier@raboud.com> and Jakub Wilk <jwilk@debian.org> to fix the
+# following bugs: #569321 and #580503.
+# For further information please see the Debian.NEWS file for cmake-data.
+IF(CMAKE_PYTHON_VERSION)
+ SET(CMAKE_PYTHON_VERSIONS ${CMAKE_PYTHON_VERSION})
+ELSE(CMAKE_PYTHON_VERSION)
+ IF(NO_DEBIAN_PY_DEFAULT)
+ SET(CMAKE_PYTHON_VERSIONS 2.6 2.5 2.4 2.3 2.2 2.1 2.0 1.6 1.5)
+ ELSE(NO_DEBIAN_PY_DEFAULT)
+ EXECUTE_PROCESS(COMMAND pyversions -dv
+ OUTPUT_VARIABLE _CMAKE_PYTHON_VERSIONS)
+ STRING(REPLACE "\n" "" CMAKE_PYTHON_VERSIONS ${_CMAKE_PYTHON_VERSIONS})
+ ENDIF(NO_DEBIAN_PY_DEFAULT)
+ENDIF(CMAKE_PYTHON_VERSION)
+
+FOREACH(_CURRENT_VERSION ${CMAKE_PYTHON_VERSIONS})
+ FIND_PROGRAM(PYTHON_EXECUTABLE
+ NAMES python${_CURRENT_VERSION}
+ PATHS
+ [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]
+ )
+ENDFOREACH(_CURRENT_VERSION)
# handle the QUIETLY and REQUIRED arguments and set PYTHONINTERP_FOUND to TRUE if
# all listed variables are TRUE
--- a/Modules/FindPythonLibs.cmake
+++ b/Modules/FindPythonLibs.cmake
@@ -27,7 +27,24 @@ INCLUDE(CMakeFindFrameworks)
# Search for the python framework on Apple.
CMAKE_FIND_FRAMEWORKS(Python)
-FOREACH(_CURRENT_VERSION 2.6 2.5 2.4 2.3 2.2 2.1 2.0 1.6 1.5)
+# The following was added for Debian by Kai Wasserbäch
+# <debian@carbon-project.org> in 2010 and based on suggestions and patches by
+# Didier Raboud <didier@raboud.com> and Jakub Wilk <jwilk@debian.org> to fix the
+# following bugs: #569321 and #580503.
+# For further information please see the Debian.NEWS file for cmake-data.
+IF(CMAKE_PYTHON_VERSION)
+ SET(CMAKE_PYTHON_VERSIONS ${CMAKE_PYTHON_VERSION})
+ELSE(CMAKE_PYTHON_VERSION)
+ IF(NO_DEBIAN_PY_DEFAULT)
+ SET(CMAKE_PYTHON_VERSIONS 2.6 2.5 2.4 2.3 2.2 2.1 2.0 1.6 1.5)
+ ELSE(NO_DEBIAN_PY_DEFAULT)
+ EXECUTE_PROCESS(COMMAND pyversions -dv
+ OUTPUT_VARIABLE _CMAKE_PYTHON_VERSIONS)
+ STRING(REPLACE "\n" "" CMAKE_PYTHON_VERSIONS ${_CMAKE_PYTHON_VERSIONS})
+ ENDIF(NO_DEBIAN_PY_DEFAULT)
+ENDIF(CMAKE_PYTHON_VERSION)
+
+FOREACH(_CURRENT_VERSION ${CMAKE_PYTHON_VERSIONS})
STRING(REPLACE "." "" _CURRENT_VERSION_NO_DOTS ${_CURRENT_VERSION})
IF(WIN32)
FIND_LIBRARY(PYTHON_DEBUG_LIBRARY

@ -1,91 +0,0 @@
From: Kai Wasserbäch <debian@carbon-project.org>
Subject: Return the Debian default for Python, unless requested otherwise.
Last-Update: 2010-05-31
Origin: vendor
Forwarded: not-needed
--- a/Modules/FindPythonInterp.cmake
+++ b/Modules/FindPythonInterp.cmake
@@ -5,6 +5,12 @@
# PYTHONINTERP_FOUND - Was the Python executable found
# PYTHON_EXECUTABLE - path to the Python interpreter
#
+# This file was modified in 2010 for Debian by Kai Wasserbäch
+# <debian@carbon-project.org> to return the current Python default interpreter
+# in Debian.
+# If you want the original behaviour (return the latest interpreter version),
+# you need to set(NO_DEBIAN_PY_DEFAULT true) before you call
+# find_package(PythonInterp)
#=============================================================================
# Copyright 2005-2009 Kitware, Inc.
@@ -19,19 +25,25 @@
# (To distributed this file outside of CMake, substitute the full
# License text for the above reference.)
-FIND_PROGRAM(PYTHON_EXECUTABLE
- NAMES python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python2.0 python1.6 python1.5 python
- PATHS
- [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.6\\InstallPath]
- [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.5\\InstallPath]
- [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.4\\InstallPath]
- [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.3\\InstallPath]
- [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.2\\InstallPath]
- [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.1\\InstallPath]
- [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.0\\InstallPath]
- [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\1.6\\InstallPath]
- [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\1.5\\InstallPath]
- )
+IF(NO_DEBIAN_PY_DEFAULT)
+ FIND_PROGRAM(PYTHON_EXECUTABLE
+ NAMES python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python2.0 python1.6 python1.5 python
+ PATHS
+ [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.6\\InstallPath]
+ [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.5\\InstallPath]
+ [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.4\\InstallPath]
+ [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.3\\InstallPath]
+ [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.2\\InstallPath]
+ [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.1\\InstallPath]
+ [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.0\\InstallPath]
+ [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\1.6\\InstallPath]
+ [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\1.5\\InstallPath]
+ )
+ELSE(NO_DEBIAN_PY_DEFAULT)
+ FIND_PROGRAM(PYTHON_EXECUTABLE
+ NAMES python
+ )
+ENDIF(NO_DEBIAN_PY_DEFAULT)
# handle the QUIETLY and REQUIRED arguments and set PYTHONINTERP_FOUND to TRUE if
# all listed variables are TRUE
--- a/Modules/FindPythonLibs.cmake
+++ b/Modules/FindPythonLibs.cmake
@@ -9,6 +9,12 @@
# PYTHON_INCLUDE_DIRS - path to where Python.h is found
# PYTHON_DEBUG_LIBRARIES - path to the debug library
#
+# This file was modified in 2010 for Debian by Kai Wasserbäch
+# <debian@carbon-project.org> to return the current Python default interpreter
+# in Debian.
+# If you want the original behaviour (return the latest interpreter version),
+# you need to set(NO_DEBIAN_PY_DEFAULT true) before you call
+# find_package(PythonLibs)
#=============================================================================
# Copyright 2001-2009 Kitware, Inc.
@@ -27,7 +33,15 @@ INCLUDE(CMakeFindFrameworks)
# Search for the python framework on Apple.
CMAKE_FIND_FRAMEWORKS(Python)
+IF(NO_DEBIAN_PY_DEFAULT)
FOREACH(_CURRENT_VERSION 2.6 2.5 2.4 2.3 2.2 2.1 2.0 1.6 1.5)
+ELSE(NO_DEBIAN_PY_DEFAULT)
+EXECUTE_PROCESS(COMMAND pyversions -d
+ OUTPUT_VARIABLE _DEB_PY_DEFAULT)
+STRING(REPLACE "python" "" _DEB_PY_STRIP ${_DEB_PY_DEFAULT})
+STRING(REPLACE "\n" "" DEB_PY_DEFAULT ${_DEB_PY_STRIP})
+FOREACH(_CURRENT_VERSION ${DEB_PY_DEFAULT})
+ENDIF(NO_DEBIAN_PY_DEFAULT)
STRING(REPLACE "." "" _CURRENT_VERSION_NO_DOTS ${_CURRENT_VERSION})
IF(WIN32)
FIND_LIBRARY(PYTHON_DEBUG_LIBRARY

@ -3,4 +3,4 @@ kFreeBSD_Hurd_fixes.diff
FindGTK2_pangommconfig.diff
FindJNI_fix_libarch_determination.diff
cpack_installed_size.diff
FindPython_fix_#580503.diff
FindPython_fix_#569321_and_#580503.diff

Loading…
Cancel
Save