Browse Source

weechat: Enable python. Patch for ruby 2.3

android-5
Fredrik Fornwall 9 years ago
parent
commit
c1cf6ad7ad
  1. 5
      packages/weechat/build.sh
  2. 85
      packages/weechat/cmake-FindPython.cmake.patch
  3. 12
      packages/weechat/cmake-FindRuby.cmake.patch
  4. 3
      packages/weechat/weechat-python-plugin.subpackage.sh

5
packages/weechat/build.sh

@ -1,7 +1,7 @@
TERMUX_PKG_HOMEPAGE=http://weechat.org/
TERMUX_PKG_DESCRIPTION="Fast, light and extensible IRC chat client"
TERMUX_PKG_VERSION=1.3
TERMUX_PKG_BUILD_REVISION=5
TERMUX_PKG_BUILD_REVISION=6
TERMUX_PKG_SRCURL=http://www.weechat.org/files/src/weechat-${TERMUX_PKG_VERSION}.tar.bz2
TERMUX_PKG_DEPENDS="ncurses, libgcrypt, libcurl, libgnutls, libandroid-support"
# weechat-curses is a symlink to weechat, so remove it:
@ -29,7 +29,8 @@ termux_step_configure () {
-DCA_FILE="$TERMUX_PREFIX/etc/tls/cert.pem" \
-DENABLE_LUA=OFF \
-DENABLE_MAN=ON \
-DENABLE_PYTHON=OFF \
-DENABLE_PYTHON=ON \
-DENABLE_PYTHON3=ON \
-DENABLE_TCL=OFF \
$TERMUX_PKG_SRCDIR
}

85
packages/weechat/cmake-FindPython.cmake.patch

@ -0,0 +1,85 @@
diff -u -r ../weechat-1.3/cmake/FindPython.cmake ./cmake/FindPython.cmake
--- ../weechat-1.3/cmake/FindPython.cmake 2015-08-16 02:27:07.000000000 -0400
+++ ./cmake/FindPython.cmake 2016-01-03 08:11:31.987778557 -0500
@@ -28,70 +28,11 @@
# PYTHON_LIBRARY = path to where libpython.so* can be found
# PYTHON_LFLAGS = python compiler options for linking
-if(PYTHON_FOUND)
- # Already in cache, be silent
- set(PYTHON_FIND_QUIETLY TRUE)
-endif()
-
-if(ENABLE_PYTHON3)
- find_program(PYTHON_EXECUTABLE
- NAMES 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
- )
-else()
- find_program(PYTHON_EXECUTABLE
- NAMES python2.7 python2.6 python2.5 python
- PATHS /usr/bin /usr/local/bin /usr/pkg/bin
- )
-endif()
-
-if(PYTHON_EXECUTABLE)
- execute_process(
- COMMAND ${PYTHON_EXECUTABLE} -c "import sys; from distutils.sysconfig import *; sys.stdout.write(get_config_var('INCLUDEPY'))"
- OUTPUT_VARIABLE PYTHON_INC_DIR
- )
-
- 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('LINKFORSHARED'))"
- OUTPUT_VARIABLE PYTHON_LFLAGS
- )
-
- find_path(PYTHON_INCLUDE_PATH
- NAMES Python.h
- HINTS ${PYTHON_INC_DIR}
- )
- if(ENABLE_PYTHON3)
- find_library(PYTHON_LIBRARY
- NAMES 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)
- execute_process(
- COMMAND ${PYTHON_EXECUTABLE} -c "import sys; sys.stdout.write(sys.version[:3])"
- OUTPUT_VARIABLE PYTHON_VERSION
- )
- execute_process(
- COMMAND ${PYTHON_EXECUTABLE} -c "import sys; sys.stdout.write(str(sys.version_info < (2,5)))"
- OUTPUT_VARIABLE PYTHON_OLD_VERSION
- )
- if(${PYTHON_OLD_VERSION} STREQUAL "True")
- message("Python >= 2.5 is needed to build python plugin, version found: ${PYTHON_VERSION}")
- else()
- set(PYTHON_FOUND TRUE)
- endif()
- endif()
+set(PYTHON_EXECUTABLE "/data/data/com.termux/files/usr/bin/python")
+set(PYTHON_INCLUDE_PATH "/data/data/com.termux/files/usr/include/python3.5m")
+set(PYTHON_LIBRARY "/data/data/com.termux/files/usr/lib")
+set(PYTHON_LFLAGS "-Xlinker -export-dynamic")
+set(PYTHON_FOUND TRUE)
mark_as_advanced(
PYTHON_EXECUTABLE
@@ -99,5 +40,3 @@
PYTHON_LIBRARY
PYTHON_LFLAGS
)
-
-endif()

12
packages/weechat/cmake-FindRuby.cmake.patch

@ -0,0 +1,12 @@
diff -u -r ../weechat-1.3/cmake/FindRuby.cmake ./cmake/FindRuby.cmake
--- ../weechat-1.3/cmake/FindRuby.cmake 2015-08-16 02:27:07.000000000 -0400
+++ ./cmake/FindRuby.cmake 2016-01-03 07:50:12.392704575 -0500
@@ -33,7 +33,7 @@
find_package(PkgConfig)
if(PKG_CONFIG_FOUND)
- pkg_search_module(RUBY ruby-2.2 ruby-2.1 ruby-2.0 ruby-1.9 ruby-1.8)
+ pkg_search_module(RUBY ruby-2.3 ruby-2.2 ruby-2.1 ruby-2.0 ruby-1.9 ruby-1.8)
endif()
if(RUBY_FOUND)

3
packages/weechat/weechat-python-plugin.subpackage.sh

@ -0,0 +1,3 @@
TERMUX_SUBPKG_INCLUDE="lib/weechat/plugins/python.so"
TERMUX_SUBPKG_DESCRIPTION="WeeChat Python3 Plugin"
TERMUX_SUBPKG_DEPENDS="weechat, python"
Loading…
Cancel
Save