Skip to content
This repository was archived by the owner on Aug 15, 2017. It is now read-only.

Commit b19712d

Browse files
committed
Added FFI to required support modules.
1 parent 7944c09 commit b19712d

File tree

4 files changed

+55
-21
lines changed

4 files changed

+55
-21
lines changed

recipes/libffi/recipe.sh

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
#!/bin/bash
2+
3+
# version of your package
4+
VERSION_libffi=${VERSION_libffi:-3.1}
5+
6+
# dependencies of this recipe
7+
DEPS_libffi=()
8+
9+
# url of the package
10+
URL_libffi=ftp://sourceware.org/pub/libffi/libffi-3.1.tar.gz
11+
12+
# md5 of the package
13+
MD5_libffi=
14+
15+
# default build path
16+
BUILD_libffi=$BUILD_PATH/libffi/libffi-3.1
17+
18+
# default recipe path
19+
RECIPE_libffi=$RECIPES_PATH/libffi
20+
21+
# function called for preparing source code if needed
22+
# (you can apply patch etc here.)
23+
function prebuild_libffi() {
24+
true
25+
}
26+
27+
# function called to build the source code
28+
function build_libffi() {
29+
cd $BUILD_libffi
30+
push_arm
31+
32+
echo try ./configure --host=arm-eabi --prefix="$BUILD_PATH/libffi/libffi-3.1" --enable-shared
33+
try ./configure --host=arm-eabi --prefix="$BUILD_PATH/libffi/libffi-3.1" --enable-shared
34+
try $MAKE
35+
try $MAKE install
36+
37+
pop_arm
38+
}
39+
40+
# function called after all the compile have been done
41+
function postbuild_libffi() {
42+
true
43+
}

recipes/python/patches/disable-modules.patch

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
+++ Python-2.7.2/setup.py 2011-11-27 16:49:36.840204364 +0100
33
@@ -21,7 +21,7 @@
44
COMPILED_WITH_PYDEBUG = hasattr(sys, 'gettotalrefcount')
5-
5+
66
# This global variable is used to hold the list of modules to be disabled.
77
-disabled_module_list = []
8-
+disabled_module_list = ['spwd', '_ctypes','bz2','ossaudiodev','_curses','_curses_panel','readline','_locale','_bsddb','gdbm','dbm','nis','linuxaudiodev','crypt','_multiprocessing']
9-
8+
+disabled_module_list = ['spwd', 'bz2','ossaudiodev','_curses','_curses_panel','readline','_locale','_bsddb','gdbm','dbm','nis','linuxaudiodev','crypt','_multiprocessing', '_tkinter', 'bsddb185', '_scproxy', '_sqlite3']
9+
1010
def add_dir_to_list(dirlist, dir):
1111
"""Add the directory 'dir' to the list 'dirlist' (at the front) if
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Ctypes
2+
_ctypes _ctypes/_ctypes.c _ctypes/callbacks.c _ctypes/callproc.c _ctypes/stgdict.c _ctypes/cfield.c -I$(srcdir)/../../libffi/libffi-3.1/arm-unknown-eabi/include/

recipes/python/recipe.sh

+7-18
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash
22

33
VERSION_python=2.7.2
4-
DEPS_python=(hostpython)
4+
DEPS_python=(hostpython libffi)
55
DEPS_OPTIONAL_python=(openssl sqlite3)
66
URL_python=http://python.org/ftp/python/$VERSION_python/Python-$VERSION_python.tar.bz2
77
MD5_python=ba7b2f11ffdbf195ee0d111b9455a5bd
@@ -32,6 +32,8 @@ function prebuild_python() {
3232
try patch -p1 < $RECIPE_python/patches/fix-dynamic-lookup.patch
3333
try patch -p1 < $RECIPE_python/patches/fix-dlfcn.patch
3434

35+
try cp $RECIPE_python/patches/modules-Setup.local $BUILD_python/Modules/Setup.local
36+
3537
system=$(uname -s)
3638
if [ "X$system" == "XDarwin" ]; then
3739
try patch -p1 < $RECIPE_python/patches/fix-configure-darwin.patch
@@ -78,24 +80,11 @@ function build_python() {
7880

7981
push_arm
8082

81-
# openssl activated ?
82-
if [ "X$BUILD_openssl" != "X" ]; then
83-
debug "Activate flags for openssl / python"
84-
export CFLAGS="$CFLAGS -I$BUILD_openssl/include/"
85-
export LDFLAGS="$LDFLAGS -L$BUILD_openssl/"
86-
fi
87-
88-
# sqlite3 activated ?
89-
if [ "X$BUILD_sqlite3" != "X" ]; then
90-
debug "Activate flags for sqlite3"
91-
export CFLAGS="$CFLAGS -I$BUILD_sqlite3"
92-
export LDFLAGS="$LDFLAGS -L$SRC_PATH/obj/local/$ARCH/"
93-
fi
94-
95-
try ./configure --host=arm-eabi OPT=$OFLAG --prefix="$BUILD_PATH/python-install" --enable-shared --disable-toolbox-glue --disable-framework
96-
echo ./configure --host=arm-eabi OPT=$OFLAG --prefix="$BUILD_PATH/python-install" --enable-shared --disable-toolbox-glue --disable-framework
83+
echo ./configure --host=arm-eabi OPT=$OFLAG --prefix="$BUILD_PATH/python-install" --enable-shared --disable-toolbox-glue --disable-framework LDLAST="-L$BUILD_libffi/lib -lffi"
84+
try ./configure --host=arm-eabi OPT=$OFLAG --prefix="$BUILD_PATH/python-install" --enable-shared --disable-toolbox-glue --disable-framework LDLAST="-L$BUILD_libffi/lib -lffi"
9785
echo $MAKE HOSTPYTHON=$BUILD_python/hostpython HOSTPGEN=$BUILD_python/hostpgen CROSS_COMPILE_TARGET=yes INSTSONAME=libpython2.7.so
98-
cp HOSTPYTHON=$BUILD_python/hostpython python
86+
$MAKE HOSTPYTHON=$BUILD_python/hostpython HOSTPGEN=$BUILD_python/hostpgen CROSS_COMPILE_TARGET=yes INSTSONAME=libpython2.7.so
87+
# cp HOSTPYTHON=$BUILD_python/hostpython python
9988

10089
debug 'Install...'
10190
$MAKE install HOSTPYTHON=$BUILD_python/hostpython HOSTPGEN=$BUILD_python/hostpgen CROSS_COMPILE_TARGET=yes INSTSONAME=libpython2.7.so

0 commit comments

Comments
 (0)