The attached patch moves the building of BrlTTY's python bindings from pyrex to
Cython. This was tested with cython 0.16, and appart from some variable
assignment warnings, the bindings build.
Index: Bindings/Python/c_brlapi.pxd
===================================================================
--- Bindings/Python/c_brlapi.pxd (revision 6594)
+++ Bindings/Python/c_brlapi.pxd (working copy)
@@ -116,6 +116,6 @@
void *memcpy(void *, void *, size_t)
cdef extern from "Python.h":
- # these are macros, we just need to make Pyrex aware of them
+ # these are macros, we just need to make Cython aware of them
int Py_BEGIN_ALLOW_THREADS
int Py_END_ALLOW_THREADS
Index: Bindings/Python/bindings.m4
===================================================================
--- Bindings/Python/bindings.m4 (revision 6594)
+++ Bindings/Python/bindings.m4 (working copy)
@@ -112,25 +112,25 @@
fi
fi
-AC_PATH_PROG([PYREXC], [pyrexc])
-if test -z "${PYREXC}"
+AC_PATH_PROG([CYTHON], [cython])
+if test -z "${CYTHON}"
then
- AC_MSG_WARN([Pyrex compiler not found])
+ AC_MSG_WARN([Cython compiler not found])
PYTHON_OK=false
fi
if test "${GCC}" = "yes"
then
- PYREXC_CFLAGS="-Wno-parentheses -Wno-unused -fno-strict-aliasing -U_POSIX_C_SOURCE -U_XOPEN_SOURCE"
+ CYTHON_CFLAGS="-Wno-parentheses -Wno-unused -fno-strict-aliasing -U_POSIX_C_SOURCE -U_XOPEN_SOURCE"
else
case "${host_os}"
in
*)
- PYREXC_CFLAGS=""
+ CYTHON_CFLAGS=""
;;
esac
fi
-AC_SUBST([PYREXC_CFLAGS])
+AC_SUBST([CYTHON_CFLAGS])
AC_SUBST([PYTHON_OK])
])
Index: Bindings/Python/Makefile.in
===================================================================
--- Bindings/Python/Makefile.in (revision 6594)
+++ Bindings/Python/Makefile.in (working copy)
@@ -28,8 +28,8 @@
PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
-PYREXC = @PYREXC@
-PYREXC_CFLAGS = @PYREXC_CFLAGS@
+CYTHON = @CYTHON@
+CYTHON_CFLAGS = @CYTHON_CFLAGS@
PYTHON_DESTDIR = $(INSTALL_ROOT)
PYTHON_MODULE = $(API_NAME)
@@ -44,7 +44,7 @@
[ "@host_os@" != "mingw32" ] || $(PYTHON) ./setup.py --quiet bdist_wininst --skip-build
brlapi.auto.c: $(SRC_DIR)/brlapi.pyx $(SRC_DIR)/c_brlapi.pxd constants.auto.pyx
- $(PYREXC) -I. -o $@ $(SRC_DIR)/brlapi.pyx
+ $(CYTHON) -I. -o $@ $(SRC_DIR)/brlapi.pyx
constants.auto.pyx: $(CONSTANTS_SCRIPTS) $(CONSTANTS_SOURCES)
$(AWK) $(CONSTANTS_OPTIONS) $(CONSTANTS_SOURCES) >$@
Index: Bindings/Python/setup.py.in
===================================================================
--- Bindings/Python/setup.py.in (revision 6594)
+++ Bindings/Python/setup.py.in (working copy)
@@ -28,7 +28,7 @@
libraries = ["brlapi"],
language = "c",
define_macros = [],
- extra_compile_args = "@PYREXC_CFLAGS@".split())
+ extra_compile_args = "@CYTHON_CFLAGS@".split())
setup(
name = "Brlapi",
_______________________________________________
This message was sent via the BRLTTY mailing list.
To post a message, send an e-mail to: [email protected]
For general information, go to: http://mielke.cc/mailman/listinfo/brltty