8000 Hotfix/freetype test by olymk2 · Pull Request #4 · olymk2/python-for-android · GitHub
[go: up one dir, main page]

Skip to content

Hotfix/freetype test #4

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 16 additions & 3 deletions recipes/freetype/recipe.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,28 @@ function prebuild_freetype() {
true
}

function shouldbuild_harfbuzz() {
if [ -f "$BUILD_freetype/objs/.libs/libfreetype.so" ]; then
DO_BUILD=0
fi
}

function build_freetype() {
cd $BUILD_freetype
push_arm
export LDFLAGS="$LDFLAGS -L$BUILD_harfbuzz/src/.libs/"
try ./configure --host=arm-linux-androideabi --prefix=$BUILD_freetype --without-zlib --with-png=no --enable-shared
#export LDFLAGS="$LDFLAGS -L$BUILD_harfbuzz/src/.libs/"
#export LDFLAGS="$LDFLAGS -L$BUILD_harfbuzz/src/"
#export LDFLAGS="$LDFLAGS -L$LIBS_PATH"
#export CFLAGS="$CFLAGS -I$BUILD_harfbuzz/src/"
export HARFBUZZ_CFLAGS="-I$BUILD_harfbuzz/src/"
export HARFBUZZ_LIBS="-L$BUILD_harfbuzz/src/.libs/"
try ./configure --host=arm-linux-androideabi --prefix=$BUILD_freetype --without-zlib --with-png=no --with-harfbuzz=yes --enable-shared

#-nostdinc is breaking but we probably want this
try make -j5
pop_arm

try cp $BUILD_freetype/objs/.libs/libfreetype.so $LIBS_PATH
#try cp $BUILD_freetype/objs/.libs/libfreetype.so $LIBS_PATH
}

# function called after all the compile have been done
Expand Down
43 changes: 35 additions & 8 deletions recipes/harfbuzz/recipe.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,47 @@ function shouldbuild_harfbuzz() {

function build_harfbuzz() {
cd $BUILD_harfbuzz

push_arm
#~ export LDFLAGS="-L$LIBS_PATH"
#~ export LDSHARED="$LIBLINK"
#try ./configure --build=i686-pc-linux-gnu --host=arm-linux-androideabi --prefix="$BUILD_PATH/python-install" --enable-shared --without-freetype --without-glib
#~ try ./autogen.sh --build=i686-pc-linux-gnu --host=arm-linux-androideabi --prefix="$BUILD_PATH/python-install" --without-freetype --without-glib
try ./configure --without-icu --host=arm-linux-androideabi --prefix="$BUILD_PATH/python-install" --without-freetype --without-glib
export CFLAGS="$CFLAGS -I$BUILD_freetype/include"
export LDFLAGS="$LDFLAGS -L$LIBS_PATH"
#export LDSHARED="$LIBLINK"
#try ./autogen.sh
try ./configure --build=i686-pc-linux-gnu --without-icu --host=arm-linux-androideabi --prefix="$BUILD_PATH/python-install" --without-freetype --without-glib --enable-shared
try make -j5
pop_arm
try cp -L $BUILD_harfbuzz/src/.libs/libharfbuzz.so $LIBS_PATH
#try cp -L $BUILD_harfbuzz/src/.libs/libharfbuzz.so $LIBS_PATH
}
#http://stackoverflow.com/questions/6666805/what-does-each-column-of-objdumps-symbol-table-mean

# function called after all the compile have been done
function postbuild_harfbuzz() {
true
if [ -f "$BUILD_freetype/objs/.libs/libfreetype.so" ]; then
echo "freetype found rebuilding harfbuzz with freetype support";
cd $BUILD_harfbuzz
push_arm
export CFLAGS="$CFLAGS -I$BUILD_freetype/include"
export LDFLAGS="$LDFLAGS -L$LIBS_PATH -L$BUILD_freetype/objs/.libs/"
export LDSHARED="$LIBLINK"
try ./configure --build=i686-pc-linux-gnu --without-icu --host=arm-linux-androideabi --prefix="$BUILD_PATH/python-install" --with-freetype --without-glib --enable-shared
try make -j5 -nostdinc
pop_arm
echo $LIBS_PATH
ls $BUILD_harfbuzz/src/.libs
try cp -L $BUILD_harfbuzz/src/.libs/libharfbuzz.so $LIBS_PATH

cd $BUILD_freetype
push_arm
export HARFBUZZ_CFLAGS="-I$BUILD_harfbuzz/src/"
export HARFBUZZ_LIBS="-L$BUILD_harfbuzz/src/.libs/"
try ./configure --host=arm-linux-androideabi --prefix=$BUILD_freetype --without-zlib --with-png=no --with-harfbuzz=yes --enable-shared

#-nostdinc is breaking but we probably want this
try make -j5
pop_arm

try cp $BUILD_freetype/objs/.libs/libfreetype.so $LIBS_PATH


fi
}

14 changes: 14 additions & 0 deletions src/src/org/renpy/android/PythonService.java
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,20 @@ public void run(){
System.load(getFilesDir() + "/lib/python2.7/lib-dynload/_io.so");
System.load(getFilesDir() + "/lib/python2.7/lib-dynload/unicodedata.so");

try {
System.load("/data/data/org.fabricad.fabricad/lib/libfreetype.so");
} catch(UnsatisfiedLinkError e) {
Log.e("JNI", "WARNING: Could not load libfreetype" + e);
System.exit(1);
}

try {
System.load("/data/data/org.fabricad.fabricad/lib/libharfbuzz.so");
} catch(UnsatisfiedLinkError e) {
Log.e("JNI", "WARNING: Could not load libharfbuzz.so" + e);
System.exit(1);
}
//FreeLibrary();
try {
System.loadLibrary("ctypes");
System.load(getFilesDir() + "/lib/python2.7/lib-dynload/_ctypes.so");
Expand Down
0