Skip to content

Commit e91310f

Browse files
committed
recipes: bump openssl to 3.0.x
extracted from kivy@6b66944
1 parent 0034516 commit e91310f

2 files changed

Lines changed: 14 additions & 35 deletions

File tree

pythonforandroid/recipes/openssl/__init__.py

Lines changed: 14 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from os.path import join
2+
from multiprocessing import cpu_count
23

34
from pythonforandroid.recipe import Recipe
45
from pythonforandroid.util import current_directory
@@ -44,35 +45,23 @@ class OpenSSLRecipe(Recipe):
4445
4546
'''
4647

47-
version = '1.1'
48-
'''the major minor version used to link our recipes'''
49-
50-
url_version = '1.1.1m'
51-
'''the version used to download our libraries'''
52-
53-
url = 'https://www.openssl.org/source/openssl-{url_version}.tar.gz'
48+
version = '3.0.18'
49+
url = 'https://www.openssl.org/source/openssl-{version}.tar.gz'
5450

5551
built_libraries = {
56-
'libcrypto{version}.so'.format(version=version): '.',
57-
'libssl{version}.so'.format(version=version): '.',
52+
'libcrypto.so': '.',
53+
'libssl.so': '.',
5854
}
5955

60-
@property
61-
def versioned_url(self):
62-
if self.url is None:
63-
return None
64-
return self.url.format(url_version=self.url_version)
65-
6656
def get_build_dir(self, arch):
6757
return join(
68-
self.get_build_container_dir(arch), self.name + self.version
58+
self.get_build_container_dir(arch), self.name + self.version[0]
6959
)
7060

7161
def include_flags(self, arch):
7262
'''Returns a string with the include folders'''
7363
openssl_includes = join(self.get_build_dir(arch.arch), 'include')
7464
return (' -I' + openssl_includes +
75-
' -I' + join(openssl_includes, 'internal') +
7665
' -I' + join(openssl_includes, 'openssl'))
7766

7867
def link_dirs_flags(self, arch):
@@ -85,7 +74,7 @@ def link_libs_flags(self):
8574
'''Returns a string with the appropriate `-l<lib>` flags to link with
8675
the openssl libs. This string is usually added to the environment
8776
variable `LIBS`'''
88-
return ' -lcrypto{version} -lssl{version}'.format(version=self.version)
77+
return ' -lcrypto -lssl'
8978

9079
def link_flags(self, arch):
9180
'''Returns a string with the flags to link with the openssl libraries
@@ -94,10 +83,12 @@ def link_flags(self, arch):
9483

9584
def get_recipe_env(self, arch=None):
9685
env = super().get_recipe_env(arch)
97-
env['OPENSSL_VERSION'] = self.version
98-
env['MAKE'] = 'make' # This removes the '-j5', which isn't safe
86+
env['OPENSSL_VERSION'] = self.version[0]
9987
env['CC'] = 'clang'
100-
env['ANDROID_NDK_HOME'] = self.ctx.ndk_dir
88+
env['ANDROID_NDK_ROOT'] = self.ctx.ndk_dir
89+
env["PATH"] = f"{self.ctx.ndk.llvm_bin_dir}:{env['PATH']}"
90+
env["CFLAGS"] += " -Wno-macro-redefined"
91+
env["MAKE"] = "make"
10192
return env
10293

10394
def select_build_arch(self, arch):
@@ -125,13 +116,12 @@ def build_arch(self, arch):
125116
'shared',
126117
'no-dso',
127118
'no-asm',
119+
'no-tests',
128120
buildarch,
129121
'-D__ANDROID_API__={}'.format(self.ctx.ndk_api),
130122
]
131123
shprint(perl, 'Configure', *config_args, _env=env)
132-
self.apply_patch('disable-sover.patch', arch.arch)
133-
134-
shprint(sh.make, 'build_libs', _env=env)
124+
shprint(sh.make, '-j', str(cpu_count()), _env=env)
135125

136126

137127
recipe = OpenSSLRecipe()

pythonforandroid/recipes/openssl/disable-sover.patch

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)