source: trunk/dports/lang/python32/Portfile @ 106228

Last change on this file since 106228 was 106228, checked in by jmr@…, 7 years ago

python32: update to 3.2.5 (#39133)

  • 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 106228 2013-05-19 21:29:52Z jmr@macports.org $
3
4PortSystem 1.0
5PortGroup select 1.0
6
7name                    python32
8epoch                   20120412
9# Remember to keep py32-tkinter and py32-gdbm's versions sync'd with this
10version                 3.2.5
11
12set major               [lindex [split $version .] 0]
13set branch              [join [lrange [split ${version} .] 0 1] .]
14categories              lang
15license                 PSF
16platforms               darwin
17maintainers             nomaintainer
18
19description             An interpreted, object-oriented programming language
20long_description        Python is an interpreted, interactive, object-oriented \
21                        programming language.
22
23homepage                http://www.python.org/
24master_sites            ${homepage}ftp/python/${version}/
25
26distname                Python-${version}
27use_xz                  yes
28
29checksums               md5 03c5843638c576d29b3321947facd22d \
30                        rmd160 ee9a13e6744406c6b99078da38a6cbf290f64256 \
31                        sha256 8ccb9645b9779fc4550055b2ebb21a724ab7a63dee45643286eb4f79b2f84116
32
33patchfiles              patch-setup.py.diff \
34                        patch-Lib-cgi.py.diff \
35                        patch-Lib-distutils-dist.py.diff \
36                        patch-configure.diff \
37                        patch-setup.py-disabled_modules.diff \
38                        patch-libedit.diff
39
40depends_lib             port:zlib port:openssl \
41                        port:sqlite3 port:ncurses \
42                        port:bzip2 port:libedit port:gettext
43depends_run             port:python_select
44
45configure.args          --enable-framework=${frameworks_dir} \
46                        --enable-ipv6 \
47                        --with-computed-gotos
48configure.ccache        no
49
50use_parallel_build      yes
51
52post-patch {
53   reinplace "s|@@PREFIX@@|${prefix}|g" ${worksrcpath}/Lib/cgi.py
54
55   reinplace "s|/setup.py|/setup.py --no-user-cfg|" ${worksrcpath}/Makefile.pre.in
56
57   # replace /Applications with ${applications_dir}
58   reinplace "s|@@APPLICATIONS_DIR@@|${applications_dir}|" \
59      ${worksrcpath}/configure
60
61   # See https://trac.macports.org/changeset/37861
62   reinplace "s|xargs -0 rm -r|/usr/bin/xargs -0 /bin/rm -r|g" \
63      ${worksrcpath}/Mac/PythonLauncher/Makefile.in
64}
65
66build.target            all
67
68# test_cmd_line fails
69# see http://bugs.python.org/issue4388 and
70#     http://bugs.python.org/issue4474
71test.run                yes
72test.target             test
73
74destroot.target         frameworkinstall maninstall
75
76# ensure that correct compiler is used
77build.args-append       MAKE="${build.cmd} CC=${configure.cc}"
78destroot.args-append    MAKE="${destroot.cmd} CC=${configure.cc}"
79
80select.group            python
81select.file             ${filespath}/python[string map {. {}} ${branch}]
82set confdir config-${branch}m
83
84notes "
85To make python ${branch} the default (i.e. the version you get when you run\
86'python'), please run:
87
88sudo port select --set ${select.group} [file tail ${select.file}]
89"
90
91post-destroot {
92   set framewpath ${frameworks_dir}/Python.framework
93   set framewdir  ${framewpath}/Versions/${branch}
94
95   foreach dir { Headers Resources Python Versions/Current } {
96      file delete ${destroot}${framewpath}/${dir}
97   }
98
99   ln -s ${framewdir}/share/man/man1/python${branch}.1 ${destroot}${prefix}/share/man/man1/
100
101   # Without this, LINKFORSHARED is set to
102   # ... $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)
103   # (this becomes Python.framework/Versions/3.2/Python) which doesn't
104   # quite work (see ticket #15099); instead specifically list the
105   # full path to the proper Python framework file (which becomes
106   # ${prefix}/Library/Frameworks/Python.framework/Versions/3.2/Python)
107    reinplace {s|^\(LINKFORSHARED=.*\)$(PYTHONFRAMEWORKDIR).*$|\1 $(PYTHONFRAMEWORKINSTALLDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)|} ${destroot}${framewdir}/lib/python${branch}/$confdir/Makefile
108
109   # remove -arch flags from the config
110    reinplace -E {s|-arch [a-z0-9_]+||g} \
111       ${destroot}${framewdir}/lib/python${branch}/$confdir/Makefile
112}
113
114variant universal {
115   post-patch {
116      set universal_arch_flags {}
117      set arch_run_32bit {}
118      foreach arch ${universal_archs} {
119         lappend universal_arch_flags -arch ${arch}
120         if { ${arch}=="i386" || ${arch}=="ppc" } {
121            lappend arch_run_32bit -${arch}
122         }
123      }
124      reinplace \
125         "s|UNIVERSAL_ARCH_FLAGS=\".*\"|UNIVERSAL_ARCH_FLAGS=\"${universal_arch_flags}\"|" \
126         ${worksrcpath}/configure
127      if { ${arch_run_32bit} != "" } {
128         reinplace \
129            "s|ARCH_RUN_32BIT=\".*\"|ARCH_RUN_32BIT=\"arch ${arch_run_32bit}\"|" \
130            ${worksrcpath}/configure
131      }
132   }
133   if {${configure.sdkroot} != ""} {
134      configure.args-append   --enable-universalsdk=${configure.sdkroot}
135   } else {
136      configure.args-append   --enable-universalsdk=/
137   }
138   post-configure {
139      system -W ${worksrcpath} "ed - pyconfig.h < ${filespath}/pyconfig.h-universal.ed"
140   }
141}
142
143variant ucs4 description {Use 4-byte Unicode characters} {
144   configure.args-append   --with-wide-unicode
145    set confdir config-${branch}mu
146}
147
148livecheck.type          regex
149livecheck.url           ${homepage}download/releases/
150livecheck.regex         Python (${branch}(?:\\.\\d+)*)
Note: See TracBrowser for help on using the repository browser.