source: trunk/dports/python/py-zeroc-ice33/Portfile

Last change on this file was 130942, checked in by larryv@…, 3 years ago

py25-zeroc-ice33: Replace with py27

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 5.1 KB
Line 
1# $Id: Portfile 130942 2015-01-04 04:03:26Z ryandesign@macports.org $
2
3PortSystem 1.0
4PortGroup       python 1.0
5
6name            py-zeroc-ice33
7version         3.3.1
8revision        2
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-ice33
37distname        Ice-${version}
38distfiles       ${distname}${extract.suffix}
39patchfiles      patch-py-modules-IcePy-Communicator.cpp.diff \
40                patch-py.config.Make.rules.Darwin.diff \
41                patch-scripts.TestUtil.py.diff
42checksums       Ice-${version}.tar.gz \
43                    md5 1f37dfcec4662fcde030553fb447d064 \
44                    sha1 08d0f32bdb7d909b4a531d45cccfa97bdde649aa \
45                    rmd160 d64d52c35640cebe1145e62f57618473d17cbeb5
46platforms       darwin
47
48python.versions 26 27
49
50if {${name} ne ${subport}} {
51    depends_lib-append  port:zeroc-ice33
52
53    build.dir       ${worksrcpath}/py
54
55    post-patch {
56        reinplace "s/-O2/-g -O2/" ${build.dir}/config/Make.rules.Darwin
57
58        # Prevent name conflicts between libICE.* from xorg-libice and
59        # libIce.* from this port by renaming libIce.* to libZerocIce.*.
60        # For consistency, rename Ice's other shared libraries.
61        foreach f [exec find ${build.dir} -name Makefile] {
62            # To prevent replacements on slice2freeze's --dict argument,
63            # match exactly on a , or a ) that follows ,Ice\w*, e.g.:
64            # $(SLICE2FREEZE) --ice -I$(slicedir) --dict StringIsbnSeqDict,string,Ice::StringSeq
65            reinplace -E {s/,Ice([[:alnum:]]*[,)])/,ZerocIce\1/} ${f}
66            reinplace -E {s/-lIce([ A-Z]|$)/-lZerocIce\1/g} ${f}
67
68            # Restore the name of the Python binding shared library.
69            reinplace -E {s/ZerocIcePy/IcePy/g} ${f}
70        }
71        reinplace -E {s/-lIce([ A-Z]|$)/-lZerocIce\1/g} \
72            ${build.dir}/config/Make.rules \
73            ${build.dir}/config/Make.rules.Darwin
74    }
75
76    use_configure   no
77
78    build.cmd       make
79    build.target    prefix="${prefix}" \
80                    CC="${configure.cc}" \
81                    CXX="${configure.cxx}" \
82                    ICE_HOME="${prefix}" \
83                    PYTHON_HOME="${python.prefix}" \
84                    PYTHON_VERSION="python${python.branch}" \
85                    OPTIMIZE="yes" \
86                    all
87
88    test.run        yes
89    test.env        ICE_HOME=${prefix}
90    test.cmd        ${python.bin}
91    test.target     allTests.py
92
93    destroot.destdir
94    destroot.cmd    ${build.cmd}
95    destroot.target prefix="${destroot}${prefix}" \
96                    CC="${configure.cc}" \
97                    CXX="${configure.cxx}" \
98                    ICE_HOME="${prefix}" \
99                    PYTHON_HOME="${python.prefix}" \
100                    PYTHON_VERSION="python${python.branch}" \
101                    OPTIMIZE="yes" \
102                    install
103
104    post-destroot {
105        set sharedir ${destroot}${prefix}/share
106        set docdir ${sharedir}/doc/${subport}
107
108        delete ${destroot}${prefix}/slice
109
110        xinstall -m 755 -d ${docdir}
111
112        xinstall -m 755 -d [file dirname ${destroot}${python.pkgd}]
113        file rename ${destroot}${prefix}/python ${destroot}${python.pkgd}
114
115        set cmd "${python.bin} \
116                ${python.libdir}/compileall.py \
117                ${destroot}${python.pkgd}"
118        ui_debug ${cmd}
119        system ${cmd}
120
121        set cmd "${python.bin} -O \
122                 ${python.libdir}/compileall.py \
123                 ${destroot}${python.pkgd}"
124        ui_debug ${cmd}
125        system ${cmd}
126
127        file rename ${destroot}${prefix}/ICE_LICENSE ${docdir}
128        file rename ${destroot}${prefix}/LICENSE ${docdir}
129        foreach f {CHANGES RELEASE_NOTES} {
130            file copy ${worksrcpath}/${f} ${docdir}
131        }
132        file copy ${build.dir}/INSTALL ${docdir}
133
134        if {[variant_isset demo_source_code]} {
135            file copy ${build.dir}/demo ${docdir}
136        }
137    }
138
139    variant demo_source_code description {Install demonstration Python code} {
140    }
141}
Note: See TracBrowser for help on using the repository browser.