core: compile with Python 3 by default

The CMake option ENABLE_PYTHON3 is renamed to ENABLE_PYTHON2, to use Python 2
first then fallback on Python 3.

In the same way, the configure option --enable-python3 is renamed to
--enable-python2, to use Python 2 first then fallback on Python 3.
v2.8-utf8proc
Sébastien Helleu 2019-07-01 21:26:48 +02:00
parent f9b6f359dd
commit ab81128a7a
8 changed files with 21 additions and 17 deletions

View File

@ -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:

View File

@ -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)

View File

@ -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)

View File

@ -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()

View File

@ -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([

View File

@ -9,7 +9,7 @@ Build-Depends:
libncursesw5-dev,
gem2deb,
libperl-dev,
python-dev,
python3-dev,
libaspell-dev,
liblua5.1-0-dev,
tcl8.6-dev,

View File

@ -9,7 +9,7 @@ Build-Depends:
libncursesw5-dev,
gem2deb,
libperl-dev,
python-dev,
python3-dev,
libaspell-dev,
liblua5.1-0-dev,
tcl8.6-dev,

View File

@ -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,