Skip to content

Commit 33a930f

Browse files
committed
Added preliminary freetype and harfbuzz recipes
1 parent 305577d commit 33a930f

File tree

3 files changed

+71
-0
lines changed

3 files changed

+71
-0
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,8 @@ properly tested (if at all).
9999

100100
- vispy
101101
- numpy
102+
- harfbuzz
103+
- freetype (assuming this works in normal p4a...)
102104

103105

104106
# Current status
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
2+
from pythonforandroid.toolchain import Recipe, shprint, get_directory, current_directory, ArchAndroid
3+
from os.path import exists, join, realpath
4+
from os import uname
5+
import glob
6+
import sh
7+
8+
class FreetypeRecipe(Recipe):
9+
10+
version = '2.5.5'
11+
url = 'http://download.savannah.gnu.org/releases/freetype/freetype-{version}.tar.gz'
12+
13+
depends = ['harfbuzz']
14+
15+
def should_build(self):
16+
if exists(join(self.get_build_dir('armeabi'), 'objs', '.libs', 'libfreetype.so')):
17+
return False
18+
return True
19+
20+
def build_arch(self, arch):
21+
env = self.get_recipe_env(arch)
22+
23+
harfbuzz_recipe = Recipe.get_recipe('harfbuzz', self.ctx)
24+
env['LDFLAGS'] = ' '.join(
25+
[env['LDFLAGS'],
26+
'-L{}'.format(join(harfbuzz_recipe.get_build_dir(arch.arch), 'src', '.libs'))])
27+
28+
with current_directory(self.get_build_dir(arch.arch)):
29+
configure = sh.Command('./configure')
30+
shprint(configure, '--host=arm-linux-androideabi',
31+
'--prefix={}'.format(realpath('.')),
32+
'--without-zlib', '--with-png=no', '--enable-shared',
33+
_env=env)
34+
shprint(sh.make, '-j5', _env=env)
35+
36+
shprint(sh.cp, 'objs/.libs/libfreetype.so', self.ctx.libs_dir)
37+
38+
39+
recipe = FreetypeRecipe()
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
2+
from pythonforandroid.toolchain import Recipe, shprint, get_directory, current_directory, ArchAndroid
3+
from os.path import exists, join, realpath
4+
from os import uname
5+
import glob
6+
import sh
7+
8+
9+
class HarfbuzzRecipe(Recipe):
10+
version = '0.9.40'
11+
url = 'http://www.freedesktop.org/software/harfbuzz/release/harfbuzz-{version}.tar.bz2'
12+
13+
def should_build(self):
14+
if exists(join(self.get_build_dir('armeabi'), 'src', '.libs', 'libharfbuzz.so')):
15+
return False
16+
return True
17+
18+
def build_arch(self, arch):
19+
20+
env = self.get_recipe_env(arch)
21+
with current_directory(self.get_build_dir(arch.arch)):
22+
configure = sh.Command('./configure')
23+
shprint(configure, '--without-icu', '--host=arm-linux=androideabi',
24+
'--prefix={}'.format(join(self.ctx.build_dir, 'python-install')),
25+
'--without-freetype', '--without-glib', _env=env)
26+
shprint(sh.make, '-j5', _env=env)
27+
28+
shprint(sh.cp, '-L', join('src', '.libs', 'libharfbuzz.so'), self.ctx.libs_dir)
29+
30+
recipe = HarfbuzzRecipe()

0 commit comments

Comments
 (0)