source: trunk/dports/lang/python33/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.1 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                    python33
8
9# Remember to keep py33-tkinter and py33-gdbm's versions sync'd with this
10version                 3.3.6
11revision                4
12
13epoch                   20141012
14
15set major               [lindex [split $version .] 0]
16set branch              [join [lrange [split ${version} .] 0 1] .]
17categories              lang
18license                 PSF
19platforms               darwin
20maintainers             jwa openmaintainer
21
22description             An interpreted, object-oriented programming language
23long_description        Python is an interpreted, interactive, object-oriented \
24                        programming language.
25
26homepage                http://www.python.org/
27#master_sites            ${homepage}ftp/python/${version}/
28master_sites            ${homepage}ftp/python/${version}/
29
30distname                Python-${version}
31
32use_xz                                  yes
33
34checksums           rmd160  e45909eedf3648408ef8b34775ab24654181d9bd \
35                    sha256  5226e4bf7a530c3ff2bcde0c94e0e09e59a8bcde0114fe0268bc925bdabb5d3f
36
37patchfiles              patch-setup.py.diff \
38                        patch-Lib-cgi.py.diff \
39                        patch-Lib-distutils-dist.py.diff \
40                        patch-configure.diff \
41                        patch-setup.py-disabled_modules.diff \
42                        patch-libedit.diff \
43                        omit-local-site-packages.patch
44
45# http://bugs.python.org/issue21811
46patchfiles-append       yosemite-configure-fixes.patch \
47                        yosemite-python-fixes.patch
48
49depends_lib             port:zlib path:lib/libssl.dylib:openssl \
50                        port:sqlite3 port:ncurses \
51                        port:bzip2 port:libedit port:gettext \
52                        port:xz
53depends_run             port:python_select \
54                        port:python3_select
55
56# blacklist llvm-gcc-4.2 compiler known to produce bad code
57compiler.blacklist      *llvm-gcc-4.2
58
59configure.args          --enable-framework=${frameworks_dir} \
60                        --enable-ipv6 \
61                        --with-computed-gotos
62configure.ccache        no
63
64use_parallel_build      yes
65
66post-patch {
67   reinplace "s|@@PREFIX@@|${prefix}|g" ${worksrcpath}/Lib/cgi.py
68
69   reinplace "s|/setup.py|/setup.py --no-user-cfg|" ${worksrcpath}/Makefile.pre.in
70
71   # replace /Applications with ${applications_dir}
72   reinplace "s|@@APPLICATIONS_DIR@@|${applications_dir}|" \
73      ${worksrcpath}/configure
74
75   # See http://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
80build.target            all
81
82# test_cmd_line fails
83# see http://bugs.python.org/issue4388 and
84#     http://bugs.python.org/issue4474
85test.run                yes
86test.target             test
87
88destroot.target         frameworkinstall maninstall
89
90# ensure that correct compiler is used
91build.args-append       MAKE="${build.cmd} CC=${configure.cc}"
92destroot.args-append    MAKE="${destroot.cmd} CC=${configure.cc}"
93
94set pythonNoDot python[string map {. {}} $branch]
95select.entries          [list python python-$pythonNoDot $pythonNoDot] \
96                        [list python3 python3-$pythonNoDot $pythonNoDot]
97
98set confdir config-${branch}m
99
100notes "
101To make this the default Python or Python 3 (i.e., the version run by\
102the 'python' or 'python3' commands), run one or both of:
103
104    sudo port select --set python $pythonNoDot
105    sudo port select --set python3 $pythonNoDot
106"
107
108post-destroot {
109   set framewpath ${frameworks_dir}/Python.framework
110   set framewdir  ${framewpath}/Versions/${branch}
111
112   foreach dir { Headers Resources Python Versions/Current } {
113      file delete ${destroot}${framewpath}/${dir}
114   }
115
116   ln -s ${framewdir}/share/man/man1/python${branch}.1 ${destroot}${prefix}/share/man/man1/
117
118   # Without this, LINKFORSHARED is set to
119   # ... $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)
120   # (this becomes Python.framework/Versions/3.2/Python) which doesn't
121   # quite work (see ticket #15099); instead specifically list the
122   # full path to the proper Python framework file (which becomes
123   # ${prefix}/Library/Frameworks/Python.framework/Versions/3.2/Python)
124    reinplace {s|^\(LINKFORSHARED=.*\)$(PYTHONFRAMEWORKDIR).*$|\1 $(PYTHONFRAMEWORKINSTALLDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)|} ${destroot}${framewdir}/lib/python${branch}/$confdir/Makefile
125
126   # remove -arch flags from the config
127    reinplace -E {s|-arch [a-z0-9_]+||g} \
128       ${destroot}${framewdir}/lib/python${branch}/$confdir/Makefile
129}
130
131platform darwin {
132   post-configure {
133      # See http://trac.macports.org/ticket/18376
134      system -W ${worksrcpath} "ed - pyconfig.h < ${filespath}/pyconfig.ed"
135   }
136}
137
138variant universal {
139   post-patch {
140      set universal_arch_flags {}
141      set arch_run_32bit {}
142      foreach arch ${universal_archs} {
143         lappend universal_arch_flags -arch ${arch}
144         if {${arch} eq "i386" || ${arch} eq "ppc"} {
145            lappend arch_run_32bit -${arch}
146         }
147      }
148      reinplace \
149         "s|UNIVERSAL_ARCH_FLAGS=\".*\"|UNIVERSAL_ARCH_FLAGS=\"${universal_arch_flags}\"|" \
150         ${worksrcpath}/configure
151      if { ${arch_run_32bit} != "" } {
152         reinplace \
153            "s|ARCH_RUN_32BIT=\".*\"|ARCH_RUN_32BIT=\"arch ${arch_run_32bit}\"|" \
154            ${worksrcpath}/configure
155      }
156   }
157   if {${configure.sdkroot} != ""} {
158      configure.args-append   --enable-universalsdk=${configure.sdkroot}
159   } else {
160      configure.args-append   --enable-universalsdk=/
161   }
162   post-configure {
163      system -W ${worksrcpath} "ed - pyconfig.h < ${filespath}/pyconfig.h-universal.ed"
164   }
165
166    post-destroot {
167        foreach unversioned {python3-32} {
168            delete ${destroot}${prefix}/bin/${unversioned}
169        }
170    }
171}
172
173livecheck.type          regex
174#livecheck.url           ${homepage}download/releases/
175livecheck.url           ${homepage}downloads/
176livecheck.regex         Python (${branch}(?:\\.\\d+)*)
Note: See TracBrowser for help on using the repository browser.