source: trunk/dports/lang/python27/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: 5.3 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
5PortGroup           select 1.0
6
7name                python27
8epoch               2
9# Remember to keep py27-tkinter and py27-gdbm's versions sync'd with this
10version             2.7.10
11revision            2
12
13set major           [lindex [split $version .] 0]
14set branch          [join [lrange [split ${version} .] 0 1] .]
15categories          lang
16license             PSF
17platforms           darwin
18
19maintainers         jwa openmaintainer
20
21description         An interpreted, object-oriented programming language
22long_description    Python is an interpreted, interactive, object-oriented \
23                    programming language.
24
25homepage            http://www.python.org/
26master_sites        ${homepage}ftp/python/${version}/
27
28distname            Python-${version}
29use_xz                          yes
30
31checksums           rmd160  eb003de9bb52fc2c6a2d2e3dcb816ba0c56751d0 \
32                    sha256  1cd3730781b91caf0fa1c4d472dc29274186480161a150294c42ce9b5c5effc0
33
34patchfiles          patch-Makefile.pre.in.diff \
35                    patch-setup.py.diff \
36                    patch-setup.py-disabled_modules.diff \
37                    patch-Lib-cgi.py.diff \
38                    patch-Lib-ctypes-macholib-dyld.py.diff \
39                    patch-configure.diff \
40                    patch-libedit.diff \
41                    patch-Include-pyport.h.diff \
42                    omit-local-site-packages.patch
43
44depends_lib         port:gettext \
45                    port:zlib \
46                    path:lib/libssl.dylib:openssl \
47                    port:sqlite3 \
48                    port:db48 \
49                    port:ncurses \
50                    port:bzip2 \
51                    port:libedit
52depends_run         port:python_select \
53                    port:python2_select
54
55# disable-ipv6 for now, getaddrinfo-function missing
56configure.args      --enable-framework=${frameworks_dir} \
57                    --enable-ipv6
58
59configure.cppflags-append -I${prefix}/include/db48
60configure.ldflags-append -L${prefix}/lib/db48
61
62configure.ccache    no
63
64# signed integer overflow is normally undefined as per the C spec, but python
65# needs it to be defined as twos-complement
66configure.cflags-append -fwrapv
67
68post-patch {
69    reinplace "s|@@PREFIX@@|${prefix}|g" \
70        ${worksrcpath}/Lib/cgi.py \
71        ${worksrcpath}/Lib/ctypes/macholib/dyld.py
72    reinplace "s|@@APPLICATIONS_DIR@@|${applications_dir}|" \
73        ${worksrcpath}/configure
74
75    # See https://trac.macports.org/changeset/37861
76    reinplace "s|xargs -0 rm -r|/usr/bin/xargs -0 /bin/rm -r|g" \
77        ${worksrcpath}/Mac/PythonLauncher/Makefile.in
78}
79
80post-configure {
81    reinplace "s;/* #undef PY_FORMAT_LONG_LONG */;#define PY_FORMAT_LONG_LONG \"ll\";" pyconfig.h
82}
83
84build.target        all
85
86test.run            yes
87test.target         test
88
89destroot.target     frameworkinstall maninstall
90
91# ensure that correct compiler is used
92build.args-append   MAKE="${build.cmd} CC=${configure.cc}"
93destroot.args-append MAKE="${destroot.cmd} CC=${configure.cc}"
94
95set pythonNoDot python[string map {. {}} $branch]
96select.entries      [list python python-$pythonNoDot $pythonNoDot] \
97                    [list python2 python2-$pythonNoDot $pythonNoDot]
98
99notes "
100To make this the default Python or Python 2 (i.e., the version run by\
101the 'python' or 'python2' commands), run one or both of:
102
103    sudo port select --set python $pythonNoDot
104    sudo port select --set python2 $pythonNoDot
105"
106
107post-destroot {
108    set framewpath ${frameworks_dir}/Python.framework
109    set framewdir  ${framewpath}/Versions/${branch}
110
111    foreach dir { Headers Resources Python Versions/Current } {
112        file delete ${destroot}${framewpath}/${dir}
113    }
114
115    ln -s ${framewdir}/share/man/man1/python${branch}.1 ${destroot}${prefix}/share/man/man1/
116    ln -s ${framewdir}/Python ${destroot}${prefix}/lib/libpython${branch}.dylib
117
118    foreach unversionedFile {2to3 2to3-2 idle idle2 pydoc pydoc2 python python2 python-config python2-config pythonw pythonw2 smtpd.py smtpd2.py} {
119        delete ${destroot}${prefix}/bin/${unversionedFile}
120    }
121
122    # remove -arch flags from the config
123    reinplace -E {s|-arch [a-z0-9_]+||g} \
124        ${destroot}${framewdir}/lib/python${branch}/config/Makefile \
125        ${destroot}${framewdir}/lib/python${branch}/_sysconfigdata.py
126}
127
128platform darwin {
129    post-patch {
130                if {![file exists /usr/lib/libSystemStubs.a]} {
131                        reinplace s/-lSystemStubs//g ${worksrcpath}/configure
132                }
133    }
134}
135
136variant universal {
137    # This patch will need updating when 2.7.6 is released, as ARCH_RUN_32BIT
138    # will once again be used for something. See ticket #39270.
139    patchfiles-append patch-configure-universal.diff
140    post-patch {
141        reinplace \
142            "s|__UNIVERSAL_ARCHFLAGS__|${configure.universal_cflags}|" \
143            ${worksrcpath}/configure
144    }
145    if {${configure.sdkroot} != ""} {
146        configure.args-append   --enable-universalsdk=${configure.sdkroot}
147    } else {
148        configure.args-append   --enable-universalsdk=/
149    }
150}
151
152variant ucs4 description {Enable support for UCS4} {
153    configure.args-append   --enable-unicode=ucs4
154}
155
156livecheck.type          regex
157#livecheck.url           ${homepage}download/releases/
158livecheck.url           ${homepage}downloads/
159livecheck.regex         Python (${branch}(?:\\.\\d+)*)
Note: See TracBrowser for help on using the repository browser.