ports/161167: Botan configure does not work with python 3.1

Jeremy C. Reed jreed at isc.org
Fri Sep 30 17:00:21 UTC 2011


>Number:         161167
>Category:       ports
>Synopsis:       Botan configure does not work with python 3.1
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Fri Sep 30 17:00:19 UTC 2011
>Closed-Date:
>Last-Modified:
>Originator:     Jeremy C. Reed
>Release:        8.2
>Organization:
ISC
>Environment:
>Description:
ports/security/botan/Makefile has:
USE_PYTHON_BUILD= yes

If it uses python 3.1 it will fail. This is a known problem and is documented in the botan docs included in the tarball:

``Botan's build is controlled by configure.py, which is a Python
script. Python 2.4 or later is required (but if you want to use the
incompatible Python 3, you must first run the 2to3 script on
it).''

(I didn't check using 2to3 lately but last time I tried it failed.)

So I changed the port's Makefile to use:

USE_PYTHON_BUILD=       2.4-2.7

But if use defined in make.conf PYTHON_VERSION=3.1 then it fails with: ===>  botan-1.8.11 needs Python 2.7 at most. But you specified 3.1.

So I attempted to use bsd.port.pre.mk and check PYTHON_VERSION is 3.1 to reset to PYTHON_VERSION_DEFAULT (if that isn't 3.1 either else 2.7) but didn't figure it out yet. Maybe that is an option.

Also if 2.6 is installed if seems to want to install 2.7. I can't figure out how to get it to use 2.6 which is good enough.

I also changed the post-patch so it uses correct python interpreter.

post-patch:
        ${REINPLACE_CMD} -e "s|#!/usr/bin/env python|#!${PYTHON_CMD}|" \
                        ${WRKSRC}/configure.py
.if defined(NOPORTDOCS)
        ${REINPLACE_CMD} -e '/$$(MKDIR_INSTALL) $$(DOCDIR)/d' \
                        -e '/$$(INSTALL_CMD_DATA) $$$$i $$(DOCDIR); /d' \
                        ${WRKSRC}/src/build-data/makefile/unix_shr.in
.endif



>How-To-Repeat:
Use python3.1 and attempt to install botan from ports.
>Fix:
Make it use python 2.4-2.7. Or patch the configure.py script to be portable for python 3.1 also.

>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list