ports/159215: Mk/bsd.python.mk: PYTHON_VERSION is ignored

John Hein jhein at symmetricom.com
Wed Apr 11 19:29:04 UTC 2012


John Hein wrote at 13:22 -0600 on Apr 11, 2012:
 > Ruslan Mahmatkhanov wrote at 17:24 +0400 on Apr 11, 2012:
 >  > miwi at 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 <bsd.port.pre.mk>
+.if ${ARCH} == "amd64"
+# python 2.7 causes process runaway
+USE_PYTHON=	2.6
+.else
+USE_PYTHON=	yes
+.endif
+.include <bsd.port.pre.mk>
 
 .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}
 


More information about the freebsd-python mailing list