source: trunk/dports/lang/python35/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: 6.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
5PortGroup select 1.0
6
7name                    python35
8
9# Remember to keep py35-tkinter and py35-gdbm's versions sync'd with this
10version                 3.5.0b4
11
12epoch                   20150726
13
14set major               [lindex [split $version .] 0]
15set branch              [join [lrange [split ${version} .] 0 1] .]
16categories              lang
17license                 PSF
18platforms               darwin
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/
26#master_sites            ${homepage}ftp/python/${version}/
27master_sites            ${homepage}ftp/python/3.5.0/
28
29distname                Python-${version}
30
31use_xz                                  yes
32
33checksums           rmd160  94e4f7d1b79420cf7efb802596f42bf3a9a33d09 \
34                    sha256  3b213210e18aa1471c4bbf62748c34dfb93101b39429ee23cf3740ef3b8ad9a0
35
36patchfiles              patch-setup.py.diff \
37                        patch-Lib-cgi.py.diff \
38                        patch-configure.diff \
39                        patch-setup.py-disabled_modules.diff \
40                        patch-Lib-ctypes-macholib-dyld.py.diff \
41                        patch-libedit.diff \
42                        omit-local-site-packages.patch
43
44depends_lib             port:zlib path:lib/libssl.dylib:openssl \
45                        port:sqlite3 port:ncurses \
46                        port:bzip2 port:libedit port:gettext \
47                        port:xz
48depends_run             port:python_select \
49                        port:python3_select
50
51# blacklist llvm-gcc-4.2 compiler known to produce bad code
52compiler.blacklist      *llvm-gcc-4.2
53
54# ensurepip arg may be removed later, now conflicts with pip and setuptools
55# packages
56configure.args          --enable-framework=${frameworks_dir} \
57                        --enable-ipv6 \
58                        --with-computed-gotos \
59                        --with-ensurepip=no
60
61configure.ccache        no
62
63use_parallel_build      yes
64
65post-patch {
66   reinplace "s|@@PREFIX@@|${prefix}|g" \
67       ${worksrcpath}/Lib/cgi.py \
68       ${worksrcpath}/Lib/ctypes/macholib/dyld.py
69
70   reinplace "s|/setup.py|/setup.py --no-user-cfg|" ${worksrcpath}/Makefile.pre.in
71
72   # replace /Applications with ${applications_dir}
73   reinplace "s|@@APPLICATIONS_DIR@@|${applications_dir}|" \
74      ${worksrcpath}/configure
75
76   # See http://trac.macports.org/changeset/37861
77   reinplace "s|xargs -0 rm -r|/usr/bin/xargs -0 /bin/rm -r|g" \
78      ${worksrcpath}/Mac/PythonLauncher/Makefile.in
79}
80
81build.target            all
82
83# test_cmd_line fails
84# see http://bugs.python.org/issue4388 and
85#     http://bugs.python.org/issue4474
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 python3 python3-$pythonNoDot $pythonNoDot]
98
99set confdir config-${branch}m
100
101notes "
102To make this the default Python or Python 3 (i.e., the version run by\
103the 'python' or 'python3' commands), run one or both of:
104
105    sudo port select --set python $pythonNoDot
106    sudo port select --set python3 $pythonNoDot
107"
108
109post-destroot {
110   set framewpath ${frameworks_dir}/Python.framework
111   set framewdir  ${framewpath}/Versions/${branch}
112
113   foreach dir { Headers Resources Python Versions/Current } {
114      file delete ${destroot}${framewpath}/${dir}
115   }
116
117   ln -s ${framewdir}/share/man/man1/python${branch}.1 ${destroot}${prefix}/share/man/man1/
118
119   # Without this, LINKFORSHARED is set to
120   # ... $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)
121   # (this becomes Python.framework/Versions/3.2/Python) which doesn't
122   # quite work (see ticket #15099); instead specifically list the
123   # full path to the proper Python framework file (which becomes
124   # ${prefix}/Library/Frameworks/Python.framework/Versions/3.2/Python)
125    reinplace {s|^\(LINKFORSHARED=.*\)$(PYTHONFRAMEWORKDIR).*$|\1 $(PYTHONFRAMEWORKINSTALLDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)|} ${destroot}${framewdir}/lib/python${branch}/$confdir/Makefile
126
127   # remove -arch flags from the config
128    reinplace -E {s|-arch [a-z0-9_]+||g} \
129       ${destroot}${framewdir}/lib/python${branch}/$confdir/Makefile
130    foreach unversioned {2to3 idle3 pydoc3 python3 python3-config pyvenv} {
131        delete ${destroot}${prefix}/bin/${unversioned}
132    }
133}
134
135platform darwin {
136   post-configure {
137      # See http://trac.macports.org/ticket/18376
138      system -W ${worksrcpath} "ed - pyconfig.h < ${filespath}/pyconfig.ed"
139   }
140}
141
142variant universal {
143    post-patch {
144        set universal_arch_flags {}
145        set arch_run_32bit {}
146        foreach arch ${universal_archs} {
147            lappend universal_arch_flags -arch ${arch}
148            if {${arch} eq "i386" || ${arch} eq "ppc"} {
149                lappend arch_run_32bit -${arch}
150            }
151        }
152        reinplace \
153            "s|UNIVERSAL_ARCH_FLAGS=\".*\"|UNIVERSAL_ARCH_FLAGS=\"${universal_arch_flags}\"|" \
154            ${worksrcpath}/configure
155        if { ${arch_run_32bit} != "" } {
156            reinplace \
157                "s|ARCH_RUN_32BIT=\".*\"|ARCH_RUN_32BIT=\"arch ${arch_run_32bit}\"|" \
158                ${worksrcpath}/configure
159        }
160    }
161    if {${configure.sdkroot} != ""} {
162        configure.args-append   --enable-universalsdk=${configure.sdkroot}
163    } else {
164        configure.args-append   --enable-universalsdk=/
165    }
166    post-configure {
167        system -W ${worksrcpath} "ed - pyconfig.h < ${filespath}/pyconfig.h-universal.ed"
168    }
169
170    post-destroot {
171        foreach unversioned {python3-32} {
172            delete ${destroot}${prefix}/bin/${unversioned}
173        }
174    }
175}
176
177livecheck.type          regex
178#livecheck.url           ${homepage}download/releases/
179livecheck.url           ${homepage}downloads/source/
180#livecheck.regex         Python (${branch}(?:\\.\\d+)*)
181#regex below just for test releases, proper above
182livecheck.regex         Python\[        \]+(3.5.0\[abrc\]+\[0-9\])
Note: See TracBrowser for help on using the repository browser.