source: trunk/dports/lang/python36/Portfile @ 152607

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

python36: version bump to 3.6.0b1

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 6.8 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 152607 2016-09-13 06:06:12Z jwa@macports.org $
3
4PortSystem 1.0
5PortGroup select 1.0
6
7name                python36
8
9# Remember to keep py36-tkinter and py36-gdbm's versions sync'd with this
10version             3.6.0b1
11
12epoch               20160913
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.6.0/
28
29distname            Python-${version}
30
31use_xz              yes
32
33checksums           rmd160  88b6dbc251da2684f8b9c32caa36dbba2f84546e \
34                    sha256  a83b094a8abf8a1fba7c548a5e8dd0aabe87a87a6ebd87c97f4a5a2527a74d42
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                    patch-configure-xcode4bug.diff
44
45depends_lib         port:zlib path:lib/libssl.dylib:openssl \
46                    port:sqlite3 port:ncurses \
47                    port:bzip2 port:libedit port:gettext \
48                    port:xz
49depends_run         port:python_select \
50                    port:python3_select
51
52# blacklist llvm-gcc-4.2 compiler known to produce bad code
53compiler.blacklist  *llvm-gcc-4.2
54
55# ensurepip arg may be removed later, now conflicts with pip and setuptools
56# packages
57configure.args      --enable-framework=${frameworks_dir} \
58                    --enable-ipv6 \
59                    --with-computed-gotos \
60                    --with-ensurepip=no
61
62configure.ccache    no
63
64use_parallel_build  yes
65
66post-patch {
67    reinplace "s|@@PREFIX@@|${prefix}|g" \
68      ${worksrcpath}/Lib/cgi.py \
69      ${worksrcpath}/Lib/ctypes/macholib/dyld.py
70
71    reinplace "s|/setup.py|/setup.py --no-user-cfg|" ${worksrcpath}/Makefile.pre.in
72
73    # replace /Applications with ${applications_dir}
74    reinplace "s|@@APPLICATIONS_DIR@@|${applications_dir}|" \
75      ${worksrcpath}/configure
76
77    # See http://trac.macports.org/changeset/37861
78    reinplace "s|xargs -0 rm -r|/usr/bin/xargs -0 /bin/rm -r|g" \
79      ${worksrcpath}/Mac/PythonLauncher/Makefile.in
80}
81
82build.target        all
83
84# test_cmd_line fails
85# see http://bugs.python.org/issue4388 and
86#     http://bugs.python.org/issue4474
87test.run            yes
88test.target         test
89
90destroot.target     frameworkinstall maninstall
91
92# ensure that correct compiler is used
93build.args-append   MAKE="${build.cmd} CC=${configure.cc}"
94destroot.args-append    MAKE="${destroot.cmd} CC=${configure.cc}"
95
96set pythonNoDot python[string map {. {}} $branch]
97select.entries      [list python python-$pythonNoDot $pythonNoDot] \
98                    [list python3 python3-$pythonNoDot $pythonNoDot]
99
100set confdir config-${branch}m
101
102platform darwin {
103    set confdir config-${branch}m-darwin
104    post-configure {
105        # See http://trac.macports.org/ticket/18376
106        system -W ${worksrcpath} "ed - pyconfig.h < ${filespath}/pyconfig.ed"
107   }
108}
109
110notes "
111To make this the default Python or Python 3 (i.e., the version run by\
112the 'python' or 'python3' commands), run one or both of:
113
114    sudo port select --set python $pythonNoDot
115    sudo port select --set python3 $pythonNoDot
116
117##############################################################
118# IF YOU ARE USING PYTHON FROM THE TERMINAL, PLEASE INSTALL:
119#   py[string map {. {}} $branch]-readline
120# TO AVOID A LIBEDIT / PYTHON INTERACTION ISSUE.
121# REF: https://trac.macports.org/ticket/48807
122##############################################################
123"
124
125post-destroot {
126    set framewpath ${frameworks_dir}/Python.framework
127    set framewdir  ${framewpath}/Versions/${branch}
128
129    foreach dir { Headers Resources Python Versions/Current } {
130        file delete ${destroot}${framewpath}/${dir}
131    }
132
133    ln -s ${framewdir}/share/man/man1/python${branch}.1 ${destroot}${prefix}/share/man/man1/
134
135    # Without this, LINKFORSHARED is set to
136    # ... $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)
137    # (this becomes Python.framework/Versions/3.2/Python) which doesn't
138    # quite work (see ticket #15099); instead specifically list the
139    # full path to the proper Python framework file (which becomes
140    # ${prefix}/Library/Frameworks/Python.framework/Versions/3.2/Python)
141    reinplace {s|^\(LINKFORSHARED=.*\)$(PYTHONFRAMEWORKDIR).*$|\1 $(PYTHONFRAMEWORKINSTALLDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)|} ${destroot}${framewdir}/lib/python${branch}/$confdir/Makefile
142
143    # remove -arch flags from the config
144    reinplace -E {s|-arch [a-z0-9_]+||g} \
145       ${destroot}${framewdir}/lib/python${branch}/$confdir/Makefile
146    foreach unversioned {2to3 idle3 pydoc3 python3 python3-config pyvenv} {
147        delete ${destroot}${prefix}/bin/${unversioned}
148    }
149}
150
151variant readline description {Use readline instead of libedit} {
152    patchfiles-delete       patch-libedit.diff
153    depends_lib-append      port:readline
154    depends_lib-delete      port:libedit
155}
156
157variant universal {
158    post-patch {
159        set universal_arch_flags {}
160        set arch_run_32bit {}
161        foreach arch ${universal_archs} {
162            lappend universal_arch_flags -arch ${arch}
163            if {${arch} eq "i386" || ${arch} eq "ppc"} {
164                lappend arch_run_32bit -${arch}
165            }
166        }
167        reinplace \
168          "s|UNIVERSAL_ARCH_FLAGS=\".*\"|UNIVERSAL_ARCH_FLAGS=\"${universal_arch_flags}\"|" \
169          ${worksrcpath}/configure
170        if { ${arch_run_32bit} != "" } {
171            reinplace \
172              "s|ARCH_RUN_32BIT=\".*\"|ARCH_RUN_32BIT=\"arch ${arch_run_32bit}\"|" \
173              ${worksrcpath}/configure
174        }
175    }
176    if {${configure.sdkroot} != ""} {
177        configure.args-append   --enable-universalsdk=${configure.sdkroot}
178    } else {
179        configure.args-append   --enable-universalsdk=/
180    }
181    post-configure {
182        system -W ${worksrcpath} "ed - pyconfig.h < ${filespath}/pyconfig.h-universal.ed"
183    }
184
185    post-destroot {
186        foreach unversioned {python3-32} {
187            delete ${destroot}${prefix}/bin/${unversioned}
188        }
189    }
190}
191
192livecheck.type      regex
193#livecheck.url       ${homepage}download/releases/
194livecheck.url       ${homepage}downloads/source/
195#livecheck.regex     Python (${branch}(?:\\.\\d+)*)
196#regex below just for test releases, proper above
197livecheck.regex     Python\[    \]+(3.6.0\[abrc\]+\[0-9\])
Note: See TracBrowser for help on using the repository browser.