Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 27 Oct 2015 15:49:14 +0000 (UTC)
From:      Sunpoet Po-Chuan Hsieh <sunpoet@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r400255 - in head/graphics/py-ming: . files
Message-ID:  <201510271549.t9RFnEiI050812@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: sunpoet
Date: Tue Oct 27 15:49:13 2015
New Revision: 400255
URL: https://svnweb.freebsd.org/changeset/ports/400255

Log:
  - Allow concurrent installation (USE_PYTHON=concurrent)
  - Fix build with Python 3.x

Added:
  head/graphics/py-ming/files/
  head/graphics/py-ming/files/patch-macros-python.m4   (contents, props changed)
  head/graphics/py-ming/files/patch-ming.py   (contents, props changed)
Modified:
  head/graphics/py-ming/Makefile

Modified: head/graphics/py-ming/Makefile
==============================================================================
--- head/graphics/py-ming/Makefile	Tue Oct 27 15:49:09 2015	(r400254)
+++ head/graphics/py-ming/Makefile	Tue Oct 27 15:49:13 2015	(r400255)
@@ -22,8 +22,8 @@ LIB_DEPENDS=	libfreetype.so:${PORTSDIR}/
 CONFIGURE_ARGS=	--enable-python
 CONFIGURE_ENV=	PYTHON_LDFLAGS="-L${PYTHON_LIBDIR} -l${PYTHON_VERSION}${PYTHON_ABIVER}"
 GNU_CONFIGURE=	yes
-USE_PYTHON=	autoplist distutils
-USES=		autoreconf libtool localbase python:2
+USE_PYTHON=	autoplist concurrent distutils
+USES=		autoreconf libtool localbase python
 
 CONFIGURE_WRKSRC=	${WRKDIR}/${GH_PROJECT}-${GH_TAGNAME_EXTRACT}
 WRKSRC=		${WRKDIR}/${GH_PROJECT}-${GH_TAGNAME_EXTRACT}/py_ext

