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

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

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