diff options
author | David Naylor <dbn@FreeBSD.org> | 2013-03-23 16:01:56 +0000 |
---|---|---|
committer | David Naylor <dbn@FreeBSD.org> | 2013-03-23 16:01:56 +0000 |
commit | bba9c27d6057794e6685c93561c6ebdb5c061d7b (patch) | |
tree | 4ab33a937f4c8b2f114d492352608ea9bd032333 /lang/pypy | |
parent | 71ed9f76bb730c95379fad25b22fe41f145e75fc (diff) | |
download | ports-bba9c27d6057794e6685c93561c6ebdb5c061d7b.tar.gz ports-bba9c27d6057794e6685c93561c6ebdb5c061d7b.zip |
Notes
Diffstat (limited to 'lang/pypy')
17 files changed, 311 insertions, 196 deletions
diff --git a/lang/pypy/Makefile b/lang/pypy/Makefile index dee5fa65ed70..e950a6ef19d3 100644 --- a/lang/pypy/Makefile +++ b/lang/pypy/Makefile @@ -2,15 +2,14 @@ # $FreeBSD$ PORTNAME= pypy -DISTVERSION= 1.9 -PORTREVISION= 2 +DISTVERSION= 2.0-beta1 CATEGORIES= lang python java MASTER_SITES= https://bitbucket.org/pypy/pypy/get/ DISTNAME= release-${DISTVERSION} DIST_SUBDIR= pypy MAINTAINER= dbn@FreeBSD.org -COMMENT= PyPy is a fast, compliant implementation of the Python language +COMMENT= Fast, compliant implementation of the Python language LICENSE= MIT PSFL LICENSE_COMB= multi @@ -18,18 +17,30 @@ LICENSE_COMB= multi LIB_DEPENDS= expat:${PORTSDIR}/textproc/expat2 \ ffi:${PORTSDIR}/devel/libffi -OPTIONS_DEFINE= SANDBOX +CLI_DESC= (BROKEN) Translate a CLI (.NET) based pypy +JVM_DESC= (BROKEN) Translate a JVM (Java) based pypy +PYPY_DESC= Use pypy to translate (faster but uses more memory) SANDBOX_DESC= Translate a sandboxed pypy +.if !defined(PYPY_INST) +OPTIONS_DEFINE+= CLI JVM SANDBOX +.endif +LOCALBASE?= /usr/local +.if exists(${LOCALBASE}/bin/pypy) +OPTIONS_DEFINE+= PYPY +.endif +ALL_TARGET= ${PYPY_NAMES} BUILD_WRKSRC= ${WRKDIR} USE_BZIP2= yes USE_ICONV= yes USE_GETTEXT= yes +MAKE_JOBS_SAFE= yes +MAKEFILE= ${FILESDIR}/Makefile PKGINSTALL= ${WRKDIR}/pkg-install PKGDEINSTALL= ${WRKDIR}/pkg-deinstall -WRKSRC= ${WRKDIR}/pypy-pypy-341e1e3821ff +WRKSRC= ${WRKDIR}/pypy-pypy-fcb6b056f00e -PYPY_VER= ${DISTVERSION} +PYPY_VER= ${DISTVERSION:C|([0-9])\.([0-9]).*|\1.\2|} PYTHON_IMPL_VER= 2.7 PYPY_LIBDIR= lib/pypy${PYPY_VER} PYPY_INCLUDEDIR= include/pypy${PYPY_VER} @@ -38,18 +49,24 @@ PYPYDIRS= ${PYPY_INCLUDEDIR} ${PYPY_LIBDIR} PLIST_SUB+= PYPY_LIBDIR=${PYPY_LIBDIR} \ PYPY_INCLUDEDIR=${PYPY_INCLUDEDIR} -MAKE_ENV+= PYPY_LOCALBASE=${LOCALBASE} -.if exists(/usr/bin/clang) -MAKE_ARGS+= CC=clang -MAKE_JOBS_SAFE= yes -.endif +MAKE_ENV+= DISTVERSION=${DISTVERSION} PYTHON_CMD=${PYTHON_CMD} \ + WRKSRC=${WRKSRC} PYPY_LOCALBASE=${LOCALBASE} -# XXX !.include <bsd.port.pre.mk> as USE_* need to be set prior .include <bsd.port.options.mk> -.include "${.CURDIR}/files/bsd.pypy.inst.mk" +.include "${MASTERDIR}/files/bsd.pypy.inst.mk" -.if defined(PACKAGE_BUILDING) -MANUAL_PACKAGE_BUILD= fails to finish compilation on pointyhat, reason unknown +.if ${OSVERSION} < 1000024 || ( ${ARCH} != "i386" && ${ARCH} != "amd64" ) +.if ${CC:T} == cc && ( exists(/usr/bin/clang) || exists(${LOCALBASE}/clang) ) +CC= clang +.else +USE_GCC= yes +.endif +.endif + +.if ${PORT_OPTIONS:MPYPY} || defined(PYTHON_CMD) +PYTHON_CMD?= ${LOCALBASE}/bin/pypy +.else +USE_PYTHON_BUILD= -2.7 .endif # List of PyPy instances @@ -60,13 +77,26 @@ PYPY_INST= DEFAULT PYPY_INST+= SANDBOX .endif +.if ${PORT_OPTIONS:MCLI} +PYPY_INST+= CLI +.endif + +.if ${PORT_OPTIONS:MJVM} +PYPY_INST+= JVM +.endif + .endif # !defined(PYPY_INST) -PYPY_NAMES= +MAKE_ENV+= PYPY_INST="${PYPY_INST}" + .for inst in ${PYPY_INST} PYPY_NAMES+= ${PYPY_${inst}_NAME} PYPY_PRIMARY?= ${PYPY_${inst}_NAME} +MAKE_ENV+= PYPY_${inst}_NAME="${PYPY_${inst}_NAME}" \ + PYPY_${inst}_OBJSPACE_ARGS="${PYPY_${inst}_OBJSPACE_ARGS}" \ + PYPY_${inst}_OPT="${PYPY_${inst}_OPT}" \ + PYPY_${inst}_TRANSLATE_ARGS="${PYPY_${inst}_TRANSLATE_ARGS}" # Check if the boehm GC will be used .if ${PYPY_${inst}_OPT} == 0 || ${PYPY_${inst}_OPT} == 1 || ${PYPY_${inst}_OPT} == size @@ -85,26 +115,8 @@ WITH_JVM= yes .endfor # inst in ${PYPY_INST} -# Use pypy if it is installed, else use python (to translate) -.if !defined(PY) -.if !defined(PYPY) -.if ${PYPY_PRIMARY} == pypy -PYPY!= ${WHICH} ${PYPY_PRIMARY} 2> /dev/null || true -.else -PYPY!= ${WHICH} ${PYPY_PRIMARY} 2> /dev/null || ${WHICH} pypy 2> /dev/null || true -.endif -.endif # !defined(PYPY) - -.if exists(${PYPY}) -PY= ${PYPY} -.else -USE_PYTHON_BUILD= 2.5+ -PY= ${PYTHON_CMD} -.endif -.endif # !defined(PY) - .if defined(WITH_BOEHM_GC) -LIB_DEPENDS+= gc.1:${PORTSDIR}/devel/boehm-gc +LIB_DEPENDS+= gc:${PORTSDIR}/devel/boehm-gc .endif .if defined(WITH_CLI) @@ -117,7 +129,7 @@ BROKEN= CLI backend broken, unsupported upstream .if defined(WITH_JVM) USE_JAVA= yes -JAVA_VERSION= 1.6+ +JAVA_VERSION= 1.5+ ONLY_FOR_ARCHS= i386 powerpc ONLY_FOR_ARCHS_REASON= only translates on 32bit systems BROKEN= JVM backend broken, partially supported upstream @@ -149,19 +161,60 @@ PYPY_${inst}_OPT= 2 .endfor # inst in ${PYPY_INST} .endif # !defined(PYPY_JITTABLE) -pre-fetch: - @${ECHO} "PyPy requires a large amount of free RAM and time to translate and compile." - @${ECHO} - @${ECHO} "To translate, PyPy requires on 32bit 3G (min 2G) free RAM and on 64bit" - @${ECHO} "6G (min 4G) free RAM. Also, to compile, PyPy on amd64 gcc requires an" - @${ECHO} "extra 4G however clang only requires 400M (CC=clang) but clang is slower" - @${ECHO} "in compiling PyPy." - @${ECHO} - @${ECHO} "If memory is in short supply consider using a lower optimisation level" - @${ECHO} "(e.g. PYPY_DEFAULT_OPT=2) however that makes PyPy much slower. Also," - @${ECHO} "consider forcing the build to use python (-DPYPY) however that makes the" - @${ECHO} "build much slower." - @${ECHO} +# Translating requires a large amount of memory, with a two by two matrix +# requirement (bitness vs PYTHON_CMD). A more refined matrix is possible based +# on optimisation level however this assumes "jit" is the preferred optimisation +# level. +# +.if ${PYPY_ARCH:M*64} +. if defined(PYTHON_CMD) && ${PYTHON_CMD:M*pypy*} +# 64bit + pypy = 5.5 GiB +PYPY_TRANSLATION_MEMORY= 5582872 +. else +# 64bit + python = 4.3 GiB +PYPY_TRANSLATION_MEMORY= 4349620 +. endif +# 64bit system += 366 MiB +PYPY_MINIMUM_MEMORY= $$((${PYPY_TRANSLATION_MEMORY} + 374784)) +.else +. if defined(PYTHON_CMD) && ${PYTHON_CMD:M*pypy*} +# 32bit + pypy = 2.4GiB +PYPY_TRANSLATION_MEMORY= 2423888 +. else +# 32bit + python = 2.1 GiB +PYPY_TRANSLATION_MEMORY= 2111388 +. endif +# 32bit system += 168 MiB +PYPY_MINIMUM_MEMORY= $$((${PYPY_TRANSLATION_MEMORY} + 171787)) +.endif + +.if !defined(DISABLE_MAKE_JOBS) && ${PYPY_PRIMARY} != ${PYPY_NAMES} +PYPY_MEMORY_MULTIPLY= `echo ${PYPY_NAMES} | wc -w` +.else +PYPY_MEMORY_MULTIPLY= 1 +.endif + +PYPY_IGNORE_MEMORY= Memory checks non-fatal until revised figures are obtained. +PYPY_MEM_WARNING= \ + ${ECHO} "warn: this system has insufficient memory, expected at least $$((${PYPY_MINIMUM_MEMORY} / 1024 * ${PYPY_MEMORY_MULTIPLY} + 1))MiB RAM" +.if defined(PYTHON_CMD) && ${PYTHON_CMD:M*pypy*} +PYPY_MEM_WARNING+= ;\ + ${ECHO} "warn: pypy is being used for translation, consider using cpython as it uses less memory" +.endif +.if ${PYPY_MEMORY_MULTIPLY} != 1 +PYPY_MEM_WARNING+= ;\ + ${ECHO} "warn: consider using -DDISABLE_MAKE_JOBS to serialise builds and to conserve memory" +.endif +.if !defined(PYPY_IGNORE_MEMORY) +PYPY_MEM_WARNING+= ;\ + ${ECHO} "err: memory warnings are terminal, to overwrite this error define -DPYPY_IGNORE_MEMORY and try again"; \ + exit 1 +.else +PYPY_MEM_WARNING+= ;\ + ${ECHO} "warn: THIS SYSTEM MAY END UP SWAP THRASHING AD INFINITUM" +.endif + +usage: @${ECHO} "PyPy supports a large number of parameters and customisations. This port" @${ECHO} "supports building multiple instances of PyPy, for example:" @${ECHO} "PYPY_INST= SANDBOX CUSTOM" @@ -174,26 +227,14 @@ pre-fetch: @${ECHO} "See for a list of parameters:" @${ECHO} " http://readthedocs.org/docs/pypy/latest/config/index.html" @${ECHO} "See for predefined instances:" - @${ECHO} " ${.CURDIR}/files/bsd.pypy.inst.mk" + @${ECHO} " ${FILESDIR}/bsd.pypy.inst.mk" @${ECHO} @${ECHO} "On a fast machine PyPy takes around 45 minutes to translate and compile," @${ECHO} "however an average machine takes in excess of 4 hours, per instance." -.if !defined(PYPY_IGNORE_MEM) && (${PYPY_ARCH} == "x86_32" || ${PYPY_ARCH} == "ppc_32") - @if [ $$((`sysctl -n hw.physmem` / 1024 / 1024)) -le 2000 ]; then \ - ${ECHO}; \ - ${ECHO} "err: this system has insufficient memory, expected at least 2G RAM",; \ - ${ECHO} "err: to overwrite this error define -DPYPY_IGNORE_MEM and try again"; \ - exit 1; \ - fi -.elif !defined(PYPY_IGNORE_MEM) - @if [ $$((`sysctl -n hw.physmem` / 1024 / 1024)) -le 4000 ]; then \ - ${ECHO}; \ - ${ECHO} "err: this system has insufficient memory, expected at least 4G RAM",; \ - ${ECHO} "err: to overwrite this error define -DPYPY_IGNORE_MEM and try again"; \ - exit 1; \ - fi -.endif - @sleep 1 + +pre-fetch: + @${ECHO} Please see http://wiki.FreeBSD.org/PyPy for more details on the port or 'make usage' for a summary + @if [ $$((`sysctl -n hw.physmem` / 1024)) -le $$((${PYPY_MINIMUM_MEMORY} * ${PYPY_MEMORY_MULTIPLY})) ]; then ${PYPY_MEM_WARNING}; fi post-extract: ${MKDIR} ${WRKSRC}/lib @@ -210,26 +251,6 @@ do-configure: ${FILESDIR}/use.pypy > ${WRKDIR}/use.pypy ${CP} ${WRKDIR}/use.pypy ${PKGINSTALL} ${CP} ${WRKDIR}/use.pypy ${PKGDEINSTALL} - ${ECHO} "all: ${PYPY_NAMES}" > ${WRKDIR}/Makefile - ${ECHO} >> ${WRKDIR}/Makefile -.for inst in ${PYPY_INST} - ${ECHO} "${PYPY_${inst}_NAME}: build_${PYPY_${inst}_NAME}/usession-release-${DISTVERSION}-0/testing_1/pypy-c" >> ${WRKDIR}/Makefile - ${ECHO} " ${CP} build_${PYPY_${inst}_NAME}/usession-release-${DISTVERSION}-0/testing_1/pypy-c ${PYPY_${inst}_NAME}" >> ${WRKDIR}/Makefile - ${ECHO} >> ${WRKDIR}/Makefile - ${ECHO} ".done_translate_${PYPY_${inst}_NAME}:" >> ${WRKDIR}/Makefile - ${ECHO} " ${RM} -rf build_${PYPY_${inst}_NAME}" >> ${WRKDIR}/Makefile - ${ECHO} " ${MKDIR} build_${PYPY_${inst}_NAME}" >> ${WRKDIR}/Makefile - ${ECHO} " (cd ${WRKSRC}/pypy/translator/goal; \ - ${SETENV} TMPDIR=${WRKDIR}/build_${PYPY_${inst}_NAME} \ - ${PY} translate.py --source ${PYPY_${inst}_TRANSLATE_ARGS} -O${PYPY_${inst}_OPT} \ - targetpypystandalone.py ${PYPY_${inst}_OBJSPACE_ARGS} )" >> ${WRKDIR}/Makefile - ${ECHO} " ${TOUCH} .done_translate_${PYPY_${inst}_NAME}" >> ${WRKDIR}/Makefile - ${ECHO} >> ${WRKDIR}/Makefile - ${ECHO} "build_${PYPY_${inst}_NAME}/usession-release-${DISTVERSION}-0/testing_1/pypy-c: .done_translate_${PYPY_${inst}_NAME}" >> ${WRKDIR}/Makefile - ${ECHO} " ${REINPLACE_CMD} -e 's|^%.o: %.c\$$\$$|.c.o:|g' build_${PYPY_${inst}_NAME}/usession-release-${DISTVERSION}-0/testing_1/Makefile" >> ${WRKDIR}/Makefile - ${ECHO} " ${MAKE} -C build_${PYPY_${inst}_NAME}/usession-release-${DISTVERSION}-0/testing_1 pypy-c" >> ${WRKDIR}/Makefile - ${ECHO} >> ${WRKDIR}/Makefile -.endfor post-build: -${FIND} ${WRKSRC}/${PYPY_LIBDIR} -type d | \ @@ -245,7 +266,7 @@ do-install: .endfor .for name in ${PYPY_NAMES:O} ${INSTALL_PROGRAM} ${WRKDIR}/${name} ${PREFIX}/bin/${name}${PYPY_VER} - ${ECHO} bin/${name}${DISTVERSION} >> ${TMPPLIST} + ${ECHO} bin/${name}${PYPY_VER} >> ${TMPPLIST} .endfor post-install: @@ -254,7 +275,7 @@ post-install: test: patch .for inst in ${PYPY_INST} @${WHICH} ${PYPY_${inst}_NAME} > /dev/null 2>&1 || (${ECHO} "Unable to find ${PYPY_${inst}_NAME}, please install port first!"; exit 1) - (${CD} ${PYPY_LIBDIR}; ${PYPY_${inst}_NAME} ../../pypy/test_all.py) + (cd ${WRKSRC}; ${PYPY_${inst}_NAME} pypy/test_all.py ${PYPY_LIBDIR}/lib_pypy/pypy_test pypy/module) .endfor pkg-plist: build diff --git a/lang/pypy/distinfo b/lang/pypy/distinfo index c0e6daa816b4..72d84dbed9ae 100644 --- a/lang/pypy/distinfo +++ b/lang/pypy/distinfo @@ -1,2 +1,2 @@ -SHA256 (pypy/release-1.9.tar.bz2) = 9fd599acade49ef98017bbce4f179f19cf2680489ff15235d3bad5b20bde0d68 -SIZE (pypy/release-1.9.tar.bz2) = 13466551 +SHA256 (pypy/release-2.0-beta1.tar.bz2) = 40d8c91fa639232d7689e2f04cec4b1f153dbbf2ea1a7e7c58dd35724ce37371 +SIZE (pypy/release-2.0-beta1.tar.bz2) = 13653701 diff --git a/lang/pypy/files/Makefile b/lang/pypy/files/Makefile new file mode 100644 index 000000000000..f745baff8b7a --- /dev/null +++ b/lang/pypy/files/Makefile @@ -0,0 +1,42 @@ +# Build Makefile for lang/pypy +# $FreeBSD$ + +# Required environment variables +# - DISTVERSION +# - PYTHON_CMD +# - PYPY_INST +# - PYPY_${inst}_NAME +# - PYPY_${inst}_OBJSPACE_ARGS +# - PYPY_${inst}_OPT +# - PYPY_${inst}_TRANSLATE_ARGS +# - WRKSRC + +CP?= cp +ECHO?= echo +MKDIR?= mkdir +RM?= rm +SED?= sed +SETENV?= env +TOUCH?= touch + +REINPLACE_CMD?= ${SED} -i~ + +.for inst in ${PYPY_INST} + +${PYPY_${inst}_NAME}: build_${PYPY_${inst}_NAME}/usession-release-${DISTVERSION}-0/testing_1/pypy-c + ${CP} build_${PYPY_${inst}_NAME}/usession-release-${DISTVERSION}-0/testing_1/pypy-c \ + ${PYPY_${inst}_NAME} + +.done_translate_${PYPY_${inst}_NAME}: + ${RM} -rf build_${PYPY_${inst}_NAME} + ${MKDIR} build_${PYPY_${inst}_NAME} + (cd ${WRKSRC}/pypy/translator/goal; \ + /usr/bin/time -l ${SETENV} TMPDIR=${.CURDIR}/build_${PYPY_${inst}_NAME} \ + ${PYTHON_CMD} translate.py --source ${PYPY_${inst}_TRANSLATE_ARGS} -O${PYPY_${inst}_OPT} \ + targetpypystandalone.py ${PYPY_${inst}_OBJSPACE_ARGS} ) + ${TOUCH} .done_translate_${PYPY_${inst}_NAME} + +build_${PYPY_${inst}_NAME}/usession-release-${DISTVERSION}-0/testing_1/pypy-c: .done_translate_${PYPY_${inst}_NAME} + ${REINPLACE_CMD} -e 's|^%.o: %.c$$|.c.o:|g' build_${PYPY_${inst}_NAME}/usession-release-${DISTVERSION}-0/testing_1/Makefile + /usr/bin/time -l ${MAKE} -C build_${PYPY_${inst}_NAME}/usession-release-${DISTVERSION}-0/testing_1 pypy-c +.endfor diff --git a/lang/pypy/files/bsd.pypy.inst.mk b/lang/pypy/files/bsd.pypy.inst.mk index 5d894ceecebd..ba4bfaf0feca 100644 --- a/lang/pypy/files/bsd.pypy.inst.mk +++ b/lang/pypy/files/bsd.pypy.inst.mk @@ -18,7 +18,7 @@ PYPY_CLI_TRANSLATE_ARGS?= --backend=cli PYPY_CLI_OPT?= 2 PYPY_CLI_OBJSPACE_ARGS?= -PYPY_JVM_NAME?= pypy-jvm -PYPY_JVM_TRANSLATE_ARGS?= --backend=jvm -PYPY_JVM_OPT?= 2 +PYPY_JVM_NAME?= pypy-jvm +PYPY_JVM_TRANSLATE_ARGS?= --backend=jvm +PYPY_JVM_OPT?= 2 PYPY_JVM_OBJSPACE_ARGS?= diff --git a/lang/pypy/files/patch-lib__pypy1.9__distutils__sysconfig_pypy.py b/lang/pypy/files/patch-lib__pypy1.9__distutils__sysconfig_pypy.py deleted file mode 100644 index dab7293ca7de..000000000000 --- a/lang/pypy/files/patch-lib__pypy1.9__distutils__sysconfig_pypy.py +++ /dev/null @@ -1,20 +0,0 @@ ---- lib/pypy1.9/distutils/sysconfig_pypy.py.orig 2012-07-13 22:52:04.000000000 +0200 -+++ lib/pypy1.9/distutils/sysconfig_pypy.py 2012-07-13 22:58:35.000000000 +0200 -@@ -15,7 +15,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[-6:-3]) - - def get_python_version(): - """Return a string containing the major and minor Python version, -@@ -44,7 +44,7 @@ - "calls to get_python_lib(standard_lib=1) cannot succeed") - if prefix is None: - prefix = PREFIX -- return os.path.join(prefix, 'site-packages') -+ return os.path.join(prefix, 'lib', 'pypy' + sys.version[-6:-3], 'site-packages') - - - _config_vars = None diff --git a/lang/pypy/files/patch-lib__pypy1.9__distutils__command__install.py b/lang/pypy/files/patch-lib__pypyX.Y__distutils__command__install.py index 9738bcfc4274..482bbbe806c2 100644 --- a/lang/pypy/files/patch-lib__pypy1.9__distutils__command__install.py +++ b/lang/pypy/files/patch-lib__pypyX.Y__distutils__command__install.py @@ -1,5 +1,5 @@ ---- lib/pypy1.9/distutils/command/install.py.orig 2012-07-15 10:10:18.000000000 +0200 -+++ lib/pypy1.9/distutils/command/install.py 2012-07-15 10:13:15.000000000 +0200 +--- lib/pypy2.0/distutils/command/install.py.orig 2012-07-15 10:10:18.000000000 +0200 ++++ lib/pypy2.0/distutils/command/install.py 2012-07-15 10:13:15.000000000 +0200 @@ -84,9 +84,9 @@ 'data' : '$userbase', }, diff --git a/lang/pypy/files/patch-lib__pypyX.Y__distutils__sysconfig_pypy.py b/lang/pypy/files/patch-lib__pypyX.Y__distutils__sysconfig_pypy.py new file mode 100644 index 000000000000..fb7f17331d4a --- /dev/null +++ b/lang/pypy/files/patch-lib__pypyX.Y__distutils__sysconfig_pypy.py @@ -0,0 +1,22 @@ +--- lib/pypy2.0/distutils/sysconfig_pypy.py.orig 2012-11-22 14:52:20.000000000 +0200 ++++ lib/pypy2.0/distutils/sysconfig_pypy.py 2012-11-27 17:59:44.000000000 +0200 +@@ -15,7 +15,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]) + + def get_python_version(): + """Return a string containing the major and minor Python version, +@@ -42,8 +42,8 @@ + if prefix is None: + prefix = PREFIX + 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') + + + _config_vars = None diff --git a/lang/pypy/files/patch-lib__pypy1.9__lib_pypy__ctypes_config_cache__rebuild.py b/lang/pypy/files/patch-lib__pypyX.Y__lib_pypy__ctypes_config_cache__rebuild.py index 32c5177e0f0b..07be0492ada8 100644 --- a/lang/pypy/files/patch-lib__pypy1.9__lib_pypy__ctypes_config_cache__rebuild.py +++ b/lang/pypy/files/patch-lib__pypyX.Y__lib_pypy__ctypes_config_cache__rebuild.py @@ -1,5 +1,5 @@ ---- lib/pypy1.9/lib_pypy/ctypes_config_cache/rebuild.py~ 2012-06-22 11:42:55.000000000 +0200 -+++ lib/pypy1.9/lib_pypy/ctypes_config_cache/rebuild.py 2012-06-22 11:43:12.000000000 +0200 +--- lib/pypy2.0/lib_pypy/ctypes_config_cache/rebuild.py~ 2012-06-22 11:42:55.000000000 +0200 ++++ lib/pypy2.0/lib_pypy/ctypes_config_cache/rebuild.py 2012-06-22 11:43:12.000000000 +0200 @@ -6,7 +6,7 @@ # get the correct path import os.path diff --git a/lang/pypy/files/patch-lib__pypy1.9__sysconfig.py b/lang/pypy/files/patch-lib__pypyX.Y__sysconfig.py index 0de71f578487..1f832abc4eae 100644 --- a/lang/pypy/files/patch-lib__pypy1.9__sysconfig.py +++ b/lang/pypy/files/patch-lib__pypyX.Y__sysconfig.py @@ -1,5 +1,5 @@ ---- lib/pypy1.9/sysconfig.py.orig 2012-07-15 09:57:14.000000000 +0200 -+++ lib/pypy1.9/sysconfig.py 2012-07-15 10:03:25.000000000 +0200 +--- lib/pypy2.0/sysconfig.py.orig 2012-07-15 09:57:14.000000000 +0200 ++++ lib/pypy2.0/sysconfig.py 2012-07-15 10:03:25.000000000 +0200 @@ -27,12 +27,12 @@ 'data' : '{base}', }, @@ -23,8 +23,8 @@ 'scripts', 'data') _PY_VERSION = sys.version.split()[0] _PY_VERSION_SHORT = sys.version[:3] -+_PYPY_VERSION = sys.version[-6:-1] -+_PYPY_VERSION_SHORT = sys.version[-6:-3] ++_PYPY_VERSION = sys.version.rsplit(' ', 1)[-1][:-1] ++_PYPY_VERSION_SHORT = _PYPY_VERSION[:3] _PY_VERSION_SHORT_NO_DOT = _PY_VERSION[0] + _PY_VERSION[2] _PREFIX = os.path.normpath(sys.prefix) _EXEC_PREFIX = os.path.normpath(sys.exec_prefix) diff --git a/lang/pypy/files/patch-py___path__local.py b/lang/pypy/files/patch-py___path__local.py deleted file mode 100644 index d193c8df5de4..000000000000 --- a/lang/pypy/files/patch-py___path__local.py +++ /dev/null @@ -1,12 +0,0 @@ ---- py/_path/local.py~ 2012-06-22 12:20:36.000000000 +0200 -+++ py/_path/local.py 2012-06-22 12:21:45.000000000 +0200 -@@ -516,6 +516,9 @@ - pkgpath = self.pypkgpath() - if pkgpath is not None: - if ensuresyspath: -+ import sys -+ if pkgpath.basename in sys.modules: -+ del sys.modules[pkgpath.basename] - self._prependsyspath(pkgpath.dirpath()) - pkg = __import__(pkgpath.basename, None, None, []) - names = self.new(ext='').relto(pkgpath.dirpath()) diff --git a/lang/pypy/files/patch-pypy__module__sys__initpath.py b/lang/pypy/files/patch-pypy__module__sys__initpath.py new file mode 100644 index 000000000000..efb96ffb6141 --- /dev/null +++ b/lang/pypy/files/patch-pypy__module__sys__initpath.py @@ -0,0 +1,21 @@ +--- pypy/module/sys/initpath.py.orig 2012-11-27 18:15:02.000000000 +0200 ++++ pypy/module/sys/initpath.py 2012-11-27 18:19:45.000000000 +0200 +@@ -91,14 +91,13 @@ + least contain a directory called ``lib-python/X.Y`` and another one called + ``lib_pypy``. If they cannot be found, it raises OSError. + """ +- from pypy.module.sys.version import CPYTHON_VERSION +- dirname = '%d.%d' % (CPYTHON_VERSION[0], +- CPYTHON_VERSION[1]) +- lib_python = os.path.join(prefix, 'lib-python') ++ from pypy.module.sys.version import PYPY_VERSION ++ dirname = 'pypy%d.%d' % PYPY_VERSION[:2] ++ lib_python = os.path.join(prefix, 'lib') + python_std_lib = os.path.join(lib_python, dirname) + checkdir(python_std_lib) + +- lib_pypy = os.path.join(prefix, 'lib_pypy') ++ lib_pypy = os.path.join(python_std_lib, 'lib_pypy') + checkdir(lib_pypy) + + importlist = [] diff --git a/lang/pypy/files/patch-pypy__module__sys__state.py b/lang/pypy/files/patch-pypy__module__sys__state.py deleted file mode 100644 index 61c0e17e9925..000000000000 --- a/lang/pypy/files/patch-pypy__module__sys__state.py +++ /dev/null @@ -1,21 +0,0 @@ ---- pypy/module/sys/state.py.orig 2012-06-07 14:24:48.000000000 +0200 -+++ pypy/module/sys/state.py 2012-06-22 14:45:23.000000000 +0200 -@@ -36,14 +36,12 @@ - platform = sys.platform - - def getinitialpath(state, prefix): -- from pypy.module.sys.version import CPYTHON_VERSION -- dirname = '%d.%d' % (CPYTHON_VERSION[0], -- CPYTHON_VERSION[1]) -- lib_python = os.path.join(prefix, 'lib-python') -- python_std_lib = os.path.join(lib_python, dirname) -+ from pypy.module.sys.version import PYPY_VERSION -+ libpath = os.path.join(prefix, 'lib') -+ python_std_lib = os.path.join(libpath, 'pypy%d.%d' % PYPY_VERSION[:2]) - checkdir(python_std_lib) - -- lib_pypy = os.path.join(prefix, 'lib_pypy') -+ lib_pypy = os.path.join(python_std_lib, 'lib_pypy') - checkdir(lib_pypy) - - importlist = [] diff --git a/lang/pypy/files/patch-pypy__translator__platform__freebsd.py b/lang/pypy/files/patch-pypy__translator__platform__freebsd.py new file mode 100644 index 000000000000..bc4836e5be62 --- /dev/null +++ b/lang/pypy/files/patch-pypy__translator__platform__freebsd.py @@ -0,0 +1,61 @@ +--- ./pypy/translator/platform/freebsd.py.orig 2012-11-22 14:52:20.000000000 +0200 ++++ ./pypy/translator/platform/freebsd.py 2013-02-28 19:28:49.000000000 +0200 +@@ -4,23 +4,15 @@ + + from pypy.translator.platform import posix + +-def get_env(key, default): +- if key in os.environ: +- return os.environ[key] +- else: +- return default +- +-def get_env_vector(key, default): +- string = get_env(key, default) +- # XXX: handle quotes +- return string.split() ++if 'PYPY_LOCALBASE' not in os.environ: ++ os.environ['PYPY_LOCALBASE'] = os.environ.get('LOCALBASE', '/usr/local') + + class Freebsd(posix.BasePosix): + name = "freebsd" + +- link_flags = ['-pthread'] + get_env_vector('LDFLAGS', '') ++ link_flags = ['-pthread'] + os.environ.get('LDFLAGS', '').split() + cflags = ['-O3', '-pthread', '-fomit-frame-pointer' +- ] + get_env_vector('CFLAGS', '') ++ ] + os.environ.get('CFLAGS', '').split() + standalone_only = [] + shared_only = [] + so_ext = 'so' +@@ -28,27 +20,17 @@ + + def __init__(self, cc=None): + if cc is None: +- cc = get_env("CC", "gcc") ++ cc = os.environ.get('CC', 'cc') + super(Freebsd, self).__init__(cc) + + def _args_for_shared(self, args): + return ['-shared'] + args + +- def _preprocess_include_dirs(self, include_dirs): +- res_incl_dirs = list(include_dirs) +- res_incl_dirs.append(os.path.join(get_env("LOCALBASE", "/usr/local"), "include")) +- return res_incl_dirs +- +- def _preprocess_library_dirs(self, library_dirs): +- res_lib_dirs = list(library_dirs) +- res_lib_dirs.append(os.path.join(get_env("LOCALBASE", "/usr/local"), "lib")) +- return res_lib_dirs +- + def _include_dirs_for_libffi(self): +- return [os.path.join(get_env("LOCALBASE", "/usr/local"), "include")] ++ return [] + + def _library_dirs_for_libffi(self): +- return [os.path.join(get_env("LOCALBASE", "/usr/local"), "lib")] ++ return [] + + class Freebsd_64(Freebsd): + shared_only = ('-fPIC',) diff --git a/lang/pypy/files/patch-pypy__translator__sandbox__pypy_interactive.py b/lang/pypy/files/patch-pypy__translator__sandbox__pypy_interactive.py new file mode 100644 index 000000000000..eaa1118280d0 --- /dev/null +++ b/lang/pypy/files/patch-pypy__translator__sandbox__pypy_interactive.py @@ -0,0 +1,32 @@ +--- pypy/translator/sandbox/pypy_interact.py.orig 2012-06-07 14:24:48.000000000 +0200 ++++ pypy/translator/sandbox/pypy_interact.py 2012-07-02 21:08:19.000000000 +0200 +@@ -24,11 +24,14 @@ + + import sys, os + import autopath ++from pypy.module.sys.version import PYPY_VERSION + from pypy.translator.sandbox.sandlib import SimpleIOSandboxedProc + from pypy.translator.sandbox.sandlib import VirtualizedSandboxedProc + from pypy.translator.sandbox.vfs import Dir, RealDir, RealFile + import pypy + LIB_ROOT = os.path.dirname(os.path.dirname(pypy.__file__)) ++LIB_ROOT = os.path.join(LIB_ROOT, 'lib') ++LIB_ROOT = os.path.join(LIB_ROOT, 'pypy%d.%d' % PYPY_VERSION[:2]) + + class PyPySandboxedProc(VirtualizedSandboxedProc, SimpleIOSandboxedProc): + argv0 = '/bin/pypy-c' +@@ -58,10 +61,10 @@ + return Dir({ + 'bin': Dir({ + 'pypy-c': RealFile(self.executable), +- 'lib-python': RealDir(os.path.join(libroot, 'lib-python'), +- exclude=exclude), +- 'lib_pypy': RealDir(os.path.join(libroot, 'lib_pypy'), +- exclude=exclude), ++ 'lib': Dir({ ++ 'pypy%d.%d' % PYPY_VERSION[:2] : RealDir(libroot, ++ exclude=exclude) ++ }) + }), + 'tmp': tmpdirnode, + }) diff --git a/lang/pypy/files/use.pypy b/lang/pypy/files/use.pypy index 0414620488b4..0b3c62a72004 100644 --- a/lang/pypy/files/use.pypy +++ b/lang/pypy/files/use.pypy @@ -18,7 +18,7 @@ then elif [ "$2" = "POST-DEINSTALL" ] ; then for name in $PYPY_NAMES do - if [ -L $PREFIX/bin/$name ] && [ `readlink $PREFIX/bin/$name` = $name ] + if [ -L $PREFIX/bin/$name ] && [ `readlink $PREFIX/bin/$name` = $name$PYPY_VER ] then rm $PREFIX/bin/$name fi diff --git a/lang/pypy/pkg-descr b/lang/pypy/pkg-descr index 425a4d0dce9e..036119c013df 100644 --- a/lang/pypy/pkg-descr +++ b/lang/pypy/pkg-descr @@ -1,5 +1,5 @@ PyPy is a fast, compliant alternative implementation of the Python language -(2.7.2). It has several advantages and distinct features: +(2.7.1). It has several advantages and distinct features: - Speed: thanks to its Just-in-Time compiler, Python programs often run faster on PyPy. diff --git a/lang/pypy/pkg-plist b/lang/pypy/pkg-plist index 0cdf6dd8410b..a5098d383e09 100644 --- a/lang/pypy/pkg-plist +++ b/lang/pypy/pkg-plist @@ -1447,8 +1447,6 @@ %%PYPY_LIBDIR%%/lib2to3/tests/test_refactor.pyc %%PYPY_LIBDIR%%/lib2to3/tests/test_util.py %%PYPY_LIBDIR%%/lib2to3/tests/test_util.pyc -%%PYPY_LIBDIR%%/lib_pypy/PyQt4.py -%%PYPY_LIBDIR%%/lib_pypy/PyQt4.pyc %%PYPY_LIBDIR%%/lib_pypy/__init__.py %%PYPY_LIBDIR%%/lib_pypy/__init__.pyc %%PYPY_LIBDIR%%/lib_pypy/_codecs_cn.py @@ -1509,8 +1507,6 @@ %%PYPY_LIBDIR%%/lib_pypy/_pypy_irc_topic.pyc %%PYPY_LIBDIR%%/lib_pypy/_pypy_wait.py %%PYPY_LIBDIR%%/lib_pypy/_pypy_wait.pyc -%%PYPY_LIBDIR%%/lib_pypy/_rpyc_support.py -%%PYPY_LIBDIR%%/lib_pypy/_rpyc_support.pyc %%PYPY_LIBDIR%%/lib_pypy/_scproxy.py %%PYPY_LIBDIR%%/lib_pypy/_scproxy.pyc %%PYPY_LIBDIR%%/lib_pypy/_sha.py @@ -1570,28 +1566,6 @@ %%PYPY_LIBDIR%%/lib_pypy/dbm.pyc %%PYPY_LIBDIR%%/lib_pypy/disassembler.py %%PYPY_LIBDIR%%/lib_pypy/disassembler.pyc -%%PYPY_LIBDIR%%/lib_pypy/distributed/__init__.py -%%PYPY_LIBDIR%%/lib_pypy/distributed/__init__.pyc -%%PYPY_LIBDIR%%/lib_pypy/distributed/demo/sockdemo.py -%%PYPY_LIBDIR%%/lib_pypy/distributed/demo/sockdemo.pyc -%%PYPY_LIBDIR%%/lib_pypy/distributed/faker.py -%%PYPY_LIBDIR%%/lib_pypy/distributed/faker.pyc -%%PYPY_LIBDIR%%/lib_pypy/distributed/objkeeper.py -%%PYPY_LIBDIR%%/lib_pypy/distributed/objkeeper.pyc -%%PYPY_LIBDIR%%/lib_pypy/distributed/protocol.py -%%PYPY_LIBDIR%%/lib_pypy/distributed/protocol.pyc -%%PYPY_LIBDIR%%/lib_pypy/distributed/socklayer.py -%%PYPY_LIBDIR%%/lib_pypy/distributed/socklayer.pyc -%%PYPY_LIBDIR%%/lib_pypy/distributed/support.py -%%PYPY_LIBDIR%%/lib_pypy/distributed/support.pyc -%%PYPY_LIBDIR%%/lib_pypy/distributed/test/__init__.py -%%PYPY_LIBDIR%%/lib_pypy/distributed/test/__init__.pyc -%%PYPY_LIBDIR%%/lib_pypy/distributed/test/test_distributed.py -%%PYPY_LIBDIR%%/lib_pypy/distributed/test/test_distributed.pyc -%%PYPY_LIBDIR%%/lib_pypy/distributed/test/test_greensock.py -%%PYPY_LIBDIR%%/lib_pypy/distributed/test/test_greensock.pyc -%%PYPY_LIBDIR%%/lib_pypy/distributed/test/test_socklayer.py -%%PYPY_LIBDIR%%/lib_pypy/distributed/test/test_socklayer.pyc %%PYPY_LIBDIR%%/lib_pypy/future_builtins.py %%PYPY_LIBDIR%%/lib_pypy/future_builtins.pyc %%PYPY_LIBDIR%%/lib_pypy/greenlet.py @@ -1600,8 +1574,6 @@ %%PYPY_LIBDIR%%/lib_pypy/grp.pyc %%PYPY_LIBDIR%%/lib_pypy/identity_dict.py %%PYPY_LIBDIR%%/lib_pypy/identity_dict.pyc -%%PYPY_LIBDIR%%/lib_pypy/itertools.py -%%PYPY_LIBDIR%%/lib_pypy/itertools.pyc %%PYPY_LIBDIR%%/lib_pypy/marshal.py %%PYPY_LIBDIR%%/lib_pypy/marshal.pyc %%PYPY_LIBDIR%%/lib_pypy/msvcrt.py @@ -1634,8 +1606,6 @@ %%PYPY_LIBDIR%%/lib_pypy/pypy_test/test_collections.pyc %%PYPY_LIBDIR%%/lib_pypy/pypy_test/test_coroutine.py %%PYPY_LIBDIR%%/lib_pypy/pypy_test/test_coroutine.pyc -%%PYPY_LIBDIR%%/lib_pypy/pypy_test/test_ctypes_support.py -%%PYPY_LIBDIR%%/lib_pypy/pypy_test/test_ctypes_support.pyc %%PYPY_LIBDIR%%/lib_pypy/pypy_test/test_datetime.py %%PYPY_LIBDIR%%/lib_pypy/pypy_test/test_datetime.pyc %%PYPY_LIBDIR%%/lib_pypy/pypy_test/test_dbm_extra.py @@ -1648,8 +1618,6 @@ %%PYPY_LIBDIR%%/lib_pypy/pypy_test/test_exception_extra.pyc %%PYPY_LIBDIR%%/lib_pypy/pypy_test/test_grp_extra.py %%PYPY_LIBDIR%%/lib_pypy/pypy_test/test_grp_extra.pyc -%%PYPY_LIBDIR%%/lib_pypy/pypy_test/test_itertools.py -%%PYPY_LIBDIR%%/lib_pypy/pypy_test/test_itertools.pyc %%PYPY_LIBDIR%%/lib_pypy/pypy_test/test_marshal_extra.py %%PYPY_LIBDIR%%/lib_pypy/pypy_test/test_marshal_extra.pyc %%PYPY_LIBDIR%%/lib_pypy/pypy_test/test_md5_extra.py @@ -1734,8 +1702,6 @@ %%PYPY_LIBDIR%%/lib_pypy/readline.pyc %%PYPY_LIBDIR%%/lib_pypy/resource.py %%PYPY_LIBDIR%%/lib_pypy/resource.pyc -%%PYPY_LIBDIR%%/lib_pypy/sip.py -%%PYPY_LIBDIR%%/lib_pypy/sip.pyc %%PYPY_LIBDIR%%/lib_pypy/stackless.py %%PYPY_LIBDIR%%/lib_pypy/stackless.pyc %%PYPY_LIBDIR%%/lib_pypy/syslog.py @@ -2503,6 +2469,10 @@ %%PYPY_LIBDIR%%/test/cjkencodings/gbk.txt %%PYPY_LIBDIR%%/test/cjkencodings/hz-utf8.txt %%PYPY_LIBDIR%%/test/cjkencodings/hz.txt +%%PYPY_LIBDIR%%/test/cjkencodings/iso2022_jp-utf8.txt +%%PYPY_LIBDIR%%/test/cjkencodings/iso2022_jp.txt +%%PYPY_LIBDIR%%/test/cjkencodings/iso2022_kr-utf8.txt +%%PYPY_LIBDIR%%/test/cjkencodings/iso2022_kr.txt %%PYPY_LIBDIR%%/test/cjkencodings/johab-utf8.txt %%PYPY_LIBDIR%%/test/cjkencodings/johab.txt %%PYPY_LIBDIR%%/test/cjkencodings/shift_jis-utf8.txt @@ -2721,6 +2691,7 @@ %%PYPY_LIBDIR%%/test/mapping_tests.py %%PYPY_LIBDIR%%/test/mapping_tests.pyc %%PYPY_LIBDIR%%/test/math_testcases.txt +%%PYPY_LIBDIR%%/test/nokia.pem %%PYPY_LIBDIR%%/test/nullcert.pem %%PYPY_LIBDIR%%/test/outstanding_bugs.py %%PYPY_LIBDIR%%/test/outstanding_bugs.pyc @@ -2741,8 +2712,6 @@ %%PYPY_LIBDIR%%/test/randv3.pck %%PYPY_LIBDIR%%/test/re_tests.py %%PYPY_LIBDIR%%/test/re_tests.pyc -%%PYPY_LIBDIR%%/test/regex_tests.py -%%PYPY_LIBDIR%%/test/regex_tests.pyc %%PYPY_LIBDIR%%/test/regrtest.py %%PYPY_LIBDIR%%/test/regrtest.pyc %%PYPY_LIBDIR%%/test/relimport.py @@ -2765,7 +2734,6 @@ %%PYPY_LIBDIR%%/test/string_tests.pyc %%PYPY_LIBDIR%%/test/subprocessdata/sigchild_ignore.py %%PYPY_LIBDIR%%/test/subprocessdata/sigchild_ignore.pyc -%%PYPY_LIBDIR%%/test/svn_python_org_https_cert.pem %%PYPY_LIBDIR%%/test/test_MimeWriter.py %%PYPY_LIBDIR%%/test/test_MimeWriter.pyc %%PYPY_LIBDIR%%/test/test_SimpleHTTPServer.py @@ -2878,6 +2846,8 @@ %%PYPY_LIBDIR%%/test/test_codecencodings_cn.pyc %%PYPY_LIBDIR%%/test/test_codecencodings_hk.py %%PYPY_LIBDIR%%/test/test_codecencodings_hk.pyc +%%PYPY_LIBDIR%%/test/test_codecencodings_iso2022.py +%%PYPY_LIBDIR%%/test/test_codecencodings_iso2022.pyc %%PYPY_LIBDIR%%/test/test_codecencodings_jp.py %%PYPY_LIBDIR%%/test/test_codecencodings_jp.pyc %%PYPY_LIBDIR%%/test/test_codecencodings_kr.py @@ -3299,6 +3269,8 @@ %%PYPY_LIBDIR%%/test/test_pwd.pyc %%PYPY_LIBDIR%%/test/test_py3kwarn.py %%PYPY_LIBDIR%%/test/test_py3kwarn.pyc +%%PYPY_LIBDIR%%/test/test_py_compile.py +%%PYPY_LIBDIR%%/test/test_py_compile.pyc %%PYPY_LIBDIR%%/test/test_pyclbr.py %%PYPY_LIBDIR%%/test/test_pyclbr.pyc %%PYPY_LIBDIR%%/test/test_pydoc.py @@ -3803,9 +3775,6 @@ @dirrm %%PYPY_LIBDIR%%/lib_pypy/pypy_test @dirrm %%PYPY_LIBDIR%%/lib_pypy/numpypy/core @dirrm %%PYPY_LIBDIR%%/lib_pypy/numpypy -@dirrm %%PYPY_LIBDIR%%/lib_pypy/distributed/test -@dirrm %%PYPY_LIBDIR%%/lib_pypy/distributed/demo -@dirrm %%PYPY_LIBDIR%%/lib_pypy/distributed @dirrm %%PYPY_LIBDIR%%/lib_pypy/ctypes_config_cache/test @dirrm %%PYPY_LIBDIR%%/lib_pypy/ctypes_config_cache @dirrm %%PYPY_LIBDIR%%/lib_pypy/_ctypes |