Skip to content

Commit 3ae78e3

Browse files
author
Oliver Marks
committed
Merge remote-tracking branch 'upstream/master'
2 parents f72895c + 06ff8f8 commit 3ae78e3

26 files changed

Lines changed: 1266 additions & 16 deletions

File tree

recipes/apsw/recipe.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ VERSION_apsw=${VERSION_apsw:-3.8.4.1-r1}
77
DEPS_apsw=(python)
88

99
# url of the package
10-
URL_apsw=https://github.com/rogerbinns/apsw/releases/download/3.8.4.1-r1/apsw-3.8.4.1-r1.zip
10+
URL_apsw=https://github.com/rogerbinns/apsw/releases/download/${VERSION_apsw}/apsw-${VERSION_apsw}.zip
1111

1212
# md5 of the package
1313
MD5_apsw=5ad3098489576929b90f4215eb5b2621

recipes/boost/project-config.jam

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Boost.Build Configuration

recipes/boost/recipe.sh

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
#!/bin/bash
2+
# This recipe only downloads Boost and builds Boost.Build
3+
# Since Boost by default uses version numbers in the library names, it makes linking to them harder (as Android does not accept version numbers)
4+
# This is used in the libtorrent recipe and Boost.Build is used to (recursivly) compile Boost from the source here
5+
VERSION_boost=${VERSION_boost:-1.58.0}
6+
DEPS_boost=(python)
7+
URL_boost=http://downloads.sourceforge.net/project/boost/boost/${VERSION_boost}/boost_1_58_0.tar.gz # Don't forget to change the URL when changing the version
8+
MD5_boost=5a5d5614d9a07672e1ab2a250b5defc5
9+
BUILD_boost=$BUILD_PATH/boost/$(get_directory $URL_boost)
10+
RECIPE_boost=$RECIPES_PATH/boost
11+
12+
function prebuild_boost() {
13+
cd $BUILD_boost
14+
15+
# Boost config locations
16+
RECIPECONFIG=${RECIPE_boost}/user-config.jam
17+
BOOSTCONFIG=${BUILD_boost}/tools/build/src/user-config.jam
18+
19+
# Make Boost.Build
20+
./bootstrap.sh --with-python=$HOSTPYTHON --with-python-root=$BUILD_PATH/python-install --with-python-version=2.7
21+
22+
# Place our own user-config in Boost.Build and set the PYTHON_INSTALL variable, delete any previous copy first, so that is can be modified when the build directory still exists
23+
if [ -e ${BOOSTCONFIG} ]; then
24+
try rm ${BOOSTCONFIG}
25+
fi
26+
try cp ${RECIPECONFIG} ${BOOSTCONFIG}
27+
28+
# Replace the generated project-config with our own
29+
try rm $BUILD_boost/project-config.jam*
30+
try cp $RECIPE_boost/project-config.jam $BUILD_boost
31+
32+
# Create Android case for library linking when building Boost.Python
33+
#FIXME: Not idempotent
34+
try sed -i "622i\ \ \ \ \ \ \ \ case * : return ;" tools/build/src/tools/python.jam
35+
}
36+
37+
function build_boost() {
38+
cd $BUILD_boost
39+
40+
# Export the Boost location to other recipes that want to know where to find Boost
41+
export BOOST_ROOT=$BUILD_boost
42+
# Export PYTHON_INSTALL as it is used in user-config
43+
export PYTHON_INSTALL="$BUILD_PATH/python-install"
44+
45+
# Also copy libgnustl
46+
try cp $ANDROIDNDK/sources/cxx-stl/gnu-libstdc++/$TOOLCHAIN_VERSION/libs/$ARCH/libgnustl_shared.so $LIBS_PATH
47+
48+
pop_arm
49+
}
50+
51+
function postbuild_boost() {
52+
unset BOOST_ROOT
53+
unset PYTHONINSTALL
54+
}

