openssl recipe version changed to 1.0.2l. Removed kivy recipe since it's no longer used.
This commit is contained in:
parent
da1ce1cc4e
commit
589e0fbb95
4 changed files with 99 additions and 54 deletions
|
@ -1,54 +0,0 @@
|
||||||
|
|
||||||
from pythonforandroid.toolchain import CythonRecipe, Recipe, shprint, current_directory, ArchARM
|
|
||||||
from os.path import exists, join
|
|
||||||
import sh
|
|
||||||
import glob
|
|
||||||
|
|
||||||
|
|
||||||
class KivyRecipe(CythonRecipe):
|
|
||||||
version = '1.10.0'
|
|
||||||
url = 'https://github.com/kivy/kivy/archive/{version}.zip'
|
|
||||||
name = 'kivy'
|
|
||||||
|
|
||||||
depends = [('sdl2', 'pygame'), 'pyjnius']
|
|
||||||
|
|
||||||
call_hostpython_via_targetpython = False
|
|
||||||
# patches = ['setargv.patch']
|
|
||||||
|
|
||||||
|
|
||||||
def cythonize_build(self, env, build_dir='.'):
|
|
||||||
super(KivyRecipe, self).cythonize_build(env, build_dir=build_dir)
|
|
||||||
|
|
||||||
if not exists(join(build_dir, 'kivy', 'include')):
|
|
||||||
return
|
|
||||||
|
|
||||||
# If kivy is new enough to use the include dir, copy it
|
|
||||||
# manually to the right location as we bypass this stage of
|
|
||||||
# the build
|
|
||||||
with current_directory(build_dir):
|
|
||||||
build_libs_dirs = glob.glob(join('build', 'lib.*'))
|
|
||||||
|
|
||||||
for dirn in build_libs_dirs:
|
|
||||||
shprint(sh.cp, '-r', join('kivy', 'include'),
|
|
||||||
join(dirn, 'kivy'))
|
|
||||||
|
|
||||||
def get_recipe_env(self, arch):
|
|
||||||
env = super(KivyRecipe, self).get_recipe_env(arch)
|
|
||||||
|
|
||||||
target_python = Recipe.get_recipe('python2', self.ctx).get_build_dir(arch.arch)
|
|
||||||
env['PYTHON_ROOT'] = join(target_python, 'python-install')
|
|
||||||
env['CFLAGS'] += ' -I' + env['PYTHON_ROOT'] + '/include/python2.7'
|
|
||||||
env['LDFLAGS'] += ' -L' + env['PYTHON_ROOT'] + '/lib' + ' -lpython2.7'
|
|
||||||
|
|
||||||
if 'sdl2' in self.ctx.recipe_build_order:
|
|
||||||
env['USE_SDL2'] = '1'
|
|
||||||
env['KIVY_SDL2_PATH'] = ':'.join([
|
|
||||||
join(self.ctx.bootstrap.build_dir, 'jni', 'SDL', 'include'),
|
|
||||||
join(self.ctx.bootstrap.build_dir, 'jni', 'SDL2_image'),
|
|
||||||
join(self.ctx.bootstrap.build_dir, 'jni', 'SDL2_mixer'),
|
|
||||||
join(self.ctx.bootstrap.build_dir, 'jni', 'SDL2_ttf'),
|
|
||||||
])
|
|
||||||
|
|
||||||
return env
|
|
||||||
|
|
||||||
recipe = KivyRecipe()
|
|
63
recipes/openssl/__init__.py
Normal file
63
recipes/openssl/__init__.py
Normal file
|
@ -0,0 +1,63 @@
|
||||||
|
from functools import partial
|
||||||
|
|
||||||
|
from pythonforandroid.toolchain import Recipe, shprint, current_directory
|
||||||
|
import sh
|
||||||
|
|
||||||
|
|
||||||
|
class OpenSSLRecipe(Recipe):
|
||||||
|
version = '1.0.2l'
|
||||||
|
url = 'https://www.openssl.org/source/openssl-{version}.tar.gz'
|
||||||
|
|
||||||
|
def should_build(self, arch):
|
||||||
|
return not self.has_libs(arch, 'libssl' + self.version + '.so',
|
||||||
|
'libcrypto' + self.version + '.so')
|
||||||
|
|
||||||
|
def check_symbol(self, env, sofile, symbol):
|
||||||
|
nm = env.get('NM', 'nm')
|
||||||
|
syms = sh.sh('-c', "{} -gp {} | cut -d' ' -f3".format(
|
||||||
|
nm, sofile), _env=env).splitlines()
|
||||||
|
if symbol in syms:
|
||||||
|
return True
|
||||||
|
print('{} missing symbol {}; rebuilding'.format(sofile, symbol))
|
||||||
|
return False
|
||||||
|
|
||||||
|
def get_recipe_env(self, arch=None):
|
||||||
|
env = super(OpenSSLRecipe, self).get_recipe_env(arch)
|
||||||
|
env['OPENSSL_VERSION'] = self.version
|
||||||
|
env['CFLAGS'] += ' ' + env['LDFLAGS']
|
||||||
|
env['CC'] += ' ' + env['LDFLAGS']
|
||||||
|
return env
|
||||||
|
|
||||||
|
def select_build_arch(self, arch):
|
||||||
|
aname = arch.arch
|
||||||
|
if 'arm64' in aname:
|
||||||
|
return 'linux-aarch64'
|
||||||
|
if 'v7a' in aname:
|
||||||
|
return 'android-armv7'
|
||||||
|
if 'arm' in aname:
|
||||||
|
return 'android'
|
||||||
|
return 'linux-armv4'
|
||||||
|
|
||||||
|
def build_arch(self, arch):
|
||||||
|
env = self.get_recipe_env(arch)
|
||||||
|
with current_directory(self.get_build_dir(arch.arch)):
|
||||||
|
# sh fails with code 255 trying to execute ./Configure
|
||||||
|
# so instead we manually run perl passing in Configure
|
||||||
|
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('rename-shared-lib.patch', arch.arch)
|
||||||
|
|
||||||
|
# check_ssl = partial(self.check_symbol, env, 'libssl' + self.version + '.so')
|
||||||
|
check_crypto = partial(self.check_symbol, env, 'libcrypto' + self.version + '.so')
|
||||||
|
while True:
|
||||||
|
shprint(sh.make, 'build_libs', _env=env)
|
||||||
|
if all(map(check_crypto, ('SSLeay', 'MD5_Transform', 'MD4_Init'))):
|
||||||
|
break
|
||||||
|
shprint(sh.make, 'clean', _env=env)
|
||||||
|
|
||||||
|
self.install_libs(arch, 'libssl' + self.version + '.so',
|
||||||
|
'libcrypto' + self.version + '.so')
|
||||||
|
|
||||||
|
recipe = OpenSSLRecipe()
|
20
recipes/openssl/disable-sover.patch
Normal file
20
recipes/openssl/disable-sover.patch
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
--- openssl/Makefile 2016-01-28 17:26:49.159522273 +0100
|
||||||
|
+++ b/Makefile 2016-01-28 17:26:54.358438402 +0100
|
||||||
|
@@ -342,7 +342,7 @@
|
||||||
|
link-shared:
|
||||||
|
@ set -e; for i in $(SHLIBDIRS); do \
|
||||||
|
$(MAKE) -f $(HERE)/Makefile.shared -e $(BUILDENV) \
|
||||||
|
- LIBNAME=$$i LIBVERSION=$(SHLIB_MAJOR).$(SHLIB_MINOR) \
|
||||||
|
+ LIBNAME=$$i LIBVERSION= \
|
||||||
|
LIBCOMPATVERSIONS=";$(SHLIB_VERSION_HISTORY)" \
|
||||||
|
symlink.$(SHLIB_TARGET); \
|
||||||
|
libs="$$libs -l$$i"; \
|
||||||
|
@@ -356,7 +356,7 @@
|
||||||
|
libs="$(LIBKRB5) $$libs"; \
|
||||||
|
fi; \
|
||||||
|
$(CLEARENV) && $(MAKE) -f Makefile.shared -e $(BUILDENV) \
|
||||||
|
- LIBNAME=$$i LIBVERSION=$(SHLIB_MAJOR).$(SHLIB_MINOR) \
|
||||||
|
+ LIBNAME=$$i LIBVERSION= \
|
||||||
|
LIBCOMPATVERSIONS=";$(SHLIB_VERSION_HISTORY)" \
|
||||||
|
LIBDEPS="$$libs $(EX_LIBS)" \
|
||||||
|
link_a.$(SHLIB_TARGET); \
|
16
recipes/openssl/rename-shared-lib.patch
Normal file
16
recipes/openssl/rename-shared-lib.patch
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
--- openssl/Makefile.shared 2016-05-03 15:44:42.000000000 +0200
|
||||||
|
+++ patch/Makefile.shared 2016-07-14 00:08:37.268792948 +0200
|
||||||
|
@@ -147,11 +147,11 @@
|
||||||
|
DETECT_GNU_LD=($(CC) -Wl,-V /dev/null 2>&1 | grep '^GNU ld' )>/dev/null
|
||||||
|
|
||||||
|
DO_GNU_SO=$(CALC_VERSIONS); \
|
||||||
|
- SHLIB=lib$(LIBNAME).so; \
|
||||||
|
+ SHLIB=lib$(LIBNAME)$(OPENSSL_VERSION).so; \
|
||||||
|
SHLIB_SUFFIX=; \
|
||||||
|
ALLSYMSFLAGS='-Wl,--whole-archive'; \
|
||||||
|
NOALLSYMSFLAGS='-Wl,--no-whole-archive'; \
|
||||||
|
- SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared -Wl,-Bsymbolic -Wl,-soname=$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX"
|
||||||
|
+ SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared -Wl,-Bsymbolic -Wl,-soname=$$SHLIB"
|
||||||
|
|
||||||
|
DO_GNU_APP=LDFLAGS="$(CFLAGS) -Wl,-rpath,$(LIBRPATH)"
|
||||||
|
|
Loading…
Reference in a new issue