Added: head/graphics/py-ming/files/patch-macros-python.m4
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/graphics/py-ming/files/patch-macros-python.m4	Tue Oct 27 15:49:13 2015	(r400255)
@@ -0,0 +1,86 @@
+--- ../macros/python.m4.orig	2015-05-15 09:43:14 UTC
++++ ../macros/python.m4
+@@ -94,8 +94,8 @@ AC_DEFUN([AC_PYTHON_DEVEL],[
+ 	#
+ 	AC_MSG_CHECKING([for a version of Python >= '2.1.0'])
+ 	ac_supports_python_ver=`$PYTHON -c "import sys, string; \
+-		ver = string.split(sys.version)[[0]]; \
+-		print ver >= '2.1.0'"`
++		ver = sys.version.split(); \
++		print(ver[[0]] >= '2.1.0')"`
+ 	if test "$ac_supports_python_ver" != "True"; then
+ 		if test -z "$PYTHON_NOVERSIONCHECK"; then
+ 			AC_MSG_RESULT([no])
+@@ -121,8 +121,8 @@ to something else than an empty string.
+ 	if test -n "$1"; then
+ 		AC_MSG_CHECKING([for a version of Python $1])
+ 		ac_supports_python_ver=`$PYTHON -c "import sys, string; \
+-			ver = string.split(sys.version)[[0]]; \
+-			print ver $1"`
++			ver = sys.version.split(); \
++			print(ver[[0]], $1)"`
+ 		if test "$ac_supports_python_ver" = "True"; then
+ 	   	   AC_MSG_RESULT([yes])
+ 		else
+@@ -157,7 +157,7 @@ $ac_distutils_result])
+ 	AC_MSG_CHECKING([for Python include path])
+ 	if test -z "$PYTHON_CPPFLAGS"; then
+ 		python_path=`$PYTHON -c "import distutils.sysconfig; \
+-           		print distutils.sysconfig.get_python_inc();"`
++           		print(distutils.sysconfig.get_python_inc());"`
+ 		if test -n "${python_path}"; then
+ 		   	python_path="-I$python_path"
+ 		fi
+@@ -174,21 +174,19 @@ $ac_distutils_result])
+ 		# (makes two attempts to ensure we've got a version number
+ 		# from the interpreter)
+ 		py_version=`$PYTHON -c "from distutils.sysconfig import *; \
+-			from string import join; \
+-			print join(get_config_vars('VERSION'))"`
++			print(' '.join(get_config_vars('VERSION')))"`
+ 		if test "$py_version" = "[None]"; then
+ 			if test -n "$PYTHON_VERSION"; then
+ 				py_version=$PYTHON_VERSION
+ 			else
+ 				py_version=`$PYTHON -c "import sys; \
+-					print sys.version[[:3]]"`
++					print(sys.version[[:3]])"`
+ 			fi
+ 		fi
+ 
+ 		PYTHON_LDFLAGS=`$PYTHON -c "from distutils.sysconfig import *; \
+-			from string import join; \
+-			print '-L' + get_python_lib(0,1), \
+-		      	'-lpython';"`$py_version
++			print('-L', get_python_lib(0,1), \
++		      	'-lpython');"`$py_version
+ 	fi
+ 	AC_MSG_RESULT([$PYTHON_LDFLAGS])
+ 	AC_SUBST([PYTHON_LDFLAGS])
+@@ -199,7 +197,7 @@ $ac_distutils_result])
+ 	AC_MSG_CHECKING([for Python site-packages path])
+ 	if test -z "$PYTHON_SITE_PKG"; then
+ 		PYTHON_SITE_PKG=`$PYTHON -c "import distutils.sysconfig; \
+-		        print distutils.sysconfig.get_python_lib(0,0);"`
++		        print(distutils.sysconfig.get_python_lib(0,0));"`
+ 	fi
+ 	AC_MSG_RESULT([$PYTHON_SITE_PKG])
+ 	AC_SUBST([PYTHON_SITE_PKG])
+@@ -211,7 +209,7 @@ $ac_distutils_result])
+ 	if test -z "$PYTHON_EXTRA_LIBS"; then
+ 	   PYTHON_EXTRA_LIBS=`$PYTHON -c "import distutils.sysconfig; \
+                 conf = distutils.sysconfig.get_config_var; \
+-                print conf('LOCALMODLIBS'), conf('LIBS')"`
++                print(conf('LOCALMODLIBS'), conf('LIBS'))"`
+ 	fi
+ 	AC_MSG_RESULT([$PYTHON_EXTRA_LIBS])
+ 	AC_SUBST(PYTHON_EXTRA_LIBS)
+@@ -223,7 +221,7 @@ $ac_distutils_result])
+ 	if test -z "$PYTHON_EXTRA_LDFLAGS"; then
+ 		PYTHON_EXTRA_LDFLAGS=`$PYTHON -c "import distutils.sysconfig; \
+ 			conf = distutils.sysconfig.get_config_var; \
+-			print conf('LINKFORSHARED')"`
++			print(conf('LINKFORSHARED'))"`
+ 	fi
+ 	AC_MSG_RESULT([$PYTHON_EXTRA_LDFLAGS])
+ 	AC_SUBST(PYTHON_EXTRA_LDFLAGS)

