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

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

Upstream patch to fix an issue with Ice clients using Bzip2
compression even when the server does not accept compressed messages.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 5.3 KB
Line 
1# $Id: Portfile 38084 2008-07-06 00:27:10Z blair@macports.org $
2
3PortSystem 1.0
4
5name            ice-cpp
6version         3.3.0
7revision        2
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                sourceforge:mcpp
35
36set mcpp_version 2.7
37set ice_dist    Ice-${version}${extract.suffix}
38set mcpp_dist   mcpp-${mcpp_version}${extract.suffix}
39
40distfiles       ${ice_dist}:ice \
41                ${mcpp_dist}:mcpp
42distname        Ice-${version}
43checksums       ${ice_dist} \
44                        md5 0500306d9cdbc0fbb553fbb529de557a \
45                        sha1 b599c3a4d1d3006b868bf2cbcd8e2a2d4575fb22 \
46                        rmd160 e85b37c93f12d9ae97c6b7b2f64f506fa051e4f8 \
47                ${mcpp_dist} \
48                        md5 14f9e4155aeb5812fc3ced6345caee02 \
49                        sha1 3bb1c2a2f0fae9c73c2c4edaf98354b2140f4f53 \
50                        rmd160 0ff924d66c383dcdd092df0f7e165a7f59a8754a
51platforms       darwin
52
53depends_lib     port:libiconv \
54                port:db46 \
55                port:expat \
56                port:openssl \
57                port:readline
58
59patchfiles      patch-ice.cpp.config.Make.rules.diff \
60                patch-ice.cpp.config.Make.rules.Darwin.diff \
61                patch-ice.cpp.src.Ice.ConnectRequestHandler.cpp.diff \
62                patch-mcpp-${mcpp_version}-1.diff \
63                patch-mcpp-${mcpp_version}-2.diff
64
65patch {
66        set cmd "cd ${workpath}/mcpp-${mcpp_version} && patch -p0 < ${filespath}/patch-mcpp-${mcpp_version}-1.diff"
67        ui_debug ${cmd}
68        system ${cmd}
69
70        set cmd "cd ${workpath}/mcpp-${mcpp_version} && patch -p0 < ${filespath}/patch-mcpp-${mcpp_version}-2.diff"
71        ui_debug ${cmd}
72        system ${cmd}
73
74        set cmd "cd ${workpath}/Ice-${version} && patch -p0 < ${filespath}/patch-ice.cpp.config.Make.rules.diff"
75        ui_debug ${cmd}
76        system ${cmd}
77
78        set cmd "cd ${workpath}/Ice-${version} && patch -p0 < ${filespath}/patch-ice.cpp.config.Make.rules.Darwin.diff"
79        ui_debug ${cmd}
80        system ${cmd}
81
82        set cmd "cd ${workpath}/Ice-${version} && patch -p0 < ${filespath}/patch-ice.cpp.src.Ice.ConnectRequestHandler.cpp.diff"
83        ui_debug ${cmd}
84        system ${cmd}
85
86        reinplace "s/-O2/-g -O2/" ${workpath}/Ice-${version}/cpp/config/Make.rules.Darwin
87
88        # It appears that the 10.4 and 10.5 installed versions of
89        # ${prefix}/include/iconv.h have different definitions of
90        # the inbuf parameter to iconv(), one is 'const char* * inbuf'
91        # and the other is 'char* * inbuf'.  The Ice compile will
92        # fail if the wrong #define is choosen by Ice.
93        set fl [open ${prefix}/include/iconv.h]
94        set data [read $fl]
95        close $fl
96        foreach line [split $data \n] {
97                if {[string match "extern size_t iconv*const*" $line]} {
98                        reinplace "s/_LIBICONV_VERSION < 0x010B/_LIBICONV_VERSION <= 0x010B/" ${workpath}/Ice-${version}/cpp/include/Ice/IconvStringConverter.h
99                        break
100                }
101        }
102}
103
104configure {
105        set cmd "cd ${workpath}/mcpp-${mcpp_version} && CFLAGS='-O2 -g -fno-common' ./configure --enable-mcpplib"
106        ui_debug ${cmd}
107        system ${cmd}
108}
109
110build {
111        set cmd "cd ${workpath}/mcpp-${mcpp_version} && make"
112        ui_debug ${cmd}
113        system ${cmd}
114
115        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"
116        ui_debug ${cmd}
117        system ${cmd}
118}
119
120test.dir        ${worksrcpath}/cpp
121test.run        yes
122test.target     test
123
124destroot.dir    ${worksrcpath}/cpp
125destroot.target prefix="${destroot}${prefix}" \
126                embedded_runpath_prefix="${prefix}" \
127                OPTIMIZE="yes" \
128                BZIP2_HOME="${prefix}" \
129                DB_HOME="${prefix}" \
130                EXPAT_HOME="${prefix}" \
131                OPENSSL_HOME="${prefix}" \
132                READLINE_HOME="${prefix}" \
133                USE_READLINE=yes \
134                install
135
136post-destroot {
137        set cppdir ${workpath}/Ice-${version}/cpp
138        set sharedir ${destroot}${prefix}/share
139        set docdir ${sharedir}/doc/${name}
140
141        xinstall -m 755 -d ${sharedir}/ice
142        file rename ${destroot}${prefix}/config ${sharedir}/ice
143        file rename ${destroot}${prefix}/slice ${sharedir}/ice
144
145        xinstall -m 755 -d ${docdir}
146        file rename ${destroot}${prefix}/ICE_LICENSE ${docdir}
147        file rename ${destroot}${prefix}/LICENSE ${docdir}
148        file copy ${cppdir}/doc/reference ${docdir}
149
150        foreach f {CHANGES RELEASE_NOTES} {
151                file copy ${workpath}/Ice-${version}/${f} ${docdir}
152        }
153
154        if {[variant_isset demo_source_code]} {
155                system "cd ${cppdir}/demo && make clean"
156                file copy ${cppdir}/demo $docdir
157        }
158}
159
160variant demo_source_code description {Install demonstration C++ code} {
161}
Note: See TracBrowser for help on using the repository browser.