Skip to content

Commit

Permalink
Undo rename openssl x.so files
Browse files Browse the repository at this point in the history
  • Loading branch information
brussee committed Mar 15, 2016
1 parent 198e309 commit 72afe0f
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 28 deletions.
4 changes: 2 additions & 2 deletions pythonforandroid/recipes/libtorrent/user-config-openssl.patch
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@
+<linkflags>-L$(OPENSSL_BUILD_PATH)
<linkflags>-lgnustl_shared
<linkflags>-lpython2.7
+<linkflags>-lcryptox
+<linkflags>-lsslx
+<linkflags>-lcrypto
+<linkflags>-lssl
;
11 changes: 2 additions & 9 deletions pythonforandroid/recipes/openssl/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,14 @@

from pythonforandroid.toolchain import Recipe, shprint, current_directory
import sh
from os.path import join


class OpenSSLRecipe(Recipe):
version = '1.0.2g'
url = 'https://www.openssl.org/source/openssl-{version}.tar.gz'

def should_build(self, arch):
return not self.has_libs(arch, 'libsslx.so', 'libcryptox.so')
return not self.has_libs(arch, 'libssl.so', 'libcrypto.so')

def check_symbol(self, env, sofile, symbol):
nm = env.get('NM', 'nm')
Expand Down Expand Up @@ -45,9 +44,7 @@ def build_arch(self, arch):
perl = sh.Command('perl')
buildarch = self.select_build_arch(arch)
shprint(perl, 'Configure', 'shared', 'no-dso', 'no-krb5', buildarch, _env=env)

self.apply_patch('disable-sover.patch', arch.arch)
self.apply_patch('fix-shared-link.patch', arch.arch)

check_crypto = partial(self.check_symbol, env, 'libcrypto.so')
# check_ssl = partial(self.check_symbol, env, 'libssl.so')
Expand All @@ -57,10 +54,6 @@ def build_arch(self, arch):
break
shprint(sh.make, 'clean', _env=env)

# MUST BE RENAMED TO AVOID CONFLICTS WITH ANDROID'S DISTRIBUTED OPENSSL (IF INCLUDED INTO THE FINAL BUILD)
libs_dir = self.get_build_dir(arch.arch)
shprint(sh.cp, "-av", join(libs_dir, 'libcrypto.so'), join(libs_dir, 'libcryptox.so'))
shprint(sh.cp, "-av", join(libs_dir, 'libssl.so'), join(libs_dir, 'libsslx.so'))
self.install_libs(arch, 'libcryptox.so', 'libsslx.so')
self.install_libs(arch, 'libssl.so', 'libcrypto.so')

recipe = OpenSSLRecipe()
15 changes: 0 additions & 15 deletions pythonforandroid/recipes/openssl/fix-shared-link.patch

This file was deleted.

2 changes: 1 addition & 1 deletion pythonforandroid/recipes/python2/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ def do_python_build(self, arch):

env['CFLAGS'] = ' '.join([env['CFLAGS'], '-I{}'.format(openssl_inc_dir),
'-I{}/openssl'.format(openssl_inc_dir)])
env['LDFLAGS'] = ' '.join([env['LDFLAGS'], '-L{}'.format(openssl_libs_dir), '-lcryptox', '-lsslx'])
env['LDFLAGS'] = ' '.join([env['LDFLAGS'], '-L{}'.format(openssl_libs_dir), '-lcrypto', '-lssl'])

if 'sqlite3' in self.ctx.recipe_build_order:
info("Activate flags for sqlite3")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ index 2ad1aa3..ede793f 100644
+SSL=/path-to-ssl-build-dir
+_ssl _ssl.c \
+ -DUSE_SSL -I$(SSL)/include -I$(SSL)/include/openssl \
+ -L$(SSL) -lsslx -lcryptox
+ -L$(SSL) -lssl -lcrypto

# The crypt module is now disabled by default because it breaks builds
# on many systems (where -lcrypt is needed), e.g. Linux (I believe).
Expand Down

0 comments on commit 72afe0f

Please sign in to comment.