Added: head/graphics/py-ming/files/patch-ming.py
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/graphics/py-ming/files/patch-ming.py	Tue Oct 27 15:49:13 2015	(r400255)
@@ -0,0 +1,175 @@
+--- ming.py.orig	2015-05-15 09:43:14 UTC
++++ ming.py
+@@ -112,57 +112,57 @@ class SWFFilter(SWFBase):
+         if type == SWFFILTER_TYPE_DROPSHADOW:
+             #color, blur, shadow, flags
+             if not isinstance(arg2, SWFBlur):
+-                raise AttributeError, "3. parameter has to be SWFBlur"
++                raise AttributeError("3. parameter has to be SWFBlur")
+             if not isinstance(arg3, SWFShadow):
+-                raise AttributeError, "4. parameter has to be SWFShadow"
++                raise AttributeError("4. parameter has to be SWFShadow")
+             self.this = mingc.newDropShadowFilter(arg1, arg2.this, arg3.this, arg4)
+         elif type == SWFFILTER_TYPE_BLUR:
+             #blur
+             if not isinstance(arg1, SWFBlur):
+-                raise AttributeError, "2. parameter has to be SWFBlur"
++                raise AttributeError("2. parameter has to be SWFBlur")
+             self.this = mingc.newBlurFilter(arg1.this)
+         elif type == SWFFILTER_TYPE_GLOW:
+             #color, blur, strength, flags
+             if not isinstance(arg2, SWFBlur):
+-                raise AttributeError, "3. parameter has to be SWFBlur"
++                raise AttributeError("3. parameter has to be SWFBlur")
+             self.this = mingc.newGlowFilter(arg1, arg2.this, arg3, arg4)
+-	elif type == SWFFILTER_TYPE_BEVEL:
++        elif type == SWFFILTER_TYPE_BEVEL:
+             #shadowColor, highlightColor, blur, shadow, flags
+             if not isinstance(arg3, SWFBlur):
+-                raise AttributeError, "4. parameter has to be SWFBlur"
++                raise AttributeError("4. parameter has to be SWFBlur")
+             if not isinstance(arg4, SWFShadow):
+-                raise AttributeError, "5. parameter has to be SWFShadow"
++                raise AttributeError("5. parameter has to be SWFShadow")
+             self.this = mingc.newBevelFilte(arg1, arg2, arg3.this, arg4.this, arg5)
+-	elif type == SWFFILTER_TYPE_GRADIENTGLOW:
++        elif type == SWFFILTER_TYPE_GRADIENTGLOW:
+             #gradient, blur, shadow, flags
+             if not isinstance(arg1, SWFGradient):
+-                raise AttributeError, "2. parameter has to be SWFGradient"
++                raise AttributeError("2. parameter has to be SWFGradient")
+             if not isinstance(arg2, SWFBlur):
+-                raise AttributeError, "3. parameter has to be SWFBlur"
++                raise AttributeError("3. parameter has to be SWFBlur")
+             if not isinstance(arg3, SWFShadow):
+-                raise AttributeError, "4. parameter has to be SWFShadow"
++                raise AttributeError("4. parameter has to be SWFShadow")
+             self.this = mingc.newGradienGlowFilter(arg1.this, arg2.this, arg3.this, arg4)
+         elif type == SWFFILTER_TYPE_COLORMATRIX:
+             #colormatrix
+             if not isinstance(arg1, SWFFilterMatrix):
+-                raise AttributeError, "2. parameter has to be SWFFilterMatrix"
++                raise AttributeError("2. parameter has to be SWFFilterMatrix")
+             self.this = mingc.newColorMatrixFilter(arg1.this)
+-	elif type == SWFFILTER_TYPE_CONVOLUTION:
++        elif type == SWFFILTER_TYPE_CONVOLUTION:
+             #colormatrix, divisor, bias, color, flags
+             if not isinstance(arg1, SWFFilterMatrix):
+-                raise AttributeError, "2. parameter has to be SWFFilterMatrix"
++                raise AttributeError("2. parameter has to be SWFFilterMatrix")
+             self.this = mingc.newConvolutionFilter(arg1.this, arg2, arg3, arg4, arg5)
+         elif type == SWFFILTER_TYPE_GRADIENTBEVEL:
+             #gradient, blur, shadow, flags
+             if not isinstance(arg1, SWFGradient):
+-                raise AttributeError, "2. parameter has to be SWFGradient"
++                raise AttributeError("2. parameter has to be SWFGradient")
+             if not isinstance(arg2, SWFBlur):
+-                raise AttributeError, "3. parameter has to be SWFBlur"
++                raise AttributeError("3. parameter has to be SWFBlur")
+             if not isinstance(arg3, SWFShadow):
+-                raise AttributeError, "4. parameter has to be SWFShadow"
++                raise AttributeError("4. parameter has to be SWFShadow")
+             self.this = mingc.newGradientBevelFilter(arg1.this, arg2.this, arg3.this, arg4)
+-	else:
+-            raise AttributeError, "bad filter type to SWFFilter::new"
++        else:
++            raise AttributeError("bad filter type to SWFFilter::new")
+ 
+ class SWFMatrix(SWFBase):
+     
+@@ -230,7 +230,7 @@ class SWFShape(SWFBase):
+             return SWFFill(mingc.SWFShape_addBitmapFill(self.this, arg1.this, arg2))
+ 
+         else:
+-            raise AttributeError, "bad argument to SWFShape::addFill"
++            raise AttributeError("bad argument to SWFShape::addFill")
+ 
+     def setLeftFill(self, fill):
+         mingc.SWFShape_setLeftFill(self.this, fill)
+@@ -455,29 +455,29 @@ class SWFDisplayItem(SWFBase):
+         mingc.SWFDisplayItem_setMaskLevel(self.this, level)
+ 
+     def getPositionX(self):
+-	x = mingc.new_floatp()
+-	y = mingc.new_floatp()
+-	mingc.SWFDisplayItem_getPosition(self.this, x, y)
+-	ret = mingc.floatp_value(x)
+-	mingc.delete_floatp(x)
+-	mingc.delete_floatp(y)
+-	return ret
++        x = mingc.new_floatp()
++        y = mingc.new_floatp()
++        mingc.SWFDisplayItem_getPosition(self.this, x, y)
++        ret = mingc.floatp_value(x)
++        mingc.delete_floatp(x)
++        mingc.delete_floatp(y)
++        return ret
+ 
+     def getPositionY(self):
+-	x = mingc.new_floatp()
+-	y = mingc.new_floatp()
+-	mingc.SWFDisplayItem_getPosition(self.this, x, y)
+-	ret = mingc.floatp_value(y)
+-	mingc.delete_floatp(x)
+-	mingc.delete_floatp(y)
+-	return ret
++        x = mingc.new_floatp()
++        y = mingc.new_floatp()
++        mingc.SWFDisplayItem_getPosition(self.this, x, y)
++        ret = mingc.floatp_value(y)
++        mingc.delete_floatp(x)
++        mingc.delete_floatp(y)
++        return ret
+ 
+     def getRotation(self):
+         rot = mingc.new_floatp()
+-	mingc.SWFDisplayItem_getRotation(self.this, rot)
+-	ret = mingc.floatp_value(rot)
+-	mingc.delete_floatp(rot)
+-	return ret
++        mingc.SWFDisplayItem_getRotation(self.this, rot)
++        ret = mingc.floatp_value(rot)
++        mingc.delete_floatp(rot)
++        return ret
+ 
+     def getScaleX(self):
+         sx = mingc.new_floatp()
+@@ -525,7 +525,7 @@ class SWFDisplayItem(SWFBase):
+         return SWFMatrix(mingc.SWFDisplayItem_getMatrix(self.this))
+ 
+     def setCXform(self, cx):
+-	mingc.SWFDisplayItem_setCXform(self.this, cx.this);
++        mingc.SWFDisplayItem_setCXform(self.this, cx.this);
+          
+     def addFilter(self, filter):
+         mingc.SWFDisplayItem_addFilter(self.this, filter.this)
+@@ -644,8 +644,8 @@ class SWFMovie(SWFBase):
+         mingc.SWFMovie_writeExports(self.this)
+ 
+     def assignSymbol(self, character, name):
+-	mingc.SWFMovie_assignSymbol(self.this, character.this, name)
+-	
++        mingc.SWFMovie_assignSymbol(self.this, character.this, name)
++
+     def setNetworkAccess(self, flag):
+         mingc.SWFMovie_setNetworkAccess(self.this, flag)
+ 
+@@ -1205,12 +1205,12 @@ SWFVIDEOSTREAM_MODE_MANUAL = mingc.SWFVI
+ 
+ class SWFVideoStream(SWFBase):
+     def __init__(self, filename=None):
+-	if filename is None:
+-		self.file = 0;
+-        	self.this = mingc.newSWFVideoStream()
+-	else:
+-		self.file = open(filename, "rb");
+-        	self.this = mingc.newSWFVideoStream_fromFile(self.file)
++        if filename is None:
++            self.file = 0;
++            self.this = mingc.newSWFVideoStream()
++        else:
++            self.file = open(filename, "rb");
++            self.this = mingc.newSWFVideoStream_fromFile(self.file)
+     def setDimension(self, w, h):
+         return mingc.SWFVideoStream_setDimension(self.this, w, h)
+     def getNumFrames(self):



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201510271549.t9RFnEiI050812>