# -*- 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 2.0.2 categories lang python devel license MIT PSF 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 homepage http://pypy.org/ master_sites https://bitbucket.org/pypy/pypy/downloads/ use_bzip2 yes distname ${name}-${version}-src checksums md5 c26662e348159b460057548ddaf35333 \ sha1 49e0af6e57bd2738cd3eb09c3246c69a3dc01319 \ rmd160 3dc53bbde9736d768d4ac7ba0e8cbc5b6667a905 depends_build port:pkgconfig depends_lib port:libffi \ port:sqlite3 \ port:bzip2 \ port:openssl \ port:gettext patchfiles darwin.py.diff \ make_output.diff \ configure.py.diff use_configure no # use pypy to build if it's already installed if {[file executable ${prefix}/lib/pypy/pypy]} { build.cmd ${prefix}/lib/pypy/pypy } else { depends_build-append port:python27 build.cmd ${prefix}/bin/python2.7 } # a lot of memory is used before the C compiler even runs, so limit build.jobs # according to available memory more tightly than the default if {![catch {sysctl hw.memsize} memsize]} { if {$build_arch == "x86_64" || $build_arch == "ppc64"} { incr memsize -4000000000 } else { incr memsize -2000000000 } if {$memsize <= 0} { build.jobs 1 } elseif {${build.jobs} > $memsize / 1000000000 + 1} { build.jobs [expr $memsize / 1000000000 + 1] } } # memory usage bug in gcc 4.2 on x86_64 if {${configure.compiler} == "gcc-4.2" && $build_arch == "x86_64"} { configure.compiler clang } platform darwin { # use arch -foo if available if {${os.major} >= 9} { build.cmd arch -${build_arch} ${build.cmd} } } build.env PYPY_USESSION_DIR=${workpath} PYPY_LOCALBASE=${prefix} \ CFLAGS="${configure.cc_archflags} ${configure.cppflags}" \ LDFLAGS="${configure.ld_archflags} ${configure.ldflags}" \ PYPY_CC="${configure.cc}" build.dir ${worksrcpath}/pypy/goal build.args --batch --translation-verbose \ --cc=${configure.cc} --opt=jit \ --make-jobs=${build.jobs} build.target ../../rpython/bin/rpython build.post_args targetpypystandalone # JIT is not available on powerpc at present if {${os.arch} != "i386"} { build.args-delete --opt=jit build.args-append --opt=3 } destroot { xinstall -d ${destroot}${prefix}/lib/${name}/lib-python copy ${worksrcpath}/lib-python/2.7 ${destroot}${prefix}/lib/${name}/lib-python copy ${worksrcpath}/lib_pypy ${worksrcpath}/include \ ${destroot}${prefix}/lib/${name} # library search paths changed quite inconveniently such that the binary # won't run if it's in ${prefix}/bin xinstall -m 755 ${build.dir}/pypy-c ${destroot}${prefix}/lib/${name}/pypy ln -s ${prefix}/lib/${name}/pypy ${destroot}${prefix}/bin } variant opt1 description {use optimization level 1 for faster build (but slower execution)} { depends_lib-append port:boehmgc build.args-delete --opt=3 --opt=jit build.args-append --opt=1 } livecheck.type regex livecheck.url http://pypy.org/download.html livecheck.regex pypy-(\[0-9.\]+)-src${extract.suffix}