@@ -17,22 +17,11 @@ class LibffiRecipe(Recipe):
1717 version = '3.2.1'
1818 url = 'https://github.com/libffi/libffi/archive/v{version}.tar.gz'
1919
20- patches = ['remove-version-info.patch' ]
21-
22- def get_host (self , arch ):
23- with current_directory (self .get_build_dir (arch .arch )):
24- host = None
25- with open ('Makefile' ) as f :
26- for line in f :
27- if line .startswith ('host = ' ):
28- host = line .strip ()[7 :]
29- break
30-
31- if not host or not exists (host ):
32- raise RuntimeError ('failed to find build output! ({})'
33- .format (host ))
34-
35- return host
20+ patches = ['remove-version-info.patch' ,
21+ # This patch below is already included into libffi's master
22+ # branch and included in the pre-release 3.3rc0...so we should
23+ # remove this when we update the version number for libffi
24+ 'fix-includedir.patch' ]
3625
3726 def should_build (self , arch ):
3827 return not exists (join (self .ctx .get_libs_dir (arch .arch ), 'libffi.so' ))
@@ -45,7 +34,8 @@ def build_arch(self, arch):
4534 shprint (sh .Command ('autoreconf' ), '-vif' , _env = env )
4635 shprint (sh .Command ('./configure' ),
4736 '--host=' + arch .command_prefix ,
48- '--prefix=' + self .ctx .get_python_install_dir (),
37+ '--prefix=' + self .get_build_dir (arch .arch ),
38+ '--disable-builddir' ,
4939 '--enable-shared' , _env = env )
5040 # '--with-sysroot={}'.format(self.ctx.ndk_platform),
5141 # '--target={}'.format(arch.toolchain_prefix),
@@ -62,7 +52,7 @@ def build_arch(self, arch):
6252 info ("make libffi.la failed as expected" )
6353 cc = sh .Command (env ['CC' ].split ()[0 ])
6454 cflags = env ['CC' ].split ()[1 :]
65- host_build = join ( self .get_build_dir (arch .arch ), self . get_host ( arch ) )
55+ host_build = self .get_build_dir (arch .arch )
6656
6757 arch_flags = ''
6858 if '-march=' in env ['CFLAGS' ]:
@@ -91,8 +81,7 @@ def build_arch(self, arch):
9181 join (host_build , '.libs' , 'libffi.so' ))
9282
9383 def get_include_dirs (self , arch ):
94- return [join (self .get_build_dir (arch .arch ), self .get_host (arch ),
95- 'include' )]
84+ return [join (self .get_build_dir (arch .arch ), 'include' )]
9685
9786
9887recipe = LibffiRecipe ()
0 commit comments