/[gentoo-x86]/eclass/python.eclass
Gentoo

Diff of /eclass/python.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.162 Revision 1.164
1# Copyright 1999-2012 Gentoo Foundation 1# Copyright 1999-2012 Gentoo Foundation
2# Distributed under the terms of the GNU General Public License v2 2# Distributed under the terms of the GNU General Public License v2
3# $Header: /var/cvsroot/gentoo-x86/eclass/python.eclass,v 1.162 2012/12/20 06:07:05 floppym Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/python.eclass,v 1.164 2012/12/20 06:34:57 floppym Exp $
4 4
5# @ECLASS: python.eclass 5# @ECLASS: python.eclass
6# @MAINTAINER: 6# @MAINTAINER:
7# Gentoo Python Project <python@gentoo.org> 7# Gentoo Python Project <python@gentoo.org>
8# @BLURB: Eclass for Python packages 8# @BLURB: Eclass for Python packages
1298pypy_interpreter_re = re.compile(r"^pypy-c(\d+\.\d+)$") 1298pypy_interpreter_re = re.compile(r"^pypy-c(\d+\.\d+)$")
1299cpython_shebang_re = re.compile(r"^#![ \t]*(?:${EPREFIX}/usr/bin/python|(?:${EPREFIX})?/usr/bin/env[ \t]+(?:${EPREFIX}/usr/bin/)?python)") 1299cpython_shebang_re = re.compile(r"^#![ \t]*(?:${EPREFIX}/usr/bin/python|(?:${EPREFIX})?/usr/bin/env[ \t]+(?:${EPREFIX}/usr/bin/)?python)")
1300python_shebang_options_re = re.compile(r"^#![ \t]*${EPREFIX}/usr/bin/(?:jython|pypy-c|python)(?:\d+(?:\.\d+)?)?[ \t]+(-\S)") 1300python_shebang_options_re = re.compile(r"^#![ \t]*${EPREFIX}/usr/bin/(?:jython|pypy-c|python)(?:\d+(?:\.\d+)?)?[ \t]+(-\S)")
1301python_verification_output_re = re.compile("^GENTOO_PYTHON_TARGET_SCRIPT_PATH supported\n$") 1301python_verification_output_re = re.compile("^GENTOO_PYTHON_TARGET_SCRIPT_PATH supported\n$")
1302 1302
1303pypy_versions_mapping = { 1303#pypy_versions_mapping = {
1304 "1.5": "2.7", 1304# "1.5": "2.7",
1305 "1.6": "2.7", 1305# "1.6": "2.7",
1306 "1.7": "2.7", 1306# "1.7": "2.7",
1307 "1.8": "2.7", 1307# "1.8": "2.7",
1308 "1.9": "2.7", 1308# "1.9": "2.7",
1309} 1309# "2.0": "2.7",
1310#}
1310 1311
1311def get_PYTHON_ABI(python_interpreter): 1312def get_PYTHON_ABI(python_interpreter):
1312 cpython_matched = cpython_interpreter_re.match(python_interpreter) 1313 cpython_matched = cpython_interpreter_re.match(python_interpreter)
1313 jython_matched = jython_interpreter_re.match(python_interpreter) 1314 jython_matched = jython_interpreter_re.match(python_interpreter)
1314 pypy_matched = pypy_interpreter_re.match(python_interpreter) 1315 pypy_matched = pypy_interpreter_re.match(python_interpreter)
1315 if cpython_matched is not None: 1316 if cpython_matched is not None:
1316 PYTHON_ABI = cpython_matched.group(1) 1317 PYTHON_ABI = cpython_matched.group(1)
1317 elif jython_matched is not None: 1318 elif jython_matched is not None:
1318 PYTHON_ABI = jython_matched.group(1) + "-jython" 1319 PYTHON_ABI = jython_matched.group(1) + "-jython"
1319 elif pypy_matched is not None: 1320 elif pypy_matched is not None:
1320 PYTHON_ABI = pypy_versions_mapping[pypy_matched.group(1)] + "-pypy-" + pypy_matched.group(1) 1321 #PYTHON_ABI = pypy_versions_mapping[pypy_matched.group(1)] + "-pypy-" + pypy_matched.group(1)
1322 PYTHON_ABI = "2.7-pypy-" + pypy_matched.group(1)
1321 else: 1323 else:
1322 PYTHON_ABI = None 1324 PYTHON_ABI = None
1323 return PYTHON_ABI 1325 return PYTHON_ABI
1324 1326
1325def get_python_interpreter(PYTHON_ABI): 1327def get_python_interpreter(PYTHON_ABI):

Legend:
Removed from v.1.162  
changed lines
  Added in v.1.164

  ViewVC Help
Powered by ViewVC 1.1.20