source: trunk/dports/python/py-zeroc-ice35/Portfile @ 100529

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

py-zeroc-ice35: new Python bindings for Ice 3.5b; based on py-zeroc-ice34.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 5.0 KB
Line 
1# $Id: Portfile 100529 2012-12-14 21:34:35Z blair@macports.org $
2
3PortSystem 1.0
4PortGroup       python 1.0
5
6name            py-zeroc-ice35
7set real_version 3.5b
8version         0.0.${real_version}
9#set branch      [join [lrange [split ${real_version} .] 0 1] .]
10set branch      3.5
11categories-append   devel
12maintainers     blair
13license         GPL-2
14description     Fast, object-oriented RPC for C++, Java, Python, Ruby, PHP
15
16long_description \
17    The Internet Communications Engine (Ice) is a modern alternative to \
18    object middleware such as CORBA or COM/DCOM/COM+, with support for \
19    C++, C#, Java, PHP, Python, Ruby and Visual Basic. \
20    Ice consists of the following packages. \
21    Slice: The Specification Language for Ice.  Slice establishes a \
22    contract between clients and servers, and is also used to describe \
23    persistent data. \
24    Slice Compilers: Slice specifications are compiled into various \
25    programming languages. Ice supports C++, Java, C#, Visual Basic, PHP, \
26    Python and Ruby.  Ice clients and servers work together, regardless \
27    of the programming language. \
28    Ice: The Ice core library manages all the communication tasks using a \
29    highly efficient protocol (including protocol compression and support \
30    for both TCP and UDP), provides a flexible thread pool for \
31    multi-threaded servers. \
32    This Port provides the Python bindings that sit on top of the C++ \
33    Ice C++ runtime libraries.
34
35homepage        http://www.zeroc.com/
36master_sites    ${homepage}download/Ice/${branch}/
37dist_subdir     zeroc-ice35
38distname        Ice-${real_version}
39checksums       sha1 1c40ca1152055ed824cec01bb4e25d7733812854 \
40                sha256 223e48213b1a5f087c760a2937d54d2878d78dc0b50cc506806ade57609fb083
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-ice35
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 s/libIce/libZerocIce/.
68        reinplace -E {s/-lIce([ A-Z]|$)/-lZerocIce\1/g} \
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.