source: trunk/dports/lang/python24/Portfile

Last change on this file was 146201, checked in by blair@…, 17 months ago

python{24,25,26,27,31,32,33,34,35: bump revision to recompile after openssl deleted _SSLv2_method symbol.

I observed this with Python 2.7 and 3.5, so assuming it affects all
Python versions:

$ /opt/local/bin/python
Python 3.5.1 (default, Dec 13 2015, 13:03:13)
[GCC 4.2.1 Compatible Apple LLVM 7.0.2 (clang-700.1.81)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
Setting tab completion.

import ssl

Traceback (most recent call last):

File "<stdin>", line 1, in <module>
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/ssl.py", line 98, in <module>

import _ssl # if we can't import it, let the error propagate

ImportError: dlopen(/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/lib-dynload/_ssl.cpython-35m-darwin.so, 2): Symbol not found: _SSLv2_method

Referenced from: /opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/lib-dynload/_ssl.cpython-35m-darwin.so
Expected in: /opt/local/lib/libssl.1.0.0.dylib

in /opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/lib-dynload/_ssl.cpython-35m-darwin.so

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 9.1 KB
Line 
1# $Id: Portfile 146201 2016-03-01 22:57:07Z ryandesign@macports.org $
2
3PortSystem 1.0
4PortGroup select 1.0
5
6name                    python24
7version                 2.4.6
8revision                11
9set major               [lindex [split $version .] 0]
10set branch              [join [lrange [split ${version} .] 0 1] .]
11categories              lang
12license                 PSF
13platforms               darwin
14maintainers             fourdigits.nl:roel openmaintainer
15
16description             An interpreted, object-oriented programming language
17long_description        Python is an interpreted, interactive, object-oriented \
18                        programming language.
19
20homepage                http://www.python.org/
21master_sites            ${homepage}/ftp/python/${version}/ \
22                        ftp://ftp.python.org/pub/python/${version}/ \
23                        ftp://ftp.fastorama.com/mirrors/ftp.python.org/pub/python/${version}/ \
24                        ftp://ftp.python.jp/pub/python/${version}/
25
26distname                Python-${version}
27use_bzip2               yes
28
29checksums               md5     76083277f6c7e4d78992f36d7ad9018d \
30                        sha1    cb1972a554a458f6a26d3e047b359251865d7c96 \
31                        rmd160  0687989193dec2ac108142759281be7ddcf7f31e
32
33patchfiles              patch-configure \
34                        patch-Makefile.pre.in \
35                        patch-Lib-cgi.py \
36                        patch-Lib-site.py \
37                        patch-setup.py \
38                        patch-Include-pyport.h \
39                        patch-Mac-OSX-Makefile.in \
40                        patch-Mac-OSX-IDLE-Makefile.in \
41                        patch-Mac-OSX-PythonLauncher-Makefile.in \
42                        patch-fwrapv.diff
43
44depends_lib             port:gettext path:lib/libssl.dylib:openssl
45depends_run             port:python_select
46
47configure.args          --with-cxx=${configure.cxx} \
48                        --enable-shared \
49                        --enable-framework=${frameworks_dir} \
50                        --mandir=${prefix}/share/man \
51                        --without-readline \
52                        --disable-tk \
53                        --enable-ipv6
54
55use_parallel_build      no
56
57post-patch {
58    reinplace "s|__PREFIX__|${prefix}|g" ${worksrcpath}/Lib/cgi.py \
59        ${worksrcpath}/Lib/site.py ${worksrcpath}/setup.py
60    reinplace "s|__FRAMEWORKS_DIR__|${frameworks_dir}|g" \
61        ${worksrcpath}/Mac/OSX/Makefile.in
62    reinplace "s|__APPLICATIONS_DIR__|${applications_dir}|g" \
63        ${worksrcpath}/Mac/OSX/IDLE/Makefile.in \
64        ${worksrcpath}/Mac/OSX/Makefile.in \
65        ${worksrcpath}/Mac/OSX/PythonLauncher/Makefile.in
66    reinplace "s|__BUILD_ARCH__|${build_arch}|" ${worksrcpath}/configure
67    reinplace "s|__UNIVERSAL_CFLAGS__|${configure.universal_cflags}|" ${worksrcpath}/configure
68    reinplace "s|__UNIVERSAL_LDFLAGS__|${configure.universal_ldflags}|" ${worksrcpath}/configure
69}
70
71build.target            all
72
73# Workaround for case-sensitive file systems
74post-build {
75    if { ![file exists ${worksrcpath}/python.exe] } {
76        ln -s python ${worksrcpath}/python.exe
77    }
78}
79
80test.run                yes
81test.target             test
82
83destroot.target         frameworkinstall maninstall
84
85post-extract {
86    copy ${filespath}/python[string map {. {}} ${branch}]-noframework ${workpath}/python[string map {. {}} ${branch}]
87}
88select.group            python
89if {${os.subplatform} ne "macosx"} {
90    select.file         ${workpath}/python[string map {. {}} ${branch}]
91}
92
93platform macosx {
94    if {(![variant_isset universal] && ![string match *64* $build_arch]) || ([variant_isset universal] && ![string match *64* $universal_archs])} {
95        select.file     ${filespath}/python[string map {. {}} ${branch}]
96        post-destroot {
97            set framewpath ${frameworks_dir}/Python.framework
98            set framewdir  ${framewpath}/Versions/${branch}
99
100            foreach dir { lib include } {
101                file rename ${destroot}${framewdir}/${dir}/python${branch} ${destroot}${prefix}/${dir}
102                ln -s ${prefix}/${dir}/python${branch} ${destroot}${framewdir}/${dir}/python${branch}
103            }
104            # Since the lib/python${branch} dir was just moved above and
105            # libpython2.4.a in lib/python${branch}/config is relative, we need
106            # to repoint it here
107            file delete ${destroot}${prefix}/lib/python${branch}/config/libpython${branch}.a
108            ln -s ${framewdir}/Python ${destroot}${prefix}/lib/python${branch}/config/libpython${branch}.a
109
110            ln -s ${framewdir}/Python ${destroot}${prefix}/lib/libpython${branch}.dylib
111   
112            file rename ${destroot}${prefix}/share/man/man1/python.1 ${destroot}${prefix}/share/man/man1/python${branch}.1
113
114            # delete symlinks without version suffix, use python_select instead to choose version
115            foreach bin { python pythonw idle pydoc smtpd.py } {
116                file delete ${destroot}${prefix}/bin/${bin}
117            }
118            foreach bin [list python${branch} pythonw${branch} idle${branch} pydoc${branch} smtpd${branch}.py] {
119                file rename -force ${destroot}${framewdir}/bin/${bin} ${destroot}${prefix}/bin
120                ln -s ${prefix}/bin/${bin} ${destroot}${framewdir}/bin/${bin}
121            }
122
123            foreach dir { Headers Resources Python Versions/Current } {
124                file delete ${destroot}${framewpath}/${dir}
125            }
126
127            # Without this, LINKFORSHARED is set to
128            # ... $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)
129            # (this becomes Python.framework/Versions/2.4/Python) which doesn't
130            # quite work (see ticket #15099); instead specifically list the
131            # full path to the proper Python framework file (which becomes
132            # ${prefix}/Library/Frameworks/Python.framework/Versions/2.4/Python)
133            reinplace {s|^\(LINKFORSHARED=.*\)$(PYTHONFRAMEWORKDIR).*$|\1 $(PYTHONFRAMEWORKINSTALLDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)|} ${destroot}${prefix}/lib/python${branch}/config/Makefile
134        }
135    } else {
136        # 64-bit, can't build mac-specific stuff
137        configure.args-delete --enable-framework=${frameworks_dir}
138        configure.args-append --disable-toolbox-glue
139        destroot.target       install maninstall
140
141        post-destroot {
142            # delete symlinks without version suffix, use python_select instead to choose version
143            file delete ${destroot}${prefix}/bin/python
144            foreach bin { idle pydoc } {
145                move ${destroot}${prefix}/bin/${bin} ${destroot}${prefix}/bin/${bin}${branch}
146            }
147            move ${destroot}${prefix}/bin/smtpd.py ${destroot}${prefix}/bin/smtpd${branch}.py
148   
149            file rename ${destroot}${prefix}/share/man/man1/python.1 ${destroot}${prefix}/share/man/man1/python${branch}.1
150        }
151
152        select.file         ${workpath}/python[string map {. {}} ${branch}]
153    }
154}
155
156notes "
157To make python ${branch} the default (i.e. the version you get when you run\
158'python'), please run:
159
160sudo port select --set ${select.group} [file tail ${select.file}]
161"
162
163platform darwin {
164    post-configure {
165        # See http://trac.macports.org/ticket/18376
166        system -W ${worksrcpath} "ed - pyconfig.h < ${filespath}/pyconfig.ed"
167    }
168    if {${os.major} >= 9} {
169        configure.cppflags-append       -D__DARWIN_UNIX03
170    }
171    if {${os.major} >= 10} {
172        post-configure {
173                        reinplace "s|#define _POSIX_C_SOURCE 200112L|#undef _POSIX_C_SOURCE|g" ${worksrcpath}/pyconfig.h
174                        reinplace "s|#define _XOPEN_SOURCE 600|#undef _XOPEN_SOURCE|g" ${worksrcpath}/pyconfig.h 
175                }
176                patchfiles-append   patch-macosmodule.diff \
177                                                        patch-mactoolboxglue.diff \
178                                                        patch-pymactoolbox.diff
179    }
180    post-patch {
181        if {![file exists /usr/lib/libSystemStubs.a]} {
182            reinplace s/-lSystemStubs//g ${worksrcpath}/configure
183        }
184    }
185    post-destroot {
186        # remove -arch flags from the config
187        reinplace -E {s|-arch [a-z0-9_]+||g} \
188            ${destroot}${prefix}/lib/python${branch}/config/Makefile
189    }
190}
191
192platform puredarwin {
193    configure.args-delete   --enable-framework=${frameworks_dir}
194    configure.args-append   --disable-toolbox-glue --disable-framework
195    destroot.target         install maninstall
196
197    post-destroot {
198        # delete symlinks without version suffix, use python_select instead to choose version
199        file delete ${destroot}${prefix}/bin/python
200        foreach bin { idle pydoc } {
201            move ${destroot}${prefix}/bin/${bin} ${destroot}${prefix}/bin/${bin}${branch}
202        }
203        move ${destroot}${prefix}/bin/smtpd.py ${destroot}${prefix}/bin/smtpd${branch}.py
204
205        file rename ${destroot}${prefix}/share/man/man1/python.1 ${destroot}${prefix}/share/man/man1/python${branch}.1
206    }
207}
208
209variant universal {
210   if {${configure.sdkroot} != ""} {
211      configure.args-append   --enable-universalsdk=${configure.sdkroot}
212   } else {
213      configure.args-append   --enable-universalsdk=/
214   }
215   post-configure {
216      system -W ${worksrcpath} "ed - pyconfig.h < ${filespath}/pyconfig.h-universal.ed"
217   }
218}
219
220livecheck.type          regex
221livecheck.url           ${homepage}download/releases/
222livecheck.regex         Python (${branch}.\[0-9\]+)
223
Note: See TracBrowser for help on using the repository browser.