Skip to content

Commit b943a48

Browse files
committed
add gevent
1 parent 6d4aded commit b943a48

File tree

3 files changed

+126
-0
lines changed

3 files changed

+126
-0
lines changed

recipes/gevent/android.patch

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
diff -ur /home/max/workspace/gevent-1.0rc2/libev/ev.c gevent-1.0rc2/libev/ev.c
2+
--- /home/max/workspace/gevent-1.0rc2/libev/ev.c 2013-04-03 05:38:12.000000000 +0800
3+
+++ gevent-1.0rc2/libev/ev.c 2013-04-16 16:57:07.315889108 +0800
4+
@@ -464,7 +464,6 @@
5+
* This value is good at least till the year 4000.
6+
*/
7+
#define MIN_INTERVAL 0.0001220703125 /* 1/2**13, good till 4000 */
8+
-/*#define MIN_INTERVAL 0.00000095367431640625 /* 1/2**20, good till 2200 */
9+
10+
#define MIN_TIMEJUMP 1. /* minimum timejump that gets detected (if monotonic clock available) */
11+
#define MAX_BLOCKTIME 59.743 /* never wait longer than this time (to detect time jumps) */
12+
@@ -617,9 +616,6 @@
13+
#if ECB_GCC_VERSION(4,7)
14+
/* see comment below (stdatomic.h) about the C11 memory model. */
15+
#define ECB_MEMORY_FENCE __atomic_thread_fence (__ATOMIC_SEQ_CST)
16+
- #elif defined __clang && __has_feature (cxx_atomic)
17+
- /* see comment below (stdatomic.h) about the C11 memory model. */
18+
- #define ECB_MEMORY_FENCE __c11_atomic_thread_fence (__ATOMIC_SEQ_CST)
19+
#elif ECB_GCC_VERSION(4,4) || defined __INTEL_COMPILER || defined __clang__
20+
#define ECB_MEMORY_FENCE __sync_synchronize ()
21+
#elif _MSC_VER >= 1400 /* VC++ 2005 */
22+
diff -ur /home/max/workspace/gevent-1.0rc2/libev/ev_select.c gevent-1.0rc2/libev/ev_select.c
23+
--- /home/max/workspace/gevent-1.0rc2/libev/ev_select.c 2013-04-03 05:38:12.000000000 +0800
24+
+++ gevent-1.0rc2/libev/ev_select.c 2013-04-16 16:44:09.407889199 +0800
25+
@@ -65,6 +65,10 @@
26+
# define NFDBYTES (NFDBITS / 8)
27+
#endif
28+
29+
+#ifdef ANDROID
30+
+typedef int fd_mask;
31+
+#endif
32+
+
33+
#include <string.h>
34+
35+
static void
36+
diff -ur /home/max/workspace/gevent-1.0rc2/setup.py gevent-1.0rc2/setup.py
37+
--- /home/max/workspace/gevent-1.0rc2/setup.py 2013-04-03 05:38:12.000000000 +0800
38+
+++ gevent-1.0rc2/setup.py 2013-04-16 16:54:12.783889127 +0800
39+
@@ -51,8 +51,8 @@
40+
41+
define_macros = []
42+
libraries = []
43+
-libev_configure_command = ["/bin/sh", abspath('libev/configure'), '> configure-output.txt']
44+
-ares_configure_command = ["/bin/sh", abspath('c-ares/configure'), 'CONFIG_COMMANDS= CONFIG_FILES= > configure-output.txt']
45+
+libev_configure_command = ["/bin/sh", abspath('libev/configure --host=arm-linux'), '> configure-output.txt']
46+
+ares_configure_command = ["/bin/sh", abspath('c-ares/configure --host=arm-linux'), 'CONFIG_COMMANDS= CONFIG_FILES= > configure-output.txt']
47+
48+
49+
if sys.platform == 'win32':

recipes/gevent/recipe.sh

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#!/bin/bash
2+
3+
VERSION_gevent=1.0rc2
4+
URL_gevent=https://gevent.googlecode.com/files/gevent-1.0rc2.tar.gz
5+
DEPS_gevent=(greenlet hostpython python)
6+
MD5_gevent=3061c1c431b83b730e64a547f9fb82c0
7+
BUILD_gevent=$BUILD_PATH/gevent/$(get_directory $URL_gevent)
8+
RECIPE_gevent=$RECIPES_PATH/gevent
9+
10+
function prebuild_gevent() {
11+
true
12+
}
13+
14+
function build_gevent() {
15+
16+
if [ -d "$BUILD_PATH/python-install/lib/python2.7/site-packages/gevent" ]; then
17+
return
18+
fi
19+
20+
cd $BUILD_gevent
21+
22+
push_arm
23+
24+
export GEVENT_RESOLVER="ares"
25+
export CC="$CC -DANDROID"
26+
try patch -p1 < $RECIPE_gevent/android.patch
27+
28+
try $BUILD_PATH/python-install/bin/python.host setup.py build
29+
try find build/lib.* -name "*.o" -exec $STRIP {} \;
30+
try find build/lib.* -name "*.so" -exec $STRIP {} \;
31+
32+
try $BUILD_PATH/python-install/bin/python.host setup.py install -O2
33+
34+
pop_arm
35+
}
36+
37+
function postbuild_gevent() {
38+
true
39+
}

recipes/greenlet/recipe.sh

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#!/bin/bash
2+
3+
VERSION_greenlet=0.4.0
4+
URL_greenlet=https://pypi.python.org/packages/source/g/greenlet/greenlet-0.4.0.zip
5+
DEPS_greenlet=(hostpython python)
6+
MD5_greenlet=87887570082caadc08fb1f8671dbed71
7+
BUILD_greenlet=$BUILD_PATH/greenlet/$(get_directory $URL_greenlet)
8+
RECIPE_greenlet=$RECIPES_PATH/greenlet
9+
10+
function prebuild_greenlet() {
11+
true
12+
}
13+
14+
function build_greenlet() {
15+
16+
if [ -f "$BUILD_PATH/python-install/lib/python2.7/site-packages/greenlet.so" ]; then
17+
return
18+
fi
19+
20+
cd $BUILD_greenlet
21+
22+
push_arm
23+
24+
#export CC="$CC -I$BUILD_openssl/include"
25+
#export LDFLAGS="$LDFLAGS -L$LIBS_PATH -L$BUILD_openssl"
26+
27+
try $BUILD_PATH/python-install/bin/python.host setup.py build
28+
try find build/lib.* -name "*.o" -exec $STRIP {} \;
29+
try find build/lib.* -name "*.so" -exec $STRIP {} \;
30+
31+
try $BUILD_PATH/python-install/bin/python.host setup.py install -O2
32+
33+
pop_arm
34+
}
35+
36+
function postbuild_greenlet() {
37+
true
38+
}

0 commit comments

Comments
 (0)