On 2015-10-27 14:53, Joerg Jung wrote:
Hi,

On Tue, Oct 27, 2015 at 01:50:31PM +0100, Wilhelm Schuster wrote:

I'm currently working on packaging opensmtpd-extras for Archlinux
(AUR). My
problem is that on Arch /usr/bin/python points to python3 rather than
python2.

Can you show what exactly fails, maybe it is easy to fix/adding support
for python3?!
I get linker errors. Just an example:

table_python.c:(.text.startup+0x7f): undefined reference to `Py_InitModule'

Py_InitModule was removed for the python3 API [0].

This means building opensmtpd-extras with python enabled fails as
it expects python2. I have attached a patch that fixes the build
script to
explicitly check for `python2` rather than the generic `python` to
avoid any
ambiguities.

Sorry, but I think this is not enough and breaks other distributions,
which do not link /usr/bin/python to python3 by default.
You're right, the change was rather short-sighted. Sorry.

I guess more sophisticated conditional checks/tests for python version
are required here.

Regards,
Joerg

From 7466c7cb4692294f7c4f52b14004001bff0a9bcd Mon Sep 17 00:00:00 2001
From: Wilhelm Schuster <[email protected]>
Date: Tue, 27 Oct 2015 13:13:58 +0100
Subject: [PATCH] Explicitly check for python2

---
 configure.ac | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/configure.ac b/configure.ac
index e09ac6e..04e33b1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2323,15 +2323,15 @@ PYTHON_LDFLAGS=
 if test x"${need_python}" = x"yes"; then
    PYTHON_CONFIG=
    for path in /usr/local/bin /usr/bin; do
-       if test -f ${path}/python-config; then
-               PYTHON_CONFIG=${path}/python-config
+       if test -f ${path}/python2-config; then
+               PYTHON_CONFIG=${path}/python2-config
                break
        fi
    done

    # if python provided --with-python, override
    if test x"${with_python}" != x""; then
-      PYTHON_CONFIG="${python_prefix}/bin/python-config"
+      PYTHON_CONFIG="${python_prefix}/bin/python2-config"
    fi

    if ! test -f $PYTHON_CONFIG; then
--
2.6.1


[0]: https://www.python.org/dev/peps/pep-3121/

--
You received this mail because you are subscribed to [email protected]
To unsubscribe, send a mail to: [email protected]

Reply via email to