source: trunk/dports/lang/python31/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.0 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                    python31
8epoch                   1
9# Remember to keep py31-tkinter and py31-gdbm's versions sync'd with this
10version                 3.1.5
11revision                2
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    20dd2b7f801dc97db948dd168df4dd52 \
30                        rmd160 021362658310f9ea5f6825bf0919f160304f4833 \
31                        sha256 035c4370354d901924ce0fd8df65c5452839f590ec1b9c17fae2ada3e5f3b4d7
32
33patchfiles              patch-setup.py.diff \
34                        patch-Lib-cgi.py.diff \
35                        patch-Lib-distutils-dist.py.diff \
36                        patch-setup.py-disabled_modules.diff \
37                        patch-libedit.diff \
38                        omit-local-site-packages.patch
39
40# http://bugs.python.org/issue21811
41patchfiles-append       yosemite-configure-fixes.patch \
42                        yosemite-python-fixes.patch
43
44depends_lib             port:zlib path:lib/libssl.dylib:openssl \
45                        port:sqlite3 port:ncurses \
46                        port:bzip2 port:libedit port:gettext
47depends_run             port:python_select
48
49configure.args          --enable-framework=${frameworks_dir} \
50                        --enable-ipv6 \
51                        --with-computed-gotos
52configure.ccache        no
53
54use_parallel_build      yes
55
56post-patch {
57   reinplace "s|@@PREFIX@@|${prefix}|g" ${worksrcpath}/Lib/cgi.py
58
59   reinplace "s|/setup.py|/setup.py --no-user-cfg|" ${worksrcpath}/Makefile.pre.in
60
61   # replace /Applications/ with ${applications_dir}/
62   reinplace "s|\\(\[^a-zA-Z0-9\]\\)/Applications/|\\1${applications_dir}/|" \
63      ${worksrcpath}/Mac/Makefile.in \
64      ${worksrcpath}/Mac/Tools/Doc/setup.py \
65      ${worksrcpath}/Mac/PythonLauncher/Makefile.in \
66      ${worksrcpath}/Mac/BuildScript/build-installer.py
67
68   reinplace "s|#!/Library/Frameworks|#!${frameworks_dir}|" \
69      ${worksrcpath}/Mac/IDLE/IDLE.app/Contents/MacOS/IDLE
70
71   # See http://trac.macports.org/changeset/37861
72   reinplace "s|xargs -0 rm -r|/usr/bin/xargs -0 /bin/rm -r|g" \
73      ${worksrcpath}/Mac/PythonLauncher/Makefile.in
74}
75
76build.target            all
77
78# test_cmd_line fails
79# see http://bugs.python.org/issue4388 and
80#     http://bugs.python.org/issue4474
81test.run                yes
82test.target             test
83
84destroot.target         frameworkinstall maninstall
85
86# ensure that correct compiler is used
87build.args-append       MAKE="${build.cmd} CC=${configure.cc}"
88destroot.args-append    MAKE="${destroot.cmd} CC=${configure.cc}"
89
90select.group            python
91select.file             ${filespath}/python[string map {. {}} ${branch}]
92
93notes "
94To make python ${branch} the default (i.e. the version you get when you run\
95'python'), please run:
96
97sudo port select --set ${select.group} [file tail ${select.file}]
98"
99
100post-destroot {
101   set framewpath ${frameworks_dir}/Python.framework
102   set framewdir  ${framewpath}/Versions/${branch}
103
104   foreach dir { Headers Resources Python Versions/Current } {
105      file delete ${destroot}${framewpath}/${dir}
106   }
107
108   ln -s ${framewdir}/share/man/man1/python${branch}.1 ${destroot}${prefix}/share/man/man1/
109
110   # Without this, LINKFORSHARED is set to
111   # ... $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)
112   # (this becomes Python.framework/Versions/3.1/Python) which doesn't
113   # quite work (see ticket #15099); instead specifically list the
114   # full path to the proper Python framework file (which becomes
115   # ${prefix}/Library/Frameworks/Python.framework/Versions/3.1/Python)
116   reinplace {s|^\(LINKFORSHARED=.*\)$(PYTHONFRAMEWORKDIR).*$|\1 $(PYTHONFRAMEWORKINSTALLDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)|} ${destroot}${framewdir}/lib/python${branch}/config/Makefile
117
118   # remove -arch flags from the config
119   reinplace -E {s|-arch [a-z0-9_]+||g} \
120      ${destroot}${framewdir}/lib/python${branch}/config/Makefile
121}
122
123platform darwin {
124   post-configure {
125      # See http://trac.macports.org/ticket/18376
126      system -W ${worksrcpath} "ed - pyconfig.h < ${filespath}/pyconfig.ed"
127   }
128   post-patch {
129                if {![file exists /usr/lib/libSystemStubs.a]} {
130                        reinplace s/-lSystemStubs//g ${worksrcpath}/configure
131                }
132   }
133}
134
135variant universal {
136   post-patch {
137      set universal_arch_flags {}
138      set arch_run_32bit {}
139      foreach arch ${universal_archs} {
140         lappend universal_arch_flags -arch ${arch}
141         if {${arch} eq "i386" || ${arch} eq "ppc"} {
142            lappend arch_run_32bit -${arch}
143         }
144      }
145      reinplace \
146         "s|UNIVERSAL_ARCH_FLAGS=\".*\"|UNIVERSAL_ARCH_FLAGS=\"${universal_arch_flags}\"|" \
147         ${worksrcpath}/configure
148      if { ${arch_run_32bit} != "" } {
149         reinplace \
150            "s|ARCH_RUN_32BIT=\".*\"|ARCH_RUN_32BIT=\"arch ${arch_run_32bit}\"|" \
151            ${worksrcpath}/configure
152      }
153   }
154   if {${configure.sdkroot} != ""} {
155      configure.args-append   --enable-universalsdk=${configure.sdkroot}
156   } else {
157      configure.args-append   --enable-universalsdk=/
158   }
159   post-configure {
160      system -W ${worksrcpath} "ed - pyconfig.h < ${filespath}/pyconfig.h-universal.ed"
161   }
162}
163
164variant ucs4 description {Use 4-byte Unicode characters} {
165   configure.args-append   --with-wide-unicode
166}
167
168livecheck.type          regex
169livecheck.url           ${homepage}download/releases/
170livecheck.regex         Python (${branch}(?:\\.\\d+)*)
Note: See TracBrowser for help on using the repository browser.