source: trunk/dports/devel/zeroc-ice35/Portfile @ 116709

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

zeroc-ice35: fix compilation on Mavericks; closes #41219.

I'm not bumping the rev since this change modifies a header file that
does not appear in the installed package:

# port contents zeroc-ice35 | grep DescriptorHelper.h | wc -l

Additionally, the patch doesn't change the behavior of the binaries
for older Mac OS X releases if it was successfully compiled there.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 5.9 KB
Line 
1# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
2# $Id: Portfile 116709 2014-02-04 17:26:09Z blair@macports.org $
3
4PortSystem 1.0
5
6name            zeroc-ice35
7version         3.5.1
8set branch      [join [lrange [split ${version} .] 0 1] .]
9categories      devel
10maintainers     blair
11conflicts       zeroc-ice33 zeroc-ice34
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       sha1   63599ea22a1e9638a49356682c9e516b7c2c454f \
40                sha256 989e51194c6adadbd156da3288e37bad847b93b3b876502e83033b70493af392
41patchfiles      patch-ice.cpp.config.Make.rules.diff \
42                patch-ice.cpp.config.Make.rules.Darwin.diff \
43                patch-ice.cpp.src.Ice.DynamicLibrary.cpp.diff \
44                patch-ice.cpp.src.IceGrid.DescriptorHelper.h.diff \
45                patch-ice.cpp.test.Ice.info.AllTests.cpp.diff \
46                patch-ice.cpp.test.IceGrid.admin.run.py.diff \
47                patch-ice.cpp.test.IceGrid.deployer.run.py.diff \
48                patch-ice.cpp.test.IceGrid.replicaGroup.run.py.diff \
49                patch-ice.cpp.test.include.TestCommon.h.diff \
50                patch-ice.scripts.TestUtil.py.diff
51
52patch.pre_args  -p1
53platforms       darwin
54
55depends_lib     port:db46 \
56                port:expat \
57                port:libiconv \
58                port:mcpp \
59                port:openssl \
60                port:readline
61
62build.dir       ${worksrcpath}/cpp
63
64post-patch {
65    reinplace "s/-O2/-g -O2/" ${build.dir}/config/Make.rules.Darwin
66
67    # It appears that the 10.4 and 10.5 installed versions of
68    # ${prefix}/include/iconv.h have different definitions of
69    # the inbuf parameter to iconv(), one is 'const char* * inbuf'
70    # and the other is 'char* * inbuf'.  The Ice compile will
71    # fail if the wrong #define is choosen by Ice.
72    set fl [open ${prefix}/include/iconv.h]
73    set data [read $fl]
74    close $fl
75    foreach line [split $data \n] {
76        if {[string match "extern size_t iconv*const*" $line]} {
77            reinplace "s/_LIBICONV_VERSION < 0x010B/1/" \
78                ${build.dir}/include/Ice/IconvStringConverter.h
79            break
80        }
81    }
82
83    # Prevent name conflicts between libICE.* from xorg-libice and
84    # libIce.* from this port by renaming libIce.* to libZerocIce.*.
85    # For consistency, rename Ice's other shared libraries.
86    foreach f [exec find ${build.dir} -name Makefile] {
87        # To prevent replacements on slice2freeze's --dict argument,
88        # match exactly on a , or a ) that follows ,Ice\w*, e.g.:
89        # $(SLICE2FREEZE) --ice -I$(slicedir) --dict StringIsbnSeqDict,string,Ice::StringSeq
90        reinplace -E {s/,Ice([[:alnum:]]*[,)])/,ZerocIce\1/} ${f}
91        reinplace -E {s/-lIce([ A-Z]|$)/-lZerocIce\1/g} ${f}
92    }
93    reinplace -E {s/-lIce([ A-Z]|$)/-lZerocIce\1/g} \
94        ${build.dir}/config/Make.rules \
95        ${build.dir}/config/Make.rules.Darwin
96}
97
98use_configure   no
99
100build {
101    set jobsargs ""
102    if {${build.jobs} > 1} {
103        set jobsargs " -j${build.jobs}"
104    }
105
106    set cmd "cd ${build.dir} && make${jobsargs} 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}' all && cd doc && make${jobsargs}"
107    ui_debug ${cmd}
108    system ${cmd}
109}
110
111test.run        yes
112test.target     test
113
114destroot.target prefix="${prefix}" \
115                embedded_runpath_prefix="${prefix}" \
116                OPTIMIZE="yes" \
117                BZIP2_HOME="${prefix}" \
118                DB_HOME="${prefix}" \
119                EXPAT_HOME="${prefix}" \
120                OPENSSL_HOME="${prefix}" \
121                READLINE_HOME="${prefix}" \
122                USE_READLINE=yes \
123                MCPP_HOME="${prefix}" \
124                install
125
126post-destroot {
127    set sharedir ${destroot}${prefix}/share
128    set docdir ${sharedir}/doc/${name}
129
130    xinstall -m 755 -d ${sharedir}/ice
131    file rename ${destroot}${prefix}/config ${sharedir}/ice
132    file delete -force ${sharedir}/man
133    file rename ${destroot}${prefix}/man ${sharedir}/man
134    file rename ${destroot}${prefix}/slice ${sharedir}/slice
135
136    xinstall -m 755 -d ${docdir}
137    foreach f {CHANGES ICE_LICENSE LICENSE RELEASE_NOTES} {
138        file rename ${destroot}${prefix}/${f} ${docdir}
139    }
140    file copy ${build.dir}/doc/reference ${docdir}
141
142    if {[variant_isset demo_source_code]} {
143        system "cd ${build.dir}/demo && make clean"
144        file copy ${build.dir}/demo $docdir
145    }
146}
147
148variant demo_source_code description {Install demonstration C++ code} {
149}
Note: See TracBrowser for help on using the repository browser.