Skip to content

Commit f2dd25a

Browse files
committed
start to add pygame, fix sdl compilation and copy all libs to build/libs
1 parent 75da8fd commit f2dd25a

File tree

4 files changed

+59
-6
lines changed

4 files changed

+59
-6
lines changed

configure.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ MODULES=$MODULES
1313
ROOT_PATH="$(dirname $(readlink -f $0))"
1414
RECIPES_PATH="$ROOT_PATH/recipes"
1515
BUILD_PATH="$ROOT_PATH/build"
16+
LIBS_PATH="$ROOT_PATH/build/libs"
1617
PACKAGES_PATH="$BUILD_PATH/packages"
1718
SRC_PATH="$ROOT_PATH/src"
1819
JNI_PATH="$SRC_PATH/jni"
@@ -173,6 +174,7 @@ function run_prepare() {
173174
# create build directory if not found
174175
if [ ! -d $BUILD_PATH ]; then
175176
mkdir -p $BUILD_PATH
177+
mkdir -p $LIBS_PATH
176178
mkdir -p $PACKAGES_PATH
177179
fi
178180

recipes/pygame/recipe.sh

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#!/bin/bash
2+
3+
PRIORITY_pygame=21
4+
VERSION_pygame=1.9.1
5+
URL_pygame=http://pygame.org/ftp/pygame-$(echo $VERSION_pygame)release.tar.gz
6+
DEPS_pygame=(sdl)
7+
MD5_pygame=1c4cdc708d17c8250a2d78ef997222fc
8+
BUILD_pygame=$BUILD_PATH/pygame/$(get_directory $URL_pygame)
9+
RECIPE_pygame=$RECIPES_PATH/pygame
10+
11+
function prebuild_pygame() {
12+
true
13+
}
14+
15+
function build_pygame() {
16+
cd $BUILD_pygame
17+
18+
push_arm
19+
20+
CFLAGS="$CFLAGS -I$JNI_PATH/png -I$JNI_PATH/jpeg"
21+
CFLAGS="$CFLAGS -I$JNI_PATH/sdl/include -I$JNI_PATH/sdl_mixer"
22+
CFLAGS="$CFLAGS -I$JNI_PATH/sdl_ttf -I$JNI_PATH/sdl_image"
23+
export CFLAGS="$CFLAGS"
24+
export LDFLAGS="$LDFLAGS -L$LIBS_PATH -lm -lz"
25+
try $BUILD_PATH/python-install/bin/python.host setup.py install
26+
try find build/lib.* -name "*.o" -exec $STRIP {} \;
27+
28+
pop_arm
29+
}
30+
31+
function postbuild_pygame() {
32+
true
33+
}

recipes/python/recipe.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ function build_python() {
4747
pop_arm
4848

4949
try cp $BUILD_hostpython/hostpython $BUILD_PATH/python-install/bin/python.host
50+
try cp libpython2.7.so $LIBS_PATH/
5051
}
5152

5253

recipes/sdl/recipe.sh

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,41 @@
22

33
PRIORITY_sdl=15
44
VERSION_sdl=1.3
5-
URL_sdl=http://www.libsdl.org/tmp/SDL-$VERSION_sdl.tar.gz
6-
MD5_sdl=7176d5f1a0f2683bf1394e0de18c74bb
7-
BUILD_sdl=$BUILD_PATH/sdl/$(get_directory $URL_sdl)
5+
URL_sdl=
6+
MD5_sdl=
7+
BUILD_sdl=$BUILD_PATH/sdl/SDL
88
RECIPE_sdl=$RECIPES_PATH/sdl
99

1010
function prebuild_sdl() {
11+
set -x
12+
# clone sdl repo
13+
if [ ! -f $BUILD_sdl ]; then
14+
cd $BUILD_PATH/sdl
15+
hg clone http://hg.libsdl.org/SDL
16+
fi
17+
1118
# make the symlink to sdl in src directory
1219
cd $SRC_PATH/jni
13-
if [ ! -f sdl ]; then
14-
ln -s $BUILD_sdl sdl
15-
fi
20+
rm sdl
21+
ln -s $BUILD_sdl sdl
1622
}
1723

1824
function build_sdl() {
1925
cd $SRC_PATH/jni
2026
push_arm
2127
ndk-build V=1
2228
pop_arm
29+
30+
# rename libs
31+
cp -a $SRC_PATH/libs/$ARCH/*.so $LIBS_PATH
32+
33+
# FIXME: patch jni compilation to make it work.
34+
cd $LIBS_PATH
35+
mv libsdl_image.so libSDL_image.so
36+
mv libsdl_image.so libSDL_image.so
37+
mv libsdl_main.so libSDL_main.so
38+
mv libsdl_mixer.so libSDL_mixer.so
39+
mv libsdl_ttf.so libSDL_ttf.so
2340
}
2441

2542
function postbuild_sdl() {

0 commit comments

Comments
 (0)