source: trunk/dports/devel/ice-cpp/Portfile @ 38492

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

Add Google Protocol Buffer's support to Ice.

http://www.zeroc.com/labs/protobuf/

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 5.7 KB
Line 
1# $Id: Portfile 38492 2008-07-22 17:17:41Z blair@macports.org $
2
3PortSystem 1.0
4
5name            ice-cpp
6version         3.3.0
7revision        3
8categories      devel
9maintainers     blair
10description     Fast, object-oriented RPC for C++, Java, Python, Ruby, PHP
11
12long_description \
13        The Internet Communications Engine (Ice) is a modern alternative to \
14        object middleware such as CORBA or COM/DCOM/COM+, with support for \
15        C++, C#, Java, PHP, Python, Ruby and Visual Basic. \
16        Ice consists of the following packages. \
17        Slice: The Specification Language for Ice.  Slice establishes a \
18        contract between clients and servers, and is also used to describe \
19        persistent data. \
20        Slice Compilers: Slice specifications are compiled into various \
21        programming languages. Ice supports C++, Java, C#, Visual Basic, PHP, \
22        Python and Ruby.  Ice clients and servers work together, regardless \
23        of the programming language. \
24        Ice: The Ice core library manages all the communication tasks using a \
25        highly efficient protocol (including protocol compression and support \
26        for both TCP and UDP), provides a flexible thread pool for \
27        multi-threaded servers. \
28        This Port provides the C++ runtime libraries, the core Slice files \
29        and slice2cpp.  It also includes the slice compilers for all the \
30        other languages: slice2cs, slice2java, slice2py, slice2rb and slice2vb.
31
32homepage        http://www.zeroc.com/
33master_sites    http://www.zeroc.com/download/Ice/3.3/:ice \
34                http://www.zeroc.com/download/Protobuf/0.1/:ice-protobuf \
35                sourceforge:mcpp
36
37set mcpp_version 2.7
38set ice_dist    Ice-${version}${extract.suffix}
39set mcpp_dist   mcpp-${mcpp_version}${extract.suffix}
40
41distfiles       ${ice_dist}:ice \
42                ${mcpp_dist}:mcpp
43distname        Ice-${version}
44checksums       ${ice_dist} \
45                        md5 0500306d9cdbc0fbb553fbb529de557a \
46                        sha1 b599c3a4d1d3006b868bf2cbcd8e2a2d4575fb22 \
47                        rmd160 e85b37c93f12d9ae97c6b7b2f64f506fa051e4f8 \
48                ${mcpp_dist} \
49                        md5 14f9e4155aeb5812fc3ced6345caee02 \
50                        sha1 3bb1c2a2f0fae9c73c2c4edaf98354b2140f4f53 \
51                        rmd160 0ff924d66c383dcdd092df0f7e165a7f59a8754a \
52                protobuf-patch-0.1.0.gz \
53                        md5 d5ac6485fd89c540fc9e3912f9595d58 \
54                        sha1sum 0f9d2e2c1c1601695339b4f621e18f40563e3fa0 \
55                        rmd160 9494f3f763c473b1ed0742eda49ae9dde18bea01
56platforms       darwin
57
58depends_lib     port:libiconv \
59                port:db46 \
60                port:expat \
61                port:openssl \
62                port:readline
63
64patchfiles      patch-ice.cpp.config.Make.rules.diff \
65                patch-ice.cpp.config.Make.rules.Darwin.diff \
66                patch-ice.cpp.src.Ice.ConnectRequestHandler.cpp.diff \
67                patch-mcpp-${mcpp_version}-1.diff \
68                patch-mcpp-${mcpp_version}-2.diff \
69                protobuf-patch-0.1.0.gz:ice-protobuf
70
71patch {
72        set cmd "cd ${workpath}/mcpp-${mcpp_version} && patch -p0 < ${filespath}/patch-mcpp-${mcpp_version}-1.diff"
73        ui_debug ${cmd}
74        system ${cmd}
75
76        set cmd "cd ${workpath}/mcpp-${mcpp_version} && patch -p0 < ${filespath}/patch-mcpp-${mcpp_version}-2.diff"
77        ui_debug ${cmd}
78        system ${cmd}
79
80        set cmd "cd ${workpath}/Ice-${version} && patch -p0 < ${filespath}/patch-ice.cpp.config.Make.rules.diff"
81        ui_debug ${cmd}
82        system ${cmd}
83
84        set cmd "cd ${workpath}/Ice-${version} && patch -p0 < ${filespath}/patch-ice.cpp.config.Make.rules.Darwin.diff"
85        ui_debug ${cmd}
86        system ${cmd}
87
88        set cmd "cd ${workpath}/Ice-${version} && patch -p0 < ${filespath}/patch-ice.cpp.src.Ice.ConnectRequestHandler.cpp.diff"
89        ui_debug ${cmd}
90        system ${cmd}
91
92        set cmd "cd ${workpath}/Ice-${version} && gzcat ${distpath}/protobuf-patch-0.1.0.gz | patch -p0"
93        ui_debug ${cmd}
94        system ${cmd}
95
96        reinplace "s/-O2/-g -O2/" ${workpath}/Ice-${version}/cpp/config/Make.rules.Darwin
97
98        # It appears that the 10.4 and 10.5 installed versions of
99        # ${prefix}/include/iconv.h have different definitions of
100        # the inbuf parameter to iconv(), one is 'const char* * inbuf'
101        # and the other is 'char* * inbuf'.  The Ice compile will
102        # fail if the wrong #define is choosen by Ice.
103        set fl [open ${prefix}/include/iconv.h]
104        set data [read $fl]
105        close $fl
106        foreach line [split $data \n] {
107                if {[string match "extern size_t iconv*const*" $line]} {
108                        reinplace "s/_LIBICONV_VERSION < 0x010B/_LIBICONV_VERSION <= 0x010B/" ${workpath}/Ice-${version}/cpp/include/Ice/IconvStringConverter.h
109                        break
110                }
111        }
112}
113
114configure {
115        set cmd "cd ${workpath}/mcpp-${mcpp_version} && CFLAGS='-O2 -g -fno-common' ./configure --enable-mcpplib"
116        ui_debug ${cmd}
117        system ${cmd}
118}
119
120build {
121        set cmd "cd ${workpath}/mcpp-${mcpp_version} && make"
122        ui_debug ${cmd}
123        system ${cmd}
124
125        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"
126        ui_debug ${cmd}
127        system ${cmd}
128}
129
130test.dir        ${worksrcpath}/cpp
131test.run        yes
132test.target     test
133
134destroot.dir    ${worksrcpath}/cpp
135destroot.target prefix="${destroot}${prefix}" \
136                embedded_runpath_prefix="${prefix}" \
137                OPTIMIZE="yes" \
138                BZIP2_HOME="${prefix}" \
139                DB_HOME="${prefix}" \
140                EXPAT_HOME="${prefix}" \
141                OPENSSL_HOME="${prefix}" \
142                READLINE_HOME="${prefix}" \
143                USE_READLINE=yes \
144                install
145
146post-destroot {
147        set cppdir ${workpath}/Ice-${version}/cpp
148        set sharedir ${destroot}${prefix}/share
149        set docdir ${sharedir}/doc/${name}
150
151        xinstall -m 755 -d ${sharedir}/ice
152        file rename ${destroot}${prefix}/config ${sharedir}/ice
153        file rename ${destroot}${prefix}/slice ${sharedir}/ice
154
155        xinstall -m 755 -d ${docdir}
156        file rename ${destroot}${prefix}/ICE_LICENSE ${docdir}
157        file rename ${destroot}${prefix}/LICENSE ${docdir}
158        file copy ${cppdir}/doc/reference ${docdir}
159
160        foreach f {CHANGES RELEASE_NOTES} {
161                file copy ${workpath}/Ice-${version}/${f} ${docdir}
162        }
163
164        if {[variant_isset demo_source_code]} {
165                system "cd ${cppdir}/demo && make clean"
166                file copy ${cppdir}/demo $docdir
167        }
168}
169
170variant demo_source_code description {Install demonstration C++ code} {
171}
Note: See TracBrowser for help on using the repository browser.