From owner-freebsd-python@FreeBSD.ORG Wed Apr 11 19:30:22 2012 Return-Path: Delivered-To: freebsd-python@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 790C3106566B for ; Wed, 11 Apr 2012 19:30:22 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 5895C8FC14 for ; Wed, 11 Apr 2012 19:30:22 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q3BJUMYS081447 for ; Wed, 11 Apr 2012 19:30:22 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q3BJUMwi081446; Wed, 11 Apr 2012 19:30:22 GMT (envelope-from gnats) Date: Wed, 11 Apr 2012 19:30:22 GMT Message-Id: <201204111930.q3BJUMwi081446@freefall.freebsd.org> To: freebsd-python@FreeBSD.org From: John Hein Cc: Subject: Re: ports/159215: Mk/bsd.python.mk: PYTHON_VERSION is ignored X-BeenThere: freebsd-python@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: John Hein List-Id: FreeBSD-specific Python issues List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Apr 2012 19:30:22 -0000 The following reply was made to PR ports/159215; it has been noted by GNATS. From: John Hein To: Ruslan Mahmatkhanov Cc: , , , Subject: Re: ports/159215: Mk/bsd.python.mk: PYTHON_VERSION is ignored Date: Wed, 11 Apr 2012 13:28:38 -0600 John Hein wrote at 13:22 -0600 on Apr 11, 2012: > Ruslan Mahmatkhanov wrote at 17:24 +0400 on Apr 11, 2012: > > miwi@FreeBSD.org wrote on 11.04.2012 17:17: > > > Synopsis: Mk/bsd.python.mk: PYTHON_VERSION is ignored > > > > > > State-Changed-From-To: open->closed > > > State-Changed-By: miwi > > > State-Changed-When: Wed Apr 11 13:17:46 UTC 2012 > > > State-Changed-Why: > > > user mistake, you have to set USE_PYTHON= 2.6. > > > > > > http://www.freebsd.org/cgi/query-pr.cgi?pr=159215 > > > > Martin, I'm not sure about. There is a comment in bsd.python.mk that states: > > > > """ > > Define PYTHON_VERSION to override the defaults that USE_PYTHON would > > give you. > > """ > > > > In PR I tried to do just that, but it didn't working. > > In the french/aster/Makefile, PYTHON_VERSION=2.6 should be > PYTHON_VERSION=python2.6 (or use USE_PYTHON=2.6 as Martin suggested). > > But (#1) neither work because bsd.port.pre.mk defines PYTHON_PORTSDIR > before the new python version can be set by the ARCH == amd64 test. > > But (#2) you can't put the ARCH .if test before bsd.port.pre.mk since > ARCH is not defined at that point. > > So, you're stuck with an ARCH before USE_PYTHON and USE_PYTHON before > ARCH chicken and egg problem if you want to change the python version > based on ARCH. > > The following ugly hack to french/aster/Makefile works around the issue. > It includes bsd.port.pre.mk twice, setting USE_PYTHON > based on ARCH in between. > There may be a better fix that could be made to bsd.python.mk Better patch (forgot to set USE_PYTHON for the non amd64 case)... Index: Makefile =================================================================== RCS file: /base/FreeBSD-CVS/ports/french/aster/Makefile,v retrieving revision 1.89 diff -u -p -r1.89 Makefile --- Makefile 12 Dec 2011 00:29:42 -0000 1.89 +++ Makefile 11 Apr 2012 19:27:34 -0000 @@ -50,7 +50,6 @@ MANUAL_PACKAGE_BUILD= runaway python on LICENSE= GPLv2 USE_BISON= build -USE_PYTHON= yes HAS_CONFIGURE= yes REINPLACE_ARGS= -i "" @@ -67,6 +66,13 @@ INTERACTIVE_SCRIPTS= check_compilers.py .include "${.CURDIR}/../../french/aster/bsd.aster.mk" .include +.if ${ARCH} == "amd64" +# python 2.7 causes process runaway +USE_PYTHON= 2.6 +.else +USE_PYTHON= yes +.endif +.include .if ${ARCH} == "i386" FLAGARCH= -DP_LINUX -DLINUX @@ -76,10 +82,6 @@ FLAGARCH= -DLINUX64 FFLAGARCH= -fdefault-integer-8 -fdefault-real-8 .endif -.if ${ARCH} == "amd64" -# python 2.7 causes process runaway -PYTHON_VERSION= 2.6 -.endif # Avoid renaming .f into .F #F90FLAGS= -x f77-cpp-input ${FFLAGS}