source: trunk/dports/lang/python32/Portfile

Last change on this file was 153800, checked in by larryv@…, 10 months ago

python*: Enable loadable SQLite extensions

This is disabled by default because Apple's system SQLite does not
support loadable extensions. But ours does.

Closes #49317.

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