@@ -24,7 +24,7 @@ class FreetypeRecipe(Recipe):
24
24
https://sourceforge.net/projects/freetype/files/freetype2/2.5.3/
25
25
"""
26
26
27
- version = '2.5.5 '
27
+ version = '2.10.1 '
28
28
url = 'http://download.savannah.gnu.org/releases/freetype/freetype-{version}.tar.gz' # noqa
29
29
built_libraries = {'libfreetype.so' : 'objs/.libs' }
30
30
@@ -35,9 +35,6 @@ def get_recipe_env(self, arch=None, with_harfbuzz=False):
35
35
'harfbuzz' , self .ctx
36
36
).get_build_dir (arch .arch )
37
37
freetype_install = join (self .get_build_dir (arch .arch ), 'install' )
38
- env ['CFLAGS' ] = ' ' .join (
39
- [env ['CFLAGS' ], '-DFT_CONFIG_OPTION_USE_HARFBUZZ' ]
40
- )
41
38
42
39
env ['HARFBUZZ_CFLAGS' ] = '-I{harfbuzz} -I{harfbuzz}/src' .format (
43
40
harfbuzz = harfbuzz_build
@@ -48,6 +45,19 @@ def get_recipe_env(self, arch=None, with_harfbuzz=False):
48
45
freetype = freetype_install , harfbuzz = harfbuzz_build
49
46
)
50
47
)
48
+
49
+ # android's zlib support
50
+ zlib_lib_path = join (self .ctx .ndk_platform , 'usr' , 'lib' )
51
+ zlib_includes = join (self .ctx .ndk_dir , 'sysroot' , 'usr' , 'include' )
52
+
53
+ def add_flag_if_not_added (flag , env_key ):
54
+ if flag not in env [env_key ]:
55
+ env [env_key ] += flag
56
+
57
+ add_flag_if_not_added (' -I' + zlib_includes , 'CFLAGS' )
58
+ add_flag_if_not_added (' -L' + zlib_lib_path , 'LDFLAGS' )
59
+ add_flag_if_not_added (' -lz' , 'LDLIBS' )
60
+
51
61
return env
52
62
53
63
def build_arch (self , arch , with_harfbuzz = False ):
@@ -66,14 +76,17 @@ def build_arch(self, arch, with_harfbuzz=False):
66
76
config_args = {
67
77
'--host={}' .format (arch .command_prefix ),
68
78
'--prefix={}' .format (prefix_path ),
69
- '--without-zlib' ,
70
79
'--without-bzip2' ,
71
80
'--with-png=no' ,
72
81
}
73
82
if not harfbuzz_in_recipes :
74
83
info ('Build freetype (without harfbuzz)' )
75
84
config_args = config_args .union (
76
- {'--disable-static' , '--enable-shared' , '--with-harfbuzz=no' }
85
+ {'--disable-static' ,
86
+ '--enable-shared' ,
87
+ '--with-harfbuzz=no' ,
88
+ '--with-zlib=yes' ,
89
+ }
77
90
)
78
91
elif not with_harfbuzz :
79
92
info ('Build freetype for First time (without harfbuzz)' )
@@ -82,12 +95,16 @@ def build_arch(self, arch, with_harfbuzz=False):
82
95
# symbols/functions, so we avoid to have two freetype shared
83
96
# libraries which will be confusing and harder to link with them
84
97
config_args = config_args .union (
85
- {'--disable-shared' , '--with-harfbuzz=no' }
98
+ {'--disable-shared' , '--with-harfbuzz=no' , '--with-zlib=no' }
86
99
)
87
100
else :
88
101
info ('Build freetype for Second time (with harfbuzz)' )
89
102
config_args = config_args .union (
90
- {'--disable-static' , '--enable-shared' , '--with-harfbuzz=yes' }
103
+ {'--disable-static' ,
104
+ '--enable-shared' ,
105
+ '--with-harfbuzz=yes' ,
106
+ '--with-zlib=yes' ,
107
+ }
91
108
)
92
109
info ('Configure args are:\n \t -{}' .format ('\n \t -' .join (config_args )))
93
110
0 commit comments