source: trunk/dports/devel/zeroc-ice33/Portfile @ 139229

Last change on this file since 139229 was 139229, checked in by jeremyhu@…, 4 years ago

misc: Change port:openssl dependency to path:lib/libssl.dylib:openssl

This should allow usage of libressl as a replacement for openssl in relevant
ports. Not all ports have been tested, but libressl aims for API
compatibility with OpenSSL, so it is expected to work.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 6.8 KB
Line 
1# $Id: Portfile 139229 2015-08-08 03:10:35Z jeremyhu@macports.org $
2
3PortSystem 1.0
4
5name            zeroc-ice33
6version         3.3.1
7revision        2
8set branch      [join [lrange [split ${version} .] 0 1] .]
9categories      devel
10maintainers     blair
11conflicts       zeroc-ice34 zeroc-ice35
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 C++ runtime libraries, the core Slice files \
32    and slice2cpp.  It also includes the slice compilers for all the \
33    other languages: slice2cs, slice2java, slice2py, slice2rb and slice2vb.
34
35homepage        http://www.zeroc.com/
36master_sites    ${homepage}download/Ice/${branch}/
37
38distname        Ice-${version}
39checksums       md5 1f37dfcec4662fcde030553fb447d064 \
40                sha1 08d0f32bdb7d909b4a531d45cccfa97bdde649aa \
41                rmd160 d64d52c35640cebe1145e62f57618473d17cbeb5
42patchfiles      patch-ice.cpp.config.Make.rules.diff \
43                patch-ice.cpp.config.Make.rules.Darwin.diff \
44                patch-ice.cpp.src.Ice.DynamicLibrary.cpp.diff \
45                patch-ice.cpp.src.IceSSL.Instance.cpp.diff \
46                patch-ice.cpp.src.Slice.Preprocessor.cpp.diff \
47                patch-ice.cpp.src.slice2cpp.Gen.cpp.diff \
48                patch-ice.cpp.src.slice2html.Gen.cpp.diff \
49                patch-clang-support.diff
50platforms       darwin
51
52depends_lib     port:libiconv \
53                port:db46 \
54                port:expat \
55                path:lib/libssl.dylib:openssl \
56                port:readline \
57                port:mcpp
58
59patch {
60    set cmd "cd ${workpath}/Ice-${version} && patch -p0 < ${filespath}/patch-ice.cpp.config.Make.rules.diff"
61    ui_debug ${cmd}
62    system ${cmd}
63
64    set cmd "cd ${workpath}/Ice-${version} && patch -p0 < ${filespath}/patch-ice.cpp.config.Make.rules.Darwin.diff"
65    ui_debug ${cmd}
66    system ${cmd}
67
68    set cmd "cd ${workpath}/Ice-${version} && patch -p1 < ${filespath}/patch-ice.cpp.src.Ice.DynamicLibrary.cpp.diff"
69    ui_debug ${cmd}
70    system ${cmd}
71
72    set cmd "cd ${workpath}/Ice-${version} && patch -p1 < ${filespath}/patch-ice.cpp.src.IceSSL.Instance.cpp.diff"
73    ui_debug ${cmd}
74    system ${cmd}
75
76    set cmd "cd ${workpath}/Ice-${version} && patch -p1 < ${filespath}/patch-ice.cpp.src.Slice.Preprocessor.cpp.diff"
77    ui_debug ${cmd}
78    system ${cmd}
79
80    set cmd "cd ${workpath}/Ice-${version} && patch -p1 < ${filespath}/patch-ice.cpp.src.slice2cpp.Gen.cpp.diff"
81    ui_debug ${cmd}
82    system ${cmd}
83
84    set cmd "cd ${workpath}/Ice-${version} && patch -p1 < ${filespath}/patch-ice.cpp.src.slice2html.Gen.diff"
85    ui_debug ${cmd}
86    system ${cmd}
87
88    set cmd "cd ${workpath}/Ice-${version} && patch -p1 < ${filespath}/patch-clang-support.diff"
89    ui_debug ${cmd}
90    system ${cmd}
91}
92
93build.dir       ${worksrcpath}/cpp
94
95post-patch {
96    reinplace "s/-O2/-g -O2/" ${build.dir}/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/1/" \
109                ${build.dir}/include/Ice/IconvStringConverter.h
110            break
111        }
112    }
113
114    # Prevent name conflicts between libICE.* from xorg-libice and
115    # libIce.* from this port by renaming libIce.* to libZerocIce.*.
116    # For consistency, rename Ice's other shared libraries.
117    foreach f [exec find ${build.dir} -name Makefile] {
118        # To prevent replacements on slice2freeze's --dict argument,
119        # match exactly on a , or a ) that follows ,Ice\w*, e.g.:
120        # $(SLICE2FREEZE) --ice -I$(slicedir) --dict StringIsbnSeqDict,string,Ice::StringSeq
121        reinplace -E {s/,Ice([[:alnum:]]*[,)])/,ZerocIce\1/} ${f}
122        reinplace -E {s/-lIce([ A-Z]|$)/-lZerocIce\1/g} ${f}
123    }
124    reinplace -E {s/-lIce([ A-Z]|$)/-lZerocIce\1/g} \
125        ${build.dir}/config/Make.rules \
126        ${build.dir}/config/Make.rules.Darwin
127}
128
129use_configure   no
130
131build {
132    set cmd "cd ${build.dir} && make prefix='${prefix}' embedded_runpath_prefix='${prefix}' CC='${configure.cc}' CXX='${configure.cxx}' OPTIMIZE='yes' BZIP2_HOME='${prefix}' DB_HOME='${prefix}' EXPAT_HOME='${prefix}' OPENSSL_HOME='${prefix}' READLINE_HOME='${prefix}' USE_READLINE=yes MCPP_HOME='${prefix}' LDPLATFORMFLAGS= all && cd doc && make"
133    ui_debug ${cmd}
134    system ${cmd}
135}
136
137test.run        yes
138test.target     test
139
140destroot.target prefix="${destroot}${prefix}" \
141                embedded_runpath_prefix="${prefix}" \
142                create_runpath_symlink=no \
143                OPTIMIZE="yes" \
144                BZIP2_HOME="${prefix}" \
145                DB_HOME="${prefix}" \
146                EXPAT_HOME="${prefix}" \
147                OPENSSL_HOME="${prefix}" \
148                READLINE_HOME="${prefix}" \
149                USE_READLINE=yes \
150                MCPP_HOME="${prefix}" \
151                install
152
153post-destroot {
154    set sharedir ${destroot}${prefix}/share
155    set docdir ${sharedir}/doc/${name}
156
157    xinstall -m 755 -d ${sharedir}/ice
158    file rename ${destroot}${prefix}/config ${sharedir}/ice
159    file rename ${destroot}${prefix}/slice ${sharedir}/slice
160
161    xinstall -m 755 -d ${docdir}
162    file rename ${destroot}${prefix}/ICE_LICENSE ${docdir}
163    file rename ${destroot}${prefix}/LICENSE ${docdir}
164    file copy ${build.dir}/doc/reference ${docdir}
165
166    foreach f {CHANGES RELEASE_NOTES} {
167        file copy ${worksrcpath}/${f} ${docdir}
168    }
169
170    if {[variant_isset demo_source_code]} {
171        system "cd ${build.dir}/demo && make clean"
172        file copy ${build.dir}/demo $docdir
173    }
174}
175
176variant demo_source_code description {Install demonstration C++ code} {
177}
Note: See TracBrowser for help on using the repository browser.