# $Id: Portfile 38084 2008-07-06 00:27:10Z blair@macports.org $ PortSystem 1.0 name ice-cpp version 3.3.0 revision 2 categories devel maintainers blair 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 C++ runtime libraries, the core Slice files \ and slice2cpp. It also includes the slice compilers for all the \ other languages: slice2cs, slice2java, slice2py, slice2rb and slice2vb. homepage http://www.zeroc.com/ master_sites http://www.zeroc.com/download/Ice/3.3/:ice \ sourceforge:mcpp set mcpp_version 2.7 set ice_dist Ice-${version}${extract.suffix} set mcpp_dist mcpp-${mcpp_version}${extract.suffix} distfiles ${ice_dist}:ice \ ${mcpp_dist}:mcpp distname Ice-${version} checksums ${ice_dist} \ md5 0500306d9cdbc0fbb553fbb529de557a \ sha1 b599c3a4d1d3006b868bf2cbcd8e2a2d4575fb22 \ rmd160 e85b37c93f12d9ae97c6b7b2f64f506fa051e4f8 \ ${mcpp_dist} \ md5 14f9e4155aeb5812fc3ced6345caee02 \ sha1 3bb1c2a2f0fae9c73c2c4edaf98354b2140f4f53 \ rmd160 0ff924d66c383dcdd092df0f7e165a7f59a8754a platforms darwin depends_lib port:libiconv \ port:db46 \ port:expat \ port:openssl \ port:readline patchfiles patch-ice.cpp.config.Make.rules.diff \ patch-ice.cpp.config.Make.rules.Darwin.diff \ patch-ice.cpp.src.Ice.ConnectRequestHandler.cpp.diff \ patch-mcpp-${mcpp_version}-1.diff \ patch-mcpp-${mcpp_version}-2.diff patch { set cmd "cd ${workpath}/mcpp-${mcpp_version} && patch -p0 < ${filespath}/patch-mcpp-${mcpp_version}-1.diff" ui_debug ${cmd} system ${cmd} set cmd "cd ${workpath}/mcpp-${mcpp_version} && patch -p0 < ${filespath}/patch-mcpp-${mcpp_version}-2.diff" ui_debug ${cmd} system ${cmd} set cmd "cd ${workpath}/Ice-${version} && patch -p0 < ${filespath}/patch-ice.cpp.config.Make.rules.diff" ui_debug ${cmd} system ${cmd} set cmd "cd ${workpath}/Ice-${version} && patch -p0 < ${filespath}/patch-ice.cpp.config.Make.rules.Darwin.diff" ui_debug ${cmd} system ${cmd} set cmd "cd ${workpath}/Ice-${version} && patch -p0 < ${filespath}/patch-ice.cpp.src.Ice.ConnectRequestHandler.cpp.diff" ui_debug ${cmd} system ${cmd} reinplace "s/-O2/-g -O2/" ${workpath}/Ice-${version}/cpp/config/Make.rules.Darwin # It appears that the 10.4 and 10.5 installed versions of # ${prefix}/include/iconv.h have different definitions of # the inbuf parameter to iconv(), one is 'const char* * inbuf' # and the other is 'char* * inbuf'. The Ice compile will # fail if the wrong #define is choosen by Ice. set fl [open ${prefix}/include/iconv.h] set data [read $fl] close $fl foreach line [split $data \n] { if {[string match "extern size_t iconv*const*" $line]} { reinplace "s/_LIBICONV_VERSION < 0x010B/_LIBICONV_VERSION <= 0x010B/" ${workpath}/Ice-${version}/cpp/include/Ice/IconvStringConverter.h break } } } configure { set cmd "cd ${workpath}/mcpp-${mcpp_version} && CFLAGS='-O2 -g -fno-common' ./configure --enable-mcpplib" ui_debug ${cmd} system ${cmd} } build { set cmd "cd ${workpath}/mcpp-${mcpp_version} && make" ui_debug ${cmd} system ${cmd} set cmd "cd ${workpath}/Ice-${version}/cpp && make prefix='${prefix}' embedded_runpath_prefix='${prefix}' OPTIMIZE='yes' BZIP2_HOME='${prefix}' DB_HOME='${prefix}' EXPAT_HOME='${prefix}' OPENSSL_HOME='${prefix}' READLINE_HOME='${prefix}' USE_READLINE=yes MCPP_LIBS='${workpath}/mcpp-${mcpp_version}/src/.libs/*.o' LDPLATFORMFLAGS= all && cd doc && make" ui_debug ${cmd} system ${cmd} } test.dir ${worksrcpath}/cpp test.run yes test.target test destroot.dir ${worksrcpath}/cpp destroot.target prefix="${destroot}${prefix}" \ embedded_runpath_prefix="${prefix}" \ OPTIMIZE="yes" \ BZIP2_HOME="${prefix}" \ DB_HOME="${prefix}" \ EXPAT_HOME="${prefix}" \ OPENSSL_HOME="${prefix}" \ READLINE_HOME="${prefix}" \ USE_READLINE=yes \ install post-destroot { set cppdir ${workpath}/Ice-${version}/cpp set sharedir ${destroot}${prefix}/share set docdir ${sharedir}/doc/${name} xinstall -m 755 -d ${sharedir}/ice file rename ${destroot}${prefix}/config ${sharedir}/ice file rename ${destroot}${prefix}/slice ${sharedir}/ice xinstall -m 755 -d ${docdir} file rename ${destroot}${prefix}/ICE_LICENSE ${docdir} file rename ${destroot}${prefix}/LICENSE ${docdir} file copy ${cppdir}/doc/reference ${docdir} foreach f {CHANGES RELEASE_NOTES} { file copy ${workpath}/Ice-${version}/${f} ${docdir} } if {[variant_isset demo_source_code]} { system "cd ${cppdir}/demo && make clean" file copy ${cppdir}/demo $docdir } } variant demo_source_code description {Install demonstration C++ code} { }