tags 629745 + patch thanks The attached patch adds support for Python 2.7 to the build system. It also adds support for the PYTHON environment variable. If PYTHON is set, the extension modules will only be built for the given version. So, with "export PYTHON=$(shell pyversions -d)" in debian/rules, the extension modules will only be built for the default Python version.
The patch is somewhat hackish and really could need some love. Regards, -- Sebastian Ramacher
--- poker-network-1.7.7.orig/configure.ac +++ poker-network-1.7.7/configure.ac @@ -95,6 +95,7 @@ AM_CONDITIONAL([PYTHON_2_4], [false]) AM_CONDITIONAL([PYTHON_2_5], [false]) AM_CONDITIONAL([PYTHON_2_6], [false]) + AM_CONDITIONAL([PYTHON_2_7], [false]) ], [ if test "$GXX" = "yes" -a "$ac_test_CXXFLAGS" != set ; then only in patch2: unchanged: --- poker-network-1.7.7.orig/config/ccpython.m4 +++ poker-network-1.7.7/config/ccpython.m4 @@ -111,20 +111,47 @@ AC_DEFUN([ALL_CC_PYTHON], [ -m4_define([_AM_PYTHON_INTERPRETER_LIST], [python2.6 python2.5 python2.4 python2.3]) +m4_define([_AM_PYTHON_INTERPRETER_LIST], [python2.7 python2.6 python2.5 python2.4 python2.3]) +if test -n "$PYTHON" ; then OLDPYTHON=`which "$PYTHON"` ; unset PYTHON ; fi PYTHONS='' found_one='' +done=false _ONE_CC_PYTHON([=2.3], [2_3]) if test -f "$PYTHON" ; then found_one=$PYTHON ; PYTHONS="$PYTHON $PYTHONS" ; fi +if test -n "$OLDPYTHON" && test "$OLDPYTHON" = "$PYTHON" ; then done=true ; fi unset PYTHON -_ONE_CC_PYTHON([=2.4], [2_4]) -if test -f "$PYTHON" ; then found_one=$PYTHON ; PYTHONS="$PYTHON $PYTHONS" ; fi -unset PYTHON -_ONE_CC_PYTHON([=2.5], [2_5]) -if test -f "$PYTHON" ; then found_one=$PYTHON ; PYTHONS="$PYTHON $PYTHONS" ; fi -unset PYTHON -_ONE_CC_PYTHON([=2.6], [2_6]) -if test -f "$PYTHON" ; then found_one=$PYTHON ; PYTHONS="$PYTHON $PYTHONS" ; fi +if test $done = "false" ; then + _ONE_CC_PYTHON([=2.4], [2_4]) + if test -f "$PYTHON" ; then found_one=$PYTHON ; PYTHONS="$PYTHON $PYTHONS" ; fi + if test -n "$OLDPYTHON" && test "$OLDPYTHON" = "$PYTHON" ; then done=true ; fi + unset PYTHON +else + AM_CONDITIONAL([PYTHON_2_4], false) +fi +if test $done = "false" ; then + _ONE_CC_PYTHON([=2.5], [2_5]) + if test -f "$PYTHON" ; then found_one=$PYTHON ; PYTHONS="$PYTHON $PYTHONS" ; fi + if test -n "$OLDPYTHON" && test "$OLDPYTHON" = "$PYTHON" ; then done=true ; fi + unset PYTHON +else + AM_CONDITIONAL([PYTHON_2_5], false) +fi +if test $done = "false" ; then + _ONE_CC_PYTHON([=2.6], [2_6]) + echo python "$PYTHON" and oldpytho n"$OLDPYTHON" + if test -f "$PYTHON" ; then found_one=$PYTHON ; PYTHONS="$PYTHON $PYTHONS" ; fi + if test -n "$OLDPYTHON" && test "$OLDPYTHON" = "$PYTHON" ; then echo "we're done"; done=true ; fi + unset PYTHON +else + AM_CONDITIONAL([PYTHON_2_6], false) +fi +if test $done = "false" ; then + _ONE_CC_PYTHON([=2.7], [2_7]) + if test -f "$PYTHON" ; then found_one=$PYTHON ; PYTHONS="$PYTHON $PYTHONS" ; fi + if test -n "$OLDPYTHON" && test "$OLDPYTHON" = "$PYTHON" ; then done=true ; fi +else + AM_CONDITIONAL([PYTHON_2_7], false) +fi PYTHON=$found_one if ! test "$found_one" ; then AC_MSG_ERROR([No python development environments found]) only in patch2: unchanged: --- poker-network-1.7.7.orig/config/python.m4 +++ poker-network-1.7.7/config/python.m4 @@ -42,7 +42,7 @@ dnl $prefix/lib/site-python in 1.4 to $prefix/lib/python1.5/site-packages dnl in 1.5. m4_define_default([_AM_PYTHON_INTERPRETER_LIST], - [python python2 python2.6 python2.5 python2.4 python2.3 python2.2 dnl + [python python2 python2.7 python2.6 python2.5 python2.4 python2.3 python2.2 dnl python2.1 python2.0 python1.6 python1.5]) m4_if([$1],[],[ only in patch2: unchanged: --- poker-network-1.7.7.orig/pokerclient2d/Makefile.am +++ poker-network-1.7.7/pokerclient2d/Makefile.am @@ -105,6 +105,14 @@ _pokerinterface_la_LDFLAGS = -module -no-undefined @GLIB_LIBS@ @GLADE_LIBS@ libinterface.la _pokerinterface_la_CPPFLAGS = @GLADE_CFLAGS@ @PYTHON_CFLAGS@ @GLIB_CFLAGS@ -DPYTHON_VERSION=\"\" -D'VERSION_NAME(w)=w' +if PYTHON_2_7 +py2_7exec_LTLIBRARIES = _pokerinterface2_7.la +_pokerinterface2_7_la_SOURCES = python.c +_pokerinterface2_7_la_DEPENDENCIES = libinterface.la +_pokerinterface2_7_la_LDFLAGS = -module -no-undefined @GLIB_LIBS@ @GLADE_LIBS@ libinterface.la +_pokerinterface2_7_la_CPPFLAGS = @GLADE_CFLAGS@ @PYTHON2_7_CFLAGS@ @GLIB_CFLAGS@ -DPYTHON_VERSION=\"2_7\" -D'VERSION_NAME(w)=w\#\#2_7' +endif + if PYTHON_2_6 py2_6exec_LTLIBRARIES = _pokerinterface2_6.la _pokerinterface2_6_la_SOURCES = python.c
signature.asc
Description: OpenPGP digital signature