Date: Tue, 30 Jul 2013 20:22:47 +0000 (UTC) From: David Naylor <dbn@FreeBSD.org> To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r323991 - head/lang/pypy/files Message-ID: <201307302022.r6UKMmYK054711@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: dbn Date: Tue Jul 30 20:22:47 2013 New Revision: 323991 URL: http://svnweb.freebsd.org/changeset/ports/323991 Log: Fix lang/pypy library detection. The library detection orginally depended on sys.version however that tends to change a lot and thus a more robust method is used based on sys.pypy_version_info. This fixes installation using distutils and corrects output from sysconfig. Special thanks to Attila Nagy who reported the issue and tracked down the root issue (allowing me to deliver a quick solution). Reported by: Attila Nagy <bra@fsn.hu> Modified: head/lang/pypy/files/patch-lib__pypyX.Y__distutils__command__install.py head/lang/pypy/files/patch-lib__pypyX.Y__distutils__sysconfig_pypy.py head/lang/pypy/files/patch-lib__pypyX.Y__sysconfig.py Modified: head/lang/pypy/files/patch-lib__pypyX.Y__distutils__command__install.py ============================================================================== --- head/lang/pypy/files/patch-lib__pypyX.Y__distutils__command__install.py Tue Jul 30 20:20:40 2013 (r323990) +++ head/lang/pypy/files/patch-lib__pypyX.Y__distutils__command__install.py Tue Jul 30 20:22:47 2013 (r323991) @@ -17,7 +17,7 @@ # about needing recursive variable expansion (shudder). py_version = (string.split(sys.version))[0] -+ pypy_version = sys.version[-6:-3] ++ pypy_version = '%s.%s.%s' % sys.pypy_version_info[:3] (prefix, exec_prefix) = get_config_vars('prefix', 'exec_prefix') self.config_vars = {'dist_name': self.distribution.get_name(), 'dist_version': self.distribution.get_version(), Modified: head/lang/pypy/files/patch-lib__pypyX.Y__distutils__sysconfig_pypy.py ============================================================================== --- head/lang/pypy/files/patch-lib__pypyX.Y__distutils__sysconfig_pypy.py Tue Jul 30 20:20:40 2013 (r323990) +++ head/lang/pypy/files/patch-lib__pypyX.Y__distutils__sysconfig_pypy.py Tue Jul 30 20:22:47 2013 (r323991) @@ -5,7 +5,7 @@ def get_python_inc(plat_specific=0, prefix=None): from os.path import join as j - return j(sys.prefix, 'include') -+ return j(sys.prefix, 'include', 'pypy' + sys.version.rsplit(' ', 1)[-1][:3]) ++ return j(sys.prefix, 'include', 'pypy%s.%s' % sys.pypy_version_info[:2]) def get_python_version(): """Return a string containing the major and minor Python version, @@ -15,8 +15,8 @@ if standard_lib: - return os.path.join(prefix, "lib-python", get_python_version()) - return os.path.join(prefix, 'site-packages') -+ return os.path.join(prefix, 'lib', 'pypy' + sys.version[-6:-3]) -+ return os.path.join(prefix, 'lib', 'pypy' + sys.version.rsplit(' ', 1)[-1][:3], 'site-packages') ++ return os.path.join(prefix, 'lib', 'pypy%s.%s' % sys.pypy_version_info[:2]) ++ return os.path.join(prefix, 'lib', 'pypy%s.%s' % sys.pypy_version_info[:2], 'site-packages') _config_vars = None Modified: head/lang/pypy/files/patch-lib__pypyX.Y__sysconfig.py ============================================================================== --- head/lang/pypy/files/patch-lib__pypyX.Y__sysconfig.py Tue Jul 30 20:20:40 2013 (r323990) +++ head/lang/pypy/files/patch-lib__pypyX.Y__sysconfig.py Tue Jul 30 20:22:47 2013 (r323991) @@ -23,7 +23,7 @@ 'scripts', 'data') _PY_VERSION = sys.version.split()[0] _PY_VERSION_SHORT = sys.version[:3] -+_PYPY_VERSION = sys.version.rsplit(' ', 1)[-1][:-1] ++_PYPY_VERSION = '%s.%s.%s' % sys.pypy_version_info[:3] +_PYPY_VERSION_SHORT = _PYPY_VERSION[:3] _PY_VERSION_SHORT_NO_DOT = _PY_VERSION[0] + _PY_VERSION[2] _PREFIX = os.path.normpath(sys.prefix)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201307302022.r6UKMmYK054711>