kdelibs/kdelibs-cmake_python3.patch
Rex Dieter 785945b8c9 4.9.3
2012-11-02 14:47:02 -05:00

30 lines
1.9 KiB
Diff

--- a/cmake/modules/FindLibPython.py 2011-07-27 13:34:31.000000000 -0500
+++ b/cmake/modules/FindLibPython.py 2012-07-24 14:57:17.259160400 -0500
@@ -11,3 +11,5 @@
print("long_version:%s" % sys.version.split()[0])
print("py_inc_dir:%s" % distutils.sysconfig.get_python_inc())
print("site_packages_dir:%s" % distutils.sysconfig.get_python_lib(plat_specific=1))
+if sys.version_info >= (3, 2):
+ print("abiflags:%s" % sys.abiflags)
--- a/cmake/modules/FindPythonLibrary.cmake 2011-07-27 13:34:31.000000000 -0500
+++ b/cmake/modules/FindPythonLibrary.cmake 2012-07-24 15:06:50.180929600 -0500
@@ -54,6 +54,9 @@
string(REGEX REPLACE ".*\npy_inc_dir:([^\n]+).*$" "\\1" _TMP_PYTHON_INCLUDE_PATH ${python_config})
string(REGEX REPLACE ".*\nsite_packages_dir:([^\n]+).*$" "\\1" _TMP_PYTHON_SITE_PACKAGES_DIR ${python_config})
+ if(PYTHON_SHORT_VERSION VERSION_GREATER "3.1")
+ string(REGEX REPLACE ".*\nabiflags:([^\n]+).*$" "\\1" _TMP_PYTHON_ABIFLAGS ${python_config})
+ endif(PYTHON_SHORT_VERSION VERSION_GREATER "3.1")
# Put these two variables in the cache so they are visible for the user, but read-only:
set(PYTHON_INCLUDE_PATH "${_TMP_PYTHON_INCLUDE_PATH}" CACHE PATH "The python include directory" FORCE)
@@ -63,7 +66,7 @@
set(PYTHON_SITE_PACKAGES_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}/python${PYTHON_SHORT_VERSION}/site-packages CACHE PATH "The directory where python modules will be installed to.")
string(REGEX REPLACE "([0-9]+).([0-9]+)" "\\1\\2" PYTHON_SHORT_VERSION_NO_DOT ${PYTHON_SHORT_VERSION})
- set(PYTHON_LIBRARY_NAMES python${PYTHON_SHORT_VERSION} python${PYTHON_SHORT_VERSION_NO_DOT})
+ set(PYTHON_LIBRARY_NAMES python${PYTHON_SHORT_VERSION}${_TMP_PYTHON_ABIFLAGS} python${PYTHON_SHORT_VERSION_NO_DOT})
if(WIN32)
string(REPLACE "\\" "/" PYTHON_SITE_PACKAGES_DIR ${PYTHON_SITE_PACKAGES_DIR})
endif(WIN32)