@@ -11,7 +11,7 @@ class ICURecipe(NDKRecipe):
1111 version = '57.1'
1212 url = 'http://download.icu-project.org/files/icu4c/57.1/icu4c-57_1-src.tgz'
1313
14- depends = [('python2' , 'python3crystax' )] # installs in python
14+ depends = [('python2' , 'python3crystax' ), 'hostpython2' ] # installs in python
1515 generated_libraries = [
1616 'libicui18n.so' , 'libicuuc.so' , 'libicudata.so' , 'libicule.so' ]
1717
@@ -68,50 +68,48 @@ def make_build_dest(dest):
6868 shprint (sh .make , "install" , _env = host_env )
6969
7070 build_android , exists = make_build_dest ("build_icu_android" )
71- if exists :
72- return
73-
74- configure = sh .Command (join (build_root , "source" , "configure" ))
75-
76- include = (
77- " -I{ndk}/sources/cxx-stl/gnu-libstdc++/{version}/include/"
78- " -I{ndk}/sources/cxx-stl/gnu-libstdc++/{version}/libs/"
79- "{arch}/include" )
80- include = include .format (ndk = self .ctx .ndk_dir ,
81- version = env ["TOOLCHAIN_VERSION" ],
82- arch = arch .arch )
83- env ["CPPFLAGS" ] = env ["CXXFLAGS" ] + " "
84- env ["CPPFLAGS" ] += host_env ["CPPFLAGS" ]
85- env ["CPPFLAGS" ] += include
71+ if not exists :
8672
87- lib = "{ndk}/sources/cxx-stl/gnu-libstdc++/{version}/libs/{arch}"
88- lib = lib .format (ndk = self .ctx .ndk_dir ,
89- version = env ["TOOLCHAIN_VERSION" ],
90- arch = arch .arch )
91- env ["LDFLAGS" ] += " -lgnustl_shared -L" + lib
92-
93- env .pop ("CFLAGS" , None )
94- env .pop ("CXXFLAGS" , None )
95-
96- with current_directory (build_android ):
97- shprint (
98- configure ,
99- "--with-cross-build=" + build_linux ,
100- "--enable-extras=no" ,
101- "--enable-strict=no" ,
102- "--enable-static" ,
103- "--enable-tests=no" ,
104- "--enable-samples=no" ,
105- "--host=" + env ["TOOLCHAIN_PREFIX" ],
106- "--prefix=" + icu_build ,
107- _env = env )
108- shprint (sh .make , "-j5" , _env = env )
109- shprint (sh .make , "install" , _env = env )
73+ configure = sh .Command (join (build_root , "source" , "configure" ))
74+
75+ include = (
76+ " -I{ndk}/sources/cxx-stl/gnu-libstdc++/{version}/include/"
77+ " -I{ndk}/sources/cxx-stl/gnu-libstdc++/{version}/libs/"
78+ "{arch}/include" )
79+ include = include .format (ndk = self .ctx .ndk_dir ,
80+ version = env ["TOOLCHAIN_VERSION" ],
81+ arch = arch .arch )
82+ env ["CPPFLAGS" ] = env ["CXXFLAGS" ] + " "
83+ env ["CPPFLAGS" ] += host_env ["CPPFLAGS" ]
84+ env ["CPPFLAGS" ] += include
85+
86+ lib = "{ndk}/sources/cxx-stl/gnu-libstdc++/{version}/libs/{arch}"
87+ lib = lib .format (ndk = self .ctx .ndk_dir ,
88+ version = env ["TOOLCHAIN_VERSION" ],
89+ arch = arch .arch )
90+ env ["LDFLAGS" ] += " -lgnustl_shared -L" + lib
91+
92+ env .pop ("CFLAGS" , None )
93+ env .pop ("CXXFLAGS" , None )
94+
95+ with current_directory (build_android ):
96+ shprint (
97+ configure ,
98+ "--with-cross-build=" + build_linux ,
99+ "--enable-extras=no" ,
100+ "--enable-strict=no" ,
101+ "--enable-static" ,
102+ "--enable-tests=no" ,
103+ "--enable-samples=no" ,
104+ "--host=" + env ["TOOLCHAIN_PREFIX" ],
105+ "--prefix=" + icu_build ,
106+ _env = env )
107+ shprint (sh .make , "-j5" , _env = env )
108+ shprint (sh .make , "install" , _env = env )
110109
111110 self .copy_files (arch )
112111
113112 def copy_files (self , arch ):
114- ndk = self .ctx .ndk_dir
115113 env = self .get_recipe_env (arch )
116114
117115 lib = "{ndk}/sources/cxx-stl/gnu-libstdc++/{version}/libs/{arch}"
0 commit comments