Ticket #50075: Portfile_zeroc-ice36-3.6.2_0

File Portfile_zeroc-ice36-3.6.2_0, 6.6 KB (added by johansen@…, 8 years ago)

Attempt at Portfile for Ice 3.6.2

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 146517 2016-03-10 17:49:28Z raimue@macports.org $
3
4PortSystem 1.0
5
6#name            zeroc-ice35
7name            zeroc-ice36
8#version         3.5.1
9version         3.6.2
10revision        1
11set branch      [join [lrange [split ${version} .] 0 1] .]
12categories      devel
13maintainers     blair
14#conflicts       zeroc-ice33 zeroc-ice34
15conflicts       zeroc-ice33 zeroc-ice34 zeroc-ice35
16license         GPL-2
17description     Fast, object-oriented RPC for C++, Java, Python, Ruby, PHP
18
19long_description \
20    The Internet Communications Engine (Ice) is a modern alternative to \
21    object middleware such as CORBA or COM/DCOM/COM+, with support for \
22    C++, C#, Java, PHP, Python, Ruby and Visual Basic. \
23    Ice consists of the following packages. \
24    Slice: The Specification Language for Ice.  Slice establishes a \
25    contract between clients and servers, and is also used to describe \
26    persistent data. \
27    Slice Compilers: Slice specifications are compiled into various \
28    programming languages. Ice supports C++, Java, C#, Visual Basic, PHP, \
29    Python and Ruby.  Ice clients and servers work together, regardless \
30    of the programming language. \
31    Ice: The Ice core library manages all the communication tasks using a \
32    highly efficient protocol (including protocol compression and support \
33    for both TCP and UDP), provides a flexible thread pool for \
34    multi-threaded servers. \
35    This Port provides the C++ runtime libraries, the core Slice files \
36    and slice2cpp.  It also includes the slice compilers for all the \
37    other languages: slice2cs, slice2java, slice2py, slice2rb and slice2vb.
38
39homepage        http://www.zeroc.com/
40#master_sites    ${homepage}download/Ice/${branch}/
41master_sites    https://github.com/zeroc-ice/ice/archive/
42
43distname        v${version}
44checksums       sha1   7516941c2ac63d300dd1ee95813cf60e7316c3cb \
45                sha256 5e9305a5eb6081c8f128d63a5546158594e9f115174fc91208f645dbe2fc02fe
46#patchfiles      patch-ice.cpp.config.Make.rules.diff \
47#                patch-ice.cpp.config.Make.rules.Darwin.diff \
48#                patch-ice.cpp.src.Ice.DynamicLibrary.cpp.diff \
49#                patch-ice.cpp.src.IceGrid.DescriptorHelper.h.diff \
50#                patch-ice.cpp.test.Ice.info.AllTests.cpp.diff \
51#                patch-ice.cpp.test.IceGrid.admin.run.py.diff \
52#                patch-ice.cpp.test.IceGrid.deployer.run.py.diff \
53#                patch-ice.cpp.test.IceGrid.replicaGroup.run.py.diff \
54#                patch-ice.cpp.test.include.TestCommon.h.diff \
55#                patch-ice.scripts.TestUtil.py.diff
56patch.pre_args  -p1
57platforms       darwin
58
59depends_lib     port:db46 \
60                port:expat \
61                port:libiconv \
62                port:mcpp \
63                path:lib/libssl.dylib:openssl \
64                port:readline
65worksrcdir      ice-${version}
66build.dir       ${worksrcpath}/cpp
67
68post-patch {
69#    reinplace "s/-O2/-g -O2/" ${build.dir}/config/Make.rules.Darwin
70
71    # It appears that the 10.4 and 10.5 installed versions of
72    # ${prefix}/include/iconv.h have different definitions of
73    # the inbuf parameter to iconv(), one is 'const char* * inbuf'
74    # and the other is 'char* * inbuf'.  The Ice compile will
75    # fail if the wrong #define is choosen by Ice.
76    set fl [open ${prefix}/include/iconv.h]
77    set data [read $fl]
78    close $fl
79    foreach line [split $data \n] {
80        if {[string match "extern size_t iconv*const*" $line]} {
81            reinplace "s/_LIBICONV_VERSION < 0x010B/1/" \
82                ${build.dir}/include/Ice/IconvStringConverter.h
83            break
84        }
85    }
86
87    # Prevent name conflicts between libICE.* from xorg-libice and
88    # libIce.* from this port by renaming libIce.* to libZerocIce.*.
89    # For consistency, rename Ice's other shared libraries.
90    foreach f [exec find ${build.dir} -name Makefile] {
91        # To prevent replacements on slice2freeze's --dict argument,
92        # match exactly on a , or a ) that follows ,Ice\w*, e.g.:
93        # $(SLICE2FREEZE) --ice -I$(slicedir) --dict StringIsbnSeqDict,string,Ice::StringSeq
94        reinplace -E {s/,Ice([[:alnum:]]*[,)])/,ZerocIce\1/} ${f}
95        reinplace -E {s/-lIce([ A-Z]|$)/-lZerocIce\1/g} ${f}
96    }
97    reinplace -E {s/-lIce([ A-Z]|$)/-lZerocIce\1/g} \
98        ${build.dir}/config/Make.rules \
99        ${build.dir}/config/Make.rules.Darwin
100}
101
102use_configure   no
103
104configure.cxxflags   -Wno-potentially-evaluated-expression
105
106build {
107    set jobsargs ""
108    if {${build.jobs} > 1} {
109        set jobsargs " -j${build.jobs}"
110    }
111
112#    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}"
113    set cmd "cd ${build.dir} && make${jobsargs} prefix='${prefix}' embedded_runpath_prefix='${prefix}' CC='${configure.cc}' CXX='${configure.cxx}' CXXFLAGS='${configure.cxxflags}' 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}" 
114    ui_debug ${cmd}
115    system ${cmd}
116}
117
118test.run        yes
119test.target     test
120
121destroot.target prefix="${prefix}" \
122                embedded_runpath_prefix="${prefix}" \
123                OPTIMIZE="yes" \
124                BZIP2_HOME="${prefix}" \
125                DB_HOME="${prefix}" \
126                EXPAT_HOME="${prefix}" \
127                OPENSSL_HOME="${prefix}" \
128                READLINE_HOME="${prefix}" \
129                USE_READLINE=yes \
130                MCPP_HOME="${prefix}" \
131                install
132
133post-destroot {
134    set sharedir ${destroot}${prefix}/share
135    set docdir ${sharedir}/doc/${name}
136
137    xinstall -m 755 -d ${sharedir}/ice
138    file rename ${destroot}${prefix}/config ${sharedir}/ice
139    file delete -force ${sharedir}/man
140    file rename ${destroot}${prefix}/man ${sharedir}/man
141    file rename ${destroot}${prefix}/slice ${sharedir}/slice
142
143    xinstall -m 755 -d ${docdir}
144    foreach f {CHANGES ICE_LICENSE LICENSE RELEASE_NOTES} {
145        file rename ${destroot}${prefix}/${f} ${docdir}
146    }
147    file copy ${build.dir}/doc/reference ${docdir}
148
149    if {[variant_isset demo_source_code]} {
150        system "cd ${build.dir}/demo && make clean"
151        file copy ${build.dir}/demo $docdir
152    }
153}
154
155variant demo_source_code description {Install demonstration C++ code} {
156}