/
Portfile
138 lines (116 loc) · 5.09 KB
/
Portfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
PortSystem 1.0
PortGroup python 1.0
name py-zeroc-ice34
version 3.4.2
revision 5
set branch [join [lrange [split ${version} .] 0 1] .]
categories-append devel
maintainers nomaintainer
license GPL-2
description Fast, object-oriented RPC for C++, Java, Python, Ruby, PHP
long_description \
The Internet Communications Engine (Ice) is a modern alternative to \
object middleware such as CORBA or COM/DCOM/COM+, with support for \
C++, C#, Java, PHP, Python, Ruby and Visual Basic. \
Ice consists of the following packages. \
Slice: The Specification Language for Ice. Slice establishes a \
contract between clients and servers, and is also used to describe \
persistent data. \
Slice Compilers: Slice specifications are compiled into various \
programming languages. Ice supports C++, Java, C#, Visual Basic, PHP, \
Python and Ruby. Ice clients and servers work together, regardless \
of the programming language. \
Ice: The Ice core library manages all the communication tasks using a \
highly efficient protocol (including protocol compression and support \
for both TCP and UDP), provides a flexible thread pool for \
multi-threaded servers. \
This Port provides the Python bindings that sit on top of the C++ \
Ice C++ runtime libraries.
homepage http://www.zeroc.com/
master_sites ${homepage}download/Ice/${branch}/
dist_subdir zeroc-ice34
distname Ice-${version}
checksums md5 e97672eb4a63c6b8dd202d0773e19dc7 \
sha1 8c84d6e3b227f583d05e08251e07047e6c3a6b42 \
rmd160 7ce680a4eb5fa9d0bb6f8b8910e267dfc2373d75
patchfiles patch-py.config.Make.rules.Darwin.diff \
patch-py.modules.IcePy.Communicator.cpp.diff \
patch-add-thrift-support.diff \
patch-fix-python-2.7.4-core-dump.diff
platforms darwin
python.versions 27
if {${name} ne ${subport}} {
depends_lib-append port:zeroc-ice34
build.dir ${worksrcpath}/py
post-patch {
reinplace "s/-O2/-g -O2/" ${build.dir}/config/Make.rules.Darwin
# Prevent name conflicts between libICE.* from xorg-libice and
# libIce.* from this port by renaming libIce.* to libZerocIce.*.
# For consistency, rename Ice's other shared libraries.
foreach f [exec find ${build.dir} -name Makefile] {
# To prevent replacements on slice2freeze's --dict argument,
# match exactly on a , or a ) that follows ,Ice\w*, e.g.:
# $(SLICE2FREEZE) --ice -I$(slicedir) --dict StringIsbnSeqDict,string,Ice::StringSeq
reinplace -E {s/,Ice([[:alnum:]]*[,)])/,ZerocIce\1/} ${f}
reinplace -E {s/-lIce([ A-Z]|$)/-lZerocIce\1/g} ${f}
# Restore the name of the Python binding shared library.
reinplace -E {s/ZerocIcePy/IcePy/g} ${f}
}
reinplace -E {s/-lIce([ A-Z]|$)/-lZerocIce\1/g} \
${build.dir}/config/Make.rules \
${build.dir}/config/Make.rules.Darwin
}
use_configure no
build.cmd make
build.target prefix="${prefix}" \
CC="${configure.cc}" \
CXX="${configure.cxx}" \
ICE_HOME="${prefix}" \
PYTHON_HOME="${python.prefix}" \
PYTHON_VERSION="python${python.branch}" \
OPTIMIZE="yes" \
all
test.run yes
test.env ICE_HOME=${prefix}
test.cmd ${python.bin}
test.target allTests.py
destroot.destdir
destroot.cmd ${build.cmd}
destroot.target prefix="${destroot}${prefix}" \
CC="${configure.cc}" \
CXX="${configure.cxx}" \
ICE_HOME="${prefix}" \
PYTHON_HOME="${python.prefix}" \
PYTHON_VERSION="python${python.branch}" \
OPTIMIZE="yes" \
install
post-destroot {
set sharedir ${destroot}${prefix}/share
set docdir ${sharedir}/doc/${subport}
delete ${destroot}${prefix}/slice
xinstall -m 755 -d ${docdir}
xinstall -m 755 -d [file dirname ${destroot}${python.pkgd}]
file rename ${destroot}${prefix}/python ${destroot}${python.pkgd}
set cmd "${python.bin} \
${python.libdir}/compileall.py \
${destroot}${python.pkgd}"
ui_debug ${cmd}
system ${cmd}
set cmd "${python.bin} -O \
${python.libdir}/compileall.py \
${destroot}${python.pkgd}"
ui_debug ${cmd}
system ${cmd}
file rename ${destroot}${prefix}/ICE_LICENSE ${docdir}
file rename ${destroot}${prefix}/LICENSE ${docdir}
foreach f {CHANGES RELEASE_NOTES} {
file copy ${worksrcpath}/${f} ${docdir}
}
file copy ${build.dir}/INSTALL ${docdir}
if {[variant_isset demo_source_code]} {
file copy ${build.dir}/demo ${docdir}
}
}
variant demo_source_code description {Install demonstration Python code} {
}
}