Twisted and Zope Recipes

141 views
Skip to first unread message

deakblue

unread,
Jan 28, 2012, 11:50:52 AM1/28/12
to python-...@googlegroups.com
Hi,

Below are recipes for Twisted and twisted's dependency, Zope.

So the Zope recipe is screwed-up but I accidentally got it to work while commenting and re-commenting lines in the "try ..." part of the build_zope() function.  This makes me think those steps might run somehow in a different sequence.  I really have no clue how this build system works, so I'm just copy/pasting and praying.

Anyway, with Twisted/Zope in my dist, I can now build and deploy socket event apps (in my case, websocket apps via Autobahn).

I'm very very interested to see recipes for these two packages mainlined, as they're required for twisted framework support in Kivy and talking to Android apps via the Interwebs is cool.

Bet regards,
-db-




 
#!/bin/bash
VERSION_twisted=
#URL_kivy=https://github.com/kivy/kivy/zipball/android-support/kivy-android-support.zip
URL_twisted=http://twistedmatrix.com/Releases/Twisted/11.1/Twisted-11.1.0.tar.bz2
DEPS_twisted=(zope)
MD5_twisted=
BUILD_twisted=$BUILD_PATH/twisted/$(get_directory $URL_twisted)
RECIPE_twisted=$RECIPES_PATH/twisted
function prebuild_twisted() {
        true
}
function build_twisted() {
        if [ -d "$BUILD_PATH/python-install/lib/python2.7/site-packages/twisted" ]; then
                return
                true
        fi
        cd $BUILD_twisted
        push_arm
        export LDFLAGS="$LDFLAGS -L$LIBS_PATH"
        export LDSHARED="$LIBLINK"
        # fake try to be able to cythonize generated files
        $BUILD_PATH/python-install/bin/python.host setup.py build_ext
        try find . -iname '*.pyx' -exec cython {} \;
        try $BUILD_PATH/python-install/bin/python.host setup.py build_ext -v
        try find build/lib.* -name "*.o" -exec $STRIP {} \;
        try $BUILD_PATH/python-install/bin/python.host setup.py install -O2
        try rm -rf $BUILD_PATH/python-install/lib/python*/site-packages/twisted/tools
        unset LDSHARED
        pop_arm
}
function postbuild_twisted() {
        true
}




VERSION_zope=
#URL_kivy=https://github.com/kivy/kivy/zipball/android-support/kivy-android-support.zip
URL_zope=http://pypi.python.org/packages/source/z/zope.interface/zope.interface-3.8.0.tar.gz
DEPS_zope=
MD5_zope=8ab837320b4532774c9c89f030d2a389
BUILD_zope=$BUILD_PATH/zope/$(get_directory $URL_zope)
RECIPE_zope=$RECIPES_PATH/zope
function prebuild_zope() {
        true
}
function build_zope() {
        if [ -d "$BUILD_PATH/python-install/lib/python2.7/site-packages/zope" ]; then
                return
                true
        fi
        cd $BUILD_zope
        push_arm
        export LDFLAGS="$LDFLAGS -L$LIBS_PATH"
        export LDSHARED="$LIBLINK"
        # fake try to be able to cythonize generated files
        $BUILD_PATH/python-install/bin/python.host setup.py build_ext
        try find . -iname '*.pyx' -exec cython {} \;
        try $BUILD_PATH/python-install/bin/python.host setup.py build_ext -v
        try find build/lib.* -name "*.o" -exec $STRIP {} \;
        try $BUILD_PATH/python-install/bin/python.host setup.py install -O2
        try rm -rf $BUILD_PATH/python-install/lib/python*/site-packages/zope/tools
        unset LDSHARED
        pop_arm
}
function postbuild_zope() {
        true
}


Mathieu Virbel

unread,
Jan 30, 2012, 12:58:59 PM1/30/12
to python-...@googlegroups.com
Hi,

I'm going to merge both of them, thanks you for the contribution :)
(next time, try to do a pull request, then you'll get the awards for the
commit ^^)

Mathieu

Mathieu Virbel

unread,
Jan 30, 2012, 1:15:13 PM1/30/12
to python-...@googlegroups.com
Both have been merged with some changes: zope doesn't use cython, and
both of recipe are not removing the "wrong" files at the end (like all
the unittest)

https://github.com/kivy/python-for-android/commit/0c084ad0593d43bcdd294d92dbf24edc976c8f54

Mathieu

On 28/01/2012 17:50, deakblue wrote:

Reply all
Reply to author
Forward
0 new messages