# $Id: Portfile 100529 2012-12-14 21:34:35Z blair@macports.org $ PortSystem 1.0 PortGroup python 1.0 name py-zeroc-ice35 set real_version 3.5b version 0.0.${real_version} #set branch [join [lrange [split ${real_version} .] 0 1] .] set branch 3.5 categories-append devel maintainers blair license GPL-2 description Fast, object-oriented RPC for C++, Java, Python, Ruby, PHP long_description \ The Internet Communications Engine (Ice) is a modern alternative to \ object middleware such as CORBA or COM/DCOM/COM+, with support for \ C++, C#, Java, PHP, Python, Ruby and Visual Basic. \ Ice consists of the following packages. \ Slice: The Specification Language for Ice. Slice establishes a \ contract between clients and servers, and is also used to describe \ persistent data. \ Slice Compilers: Slice specifications are compiled into various \ programming languages. Ice supports C++, Java, C#, Visual Basic, PHP, \ Python and Ruby. Ice clients and servers work together, regardless \ of the programming language. \ Ice: The Ice core library manages all the communication tasks using a \ highly efficient protocol (including protocol compression and support \ for both TCP and UDP), provides a flexible thread pool for \ multi-threaded servers. \ This Port provides the Python bindings that sit on top of the C++ \ Ice C++ runtime libraries. homepage http://www.zeroc.com/ master_sites ${homepage}download/Ice/${branch}/ dist_subdir zeroc-ice35 distname Ice-${real_version} checksums sha1 1c40ca1152055ed824cec01bb4e25d7733812854 \ sha256 223e48213b1a5f087c760a2937d54d2878d78dc0b50cc506806ade57609fb083 patchfiles patch-py.config.Make.rules.Darwin.diff platforms darwin python.versions 25 26 27 if {$subport != $name} { # Special case Python 25 so only one Portfile is needed, as the # Python Ice bindings need a the paths to the framework portion of # the Python build. These copied from python26-1.0.tcl. if {${python.version} == 25} { set python.prefix ${frameworks_dir}/Python.framework/Versions/${python.branch} set python.bin ${python.prefix}/bin/python${python.branch} set python.lib ${python.prefix}/Python set python.libdir ${python.prefix}/lib/python${python.branch} set python.pkgd ${python.prefix}/lib/python${python.branch}/site-packages set python.include ${python.prefix}/include/python${python.branch} } depends_lib-append port:zeroc-ice35 build.dir ${worksrcpath}/py post-patch { reinplace "s/-O2/-g -O2/" ${build.dir}/config/Make.rules.Darwin # Prevent name conflicts between libICE.* from xorg-libice and # libIce.* from this port by renaming s/libIce/libZerocIce/. reinplace -E {s/-lIce([ A-Z]|$)/-lZerocIce\1/g} \ ${build.dir}/config/Make.rules \ ${build.dir}/config/Make.rules.Darwin } use_configure no build.cmd make build.target prefix="${prefix}" \ CC="${configure.cc}" \ CXX="${configure.cxx}" \ ICE_HOME="${prefix}" \ PYTHON_HOME="${python.prefix}" \ PYTHON_VERSION="python${python.branch}" \ OPTIMIZE="yes" \ all test.run yes test.env ICE_HOME=${prefix} test.cmd ${python.bin} test.target allTests.py destroot.destdir destroot.cmd ${build.cmd} destroot.target prefix="${destroot}${prefix}" \ CC="${configure.cc}" \ CXX="${configure.cxx}" \ ICE_HOME="${prefix}" \ PYTHON_HOME="${python.prefix}" \ PYTHON_VERSION="python${python.branch}" \ OPTIMIZE="yes" \ install post-destroot { set sharedir ${destroot}${prefix}/share set docdir ${sharedir}/doc/${subport} delete ${destroot}${prefix}/slice xinstall -m 755 -d ${docdir} xinstall -m 755 -d [file dirname ${destroot}${python.pkgd}] file rename ${destroot}${prefix}/python ${destroot}${python.pkgd} set cmd "${python.bin} \ ${python.libdir}/compileall.py \ ${destroot}${python.pkgd}" ui_debug ${cmd} system ${cmd} set cmd "${python.bin} -O \ ${python.libdir}/compileall.py \ ${destroot}${python.pkgd}" ui_debug ${cmd} system ${cmd} file rename ${destroot}${prefix}/ICE_LICENSE ${docdir} file rename ${destroot}${prefix}/LICENSE ${docdir} foreach f {CHANGES RELEASE_NOTES} { file copy ${worksrcpath}/${f} ${docdir} } file copy ${build.dir}/INSTALL ${docdir} if {[variant_isset demo_source_code]} { file copy ${build.dir}/demo ${docdir} } } variant demo_source_code description {Install demonstration Python code} { } }