Skip to content

Commit fc2a373

Browse files
committed
zeromq/pyzmq: started working on pyzmq for android. not working yet.
1 parent 33f10f2 commit fc2a373

File tree

4 files changed

+109
-0
lines changed

4 files changed

+109
-0
lines changed

distribute.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ PACKAGES_PATH="$ROOT_PATH/.packages"
2828
SRC_PATH="$ROOT_PATH/src"
2929
JNI_PATH="$SRC_PATH/jni"
3030
DIST_PATH="$ROOT_PATH/dist/default"
31+
INSTALL_PATH="$BUILD_PATH/install"
3132

3233
# Tools
3334
export LIBLINK_PATH="$BUILD_PATH/objects"
@@ -333,6 +334,7 @@ function run_prepare() {
333334
test -d $LIBS_PATH || mkdir -p $LIBS_PATH
334335
test -d $JAVACLASS_PATH || mkdir -p $JAVACLASS_PATH
335336
test -d $LIBLINK_PATH || mkdir -p $LIBLINK_PATH
337+
test -d $INSTALL_PATH || mkdir -p $INSTALL_PATH
336338

337339
# create initial files
338340
echo "target=android-$ANDROIDAPI" > $SRC_PATH/default.properties

recipes/pyzmq/recipe.sh

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
#!/bin/bash
2+
3+
VERSION_pyzmq=13.0.2
4+
URL_pyzmq=https://pypi.python.org/packages/source/p/pyzmq/pyzmq-$VERSION_pyzmq.tar.gz
5+
DEPS_pyzmq=(zeromq python)
6+
MD5_pyzmq=
7+
BUILD_pyzmq=$BUILD_PATH/pyzmq/$(get_directory $URL_pyzmq)
8+
RECIPE_pyzmq=$RECIPES_PATH/pyzmq
9+
10+
function prebuild_pyzmq() {
11+
true
12+
}
13+
14+
function build_pyzmq() {
15+
if [ -d "$BUILD_PATH/python-install/lib/python2.7/site-packages/pyzmq" ]; then
16+
return
17+
fi
18+
19+
cd $BUILD_pyzmq
20+
21+
push_arm
22+
23+
export CFLAGS="$CFLAGS -I$INSTALL_PATH/include"
24+
export CXXFLAGS="$CXXFLAGS -I$INSTALL_PATH/include"
25+
export LDFLAGS="$LDFLAGS -L$INSTALL_PATH/lib"
26+
export LDSHARED="$LIBLINK"
27+
28+
# fake try to be able to cythonize generated files
29+
echo <<END >setup.cfg
30+
[global]
31+
zmq_prefix = /home/tito/code/python-for-android/build/install/
32+
have_sys_un_h = False
33+
END
34+
35+
bash
36+
$BUILD_PATH/python-install/bin/python.host setup.py build_ext
37+
try find build/lib.* -name "*.o" -exec $STRIP {} \;
38+
try $BUILD_PATH/python-install/bin/python.host setup.py install -O2
39+
40+
try rm -rf $BUILD_PATH/python-install/lib/python*/site-packages/pyzmq/tools
41+
42+
unset LDSHARED
43+
pop_arm
44+
}
45+
46+
function postbuild_pyzmq() {
47+
true
48+
}

recipes/stlport/recipe.sh

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/bin/bash
2+
3+
VERSION_stlport=
4+
URL_stlport=
5+
DEPS_stlport=()
6+
MD5_stlport=
7+
BUILD_stlport=$ANDROIDNDK/sources/cxx-stl/stlport/
8+
RECIPE_stlport=$RECIPES_PATH/stlport
9+
10+
function prebuild_stlport() {
11+
export LIB_stlport=$BUILD_stlport/libs/$ARCH/
12+
export INCLUDE_stlport=$BUILD_stlport/stlport
13+
}
14+
15+
function build_stlport() {
16+
true
17+
}
18+
19+
function postbuild_stlport() {
20+
true
21+
}
22+

recipes/zeromq/recipe.sh

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
#!/bin/bash
2+
3+
VERSION_zeromq=3.2.3
4+
URL_zeromq=http://download.zeromq.org/zeromq-$VERSION_zeromq.tar.gz
5+
DEPS_zeromq=(stlport)
6+
MD5_zeromq=
7+
BUILD_zeromq=$BUILD_PATH/zeromq/$(get_directory $URL_zeromq)
8+
RECIPE_zeromq=$RECIPES_PATH/zeromq
9+
10+
function prebuild_zeromq() {
11+
true
12+
}
13+
14+
function build_zeromq() {
15+
cd $BUILD_zeromq
16+
17+
if [ -f src/.libs/zeromq.a ]; then
18+
return
19+
fi
20+
21+
push_arm
22+
23+
export CXXFLAGS="$CXXFLAGS -I$INCLUDE_stlport -Wno-long-long"
24+
export LDFLAGS="-L$LIB_stlport -lstlport_static"
25+
26+
27+
try ./configure --host=arm-linux-androideabi --enable-static --disable-shared --prefix=$INSTALL_PATH
28+
try cd src
29+
try make install
30+
bash
31+
32+
pop_arm
33+
}
34+
35+
function postbuild_zeromq() {
36+
true
37+
}

0 commit comments

Comments
 (0)