Ticket #34079: python33-1.0.tcl

File python33-1.0.tcl, 4.0 KB (added by erik_nolte@…, 13 years ago)

/opt/local/var/macports/sources/rsync.macports.org/release/tarballs/ports/_resources/port1.0/group

Line 
1# et:ts=4
2# python33-1.0.tcl
3#
4# $Id: python33-1.0.tcl 72558 2010-10-20 21:12:08Z ryandesign@macports.org $
5#
6# Copyright (c) 2007 Markus W. Weissman <mww@macports.org>,
7# All rights reserved.
8#
9# Redistribution and use in source and binary forms, with or without
10# modification, are permitted provided that the following conditions are
11# met:
12#
13# 1. Redistributions of source code must retain the above copyright
14#    notice, this list of conditions and the following disclaimer.
15# 2. Redistributions in binary form must reproduce the above copyright
16#    notice, this list of conditions and the following disclaimer in the
17#    documentation and/or other materials provided with the distribution.
18# 3. Neither the name of Apple Computer, Inc. nor the names of its
19#    contributors may be used to endorse or promote products derived from
20#    this software without specific prior written permission.
21#
22# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
25# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
26# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
27# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
28# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
29# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
30# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
32# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33#
34
35set python.branch       3.3
36set python.prefix       ${frameworks_dir}/Python.framework/Versions/${python.branch}
37set python.bin  ${python.prefix}/bin/python${python.branch}
38set python.lib  ${python.prefix}/Python
39set python.libdir ${python.prefix}/lib/python${python.branch}
40set python.pkgd ${python.prefix}/lib/python${python.branch}/site-packages
41set python.include      ${python.prefix}/include/python${python.branch}
42
43categories              python
44
45dist_subdir             python
46
47depends_lib             port:python33
48
49# we want the default universal variant added despite not using configure
50use_configure   no
51universal_variant yes
52
53build.cmd               ${python.bin} setup.py --no-user-cfg
54build.target    build
55options python.add_archflags
56default python.add_archflags yes
57pre-build {
58    if {${python.add_archflags}} {
59        if {[variant_exists universal] && [variant_isset universal]} {
60            build.env-append CFLAGS="${configure.universal_cflags}" \
61                             OBJCFLAGS="${configure.universal_cflags}" \
62                             CXXFLAGS="${configure.universal_cxxflags}" \
63                             LDFLAGS="${configure.universal_ldflags}"
64        } else {
65            build.env-append CFLAGS="${configure.cc_archflags}" \
66                             OBJCFLAGS="${configure.objc_archflags}" \
67                             CXXFLAGS="${configure.cxx_archflags}" \
68                             FFLAGS="${configure.f77_archflags}" \
69                             F90FLAGS="${configure.f90_archflags}" \
70                             FCFLAGS="${configure.fc_archflags}" \
71                             LDFLAGS="${configure.ld_archflags}"
72        }
73    }
74}
75
76destroot.cmd    ${python.bin} setup.py --no-user-cfg
77destroot.destdir        --prefix=${python.prefix} --root=${destroot}
78
79pre-destroot    {
80        xinstall -d -m 755 ${destroot}${prefix}/share/doc/${name}/examples
81}
82
83options         python.link_binaries python.link_binaries_suffix
84default python.link_binaries yes
85default python.link_binaries_suffix {-${python.branch}}
86post-destroot {
87    if {${python.link_binaries}} {
88        foreach bin [glob -nocomplain -tails -directory "${destroot}${python.prefix}/bin" *] {
89            if {[catch {file type "${destroot}${prefix}/bin/${bin}${python.link_binaries_suffix}"}]} {
90                ln -s "${python.prefix}/bin/${bin}" "${destroot}${prefix}/bin/${bin}${python.link_binaries_suffix}"
91            }
92        }
93    }
94}