source: trunk/dports/python/py-zeroc-ice34/Portfile @ 96799

Last change on this file since 96799 was 96799, checked in by blair@…, 8 years ago

py-zeroc-ice34: also build py25-zeroc-ice34 by setting python.* for framework Python.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 5.0 KB
Line 
1# $Id: Portfile 96799 2012-08-19 15:48:06Z blair@macports.org $
2
3PortSystem 1.0
4PortGroup       python 1.0
5
6name            py-zeroc-ice34
7version         3.4.2
8revision        1
9set branch      [join [lrange [split ${version} .] 0 1] .]
10categories-append   devel
11maintainers     blair
12license         GPL-2
13description     Fast, object-oriented RPC for C++, Java, Python, Ruby, PHP
14
15long_description \
16    The Internet Communications Engine (Ice) is a modern alternative to \
17    object middleware such as CORBA or COM/DCOM/COM+, with support for \
18    C++, C#, Java, PHP, Python, Ruby and Visual Basic. \
19    Ice consists of the following packages. \
20    Slice: The Specification Language for Ice.  Slice establishes a \
21    contract between clients and servers, and is also used to describe \
22    persistent data. \
23    Slice Compilers: Slice specifications are compiled into various \
24    programming languages. Ice supports C++, Java, C#, Visual Basic, PHP, \
25    Python and Ruby.  Ice clients and servers work together, regardless \
26    of the programming language. \
27    Ice: The Ice core library manages all the communication tasks using a \
28    highly efficient protocol (including protocol compression and support \
29    for both TCP and UDP), provides a flexible thread pool for \
30    multi-threaded servers. \
31    This Port provides the Python bindings that sit on top of the C++ \
32    Ice C++ runtime libraries.
33
34homepage        http://www.zeroc.com/
35master_sites    ${homepage}download/Ice/${branch}/
36dist_subdir     zeroc-ice34
37distname        Ice-${version}
38checksums       md5 e97672eb4a63c6b8dd202d0773e19dc7 \
39                sha1 8c84d6e3b227f583d05e08251e07047e6c3a6b42 \
40                rmd160 7ce680a4eb5fa9d0bb6f8b8910e267dfc2373d75
41patchfiles      patch-py.config.Make.rules.Darwin.diff
42platforms       darwin
43
44python.versions 25 26 27
45
46if {$subport != $name} {
47    # Special case Python 25 so only one Portfile is needed, as the
48    # Python Ice bindings need a the paths to the framework portion of
49    # the Python build.  These copied from python26-1.0.tcl.
50    if {${python.version} == 25} {
51        set python.prefix   ${frameworks_dir}/Python.framework/Versions/${python.branch}
52        set python.bin      ${python.prefix}/bin/python${python.branch}
53        set python.lib      ${python.prefix}/Python
54        set python.libdir   ${python.prefix}/lib/python${python.branch}
55        set python.pkgd     ${python.prefix}/lib/python${python.branch}/site-packages
56        set python.include  ${python.prefix}/include/python${python.branch}
57    }
58
59    depends_lib-append  port:zeroc-ice34
60
61    build.dir       ${worksrcpath}/py
62
63    post-patch {
64        reinplace "s/-O2/-g -O2/" ${build.dir}/config/Make.rules.Darwin
65
66        # Prevent name conflicts between libICE.* from xorg-libice and
67        # libIce.* from this port by renaming libIce.* to libZeroCIce.*.
68        reinplace "s/-lIce /-lZeroCIce /" \
69            ${build.dir}/config/Make.rules \
70            ${build.dir}/config/Make.rules.Darwin
71    }
72
73    use_configure   no
74
75    build.cmd       make
76    build.target    prefix="${prefix}" \
77                    CC="${configure.cc}" \
78                    CXX="${configure.cxx}" \
79                    ICE_HOME="${prefix}" \
80                    PYTHON_HOME="${python.prefix}" \
81                    PYTHON_VERSION="python${python.branch}" \
82                    OPTIMIZE="yes" \
83                    all
84
85    test.run        yes
86    test.env        ICE_HOME=${prefix}
87    test.cmd        ${python.bin}
88    test.target     allTests.py
89
90    destroot.destdir
91    destroot.cmd    ${build.cmd}
92    destroot.target prefix="${destroot}${prefix}" \
93                    CC="${configure.cc}" \
94                    CXX="${configure.cxx}" \
95                    ICE_HOME="${prefix}" \
96                    PYTHON_HOME="${python.prefix}" \
97                    PYTHON_VERSION="python${python.branch}" \
98                    OPTIMIZE="yes" \
99                    install
100
101    post-destroot {
102        set sharedir ${destroot}${prefix}/share
103        set docdir ${sharedir}/doc/${subport}
104
105        delete ${destroot}${prefix}/slice
106
107        xinstall -m 755 -d ${docdir}
108
109        xinstall -m 755 -d [file dirname ${destroot}${python.pkgd}]
110        file rename ${destroot}${prefix}/python ${destroot}${python.pkgd}
111
112        set cmd "${python.bin} \
113                ${python.libdir}/compileall.py \
114                ${destroot}${python.pkgd}"
115        ui_debug ${cmd}
116        system ${cmd}
117
118        set cmd "${python.bin} -O \
119                 ${python.libdir}/compileall.py \
120                 ${destroot}${python.pkgd}"
121        ui_debug ${cmd}
122        system ${cmd}
123
124        file rename ${destroot}${prefix}/ICE_LICENSE ${docdir}
125        file rename ${destroot}${prefix}/LICENSE ${docdir}
126        foreach f {CHANGES RELEASE_NOTES} {
127            file copy ${worksrcpath}/${f} ${docdir}
128        }
129        file copy ${build.dir}/INSTALL ${docdir}
130
131        if {[variant_isset demo_source_code]} {
132            file copy ${build.dir}/demo ${docdir}
133        }
134    }
135
136    variant demo_source_code description {Install demonstration Python code} {
137    }
138}
Note: See TracBrowser for help on using the repository browser.