source: trunk/dports/lang/python26/Portfile @ 40886

Last change on this file since 40886 was 40886, checked in by blb@…, 9 years ago

Fix library and framework install discrepancy; ticket #16111, for 2.5
(patch 4 from #16765)

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 5.0 KB
Line 
1# $Id: Portfile 40886 2008-10-17 06:41:01Z blb@macports.org $
2
3PortSystem 1.0
4
5name                    python26
6version                 2.6
7revision                1
8set major               [lindex [split $version .] 0]
9set branch              [join [lrange [split ${version} .] 0 1] .]
10categories              lang
11platforms               darwin
12maintainers             blb
13
14description             An interpreted, object-oriented programming language
15long_description        Python is an interpreted, interactive, object-oriented \
16                        programming language.
17
18homepage                http://www.python.org
19master_sites            ${homepage}/ftp/python/${version}/ \
20                        ftp://ftp.python.org/pub/python/${version}/
21# ftp.python.jp works, but no 2.6 as of 2008-10-05
22#                        ftp://ftp.python.jp/ftp.python.org/python/${version}/
23
24distname                Python-${version}
25extract.suffix          .tgz
26
27checksums               md5     d16d29a77db2cd3af882a591f431a403 \
28                        sha1    d7fd08304b66cb4020786a7ee5aa452235046ecd \
29                        rmd160  b44d5cc7efa198b21f41e43e1d28af60875f0a4e
30
31# Can be removed once MacPorts 1.7.0 is released
32if {![info exists applications_dir]} {
33   set applications_dir /Applications/MacPorts
34}
35if {![info exists frameworks_dir]} {
36   set frameworks_dir ${prefix}/Library/Frameworks
37}
38
39patchfiles              patch-setup.py.diff \
40                        patch-Lib-cgi.py.diff \
41                        patch-Mac-IDLE-Makefile.in.diff \
42                        patch-Mac-Makefile.in.diff \
43                        patch-Mac-PythonLauncher-Makefile.in.diff \
44                        patch-Mac-Tools-Doc-setup.py.diff
45
46depends_lib             port:gettext
47
48configure.args          --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   reinplace "s|@@APPLICATIONS_DIR@@|${applications_dir}|g" \
60      ${worksrcpath}/Mac/Makefile.in ${worksrcpath}/Mac/IDLE/Makefile.in \
61      ${worksrcpath}/Mac/Tools/Doc/setup.py \
62      ${worksrcpath}/Mac/PythonLauncher/Makefile.in
63   reinplace "s|xargs -0 rm -r|xargs -0 rm -rf|g" \
64      ${worksrcpath}/Mac/PythonLauncher/Makefile.in
65}
66
67build.target            all
68
69test.run                yes
70test.target             test
71
72destroot.target         frameworkinstall maninstall
73
74post-destroot {
75   set framewpath ${frameworks_dir}/Python.framework
76   set framewdir  ${framewpath}/Versions/${branch}
77
78   foreach dir { lib include } {
79      file rename ${destroot}${framewdir}/${dir}/python${branch} ${destroot}${prefix}/${dir}
80      ln -s ${prefix}/${dir}/python${branch} ${destroot}${framewdir}/${dir}/python${branch}
81   }
82
83   ln -s ${framewdir}/Python ${destroot}${prefix}/lib/libpython${branch}.dylib
84
85   file rename ${destroot}${prefix}/share/man/man1/python.1 ${destroot}${prefix}/share/man/man1/python${branch}.1
86
87   # delete symlinks without version suffix, use python_select instead to choose version
88   foreach bin { python pythonw idle pydoc smtpd.py python-config } {
89      file delete ${destroot}${prefix}/bin/${bin}
90   }
91   foreach bin [list python${branch} pythonw${branch} idle${branch} pydoc${branch} smtpd${branch}.py python${branch}-config] {
92      file rename -force ${destroot}${framewdir}/bin/${bin} ${destroot}${prefix}/bin
93      ln -s ${prefix}/bin/${bin} ${destroot}${framewdir}/bin/${bin}
94   }
95
96   foreach dir { Headers Resources Python Versions/Current } {
97      file delete ${destroot}${framewpath}/${dir}
98   }
99
100   # install select file for python_select
101   xinstall -m 755 -d ${destroot}${prefix}/etc/select/python
102   xinstall -m 644 ${filespath}/${name} ${destroot}${prefix}/etc/select/python/
103}
104
105post-activate {
106   ui_msg "\nTo fully complete your installation and make python $branch the default, please run
107\n\tsudo port install python_select \
108\n\tsudo python_select $name\n"
109}
110
111platform darwin 7 {
112   # there is no SystemStubs on 10.3
113   post-patch {
114      reinplace "s|-lSystemStubs||g" ${worksrcpath}/configure \
115         ${worksrcpath}/configure.in
116   }
117   post-configure {
118      reinplace "s|-lSystemStubs||g" ${worksrcpath}/Makefile.pre.in \
119         ${worksrcpath}/Makefile.pre ${worksrcpath}/Makefile
120   }
121   # To avoid GCC incompatibility issue. See http://nxg.me.uk/note/2004/restFP/ (by ebgssth at gmail.com, ticket #13322)
122   configure.ldflags-append   "-lcc_dynamic"
123}
124
125platform darwin 8 {
126   # TODO: would configure.compiler be more appropriate?
127   configure.args-append   --with-cxx=/usr/bin/g++-4.0
128}
129
130platform darwin 9 {
131   configure.cppflags-append   -D__DARWIN_UNIX03
132}
133
134platform darwin 10 {
135   configure.compiler   gcc-4.2
136}
137
138variant universal {
139   configure.args-append   --enable-universalsdk
140}
141
142livecheck.check         regex
143livecheck.url           ${homepage}download/releases/
144livecheck.regex         Python (${branch}.\[0-9\]+)
145
Note: See TracBrowser for help on using the repository browser.