source: trunk/dports/lang/pypy/Portfile @ 139229

Last change on this file since 139229 was 139229, checked in by jeremyhu@…, 4 years ago

misc: Change port:openssl dependency to path:lib/libssl.dylib:openssl

This should allow usage of libressl as a replacement for openssl in relevant
ports. Not all ports have been tested, but libressl aims for API
compatibility with OpenSSL, so it is expected to work.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 4.4 KB
Line 
1# -*- 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
2# $Id: Portfile 139229 2015-08-08 03:10:35Z jeremyhu@macports.org $
3
4PortSystem          1.0
5
6name                pypy
7version             2.6.0
8categories          lang python devel
9license             MIT PSF
10maintainers         jmr openmaintainer
11description         implementation of Python in Python
12long_description \
13   PyPy is both a reimplementation of Python in Python, and a framework for \
14   implementing interpreters and virtual machines for programming languages, \
15   especially dynamic languages.
16
17platforms           darwin
18
19homepage            http://pypy.org/
20master_sites        https://bitbucket.org/pypy/pypy/downloads/
21use_bzip2           yes
22distname            ${name}-${version}-src
23checksums           md5 b09ab96f50ab3021d020e321f210e4c0 \
24                    sha1 d6580ed01c0b963ef3735e810bc750b8d44f11f2 \
25                    rmd160 9019bd2afad56fe066827e2b49d9d461c6e2b40e
26
27depends_build       port:pkgconfig
28depends_lib         port:libffi \
29                    port:sqlite3 \
30                    port:bzip2 \
31                    path:lib/libssl.dylib:openssl \
32                    port:gettext
33
34patchfiles          darwin.py.diff \
35                    make_output.diff \
36                    configure.py.diff \
37                    ffiplatform.py.diff
38
39post-patch {
40    reinplace "s|__PREFIX__|${prefix}|" ${worksrcpath}/lib_pypy/cffi/ffiplatform.py
41}
42
43use_configure       no
44
45# use pypy to build if it's already installed
46if {[file executable ${prefix}/lib/pypy/pypy]} {
47    build.cmd       ${prefix}/lib/pypy/pypy
48} else {
49    depends_build-append port:python27
50    build.cmd       ${prefix}/bin/python2.7
51}
52
53# a lot of memory is used before the C compiler even runs, so limit build.jobs
54# according to available memory more tightly than the default
55if {![catch {sysctl hw.memsize} memsize]} {
56    if {$build_arch eq "x86_64" || $build_arch eq "ppc64"} {
57        incr memsize -4000000000
58    } else {
59        incr memsize -2000000000
60    }
61    if {$memsize <= 0} {
62        build.jobs 1
63    } elseif {${build.jobs} > $memsize / 1000000000 + 1} {
64        build.jobs [expr {$memsize / 1000000000 + 1}]
65    }
66}
67
68# memory usage bug in gcc 4.2 on x86_64
69if {$build_arch eq "x86_64"} {
70    compiler.blacklist gcc-4.2
71}
72
73platform darwin {
74    # use arch -foo if available
75    if {${os.major} >= 9} {
76        build.cmd arch -${build_arch} ${build.cmd}
77    }
78}
79build.env           PYPY_USESSION_DIR=${workpath} PYPY_LOCALBASE=${prefix} \
80                    CFLAGS="${configure.cc_archflags} ${configure.cppflags}" \
81                    LDFLAGS="${configure.ld_archflags} ${configure.ldflags}" \
82                    PYPY_CC="${configure.cc}"
83
84build.dir           ${worksrcpath}/pypy/goal
85build.args          --batch --verbose \
86                    --cc=${configure.cc} --opt=jit \
87                    --make-jobs=${build.jobs}
88build.target        ../../rpython/bin/rpython
89build.post_args     targetpypystandalone
90
91# JIT is not available on powerpc at present
92if {${os.arch} ne "i386"} {
93    build.args-delete --opt=jit
94    build.args-append --opt=3
95}
96
97post-build {
98    # some modules have to be compiled in an extra step
99    foreach script {_audioop_build.py _curses_build.py _pwdgrp_build.py _sqlite3_build.py _syslog_build.py} {
100        system -W ${worksrcpath}/lib_pypy "${build.dir}/pypy-c $script"
101    }
102}
103
104destroot {
105    xinstall -d ${destroot}${prefix}/lib/${name}/lib-python
106    copy ${worksrcpath}/lib-python/2.7 ${destroot}${prefix}/lib/${name}/lib-python
107    copy ${worksrcpath}/lib_pypy ${worksrcpath}/include \
108         ${destroot}${prefix}/lib/${name}
109    # library search paths changed quite inconveniently such that the binary
110    # won't run if it's in ${prefix}/bin
111    xinstall -m 755 ${build.dir}/pypy-c ${destroot}${prefix}/lib/${name}/pypy
112    xinstall ${build.dir}/libpypy-c.dylib ${destroot}${prefix}/lib/${name}
113    ln -s ${prefix}/lib/${name}/pypy ${destroot}${prefix}/bin
114
115    xinstall -d ${destroot}${prefix}/share/doc/${name}
116    xinstall -W ${worksrcpath} -m 644 README.rst LICENSE ${destroot}${prefix}/share/doc/${name}
117}
118
119variant opt1 description {use optimization level 1 for faster build (but slower execution)} {
120    depends_lib-append port:boehmgc
121    build.args-delete  --opt=3 --opt=jit
122    build.args-append  --opt=1
123}
124
125livecheck.type      regex
126livecheck.url       http://pypy.org/download.html
127livecheck.regex     pypy-(\[0-9.\]+)-src${extract.suffix}
Note: See TracBrowser for help on using the repository browser.