summaryrefslogtreecommitdiff
path: root/lang/pypy-devel/files
diff options
context:
space:
mode:
Diffstat (limited to 'lang/pypy-devel/files')
-rw-r--r--lang/pypy-devel/files/Makefile44
-rw-r--r--lang/pypy-devel/files/bsd.pypy.inst.mk13
-rw-r--r--lang/pypy-devel/files/patch-lib-python__2.7__distutils__command__install.py33
-rw-r--r--lang/pypy-devel/files/patch-lib-python__2.7__distutils__sysconfig_pypy.py22
-rw-r--r--lang/pypy-devel/files/patch-lib-python__2.7__sysconfig.py40
-rw-r--r--lang/pypy-devel/files/patch-lib_pypy___sqlite3.py11
-rw-r--r--lang/pypy-devel/files/patch-pypy__module__sys__initpath.py21
-rw-r--r--lang/pypy-devel/files/patch-pypy__sandbox__pypy_interactive.py32
-rw-r--r--lang/pypy-devel/files/patch-rpython__rtyper__tool__rffi_platform.py13
-rw-r--r--lang/pypy-devel/files/use.pypy28
10 files changed, 257 insertions, 0 deletions
diff --git a/lang/pypy-devel/files/Makefile b/lang/pypy-devel/files/Makefile
new file mode 100644
index 000000000000..3c9b017eff23
--- /dev/null
+++ b/lang/pypy-devel/files/Makefile
@@ -0,0 +1,44 @@
+# 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~
+
+BUILDDIR= usession-default-0
+
+.for inst in ${PYPY_INST}
+
+${PYPY_${inst}_NAME}: build_${PYPY_${inst}_NAME}/${BUILDDIR}/testing_1/pypy-c
+ ${CP} build_${PYPY_${inst}_NAME}/${BUILDDIR}/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/goal; \
+ /usr/bin/time -l ${SETENV} TMPDIR=${.CURDIR}/build_${PYPY_${inst}_NAME} \
+ ${PYTHON_CMD} ../../rpython/bin/rpython --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}/${BUILDDIR}/testing_1/pypy-c: .done_translate_${PYPY_${inst}_NAME}
+ ${REINPLACE_CMD} -e 's|^%.o: %.c$$|.c.o:|g' build_${PYPY_${inst}_NAME}/${BUILDDIR}/testing_1/Makefile
+ /usr/bin/time -l ${MAKE} -C build_${PYPY_${inst}_NAME}/${BUILDDIR}/testing_1 pypy-c
+.endfor
diff --git a/lang/pypy-devel/files/bsd.pypy.inst.mk b/lang/pypy-devel/files/bsd.pypy.inst.mk
new file mode 100644
index 000000000000..d2085dd7da02
--- /dev/null
+++ b/lang/pypy-devel/files/bsd.pypy.inst.mk
@@ -0,0 +1,13 @@
+# PyPy instances
+# See http://readthedocs.org/docs/pypy/latest/config/index.html for a list of
+# options available. --gcrootfinder=asmgcc does not work under FreeBSD/amd64.
+
+PYPY_DEFAULT_NAME?= pypy
+PYPY_DEFAULT_TRANSLATE_ARGS?=
+PYPY_DEFAULT_OPT?= jit
+PYPY_DEFAULT_OBJSPACE_ARGS?=
+
+PYPY_SANDBOX_NAME?= pypy-sandbox
+PYPY_SANDBOX_TRANSLATE_ARGS?= --sandbox
+PYPY_SANDBOX_OPT?= jit
+PYPY_SANDBOX_OBJSPACE_ARGS?=
diff --git a/lang/pypy-devel/files/patch-lib-python__2.7__distutils__command__install.py b/lang/pypy-devel/files/patch-lib-python__2.7__distutils__command__install.py
new file mode 100644
index 000000000000..b44070c610f3
--- /dev/null
+++ b/lang/pypy-devel/files/patch-lib-python__2.7__distutils__command__install.py
@@ -0,0 +1,33 @@
+--- lib-python/2.7/distutils/command/install.py.orig 2012-07-15 10:10:18.000000000 +0200
++++ lib-python/2.7/distutils/command/install.py 2012-07-15 10:13:15.000000000 +0200
+@@ -84,9 +84,9 @@
+ 'data' : '$userbase',
+ },
+ 'pypy': {
+- 'purelib': '$base/site-packages',
+- 'platlib': '$base/site-packages',
+- 'headers': '$base/include',
++ 'purelib': '$base/lib/pypy-$pypy_version_short/site-packages',
++ 'platlib': '$platbase/lib/pypy-$pypy_version_short/site-packages',
++ 'headers': '$base/include/pypy-$pypy_version_short/$dist_name',
+ 'scripts': '$base/bin',
+ 'data' : '$base',
+ },
+@@ -304,6 +304,7 @@
+ # about needing recursive variable expansion (shudder).
+
+ py_version = (string.split(sys.version))[0]
++ 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(),
+@@ -311,6 +312,9 @@
+ 'py_version': py_version,
+ 'py_version_short': py_version[0:3],
+ 'py_version_nodot': py_version[0] + py_version[2],
++ 'pypy_version': pypy_version,
++ 'pypy_version_short': pypy_version[0:3],
++ 'pypy_version_nodot': pypy_version[0] + pypy_version[2],
+ 'sys_prefix': prefix,
+ 'prefix': prefix,
+ 'sys_exec_prefix': exec_prefix,
diff --git a/lang/pypy-devel/files/patch-lib-python__2.7__distutils__sysconfig_pypy.py b/lang/pypy-devel/files/patch-lib-python__2.7__distutils__sysconfig_pypy.py
new file mode 100644
index 000000000000..426a13fc33a4
--- /dev/null
+++ b/lang/pypy-devel/files/patch-lib-python__2.7__distutils__sysconfig_pypy.py
@@ -0,0 +1,22 @@
+--- lib-python/2.7/distutils/sysconfig_pypy.py.orig 2012-11-22 14:52:20.000000000 +0200
++++ lib-python/2.7/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-%s.%s' % sys.pypy_version_info[:2])
+
+ 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-%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
diff --git a/lang/pypy-devel/files/patch-lib-python__2.7__sysconfig.py b/lang/pypy-devel/files/patch-lib-python__2.7__sysconfig.py
new file mode 100644
index 000000000000..e96cc0e2e8af
--- /dev/null
+++ b/lang/pypy-devel/files/patch-lib-python__2.7__sysconfig.py
@@ -0,0 +1,40 @@
+--- lib-python/2.7/sysconfig.py.orig 2012-07-15 09:57:14.000000000 +0200
++++ lib-python/2.7/sysconfig.py 2012-07-15 10:03:25.000000000 +0200
+@@ -27,12 +27,12 @@
+ 'data' : '{base}',
+ },
+ 'pypy': {
+- 'stdlib': '{base}/lib-python/{py_version_short}',
+- 'platstdlib': '{base}/lib-python/{py_version_short}',
+- 'purelib': '{base}/lib-python/{py_version_short}',
+- 'platlib': '{base}/lib-python/{py_version_short}',
+- 'include': '{base}/include',
+- 'platinclude': '{base}/include',
++ 'stdlib': '{base}/lib/pypy-{pypy_version_short}',
++ 'platstdlib': '{platbase}/lib/pypy-{pypy_version_short}',
++ 'purelib': '{base}/lib/pypy-{pypy_version_short}',
++ 'platlib': '{platbase}/lib/pypy-{pypy_version_short}',
++ 'include': '{base}/include/pypy-{pypy_version_short}',
++ 'platinclude': '{platbase}/include/pypy-{pypy_version_short}',
+ 'scripts': '{base}/bin',
+ 'data' : '{base}',
+ },
+@@ -98,6 +98,8 @@
+ 'scripts', 'data')
+ _PY_VERSION = sys.version.split()[0]
+ _PY_VERSION_SHORT = sys.version[:3]
++_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)
+ _EXEC_PREFIX = os.path.normpath(sys.exec_prefix)
+@@ -304,6 +306,9 @@
+ _CONFIG_VARS['py_version'] = _PY_VERSION
+ _CONFIG_VARS['py_version_short'] = _PY_VERSION_SHORT
+ _CONFIG_VARS['py_version_nodot'] = _PY_VERSION[0] + _PY_VERSION[2]
++ _CONFIG_VARS['py_version'] = _PYPY_VERSION
++ _CONFIG_VARS['pypy_version_short'] = _PYPY_VERSION_SHORT
++ _CONFIG_VARS['pypy_version_nodot'] = _PYPY_VERSION[0] + _PYPY_VERSION[2]
+ _CONFIG_VARS['base'] = _PREFIX
+ _CONFIG_VARS['platbase'] = _EXEC_PREFIX
+ _CONFIG_VARS['projectbase'] = _PROJECT_BASE
diff --git a/lang/pypy-devel/files/patch-lib_pypy___sqlite3.py b/lang/pypy-devel/files/patch-lib_pypy___sqlite3.py
new file mode 100644
index 000000000000..6cb5a0c53265
--- /dev/null
+++ b/lang/pypy-devel/files/patch-lib_pypy___sqlite3.py
@@ -0,0 +1,11 @@
+--- lib_pypy/_sqlite3.py.orig 2013-05-18 16:20:00.000000000 +0200
++++ lib_pypy/_sqlite3.py 2013-05-18 16:21:06.000000000 +0200
+@@ -270,7 +270,7 @@
+
+ _lib = _ffi.verify("""
+ #include <sqlite3.h>
+-""", libraries=['sqlite3']
++""", libraries=['sqlite3'], include_dirs=['/usr/local/include'], library_dirs=['/usr/local/lib']
+ )
+
+ exported_sqlite_symbols = [
diff --git a/lang/pypy-devel/files/patch-pypy__module__sys__initpath.py b/lang/pypy-devel/files/patch-pypy__module__sys__initpath.py
new file mode 100644
index 000000000000..a134097b8e0e
--- /dev/null
+++ b/lang/pypy-devel/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
+@@ -90,14 +90,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-devel/files/patch-pypy__sandbox__pypy_interactive.py b/lang/pypy-devel/files/patch-pypy__sandbox__pypy_interactive.py
new file mode 100644
index 000000000000..ec8cfbdc0b18
--- /dev/null
+++ b/lang/pypy-devel/files/patch-pypy__sandbox__pypy_interactive.py
@@ -0,0 +1,32 @@
+--- pypy/sandbox/pypy_interact.py.orig 2012-06-07 14:24:48.000000000 +0200
++++ pypy/sandbox/pypy_interact.py 2012-07-02 21:08:19.000000000 +0200
+@@ -22,11 +22,14 @@
+
+ import sys, os
+ sys.path.insert(0, os.path.realpath(os.path.join(os.path.dirname(__file__), '..', '..', '..')))
++from pypy.module.sys.version import PYPY_VERSION
+ from rpython.translator.sandbox.sandlib import SimpleIOSandboxedProc
+ from rpython.translator.sandbox.sandlib import VirtualizedSandboxedProc
+ from rpython.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'
+@@ -56,10 +59,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-devel/files/patch-rpython__rtyper__tool__rffi_platform.py b/lang/pypy-devel/files/patch-rpython__rtyper__tool__rffi_platform.py
new file mode 100644
index 000000000000..d8eab77cd863
--- /dev/null
+++ b/lang/pypy-devel/files/patch-rpython__rtyper__tool__rffi_platform.py
@@ -0,0 +1,13 @@
+--- rpython/rtyper/tool/rffi_platform.py~ 2011-11-19 09:44:54.000000000 +0200
++++ rpython/rtyper/tool/rffi_platform.py 2011-11-23 20:17:30.000000000 +0200
+@@ -805,7 +805,9 @@
+ includes=['gc.h']
+ else:
+ library_dir = ''
+- libraries = ['gc', 'dl']
++ libraries = ['gc']
++ if platform.name != "freebsd":
++ libraries += ['dl']
+ includes=['gc/gc.h']
+ eci = ExternalCompilationInfo(
+ platform=platform,
diff --git a/lang/pypy-devel/files/use.pypy b/lang/pypy-devel/files/use.pypy
new file mode 100644
index 000000000000..5e399af284dc
--- /dev/null
+++ b/lang/pypy-devel/files/use.pypy
@@ -0,0 +1,28 @@
+#!/bin/sh
+
+# $FreeBSD$
+
+PREFIX=%%PREFIX%%
+PYPY_NAMES="%%PYPY_NAMES%%"
+PYPY_VER=%%PYPY_VER%%
+
+if [ "$2" = "POST-INSTALL" ]
+then
+ for name in $PYPY_NAMES
+ do
+ if [ ! -L $PREFIX/bin/$name ]
+ then
+ ln -s $name-$PYPY_VER $PREFIX/bin/$name
+ fi
+ done
+elif [ "$2" = "POST-DEINSTALL" ] ; then
+ for name in $PYPY_NAMES
+ do
+ if [ -L $PREFIX/bin/$name ] && [ `readlink $PREFIX/bin/$name` = $name-$PYPY_VER ]
+ then
+ rm $PREFIX/bin/$name
+ fi
+ done
+fi
+
+exit 0