source: trunk/dports/lang/python25/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: 8.6 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 146201 2016-03-01 22:57:07Z ryandesign@macports.org $
3
4PortSystem 1.0
5PortGroup select 1.0
6
7name                    python25
8version                 2.5.6
9revision                6
10
11set branch              [join [lrange [split ${version} .] 0 1] .]
12categories              lang
13license                 PSF
14platforms               darwin
15maintainers             nomaintainer
16
17description             An interpreted, object-oriented programming language
18long_description        Python is an interpreted, interactive, object-oriented \
19                        programming language.
20
21homepage                http://www.python.org/
22master_sites            http://ftp.python.org/ftp/python/${version}/
23
24distname                Python-${version}
25use_bzip2               yes
26
27checksums           md5     5d45979c5f30fb2dd5f067c6b06b88e4 \
28                    sha1    29f6dd41bf09c5e04311b367cbb7604fa016e699 \
29                    rmd160  92f0a955971f187a7d50c6422168202ec551bf22
30
31# patch-Lib-distutils-dist.py.diff comes from
32# <http://bugs.python.org/issue1180>
33patchfiles              patch-Makefile.pre.in.diff \
34                        patch-Lib-cgi.py.diff \
35                        patch-Lib-distutils-dist.py.diff \
36                        patch-setup.py.diff \
37                        patch-configure.diff \
38                        patch-64bit.diff \
39                        patch-setup.py-disabled_modules.diff \
40                        patch-mac_ver.diff \
41                        patch-libedit.diff \
42                        patch-fwrapv.diff
43
44depends_lib             port:gettext port:zlib path:lib/libssl.dylib:openssl \
45                        port:sqlite3 port:db46 port:bzip2 \
46                        port:libedit port:ncurses
47depends_run             port:python_select
48
49configure.args          --enable-shared \
50                        --enable-framework=${frameworks_dir} \
51                        --mandir=${prefix}/share/man \
52                        --enable-ipv6 \
53                        --with-cxx=${configure.cxx}
54
55post-patch {
56        reinplace "s|__PREFIX__|${prefix}|g" ${worksrcpath}/Lib/cgi.py \
57                ${worksrcpath}/setup.py
58        reinplace "s|/Applications/MacPython|${applications_dir}/MacPython|g" \
59                ${worksrcpath}/Mac/Makefile.in \
60                ${worksrcpath}/Mac/IDLE/Makefile.in \
61                ${worksrcpath}/Mac/Tools/Doc/setup.py \
62                ${worksrcpath}/Mac/PythonLauncher/Makefile.in \
63                ${worksrcpath}/Mac/BuildScript/build-installer.py
64        reinplace "s|xargs -0 rm -r|xargs -0 rm -rf|g" \
65                ${worksrcpath}/Mac/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}|" \
69            ${worksrcpath}/configure \
70            ${worksrcpath}/Makefile.pre.in
71
72        # http://trac.macports.org/ticket/21517
73        system -W ${worksrcpath} "ed - Modules/_localemodule.c < ${filespath}/_localemodule.c.ed"
74        system -W ${worksrcpath} "ed - Lib/locale.py < ${filespath}/locale.py.ed"
75}
76
77build.target            all
78
79# TODO: From python24, do we still need this?
80# Workaround for case-sensitive file systems
81post-build {
82    if { ![file exists ${worksrcpath}/python.exe] } {
83        ln -s python ${worksrcpath}/python.exe
84    }
85}
86
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
96select.group            python
97select.file             ${filespath}/python[string map {. {}} ${branch}]
98
99notes "
100To make python ${branch} the default (i.e. the version you get when you run\
101'python'), please run:
102
103sudo port select --set ${select.group} [file tail ${select.file}]
104"
105
106platform macosx {
107post-destroot {
108
109        set framewpath ${frameworks_dir}/Python.framework
110        set framewdir  ${framewpath}/Versions/${branch}
111
112        # Without this, LINKFORSHARED is set to
113        # ... $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)
114        # (this becomes Python.framework/Versions/2.5/Python) which doesn't
115        # quite work (see ticket #15099); instead specifically list the
116        # full path to the proper Python framework file (which becomes
117        # ${prefix}/Library/Frameworks/Python.framework/Versions/2.5/Python)
118        reinplace {s|^\(LINKFORSHARED=.*\)$(PYTHONFRAMEWORKDIR).*$|\1 $(PYTHONFRAMEWORKINSTALLDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)|} ${destroot}${framewdir}/lib/python${branch}/config/Makefile
119
120        foreach dir { lib include } {
121            file rename ${destroot}${framewdir}/${dir}/python${branch} ${destroot}${prefix}/${dir}
122            ln -s ${prefix}/${dir}/python${branch} ${destroot}${framewdir}/${dir}/python${branch}
123        }
124        ln -s ${prefix}/share ${destroot}${framewdir}/share
125
126        ln -s ${framewdir}/Python ${destroot}${prefix}/lib/libpython${branch}.dylib
127
128        file rename ${destroot}${prefix}/share/man/man1/python.1 ${destroot}${prefix}/share/man/man1/python${branch}.1
129
130        # delete symlinks without version suffix, use python_select instead to choose version
131        foreach bin { python pythonw idle pydoc smtpd.py python-config } {
132            file delete ${destroot}${prefix}/bin/${bin}
133        }
134        foreach bin [list python${branch} pythonw${branch} idle${branch} pydoc${branch} smtpd${branch}.py python${branch}-config] {
135            file rename -force ${destroot}${framewdir}/bin/${bin} ${destroot}${prefix}/bin
136            ln -s ${prefix}/bin/${bin} ${destroot}${framewdir}/bin/${bin}
137        }
138
139        foreach dir { Headers Resources Python Versions/Current } {
140            file delete ${destroot}${framewpath}/${dir}
141        }
142
143        # Fix incorrectly-pointed libpython2.5.a symlink, see
144        # http://trac.macports.org/ticket/19906
145        set python_staticlink ${destroot}${prefix}/lib/python${branch}/config/libpython${branch}.a
146        file delete ${python_staticlink}
147        ln -s ${framewdir}/Python ${python_staticlink}
148}
149}
150
151platform darwin {
152   post-configure {
153      # See http://trac.macports.org/ticket/18376
154      system -W ${worksrcpath} "ed - pyconfig.h < ${filespath}/pyconfig.ed"
155   }
156   if {${os.major} >= 10} {
157        configure.cppflags-append   -D_DARWIN_C_SOURCE
158        patchfiles-append           patch-pyconfig.h.in.diff
159   }
160   post-patch {
161                if {![file exists /usr/lib/libSystemStubs.a]} {
162                        reinplace s/-lSystemStubs//g ${worksrcpath}/configure
163                }
164   }
165   post-destroot {
166      # remove -arch flags from the config
167      reinplace -E {s|-arch [a-z0-9_]+||g} \
168         ${destroot}${prefix}/lib/python${branch}/config/Makefile
169   }
170}
171
172platform darwin 8 {
173    patchfiles-append               patch-FSIORefNum.diff
174}
175
176platform darwin 9 {
177        configure.cppflags-append       -D__DARWIN_UNIX03
178}
179
180platform puredarwin {
181        patchfiles-append       patch-Modules-posixmodule.c.diff
182        configure.args-delete   --enable-framework=${frameworks_dir}
183        configure.args-append   --disable-toolbox-glue --disable-framework
184        destroot.target     install maninstall
185
186post-build {
187    # thin dynamic library to have the same arch as static lib, even after -lSystemStubs
188    system "lipo ${worksrcpath}/libpython${branch}.dylib -output ${worksrcpath}/libpython${branch}.dylib -thin `lipo -info ${worksrcpath}/libpython${branch}.a | tail -n 1 | sed -e 's/.*architecture: \\(.*\\)/\\1/'`"
189}
190
191post-destroot {
192        # delete symlinks without version suffix, use python_select instead to choose version
193        foreach bin { python pythonw idle pydoc smtpd.py python-config } {
194            file delete ${destroot}${prefix}/bin/${bin}
195        }
196
197        file rename ${destroot}${prefix}/share/man/man1/python.1 ${destroot}${prefix}/share/man/man1/python${branch}.1
198}
199}
200
201variant universal {
202   if {${configure.sdkroot} == ""} {
203      configure.args-append   --enable-universalsdk=/
204   } else {
205      configure.args-append   --enable-universalsdk=${configure.sdkroot}
206   }
207   post-configure {
208      system -W ${worksrcpath} "ed - pyconfig.h < ${filespath}/pyconfig.h-universal.ed"
209   }
210}
211
212if {${os.platform} eq "darwin" && ${os.major} >= 14} {
213    depends_lib
214    depends_run
215    archive_sites
216    pre-fetch {
217        ui_error "${name} is not supported on Yosemite or later."
218        return -code error {unsupported platform}
219    }
220}
221
222livecheck.type          regex
223livecheck.url           ${homepage}download/releases/
224livecheck.regex         Python (${branch}.\[0-9\]+)
Note: See TracBrowser for help on using the repository browser.