diff --git a/.travis.yml b/.travis.yml index 9b2d0f225..726cbf63c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,11 +8,11 @@ compiler: env: - BUILDTOOL="cmake" BUILDARGS="" - # - BUILDTOOL="cmake" BUILDARGS="-DENABLE_PYTHON3=ON" + - BUILDTOOL="cmake" BUILDARGS="-DENABLE_PYTHON2=ON" - BUILDTOOL="cmake" BUILDARGS="-DENABLE_GNUTLS=OFF" - BUILDTOOL="cmake" BUILDARGS="-DENABLE_CODE_COVERAGE=ON" CODECOVERAGE="1" - BUILDTOOL="autotools" BUILDARGS="" - # - BUILDTOOL="autotools" BUILDARGS="--enable-python3" + - BUILDTOOL="autotools" BUILDARGS="--enable-python2" - BUILDTOOL="autotools" BUILDARGS="--disable-gnutls" matrix: diff --git a/CMakeLists.txt b/CMakeLists.txt index 61ebff75d..6ea4979fb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -102,7 +102,7 @@ option(ENABLE_SCRIPT "Enable Script plugin (script manager)" ON) option(ENABLE_SCRIPTS "Enable script plugins (perl, python, ...)" ON) option(ENABLE_PERL "Enable Perl scripting language" ON) option(ENABLE_PYTHON "Enable Python scripting language" ON) -option(ENABLE_PYTHON3 "Use Python 3.x if found (NOT recommended because many \"official\" scripts won't work)" OFF) +option(ENABLE_PYTHON2 "Use Python 2 first, fallback on Python 3" OFF) option(ENABLE_RUBY "Enable Ruby scripting language" ON) option(ENABLE_LUA "Enable Lua scripting language" ON) option(ENABLE_TCL "Enable Tcl scripting language" ON) diff --git a/ChangeLog.adoc b/ChangeLog.adoc index 95af85317..a818b040c 100644 --- a/ChangeLog.adoc +++ b/ChangeLog.adoc @@ -36,6 +36,10 @@ Bug fixes:: * irc: strip spaces at beginning/end of addresses in server option "addresses" (issue #195) * irc: fix display of enabled/disabled client capabilities received in command CAP ACK (issue #151) +Build:: + + * python: compile with Python 3 by default + [[v2.5]] == Version 2.5 (2019-06-06) diff --git a/cmake/FindPython.cmake b/cmake/FindPython.cmake index 354a08656..a5ba729ab 100644 --- a/cmake/FindPython.cmake +++ b/cmake/FindPython.cmake @@ -33,14 +33,14 @@ if(PYTHON_FOUND) set(PYTHON_FIND_QUIETLY TRUE) endif() -if(ENABLE_PYTHON3) +if(ENABLE_PYTHON2) find_program(PYTHON_EXECUTABLE - 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 + NAMES python2.7 python2.6 python2.5 python3.7 python3.6 python3.5 python3.4 python3.3 python3.2 python3.1 python3.0 python3 python PATHS /usr/bin /usr/local/bin /usr/pkg/bin ) else() find_program(PYTHON_EXECUTABLE - NAMES python2.7 python2.6 python2.5 python + NAMES python3.7 python3.6 python3.5 python3.4 python3.3 python3.2 python3.1 python3.0 python3 python PATHS /usr/bin /usr/local/bin /usr/pkg/bin ) endif() @@ -65,14 +65,14 @@ if(PYTHON_EXECUTABLE) NAMES Python.h HINTS ${PYTHON_INC_DIR} ) - if(ENABLE_PYTHON3) + if(ENABLE_PYTHON2) 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 + NAMES python2.7 python2.6 python2.5 python3.7 python3.6 python3.5 python3.4 python3.3 python3.2 python3.1 python3.0 python3 python HINTS ${PYTHON_POSSIBLE_LIB_PATH} ) else() find_library(PYTHON_LIBRARY - NAMES python2.7 python2.6 python2.5 python + NAMES python3.7 python3.6 python3.5 python3.4 python3.3 python3.2 python3.1 python3.0 python3 python HINTS ${PYTHON_POSSIBLE_LIB_PATH} ) endif() diff --git a/configure.ac b/configure.ac index 2132c1340..172ccf494 100644 --- a/configure.ac +++ b/configure.ac @@ -153,7 +153,7 @@ AC_ARG_ENABLE(script, [ --disable-script turn off Script plugin (d AC_ARG_ENABLE(scripts, [ --disable-scripts turn off script plugins (perl, python, ...) (default=compiled if found)],enable_scripts=$enableval,enable_scripts=yes) AC_ARG_ENABLE(perl, [ --disable-perl turn off Perl script plugin (default=compiled if found)],enable_perl=$enableval,enable_perl=yes) AC_ARG_ENABLE(python, [ --disable-python turn off Python script plugin (default=compiled if found)],enable_python=$enableval,enable_python=yes) -AC_ARG_ENABLE(python3, [ --enable-python3 use Python 3.x if found (NOT recommended because many "official" scripts won't work) (default=off)],enable_python3=$enableval,enable_python3=no) +AC_ARG_ENABLE(python2, [ --enable-python2 use Python 2 first, fallback on Python 3 (default=off)],enable_python2=$enableval,enable_python2=no) AC_ARG_ENABLE(ruby, [ --disable-ruby turn off Ruby script plugin (default=compiled if found)],enable_ruby=$enableval,enable_ruby=yes) AC_ARG_ENABLE(lua, [ --disable-lua turn off Lua script plugin (default=compiled if found)],enable_lua=$enableval,enable_lua=yes) AC_ARG_ENABLE(tcl, [ --disable-tcl turn off Tcl script plugin (default=compiled if found)],enable_tcl=$enableval,enable_tcl=yes) @@ -473,10 +473,10 @@ fi PYTHON_VERSION= if test "x$enable_python" = "xyes" ; then - if test "x$enable_python3" = "xyes" ; then - AC_PATH_PROGS(PYTHON, python3.7 python3.6 python3.5 python3.4 python3.3 python3.2 python3.1 python3.0 python3 python2.7 python2.6 python2.5 python2 python) + if test "x$enable_python2" = "xyes" ; then + AC_PATH_PROGS(PYTHON, python2.7 python2.6 python2.5 python2 python3.7 python3.6 python3.5 python3.4 python3.3 python3.2 python3.1 python3.0 python3 python) else - AC_PATH_PROGS(PYTHON, python2.7 python2.6 python2.5 python2 python) + AC_PATH_PROGS(PYTHON, python3.7 python3.6 python3.5 python3.4 python3.3 python3.2 python3.1 python3.0 python3 python) fi if test -z $PYTHON ; then AC_MSG_WARN([ diff --git a/debian-devel/control b/debian-devel/control index a6cc3c91c..d216ff275 100644 --- a/debian-devel/control +++ b/debian-devel/control @@ -9,7 +9,7 @@ Build-Depends: libncursesw5-dev, gem2deb, libperl-dev, - python-dev, + python3-dev, libaspell-dev, liblua5.1-0-dev, tcl8.6-dev, diff --git a/debian-stable/control b/debian-stable/control index 1b0a27009..c7bffac81 100644 --- a/debian-stable/control +++ b/debian-stable/control @@ -9,7 +9,7 @@ Build-Depends: libncursesw5-dev, gem2deb, libperl-dev, - python-dev, + python3-dev, libaspell-dev, liblua5.1-0-dev, tcl8.6-dev, diff --git a/tools/debian/patches/weechat_debian_wheezy.patch b/tools/debian/patches/weechat_debian_wheezy.patch index c7028657c..f27344737 100644 --- a/tools/debian/patches/weechat_debian_wheezy.patch +++ b/tools/debian/patches/weechat_debian_wheezy.patch @@ -20,7 +20,7 @@ index d3a1dad8b..4c5953e46 100644 libncursesw5-dev, gem2deb, @@ -12,14 +11,12 @@ Build-Depends: - python-dev, + python3-dev, libaspell-dev, liblua5.1-0-dev, - tcl8.6-dev, @@ -136,7 +136,7 @@ index 8fbf582b3..a30e30053 100644 libncursesw5-dev, gem2deb, @@ -12,14 +11,12 @@ Build-Depends: - python-dev, + python3-dev, libaspell-dev, liblua5.1-0-dev, - tcl8.6-dev,