Skip to content

Commit 3762c88

Browse files
authored
Merge pull request #3233 from T-Dynamos/cffi-fix
`cffi`: fix build
2 parents 7593f9d + b4accdf commit 3762c88

File tree

3 files changed

+10
-17
lines changed

3 files changed

+10
-17
lines changed

pythonforandroid/recipes/cffi/__init__.py

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,19 @@
11
import os
2-
from pythonforandroid.recipe import CompiledComponentsPythonRecipe
2+
from pythonforandroid.recipe import PyProjectRecipe
33

44

5-
class CffiRecipe(CompiledComponentsPythonRecipe):
5+
class CffiRecipe(PyProjectRecipe):
66
"""
77
Extra system dependencies: autoconf, automake and libtool.
88
"""
99
name = 'cffi'
10-
version = '1.15.1'
11-
url = 'https://pypi.python.org/packages/source/c/cffi/cffi-{version}.tar.gz'
10+
version = '2.0.0'
11+
url = 'https://github.com/python-cffi/cffi/archive/refs/tags/v{version}.tar.gz'
1212

13-
depends = ['setuptools', 'pycparser', 'libffi']
13+
depends = ['pycparser', 'libffi']
1414

1515
patches = ['disable-pkg-config.patch']
1616

17-
# call_hostpython_via_targetpython = False
18-
install_in_hostpython = True
19-
2017
def get_hostrecipe_env(self, arch=None):
2118
# fixes missing ffi.h on some host systems (e.g. gentoo)
2219
env = super().get_hostrecipe_env(arch)
@@ -25,8 +22,8 @@ def get_hostrecipe_env(self, arch=None):
2522
env['FFI_INC'] = ",".join(includes)
2623
return env
2724

28-
def get_recipe_env(self, arch=None):
29-
env = super().get_recipe_env(arch)
25+
def get_recipe_env(self, arch=None, **kwargs):
26+
env = super().get_recipe_env(arch, **kwargs)
3027
libffi = self.get_recipe('libffi', self.ctx)
3128
includes = libffi.get_include_dirs(arch)
3229
env['CFLAGS'] = ' -I'.join([env.get('CFLAGS', '')] + includes)
@@ -36,10 +33,6 @@ def get_recipe_env(self, arch=None):
3633
env['LDFLAGS'] += ' -L{}'.format(os.path.join(self.ctx.bootstrap.build_dir, 'libs', arch.arch))
3734
# required for libc and libdl
3835
env['LDFLAGS'] += ' -L{}'.format(arch.ndk_lib_dir_versioned)
39-
env['PYTHONPATH'] = ':'.join([
40-
self.ctx.get_site_packages_dir(arch),
41-
env['BUILDLIB_PATH'],
42-
])
4336
env['LDFLAGS'] += ' -L{}'.format(self.ctx.python_recipe.link_root(arch.arch))
4437
env['LDFLAGS'] += ' -lpython{}'.format(self.ctx.python_recipe.link_version)
4538
return env

pythonforandroid/recipes/cryptography/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
class CryptographyRecipe(RustCompiledComponentsRecipe):
66

77
name = 'cryptography'
8-
version = '42.0.1'
8+
version = '46.0.3'
99
url = 'https://github.com/pyca/cryptography/archive/refs/tags/{version}.tar.gz'
10-
depends = ['openssl']
10+
depends = ['openssl', 'cffi']
1111

1212
def get_recipe_env(self, arch, **kwargs):
1313
env = super().get_recipe_env(arch, **kwargs)

pythonforandroid/recipes/libffi/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def build_arch(self, arch):
3535
shprint(sh.make, '-j', str(cpu_count()), 'libffi.la', _env=env)
3636

3737
def get_include_dirs(self, arch):
38-
return [join(self.get_build_dir(arch.arch), 'include')]
38+
return [join(self.get_build_dir(arch), 'include')]
3939

4040

4141
recipe = LibffiRecipe()

0 commit comments

Comments
 (0)