[arch-commits] Commit in cmake/trunk (PKGBUILD python-3.5.patch)
Felix Yan
fyan at archlinux.org
Sun Sep 20 03:10:22 UTC 2015
Date: Sunday, September 20, 2015 @ 05:10:21
Author: fyan
Revision: 246720
upgpkg: cmake 3.3.2-3
- the last patch for python 3.5 is not sufficient - let's fix it again!
Modified:
cmake/trunk/PKGBUILD
cmake/trunk/python-3.5.patch
------------------+
PKGBUILD | 4 -
python-3.5.patch | 183 ++++++++++++++++++++++++++++++++++++++++++++++++-----
2 files changed, 170 insertions(+), 17 deletions(-)
Modified: PKGBUILD
===================================================================
--- PKGBUILD 2015-09-20 02:31:48 UTC (rev 246719)
+++ PKGBUILD 2015-09-20 03:10:21 UTC (rev 246720)
@@ -5,7 +5,7 @@
pkgname=cmake
pkgver=3.3.2
-pkgrel=2
+pkgrel=3
pkgdesc='A cross-platform open-source make system'
arch=('i686' 'x86_64')
url="http://www.cmake.org/"
@@ -18,7 +18,7 @@
source=("http://www.cmake.org/files/v${pkgver%.*}/${pkgname}-${pkgver}.tar.gz" 'kdelibs-4.14.11.patch' 'python-3.5.patch')
md5sums=('5febbd11bcaac854a27eebaf4a124be2'
'1eeec67ab4bff6d92430d52acdbde142'
- 'cc5305ef44b935ef85e5ed2773a01aee')
+ 'c172343ccd88551f8858de1c8806ab79')
prepare() {
cd ${pkgname}-${pkgver}
Modified: python-3.5.patch
===================================================================
--- python-3.5.patch 2015-09-20 02:31:48 UTC (rev 246719)
+++ python-3.5.patch 2015-09-20 03:10:21 UTC (rev 246720)
@@ -1,13 +1,3 @@
-From 2db092b1f60b3677a2d44d5563bec216ae687e2f Mon Sep 17 00:00:00 2001
-From: David Gobbi <david.gobbi at gmail.com>
-Date: Mon, 14 Sep 2015 21:44:36 -0600
-Subject: [PATCH] FindPython{Interp,Libs}: Add versions 3.5 and 3.6
-
----
- Modules/FindPythonInterp.cmake | 2 +-
- Modules/FindPythonLibs.cmake | 2 +-
- 2 files changed, 2 insertions(+), 2 deletions(-)
-
diff --git a/Modules/FindPythonInterp.cmake b/Modules/FindPythonInterp.cmake
index 8784e18..879192e 100644
--- a/Modules/FindPythonInterp.cmake
@@ -21,12 +11,44 @@
if(PythonInterp_FIND_VERSION)
if(PythonInterp_FIND_VERSION_COUNT GREATER 1)
-diff --git a/Modules/FindPythonLibs.cmake b/Modules/FindPythonLibs.cmake
-index b80d3ce..d01fae4 100644
---- a/Modules/FindPythonLibs.cmake
-+++ b/Modules/FindPythonLibs.cmake
-@@ -64,7 +64,7 @@ set(CMAKE_FIND_FRAMEWORK LAST)
+--- a/Modules/FindPythonLibs.cmake 2015-09-17 00:53:05.000000000 +0800
++++ b/Modules/FindPythonLibs.cmake 2015-09-20 10:49:56.252386270 +0800
+@@ -49,13 +49,41 @@
+ # (To distribute this file outside of CMake, substitute the full
+ # License text for the above reference.)
++# Use the executable's path as a hint
++set(_Python_LIBRARY_PATH_HINT)
++if(PYTHON_EXECUTABLE)
++ if(WIN32)
++ get_filename_component(_Python_PREFIX ${PYTHON_EXECUTABLE} PATH)
++ if(_Python_PREFIX)
++ set(_Python_LIBRARY_PATH_HINT ${_Python_PREFIX}/libs)
++ endif()
++ unset(_Python_PREFIX)
++ else()
++ get_filename_component(_Python_PREFIX ${PYTHON_EXECUTABLE} PATH)
++ get_filename_component(_Python_PREFIX ${_Python_PREFIX} PATH)
++ if(_Python_PREFIX)
++ set(_Python_LIBRARY_PATH_HINT ${_Python_PREFIX}/lib)
++ endif()
++ unset(_Python_PREFIX)
++ endif()
++endif()
++
+ include(${CMAKE_CURRENT_LIST_DIR}/CMakeFindFrameworks.cmake)
+ # Search for the python framework on Apple.
+ CMAKE_FIND_FRAMEWORKS(Python)
+
++# Save CMAKE_FIND_FRAMEWORK
++if(DEFINED CMAKE_FIND_FRAMEWORK)
++ set(_PythonLibs_CMAKE_FIND_FRAMEWORK ${CMAKE_FIND_FRAMEWORK})
++else()
++ unset(_PythonLibs_CMAKE_FIND_FRAMEWORK)
++endif()
++# To avoid picking up the system Python.h pre-maturely.
++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.4 3.3 3.2 3.1 3.0)
@@ -34,3 +56,134 @@
if(PythonLibs_FIND_VERSION)
if(PythonLibs_FIND_VERSION_COUNT GREATER 1)
+@@ -103,6 +131,7 @@
+ if(WIN32)
+ find_library(PYTHON_DEBUG_LIBRARY
+ NAMES python${_CURRENT_VERSION_NO_DOTS}_d python
++ HINTS ${_Python_LIBRARY_PATH_HINT}
+ PATHS
+ [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/libs/Debug
+ [HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/libs/Debug
+@@ -111,14 +140,24 @@
+ )
+ endif()
+
++ set(PYTHON_FRAMEWORK_LIBRARIES)
++ if(Python_FRAMEWORKS AND NOT PYTHON_LIBRARY)
++ foreach(dir ${Python_FRAMEWORKS})
++ list(APPEND PYTHON_FRAMEWORK_LIBRARIES
++ ${dir}/Versions/${_CURRENT_VERSION}/lib)
++ endforeach()
++ endif()
+ find_library(PYTHON_LIBRARY
+ NAMES
+- python${_CURRENT_VERSION_NO_DOTS}
+- python${_CURRENT_VERSION}mu
+- python${_CURRENT_VERSION}m
+- python${_CURRENT_VERSION}u
+- python${_CURRENT_VERSION}
++ python${_CURRENT_VERSION_NO_DOTS}
++ python${_CURRENT_VERSION}mu
++ python${_CURRENT_VERSION}m
++ python${_CURRENT_VERSION}u
++ python${_CURRENT_VERSION}
++ HINTS
++ ${_Python_LIBRARY_PATH_HINT}
+ PATHS
++ ${PYTHON_FRAMEWORK_LIBRARIES}
+ [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/libs
+ [HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/libs
+ # Avoid finding the .dll in the PATH. We want the .lib.
+@@ -133,33 +172,42 @@
+ PATH_SUFFIXES python${_CURRENT_VERSION}/config
+ )
+
+- # For backward compatibility, honour value of PYTHON_INCLUDE_PATH, if
+- # PYTHON_INCLUDE_DIR is not set.
+- if(DEFINED PYTHON_INCLUDE_PATH AND NOT DEFINED PYTHON_INCLUDE_DIR)
+- set(PYTHON_INCLUDE_DIR "${PYTHON_INCLUDE_PATH}" CACHE PATH
+- "Path to where Python.h is found" FORCE)
+- endif()
++ # Don't search for include dir until library location is known
++ if(PYTHON_LIBRARY)
+
+- set(PYTHON_FRAMEWORK_INCLUDES)
+- if(Python_FRAMEWORKS AND NOT PYTHON_INCLUDE_DIR)
+- foreach(dir ${Python_FRAMEWORKS})
+- set(PYTHON_FRAMEWORK_INCLUDES ${PYTHON_FRAMEWORK_INCLUDES}
+- ${dir}/Versions/${_CURRENT_VERSION}/include/python${_CURRENT_VERSION})
+- endforeach()
+- endif()
++ # Use the library's install prefix as a hint
++ set(_Python_INCLUDE_PATH_HINT)
++ get_filename_component(_Python_PREFIX ${PYTHON_LIBRARY} PATH)
++ get_filename_component(_Python_PREFIX ${_Python_PREFIX} PATH)
++ if(_Python_PREFIX)
++ set(_Python_INCLUDE_PATH_HINT ${_Python_PREFIX}/include)
++ endif()
++ unset(_Python_PREFIX)
+
+- find_path(PYTHON_INCLUDE_DIR
+- NAMES Python.h
+- PATHS
+- ${PYTHON_FRAMEWORK_INCLUDES}
+- [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/include
+- [HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/include
+- PATH_SUFFIXES
+- python${_CURRENT_VERSION}mu
+- python${_CURRENT_VERSION}m
+- python${_CURRENT_VERSION}u
+- python${_CURRENT_VERSION}
+- )
++ # Add framework directories to the search paths
++ set(PYTHON_FRAMEWORK_INCLUDES)
++ if(Python_FRAMEWORKS AND NOT PYTHON_INCLUDE_DIR)
++ foreach(dir ${Python_FRAMEWORKS})
++ list(APPEND PYTHON_FRAMEWORK_INCLUDES
++ ${dir}/Versions/${_CURRENT_VERSION}/include)
++ endforeach()
++ endif()
++
++ find_path(PYTHON_INCLUDE_DIR
++ NAMES Python.h
++ HINTS
++ ${_Python_INCLUDE_PATH_HINT}
++ PATHS
++ ${PYTHON_FRAMEWORK_INCLUDES}
++ [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/include
++ [HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/include
++ PATH_SUFFIXES
++ python${_CURRENT_VERSION}mu
++ python${_CURRENT_VERSION}m
++ python${_CURRENT_VERSION}u
++ python${_CURRENT_VERSION}
++ )
++ endif()
+
+ # For backward compatibility, set PYTHON_INCLUDE_PATH.
+ set(PYTHON_INCLUDE_PATH "${PYTHON_INCLUDE_DIR}")
+@@ -177,6 +225,9 @@
+ endif()
+ endforeach()
+
++unset(_Python_INCLUDE_PATH_HINT)
++unset(_Python_LIBRARY_PATH_HINT)
++
+ mark_as_advanced(
+ PYTHON_DEBUG_LIBRARY
+ PYTHON_LIBRARY
+@@ -201,6 +252,14 @@
+ # for historical reasons.
+ unset(PYTHON_FOUND)
+
++# Restore CMAKE_FIND_FRAMEWORK
++if(DEFINED _PythonLibs_CMAKE_FIND_FRAMEWORK)
++ set(CMAKE_FIND_FRAMEWORK ${_PythonLibs_CMAKE_FIND_FRAMEWORK})
++ unset(_PythonLibs_CMAKE_FIND_FRAMEWORK)
++else()
++ unset(CMAKE_FIND_FRAMEWORK)
++endif()
++
+ include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+ FIND_PACKAGE_HANDLE_STANDARD_ARGS(PythonLibs
+ REQUIRED_VARS PYTHON_LIBRARIES PYTHON_INCLUDE_DIRS
More information about the arch-commits
mailing list