From cdf5b807274180c3eddc2a89d91b52216e481ad5 Mon Sep 17 00:00:00 2001 From: Orion Poplawski Date: Wed, 5 Mar 2014 10:10:19 -0700 Subject: [PATCH] Add additional FindPythonLibs patch from upstream (bug #1072964) --- cmake-FindPythonLibs.patch | 51 +++++++++++++++++++++++++------------ cmake-FindPythonLibs2.patch | 31 ++++++++++++++++++++++ cmake.spec | 5 +++- 3 files changed, 70 insertions(+), 17 deletions(-) create mode 100644 cmake-FindPythonLibs2.patch diff --git a/cmake-FindPythonLibs.patch b/cmake-FindPythonLibs.patch index 1433d3f..dd5afd1 100644 --- a/cmake-FindPythonLibs.patch +++ b/cmake-FindPythonLibs.patch @@ -1,7 +1,29 @@ -diff -rupN cmake/Modules/FindPythonLibs.cmake new/Modules/FindPythonLibs.cmake ---- cmake/Modules/FindPythonLibs.cmake 2013-04-12 14:09:08.470669049 -0500 -+++ new/Modules/FindPythonLibs.cmake 2013-04-12 15:41:15.789496153 -0500 -@@ -69,10 +69,21 @@ endif() +From 3816cd2dc7a7cc220e4f1b1e87fee986545b9cb3 Mon Sep 17 00:00:00 2001 +From: Matt McCormick +Date: Wed, 26 Feb 2014 21:47:20 -0500 +Subject: [PATCH] FindPythonLibs: Find consistent Python interp, headers, libs + (#13794) + +When possible, get consistent version of the Python interpreter, headers path, +and library. + +Now find_package(PythonLibs) internally calls find_package(PythonInterp +QUIET) and uses the resulting PYTHON_VERSION_MAJOR and +PYTHON_VERSION_MINOR to prefer these versions when looking for the +header path and library. The Python_ADDITIONAL_VERSIONS variable has +priority over the interpreter version. + +Co-Author: Adam Wolf +Co-Author: Gert Wollny +--- + Modules/FindPythonLibs.cmake | 13 +++++++++---- + 1 file changed, 9 insertions(+), 4 deletions(-) + +diff --git a/Modules/FindPythonLibs.cmake b/Modules/FindPythonLibs.cmake +index 0749efc..27d9e45 100644 +--- a/Modules/FindPythonLibs.cmake ++++ b/Modules/FindPythonLibs.cmake +@@ -80,10 +80,15 @@ endif() # Set up the versions we know about, in the order we will search. Always add # the user supplied additional versions to the front. @@ -9,21 +31,18 @@ diff -rupN cmake/Modules/FindPythonLibs.cmake new/Modules/FindPythonLibs.cmake - ${Python_ADDITIONAL_VERSIONS} - ${_PYTHON_FIND_OTHER_VERSIONS} - ) -+# If FindPythonInterp has already found the major and minor version, ++# If FindPythonInterp has already found the major and minor version, +# insert that version between the user supplied versions and the stock -+# version list. ++# version list. ++find_package(PythonInterp QUIET) ++set(_Python_VERSIONS ${Python_ADDITIONAL_VERSIONS}) +if(DEFINED PYTHON_VERSION_MAJOR AND DEFINED PYTHON_VERSION_MINOR) -+ set(_Python_VERSIONS -+ ${Python_ADDITIONAL_VERSIONS} -+ ${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR} -+ ${_PYTHON_FIND_OTHER_VERSIONS} -+ ) -+else() -+ set(_Python_VERSIONS -+ ${Python_ADDITIONAL_VERSIONS} -+ ${_PYTHON_FIND_OTHER_VERSIONS} -+ ) ++ list(APPEND _Python_VERSIONS ${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}) +endif() ++list(APPEND _Python_VERSIONS ${_PYTHON_FIND_OTHER_VERSIONS}) unset(_PYTHON_FIND_OTHER_VERSIONS) unset(_PYTHON1_VERSIONS) +-- +1.7.10.4 + diff --git a/cmake-FindPythonLibs2.patch b/cmake-FindPythonLibs2.patch new file mode 100644 index 0000000..6dca914 --- /dev/null +++ b/cmake-FindPythonLibs2.patch @@ -0,0 +1,31 @@ +From bf28ff1f422407f10ecc283f03ce8c5ee57f1812 Mon Sep 17 00:00:00 2001 +From: Brad King +Date: Wed, 5 Mar 2014 11:57:00 -0500 +Subject: [PATCH] FindPythonLibs: Do not try to find the interpreter (#13794) + +The parent commit taught FindPythonLibs to try to find PythonInterp +unconditionally. Some projects may want the libraries of a specific +version even when the corresponding interpreter is not available. Drop +the internal use of FindPythonInterp and just use the versions from it +if it happens to have been found by the project first. That will allow +projects to get a consistent version when they want both but not +otherwise force them to find the interpreter. +--- + Modules/FindPythonLibs.cmake | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/Modules/FindPythonLibs.cmake b/Modules/FindPythonLibs.cmake +index 27d9e45..656ed7b 100644 +--- a/Modules/FindPythonLibs.cmake ++++ b/Modules/FindPythonLibs.cmake +@@ -83,7 +83,6 @@ endif() + # If FindPythonInterp has already found the major and minor version, + # insert that version between the user supplied versions and the stock + # version list. +-find_package(PythonInterp QUIET) + set(_Python_VERSIONS ${Python_ADDITIONAL_VERSIONS}) + if(DEFINED PYTHON_VERSION_MAJOR AND DEFINED PYTHON_VERSION_MINOR) + list(APPEND _Python_VERSIONS ${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}) +-- +1.7.10.4 + diff --git a/cmake.spec b/cmake.spec index 8f7af1c..4bcdcbf 100644 --- a/cmake.spec +++ b/cmake.spec @@ -54,6 +54,8 @@ Patch7: cmake-desktop_icon.patch # Remove automatic Qt module dep adding # http://public.kitware.com/Bug/view.php?id=14750 Patch8: cmake-qtdeps.patch +# Additiona python fixes from upstream +Patch9: cmake-FindPythonLibs2.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -123,6 +125,7 @@ The %{name}-gui package contains the Qt based GUI for CMake. %patch6 -p1 %patch7 -p1 %patch8 -p1 +%patch9 -p1 # Setup copyright docs for main package mkdir _doc find Source Utilities -type f -iname copy\* | while read f @@ -237,7 +240,7 @@ update-mime-database %{_datadir}/mime &> /dev/null || : %changelog * Wed Mar 5 2014 Orion Poplawski - 3.0.0-0.4.rc1 -- Revert to Fedora version of FindPythonLibs patch (bug #1072964) +- Add additional FindPythonLibs patch from upstream (bug #1072964) * Mon Mar 3 2014 Orion Poplawski - 3.0.0-0.3.rc1 - Update to upstreams version of FindPythonLibs patch