Skip to content

Commit 8d71dbe

Browse files
committed
cryptography now builds
1 parent 7ea8be5 commit 8d71dbe

4 files changed

Lines changed: 18 additions & 7 deletions

File tree

pythonforandroid/recipe.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -553,13 +553,15 @@ def clean_build(self, arch=None):
553553
# doesn't persist in site-packages
554554
shutil.rmtree(self.ctx.python_installs_dir)
555555

556-
def install_libs(self, arch, *libs):
556+
def install_libs(self, arch, *libs, **links):
557557
libs_dir = self.ctx.get_libs_dir(arch.arch)
558558
if not libs:
559559
warning('install_libs called with no libraries to install!')
560560
return
561561
args = libs + (libs_dir,)
562562
shprint(sh.cp, *args)
563+
for lib, link in links.iteritems():
564+
shprint(sh.ln, '-s', join(libs_dir, lib), join(libs_dir, link))
563565

564566
def has_libs(self, arch, *libs):
565567
return all(map(lambda l: self.ctx.has_lib(arch.arch, l), libs))
@@ -879,8 +881,12 @@ def build_compiled_components(self, arch):
879881
hostpython = sh.Command(self.hostpython_location)
880882
if self.install_in_hostpython:
881883
shprint(hostpython, 'setup.py', 'clean', '--all', _env=env)
884+
882885
shprint(hostpython, 'setup.py', self.build_cmd, '-v',
883886
_env=env, *self.setup_extra_args)
887+
888+
# hostpython('setup.py', self.build_cmd, '-v', _env=env, _fg=True)
889+
884890
build_dir = glob.glob('build/lib.*')[0]
885891
shprint(sh.find, build_dir, '-name', '"*.o"', '-exec',
886892
env['STRIP'], '{}', ';', _env=env)

pythonforandroid/recipes/cryptography/__init__.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
class CryptographyRecipe(CompiledComponentsPythonRecipe):
55
name = 'cryptography'
66
version = 'master'
7-
url = 'git+file:///home/enoch/cryptography'
7+
url = 'git+https://github.com/pyca/cryptography.git'
88
depends = ['host_cffi', 'host_cython', 'host_setuptools', 'host_sh',
99
'idna', 'asn1crypto', 'six', 'cffi',
1010
'enum34', 'ipaddress', 'openssl']
@@ -17,7 +17,11 @@ def get_recipe_env(self, arch):
1717
dirs = recipe.get_include_dirs(arch)
1818
recipe = self.get_recipe('openssl', self.ctx)
1919
dirs += recipe.get_include_dirs(arch)
20-
env['CFLAGS'] += ''.join([' -I' + dir for dir in dirs])
20+
# Required: ln -s \
21+
# ~/Android/Sdk/ndk-bundle/sysroot/usr/include/arm-linux-androideabi/asm/unistd-common.h \
22+
# ~/Android/CrystaX/platforms/android-19/arch-arm/usr/include
23+
env['CFLAGS'] += (' -include unistd-common.h' +
24+
''.join([' -I' + dir for dir in dirs]))
2125
return env
2226

2327

pythonforandroid/recipes/kivy/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
class KivyRecipe(CythonRecipe):
99
name = 'kivy'
1010
version = 'master'
11-
url = 'git+file:///home/enoch/kivy'
11+
url = 'git+https://github.com/kivy/kivy.git'
1212

1313
depends = [('sdl2', 'pygame'), 'pyjnius']
1414

pythonforandroid/recipes/openssl/__init__.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,10 @@ def build_arch(self, arch):
6060
if all(map(check_crypto, ('SSLeay', 'MD5_Transform', 'MD4_Init'))):
6161
break
6262
shprint(sh.make, 'clean', _env=env)
63-
64-
self.install_libs(arch, 'libssl' + self.version + '.so',
65-
'libcrypto' + self.version + '.so')
63+
libn = 'libssl', 'libcrypto'
64+
libs = [lib + self.version + '.so' for lib in libn]
65+
lnks = {lib + self.version + '.so': lib + '.so' for lib in libn}
66+
self.install_libs(arch, *libs, **lnks)
6667

6768
def get_include_dirs(self, arch):
6869
return [join(self.get_build_dir(arch.arch), 'include')]

0 commit comments

Comments
 (0)