Skip to content
Permalink
Browse files

Now that MacPorts has a framework Python 2.5 build, the Ice bindings

to them can be built.

git-svn-id: https://svn.macports.org/repository/macports/trunk/dports@37863 d073be05-634f-4543-b044-5fe20cf6d1d6
  • Loading branch information
blair committed Jun 26, 2008
1 parent 1264ceb commit ce497a6bad0deb6d24145af536372bbc5f617b17
@@ -0,0 +1,110 @@
# $Id$

PortSystem 1.0

name ice-python25
version 3.3.0
categories devel python
maintainers blair
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 http://www.zeroc.com/download/Ice/3.3/
dist_subdir ice-cpp
distname Ice-${version}
checksums md5 0500306d9cdbc0fbb553fbb529de557a \
sha1 b599c3a4d1d3006b868bf2cbcd8e2a2d4575fb22 \
rmd160 e85b37c93f12d9ae97c6b7b2f64f506fa051e4f8
platforms darwin

depends_lib port:python25 \
port:ice-cpp

patchfiles patch-py.config.Make.rules.Darwin.diff \
patch-config.TestUtil.py.diff

post-patch {
reinplace "s#python Client.py#${prefix}/bin/python2.5 Client.py#" \
${worksrcpath}/py/test/Slice/keyword/run.py
}

use_configure no

build.dir ${worksrcpath}/py
build.target prefix="${prefix}" \
ICE_HOME="${prefix}" \
PYTHON_HOME="${prefix}/Library/Frameworks/Python.framework/Versions/2.5" \
PYTHON_VERSION=python2.5 \
OPTIMIZE="yes" \
all

test.run yes
test.dir ${worksrcpath}/py
test.env ICE_HOME=${prefix}
test.cmd ${prefix}/bin/python2.5
test.target allTests.py

destroot.dir ${worksrcpath}/py
destroot.target prefix="${destroot}${prefix}" \
ICE_HOME="${prefix}" \
PYTHON_HOME="${prefix}/Library/Frameworks/Python.framework/Versions/2.5" \
PYTHON_VERSION=python2.5 \
OPTIMIZE="yes" \
install

post-destroot {
set sharedir ${destroot}${prefix}/share
set docdir ${sharedir}/doc/${name}

delete ${destroot}${prefix}/slice

xinstall -m 755 -d ${docdir}

file mkdir ${destroot}${prefix}/lib/python2.5
file rename ${destroot}${prefix}/python ${destroot}${prefix}/lib/python2.5/site-packages

set cmd "${prefix}/bin/python2.5 \
${prefix}/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/compileall.py \
${destroot}${prefix}/lib/python2.5/site-packages"
ui_debug ${cmd}
system ${cmd}

set cmd "${prefix}/bin/python2.5 -O \
${prefix}/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/compileall.py \
${destroot}${prefix}/lib/python2.5/site-packages"
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 ${worksrcpath}/py/INSTALL ${docdir}

if {[variant_isset demo_source_code]} {
file copy ${worksrcpath}/py/demo ${docdir}
}
}

variant demo_source_code description {Install demonstration Python code} {
}
@@ -0,0 +1,28 @@
diff -ru ../Ice-3.3.0.orig/config/TestUtil.py ./config/TestUtil.py
--- ../Ice-3.3.0.orig/config/TestUtil.py 2008-05-16 10:24:00.000000000 -0700
+++ ./config/TestUtil.py 2008-05-28 14:39:16.000000000 -0700
@@ -838,7 +838,7 @@
print >>output, "-Djava.net.preferIPv4Stack=true",
print >>output, exe,
elif config.lang == "py":
- print >>output, "python", exe,
+ print >>output, sys.executable, exe,
elif config.lang == "php" and config.type == "client":
print >>output, phpCmd, "-c tmp.ini -f", exe, " -- ",
else:
@@ -923,13 +923,13 @@

global keepGoing
if script:
- print "if ! python %s %s; then" % (os.path.join(dir, "run.py"), args)
+ print "if ! %s %s %s; then" % (sys.executable, os.path.join(dir, "run.py"), args)
print " echo 'test in %s failed'" % os.path.abspath(dir)
if not keepGoing:
print " exit 1"
print "fi"
else:
- status = os.system("python " + os.path.join(dir, "run.py " + args))
+ status = os.system(sys.executable + " " + os.path.join(dir, "run.py " + args))

if status:
if(num > 0):
@@ -0,0 +1,21 @@
diff -ru ../Ice-3.3.0.orig/py/config/Make.rules.Darwin ./py/config/Make.rules.Darwin
--- ../Ice-3.3.0.orig/py/config/Make.rules.Darwin 2008-05-16 10:24:03.000000000 -0700
+++ ./py/config/Make.rules.Darwin 2008-05-28 14:48:28.000000000 -0700
@@ -23,9 +23,9 @@
endif

PYTHON_INCLUDE_DIR = $(PYTHON_HOME)/include/$(PYTHON_VERSION)
-PYTHON_LIBS = -F$(PYTHON_HOME) -framework Python
+PYTHON_LIBS = $(PYTHON_HOME)/Python

-CXX = c++
+CXX ?= c++

CXXFLAGS = -ftemplate-depth-128 -Wall -D_REENTRANT

@@ -47,4 +47,4 @@
BASELIBS = -lIceUtil -lpthread
LIBS = -lIce $(BASELIBS)

-PLATFORM_HAS_READLINE := no
+PLATFORM_HAS_READLINE := yes

0 comments on commit ce497a6

Please sign in to comment.
You can’t perform that action at this time.