[55661] trunk/dports/lang
jmr at macports.org
jmr at macports.org
Sun Aug 16 07:52:30 PDT 2009
Revision: 55661
http://trac.macports.org/changeset/55661
Author: jmr at macports.org
Date: 2009-08-16 07:52:28 -0700 (Sun, 16 Aug 2009)
Log Message:
-----------
New port: pypy, an implementation of Python in Python
Added Paths:
-----------
trunk/dports/lang/pypy/
trunk/dports/lang/pypy/Portfile
trunk/dports/lang/pypy/files/
trunk/dports/lang/pypy/files/setpgrp.diff
Added: trunk/dports/lang/pypy/Portfile
===================================================================
--- trunk/dports/lang/pypy/Portfile (rev 0)
+++ trunk/dports/lang/pypy/Portfile 2009-08-16 14:52:28 UTC (rev 55661)
@@ -0,0 +1,71 @@
+# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
+# $Id$
+
+PortSystem 1.0
+
+name pypy
+version 1.1.0
+set branch [join [lrange [split ${version} .] 0 1] .]
+categories lang python devel
+maintainers jmr openmaintainer
+description implementation of Python in Python
+long_description \
+ PyPy is both a reimplementation of Python in Python, and a framework for \
+ implementing interpreters and virtual machines for programming languages, \
+ especially dynamic languages.
+
+platforms darwin
+#license MIT
+
+homepage http://codespeak.net/pypy/
+master_sites http://codespeak.net/download/pypy/
+use_bzip2 yes
+
+checksums md5 562779596ca08e5405dd3c48df194744 \
+ sha1 cf62fc6d5dacca20f540f84431e5adee872b98d4 \
+ rmd160 c4715a620334251fdd98c6015805057813773c30
+
+depends_lib port:bzip2 \
+ port:libffi \
+ port:ncurses \
+ port:python26 \
+ port:zlib
+
+patchfiles setpgrp.diff
+patch.args -p2
+
+use_configure no
+
+build.dir ${worksrcpath}/pypy/translator/goal
+build.cmd ${prefix}/bin/python2.6
+build.args --batch --cc=${configure.cc} --opt=3
+build.target translate.py
+build.post_args targetpypystandalone.py
+
+if {[info exists configure.cc_archflags]} {
+ build.args-append --cflags=\"${configure.cc_archflags} ${configure.cppflags} ${configure.ldflags}\"
+} else {
+ build.args-append --cflags=\"${configure.cppflags} ${configure.ldflags}\"
+}
+
+destroot {
+ xinstall -d ${destroot}${prefix}/share/${name}-${branch}/pypy
+ copy ${worksrcpath}/pypy/lib ${destroot}${prefix}/share/${name}-${branch}/pypy
+ xinstall -d ${destroot}${prefix}/share/${name}-${branch}/lib-python
+ copy ${worksrcpath}/lib-python/2.5.2 ${worksrcpath}/lib-python/modified-2.5.2 \
+ ${destroot}${prefix}/share/${name}-${branch}/lib-python
+ xinstall -m 755 ${build.dir}/pypy-c ${destroot}${prefix}/bin
+}
+
+variant opt1 description {use optimization level 1 for faster build} {
+ depends_lib-append port:boehmgc
+ build.args-delete --opt=3
+ build.args-append --opt=1
+}
+#variant jit description {enable just-in-time compiler} {
+# build.args-append --jit
+#}
+
+livecheck.check regex
+livecheck.url http://codespeak.net/pypy/dist/pypy/doc/download.html
+livecheck.regex pypy-(\[0-9.\]+)${extract.suffix}
Property changes on: trunk/dports/lang/pypy/Portfile
___________________________________________________________________
Added: svn:keywords
+ Id
Added: svn:eol-style
+ native
Added: trunk/dports/lang/pypy/files/setpgrp.diff
===================================================================
--- trunk/dports/lang/pypy/files/setpgrp.diff (rev 0)
+++ trunk/dports/lang/pypy/files/setpgrp.diff 2009-08-16 14:52:28 UTC (rev 55661)
@@ -0,0 +1,80 @@
+Modified: pypy/trunk/pypy/rpython/module/ll_os.py
+==============================================================================
+--- pypy/trunk/pypy/rpython/module/ll_os.py (original)
++++ pypy/trunk/pypy/rpython/module/ll_os.py Sat Jun 13 22:39:08 2009
+@@ -88,10 +88,31 @@
+ def __init__(self):
+ self.configure(CConfig)
+
++ # on some platforms, e.g. OS X Leopard, the following constants which
++ # may be defined in pyconfig.h triggers "legacy" behaviour for functions
++ # like setpgrp():
++ #
++ # _POSIX_C_SOURCE 200112L
++ # _XOPEN_SOURCE 600
++ # _DARWIN_C_SOURCE 1
++ #
++ # since the translation currently includes pyconfig.h, the checkcompiles
++ # call below include the pyconfig.h file so that the same behaviour is
++ # present in both the check and the final translation...
++
+ if hasattr(os, 'getpgrp'):
+- self.GETPGRP_HAVE_ARG = platform.checkcompiles("getpgrp(0)", "#include <unistd.h>")
++ self.GETPGRP_HAVE_ARG = platform.checkcompiles(
++ "getpgrp(0)",
++ '#include "pyconfig.h"\n#include <unistd.h>',
++ [platform.get_python_include_dir()]
++ )
++
+ if hasattr(os, 'setpgrp'):
+- self.SETPGRP_HAVE_ARG = platform.checkcompiles("setpgrp(0,0)", "#include <unistd.h>")
++ self.SETPGRP_HAVE_ARG = platform.checkcompiles(
++ "setpgrp(0,0)",
++ '#include "pyconfig.h"\n#include <unistd.h>',
++ [platform.get_python_include_dir()]
++ )
+
+ # we need an indirection via c functions to get macro calls working on llvm XXX still?
+ if hasattr(os, 'WCOREDUMP'):
+
+Modified: pypy/trunk/pypy/rpython/tool/rffi_platform.py
+==============================================================================
+--- pypy/trunk/pypy/rpython/tool/rffi_platform.py (original)
++++ pypy/trunk/pypy/rpython/tool/rffi_platform.py Sat Jun 13 22:39:08 2009
+@@ -14,9 +14,10 @@
+ #
+ # Helpers for simple cases
+
+-def eci_from_header(c_header_source):
++def eci_from_header(c_header_source, include_dirs=[]):
+ return ExternalCompilationInfo(
+- pre_include_bits=[c_header_source]
++ pre_include_bits=[c_header_source],
++ include_dirs=include_dirs
+ )
+
+ def getstruct(name, c_header_source, interesting_fields):
+@@ -43,9 +44,9 @@
+ DEFINED = Defined(macro)
+ return configure(CConfig)['DEFINED']
+
+-def has(name, c_header_source):
++def has(name, c_header_source, include_dirs=[]):
+ class CConfig:
+- _compilation_info_ = eci_from_header(c_header_source)
++ _compilation_info_ = eci_from_header(c_header_source, include_dirs)
+ HAS = Has(name)
+ return configure(CConfig)['HAS']
+
+@@ -57,9 +58,9 @@
+ WORKS = Works()
+ configure(CConfig)
+
+-def checkcompiles(expression, c_header_source):
++def checkcompiles(expression, c_header_source, include_dirs=[]):
+ """Check if expression compiles. If not, returns False"""
+- return has(expression, c_header_source)
++ return has(expression, c_header_source, include_dirs)
+
+ def sizeof(name, eci, **kwds):
+ class CConfig:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20090816/34f87bfb/attachment.html>
More information about the macports-changes
mailing list