summaryrefslogtreecommitdiff
path: root/user/weechat/python.patch
diff options
context:
space:
mode:
authorA. Wilcox <awilcox@wilcox-tech.com>2019-06-25 01:27:09 +0000
committerA. Wilcox <awilcox@wilcox-tech.com>2019-06-25 01:27:09 +0000
commit5de831431757db1a30edaf34d3036f1625060df7 (patch)
tree24aff272fa351d3f03b4e25fa4a977dcb6f17bda /user/weechat/python.patch
parent144eb4fd1d5aa16e7930bd0e59b403bf940af2d9 (diff)
parentd6f84c6bf94a6ba32a02a5c3026adfb771b634fa (diff)
downloadpackages-5de831431757db1a30edaf34d3036f1625060df7.tar.gz
packages-5de831431757db1a30edaf34d3036f1625060df7.tar.bz2
packages-5de831431757db1a30edaf34d3036f1625060df7.tar.xz
packages-5de831431757db1a30edaf34d3036f1625060df7.zip
Merge branch 'weechat-python' into 'master'
user/weechat: fix weechat-python linking ONCE AND FOR ALL See merge request !252
Diffstat (limited to 'user/weechat/python.patch')
-rw-r--r--user/weechat/python.patch86
1 files changed, 86 insertions, 0 deletions
diff --git a/user/weechat/python.patch b/user/weechat/python.patch
new file mode 100644
index 000000000..a6e194719
--- /dev/null
+++ b/user/weechat/python.patch
@@ -0,0 +1,86 @@
+--- weechat-2.5/cmake/FindPython.cmake 2019-06-06 18:43:20.000000000 +0000
++++ weechat-2.5/cmake/FindPython.cmake 2019-06-24 12:22:10.659972390 +0000
+@@ -25,7 +25,6 @@
+ #
+ # PYTHON_EXECUTABLE = full path to the python binary
+ # PYTHON_INCLUDE_PATH = path to where python.h can be found
+-# PYTHON_LIBRARY = path to where libpython.so* can be found
+ # PYTHON_LFLAGS = python compiler options for linking
+
+ if(PYTHON_FOUND)
+@@ -38,11 +37,19 @@
+ NAMES python3.7 python3.6 python3.5 python3.4 python3.3 python3.2 python3.1 python3.0 python3 python2.7 python2.6 python2.5 python
+ PATHS /usr/bin /usr/local/bin /usr/pkg/bin
+ )
++ find_program(PYTHON_CONFIG
++ NAMES python3-config
++ PATHS /usr/bin /usr/local/bin /usr/pkg/bin
++ )
+ else()
+ find_program(PYTHON_EXECUTABLE
+ NAMES python2.7 python2.6 python2.5 python
+ PATHS /usr/bin /usr/local/bin /usr/pkg/bin
+ )
++ find_program(PYTHON_CONFIG
++ NAMES python-config
++ PATHS /usr/bin /usr/local/bin /usr/pkg/bin
++ )
+ endif()
+
+ if(PYTHON_EXECUTABLE)
+@@ -52,32 +59,17 @@
+ )
+
+ execute_process(
+- COMMAND ${PYTHON_EXECUTABLE} -c "import sys; from distutils.sysconfig import *; sys.stdout.write(get_config_var('LIBPL'))"
+- OUTPUT_VARIABLE PYTHON_POSSIBLE_LIB_PATH
+- )
+-
+- execute_process(
+- COMMAND ${PYTHON_EXECUTABLE} -c "import sys; from distutils.sysconfig import *; sys.stdout.write(get_config_var('LIBS') + ' ' + get_config_var('LINKFORSHARED'))"
++ COMMAND ${PYTHON_CONFIG} --libs
+ OUTPUT_VARIABLE PYTHON_LFLAGS
++ OUTPUT_STRIP_TRAILING_WHITESPACE
+ )
+
+ find_path(PYTHON_INCLUDE_PATH
+ NAMES Python.h
+ HINTS ${PYTHON_INC_DIR}
+ )
+- if(ENABLE_PYTHON3)
+- find_library(PYTHON_LIBRARY
+- NAMES python3.7 python3.6 python3.5 python3.4 python3.3 python3.2 python3.1 python3.0 python3 python2.7 python2.6 python2.5 python
+- HINTS ${PYTHON_POSSIBLE_LIB_PATH}
+- )
+- else()
+- find_library(PYTHON_LIBRARY
+- NAMES python2.7 python2.6 python2.5 python
+- HINTS ${PYTHON_POSSIBLE_LIB_PATH}
+- )
+- endif()
+
+- if(PYTHON_LIBRARY AND PYTHON_INCLUDE_PATH)
++ if(PYTHON_LFLAGS AND PYTHON_INCLUDE_PATH)
+ execute_process(
+ COMMAND ${PYTHON_EXECUTABLE} -c "import sys; sys.stdout.write(sys.version[:3])"
+ OUTPUT_VARIABLE PYTHON_VERSION
+@@ -96,7 +88,6 @@
+ mark_as_advanced(
+ PYTHON_EXECUTABLE
+ PYTHON_INCLUDE_PATH
+- PYTHON_LIBRARY
+ PYTHON_LFLAGS
+ )
+
+--- weechat-2.5/src/plugins/python/CMakeLists.txt 2019-06-06 18:43:20.000000000 +0000
++++ weechat-2.5/src/plugins/python/CMakeLists.txt 2019-06-24 12:22:16.259972363 +0000
+@@ -24,8 +24,7 @@
+
+ if(PYTHON_FOUND)
+ include_directories(${PYTHON_INCLUDE_PATH})
+- set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${PYTHON_LFLAGS}")
+- target_link_libraries(python ${PYTHON_LIBRARY} weechat_plugins_scripts coverage_config)
++ target_link_libraries(python ${PYTHON_LFLAGS} weechat_plugins_scripts coverage_config)
+ endif()
+
+ install(TARGETS python LIBRARY DESTINATION ${WEECHAT_LIBDIR}/plugins)