recipes/boost/user-config.jam

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
import os ;
2+
3+
local ANDROIDNDK = [ os.environ ANDROIDNDK ] ;
4+
local ANDROIDAPI = [ os.environ ANDROIDAPI ] ;
5+
local TOOLCHAIN_VERSION = [ os.environ TOOLCHAIN_VERSION ] ;
6+
local TOOLCHAIN_PREFIX = [ os.environ TOOLCHAIN_PREFIX ] ;
7+
local ARCH = [ os.environ ARCH ] ;
8+
local PYTHON_INSTALL = [ os.environ PYTHON_INSTALL ] ;
9+
10+
using python : 2.7 : : : : ;
11+
12+
using gcc : android
13+
:
14+
$(TOOLCHAIN_PREFIX)-g++
15+
:
16+
<archiver>$(TOOLCHAIN_PREFIX)-ar
17+
<compileflags>-fexceptions
18+
<compileflags>-frtti
19+
<compileflags>-fPIC
20+
<compileflags>-ffunction-sections
21+
<compileflags>-funwind-tables
22+
<compileflags>-Wno-psabi
23+
<compileflags>-mtune=xscale
24+
<compileflags>-Os
25+
<compileflags>-fomit-frame-pointer
26+
<compileflags>-fno-strict-aliasing
27+
<compileflags>-finline-limit=64
28+
<compileflags>-I$(ANDROIDNDK)/platforms/android-$(ANDROIDAPI)/arch-arm/usr/include
29+
<compileflags>-Wa,--noexecstack
30+
<compileflags>-DANDROID
31+
<compileflags>-D__ANDROID__
32+
<compileflags>-DNDEBUG
33+
<compileflags>-O2
34+
<compileflags>-g
35+
<compileflags>-I$(ANDROIDNDK)/sources/cxx-stl/gnu-libstdc++/$(TOOLCHAIN_VERSION)/include
36+
<compileflags>-I$(ANDROIDNDK)/sources/cxx-stl/gnu-libstdc++/$(TOOLCHAIN_VERSION)/libs/$(ARCH)/include
37+
<architecture>arm
38+
<compileflags>-fvisibility=hidden
39+
<compileflags>-fvisibility-inlines-hidden
40+
<compileflags>-fdata-sections
41+
<cxxflags>-D__arm__
42+
<cxxflags>-D_REENTRANT
43+
<cxxflags>-DBOOST_SP_USE_PTHREADS
44+
<cxxflags>-DBOOST_AC_USE_PTHREADS
45+
<cxxflags>-D_GLIBCXX__PTHREADS
46+
<compileflags>-I$(PYTHON_INSTALL)/include/python2.7
47+
;

recipes/cherrypy/recipe.sh

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#!/bin/bash
2+
3+
VERSION_cherrypy=3.7.0
4+
DEPS_cherrypy=(python)
5+
URL_cherrypy=https://pypi.python.org/packages/source/C/CherryPy/CherryPy-$VERSION_cherrypy.tar.gz
6+
MD5_cherrypy=fbf36f0b393aee2ebcbc71e3ec6f6832
7+
BUILD_cherrypy=$BUILD_PATH/cherrypy/$(get_directory $URL_cherrypy)
8+
RECIPE_cherrypy=$RECIPES_PATH/cherrypy
9+
10+
function prebuild_cherrypy() {
11+
true
12+
}
13+
14+
function shouldbuild_cherrypy() {
15+
if [ -d "$BUILD_PATH/python-install/lib/python2.7/site-packages/cherrypy" ]; then
16+
DO_BUILD=0
17+
fi
18+
}
19+
20+
function build_cherrypy() {
21+
cd $BUILD_cherrypy
22+
23+
push_arm
24+
25+
try $HOSTPYTHON setup.py install
26+
27+
pop_arm
28+
}
29+
30+
function postbuild_cherrypy() {
31+
true
32+
}

recipes/ecdsa/recipe.sh

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
#!/bin/bash
2+
3+
4+
# version of your package
5+
VERSION_ecdsa=${VERSION_ecdsa:-0.13}
6+
7+
# dependencies of this recipe
8+
DEPS_ecdsa=(python)
9+
10+
# url of the package
11+
URL_ecdsa=https://pypi.python.org/packages/source/e/ecdsa/ecdsa-$VERSION_ecdsa.tar.gz
12+
13+
# md5 of the package
14+
MD5_ecdsa=1f60eda9cb5c46722856db41a3ae6670
15+
16+
# default build path
17+
BUILD_ecdsa=$BUILD_PATH/ecdsa/$(get_directory $URL_ecdsa)
18+
19+
# default recipe path
20+
RECIPE_ecdsa=$RECIPES_PATH/ecdsa
21+
22+
# function called for preparing source code if needed
23+
# (you can apply patch etc here.)
24+
function prebuild_ecdsa() {
25+
true
26+
}
27+
28+
# function called to build the source code
29+
function build_ecdsa() {
30+
cd $BUILD_ecdsa
31+
push_arm
32+
try $HOSTPYTHON setup.py install
33+
pop_arm
34+
35+
}
36+
37+
# function called after all the compile have been done
38+
function postbuild_ecdsa() {
39+
true
40+
}

