File tree 2 files changed +15
-6
lines changed
pythonforandroid/recipes/cffi 2 files changed +15
-6
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,14 @@ class CffiRecipe(CompiledComponentsPythonRecipe):
14
14
# call_hostpython_via_targetpython = False
15
15
install_in_hostpython = True
16
16
17
+ def get_hostrecipe_env (self , arch = None ):
18
+ # fixes missing ffi.h on some host systems (e.g. gentoo)
19
+ env = super (CffiRecipe , self ).get_hostrecipe_env (arch )
20
+ libffi = self .get_recipe ('libffi' , self .ctx )
21
+ includes = libffi .get_include_dirs (arch )
22
+ env ['FFI_INC' ] = "," .join (includes )
23
+ return env
24
+
17
25
def get_recipe_env (self , arch = None ):
18
26
env = super (CffiRecipe , self ).get_recipe_env (arch )
19
27
# sets linker to use the correct gcc (cross compiler)
Original file line number Diff line number Diff line change 1
- diff -Naur cffi-1.4.2/setup.py b/setup.py
2
- --- cffi-1.4.2/setup.py 2015-12-21 12:09:47.000000000 -0600
3
- +++ b/setup.py 2015-12-23 10:20:40.590622524 -0600
4
- @@ -5,8 +5,7 @@
1
+ diff --git a/setup.py b/setup.py
2
+ index c1db368..57311c3 100644
3
+ --- a/setup.py
4
+ +++ b/setup.py
5
+ @@ -5,8 +5,7 @@ import errno
5
6
6
7
sources = ['c/_cffi_backend.c']
7
8
libraries = ['ffi']
8
9
- include_dirs = ['/usr/include/ffi',
9
10
- '/usr/include/libffi'] # may be changed by pkg-config
10
- + include_dirs = []
11
+ + include_dirs = os.environ['FFI_INC'].split(",") if 'FFI_INC' in os.environ else []
11
12
define_macros = []
12
13
library_dirs = []
13
14
extra_compile_args = []
14
- @@ -67,14 +66,7 @@
15
+ @@ -67,14 +66,7 @@ def ask_supports_thread():
15
16
sys.stderr.write("The above error message can be safely ignored\n")
16
17
17
18
def use_pkg_config():
You can’t perform that action at this time.
0 commit comments