chiark / gitweb /
weechat: Fix the python plugin to load
[termux-packages] / packages / weechat / cmake-FindPython.cmake.patch
1 diff -u -r ../weechat-1.3/cmake/FindPython.cmake ./cmake/FindPython.cmake
2 --- ../weechat-1.3/cmake/FindPython.cmake       2015-08-16 02:27:07.000000000 -0400
3 +++ ./cmake/FindPython.cmake    2016-01-03 08:11:31.987778557 -0500
4 @@ -28,70 +28,11 @@
5  #  PYTHON_LIBRARY = path to where libpython.so* can be found
6  #  PYTHON_LFLAGS = python compiler options for linking
7  
8 -if(PYTHON_FOUND)
9 -   # Already in cache, be silent
10 -   set(PYTHON_FIND_QUIETLY TRUE)
11 -endif()
12 -
13 -if(ENABLE_PYTHON3)
14 -  find_program(PYTHON_EXECUTABLE
15 -    NAMES python3.4 python3.3 python3.2 python3.1 python3.0 python3 python2.7 python2.6 python2.5 python
16 -    PATHS /usr/bin /usr/local/bin /usr/pkg/bin
17 -    )
18 -else()
19 -  find_program(PYTHON_EXECUTABLE
20 -    NAMES python2.7 python2.6 python2.5 python
21 -    PATHS /usr/bin /usr/local/bin /usr/pkg/bin
22 -    )
23 -endif()
24 -
25 -if(PYTHON_EXECUTABLE)
26 -  execute_process(
27 -    COMMAND ${PYTHON_EXECUTABLE} -c "import sys; from distutils.sysconfig import *; sys.stdout.write(get_config_var('INCLUDEPY'))"
28 -    OUTPUT_VARIABLE PYTHON_INC_DIR
29 -    )
30 -
31 -  execute_process(
32 -    COMMAND ${PYTHON_EXECUTABLE} -c "import sys; from distutils.sysconfig import *; sys.stdout.write(get_config_var('LIBPL'))"
33 -    OUTPUT_VARIABLE PYTHON_POSSIBLE_LIB_PATH
34 -    )
35 -
36 -  execute_process(
37 -    COMMAND ${PYTHON_EXECUTABLE} -c "import sys; from distutils.sysconfig import *; sys.stdout.write(get_config_var('LINKFORSHARED'))"
38 -    OUTPUT_VARIABLE PYTHON_LFLAGS
39 -    )
40 -
41 -  find_path(PYTHON_INCLUDE_PATH
42 -    NAMES Python.h
43 -    HINTS ${PYTHON_INC_DIR}
44 -    )
45 -  if(ENABLE_PYTHON3)
46 -    find_library(PYTHON_LIBRARY
47 -      NAMES python3.4 python3.3 python3.2 python3.1 python3.0 python3 python2.7 python2.6 python2.5 python
48 -      HINTS ${PYTHON_POSSIBLE_LIB_PATH}
49 -      )
50 -  else()
51 -    find_library(PYTHON_LIBRARY
52 -      NAMES python2.7 python2.6 python2.5 python
53 -      HINTS ${PYTHON_POSSIBLE_LIB_PATH}
54 -      )
55 -  endif()
56 -
57 -  if(PYTHON_LIBRARY AND PYTHON_INCLUDE_PATH)
58 -    execute_process(
59 -      COMMAND ${PYTHON_EXECUTABLE} -c "import sys; sys.stdout.write(sys.version[:3])"
60 -      OUTPUT_VARIABLE PYTHON_VERSION
61 -      )
62 -    execute_process(
63 -      COMMAND ${PYTHON_EXECUTABLE} -c "import sys; sys.stdout.write(str(sys.version_info < (2,5)))"
64 -      OUTPUT_VARIABLE PYTHON_OLD_VERSION
65 -      )
66 -    if(${PYTHON_OLD_VERSION} STREQUAL "True")
67 -      message("Python >= 2.5 is needed to build python plugin, version found: ${PYTHON_VERSION}")
68 -    else()
69 -      set(PYTHON_FOUND TRUE)
70 -    endif()
71 -  endif()
72 +set(PYTHON_EXECUTABLE "/data/data/com.termux/files/usr/bin/python")
73 +set(PYTHON_INCLUDE_PATH "/data/data/com.termux/files/usr/include/python3.5m")
74 +set(PYTHON_LIBRARY "/data/data/com.termux/files/usr/lib")
75 +set(PYTHON_LFLAGS "-Xlinker -export-dynamic -lpython3.5m")
76 +set(PYTHON_FOUND TRUE)
77  
78    mark_as_advanced(
79      PYTHON_EXECUTABLE
80 @@ -99,5 +40,3 @@
81      PYTHON_LIBRARY
82      PYTHON_LFLAGS
83      )
84 -
85 -endif()