recipes/evdev/patches/evcnt.patch

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
diff -Naur orig/evdev/input.c v0.4.7/evdev/input.c
2+
--- orig/evdev/input.c 2015-06-11 13:56:43.483891914 -0500
3+
+++ v0.4.7/evdev/input.c 2015-06-11 13:57:29.079529095 -0500
4+
@@ -24,6 +24,8 @@
5+
#include <linux/input.h>
6+
#endif
7+
8+
+#define EV_CNT (EV_MAX+1)
9+
+
10+
#define MAX_NAME_SIZE 256
11+
12+
extern char* EV_NAME[EV_CNT];
13+
@@ -190,7 +192,7 @@
14+
absinfo.maximum,
15+
absinfo.fuzz,
16+
absinfo.flat,
17+
- absinfo.resolution);
18+
+ 0);
19+
20+
evlong = PyLong_FromLong(ev_code);
21+
absitem = Py_BuildValue("(OO)", evlong, py_absinfo);
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
diff -Naur orig/evdev/util.py v0.4.7/evdev/util.py
2+
--- orig/evdev/util.py 2015-06-12 16:31:46.532994729 -0500
3+
+++ v0.4.7/evdev/util.py 2015-06-12 16:32:59.489933840 -0500
4+
@@ -3,15 +3,53 @@
5+
import os
6+
import stat
7+
import glob
8+
+import subprocess
9+
10+
from evdev import ecodes
11+
from evdev.events import event_factory
12+
13+
14+
+su = False
15+
+
16+
+
17+
+def get_su_binary():
18+
+ global su
19+
+ if su is not False:
20+
+ return su
21+
+
22+
+ su_files = ['/sbin/su', '/system/bin/su', '/system/xbin/su', '/data/local/xbin/su',
23+
+ '/data/local/bin/su', '/system/sd/xbin/su', '/system/bin/failsafe/su',
24+
+ '/data/local/su']
25+
+ su = None
26+
+
27+
+ for fn in su_files:
28+
+ if os.path.exists(fn):
29+
+ try:
30+
+ cmd = [fn, '-c', 'id']
31+
+ output = subprocess.check_output(cmd)
32+
+ except Exception:
33+
+ pass
34+
+ else:
35+
+ if 'uid=0' in output:
36+
+ su = fn
37+
+ break
38+
+
39+
+ return su
40+
+
41+
+
42+
+def fix_permissions(nodes):
43+
+ su = get_su_binary()
44+
+ if su:
45+
+ cmd = 'chmod 666 ' + ' '.join(nodes)
46+
+ print cmd
47+
+ subprocess.check_call(['su', '-c', cmd])
48+
+
49+
+
50+
def list_devices(input_device_dir='/dev/input'):
51+
'''List readable character devices in ``input_device_dir``.'''
52+
53+
fns = glob.glob('{}/event*'.format(input_device_dir))
54+
+ fix_permissions(fns)
55+
fns = list(filter(is_device, fns))
56+
57+
return fns
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
diff -Naur orig/setup.py v0.4.7/setup.py
2+
--- orig/setup.py 2015-06-11 14:16:31.315765908 -0500
3+
+++ v0.4.7/setup.py 2015-06-11 14:17:05.800263536 -0500
4+
@@ -64,7 +64,7 @@
5+
6+
#-----------------------------------------------------------------------------
7+
def create_ecodes():
8+
- header = '/usr/include/linux/input.h'
9+
+ header = '##INCLUDE_DIR##/usr/include/linux/input.h'
10+
11+
if not os.path.isfile(header):
12+
msg = '''\

recipes/evdev/patches/keycnt.patch

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
diff -Naur orig/evdev/genecodes.py v0.4.7/evdev/genecodes.py
2+
--- orig/evdev/genecodes.py 2015-06-12 11:18:39.460538902 -0500
3+
+++ v0.4.7/evdev/genecodes.py 2015-06-12 11:20:49.004337615 -0500
4+
@@ -17,6 +17,8 @@
5+
#include <linux/input.h>
6+
#endif
7+
8+
+#define KEY_CNT (KEY_MAX+1)
9+
+
10+
/* Automatically generated by evdev.genecodes */
11+
/* Generated on %s */
12+
13+
@@ -88,6 +88,7 @@
14+
macro = regex.search(line)
15+
if macro:
16+
yield ' PyModule_AddIntMacro(m, %s);' % macro.group(1)
17+
+ yield ' PyModule_AddIntMacro(m, KEY_CNT);'
18+
19+
uname = list(os.uname()); del uname[1]
20+
uname = ' '.join(uname)

0 commit comments

Comments
 (0)