From owner-freebsd-python@FreeBSD.ORG Wed Apr 11 19:29:04 2012 Return-Path: Delivered-To: freebsd-python@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1EDE3106566C; Wed, 11 Apr 2012 19:29:04 +0000 (UTC) (envelope-from jhein@symmetricom.com) Received: from duck.timing.com (duck.symmetricom.us [206.168.13.214]) by mx1.freebsd.org (Postfix) with ESMTP id E5CC98FC0A; Wed, 11 Apr 2012 19:29:03 +0000 (UTC) Received: from gromit.timing.com (gromit.timing.com [206.168.13.209]) by duck.timing.com (8.14.5/8.14.4) with ESMTP id q3BJSnX5054479; Wed, 11 Apr 2012 13:28:49 -0600 (MDT) (envelope-from jhein@symmetricom.com) Received: from gromit.timing.com (localhost [127.0.0.1]) by gromit.timing.com (8.14.5/8.14.5) with ESMTP id q3BJScVu082691; Wed, 11 Apr 2012 13:28:38 -0600 (MDT) (envelope-from jhein@gromit.timing.com) Received: (from jhein@localhost) by gromit.timing.com (8.14.5/8.14.5/Submit) id q3BJScJi082690; Wed, 11 Apr 2012 13:28:38 -0600 (MDT) (envelope-from jhein) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <20357.56166.508781.850372@gromit.timing.com> Date: Wed, 11 Apr 2012 13:28:38 -0600 From: John Hein To: Ruslan Mahmatkhanov In-Reply-To: <20357.55785.187568.687487@gromit.timing.com> References: <201204111317.q3BDHksK038176@freefall.freebsd.org> <4F858621.603@yandex.ru> <20357.55785.187568.687487@gromit.timing.com> X-Mailer: VM 8.2.0b-8.2.x-reddyuday.r1325 under 23.3.1 (i386-portbld-freebsd7.3) Cc: miwi@FreeBSD.org, mexas@bristol.ac.uk, bug-followup@FreeBSD.org, freebsd-python@FreeBSD.org 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 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:29:04 -0000 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}