Skip to content

Commit 81ce8e9

Browse files
committed
improve openssl patch
1 parent 24cda50 commit 81ce8e9

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

pythonforandroid/recipes/openssl/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,8 @@ def build_arch(self, arch):
131131
buildarch,
132132
'-D__ANDROID_API__={}'.format(self.ctx.ndk_api),
133133
]
134-
self.apply_patch('standalone-ndk.patch', arch.arch)
134+
if self.ctx.ndk_standalone:
135+
self.apply_patch('standalone-ndk.patch', arch.arch)
135136
shprint(perl, 'Configure', *config_args, _env=env)
136137
self.apply_patch('disable-sover.patch', arch.arch)
137138

pythonforandroid/recipes/openssl/standalone-ndk.patch

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,19 @@
11
--- a/Configurations/15-android.conf 2021-01-02 03:49:06.227255874 +0100
2-
+++ b/Configurations/15-android.conf 2021-01-02 04:06:22.239571311 +0100
3-
@@ -107,16 +107,20 @@
2+
+++ b/Configurations/15-android.conf 2021-01-02 05:57:26.205585631 +0100
3+
@@ -8,7 +8,7 @@
4+
5+
my $android_ndk = {};
6+
my %triplet = (
7+
- arm => "arm-linux-androideabi",
8+
+ arm => "armv7a-linux-androideabi",
9+
arm64 => "aarch64-linux-android",
10+
mips => "mipsel-linux-android",
11+
mips64 => "mips64el-linux-android",
12+
@@ -107,16 +107,19 @@
413
}
514
} elsif (-f "$ndk/AndroidVersion.txt") { #"standalone toolchain"
615
my $cc = $user{CC} // "clang";
7-
+ my $ndk_api = $ENV{NDK_API};
8-
+ if ($ndk_api =~ m|^android-(\d+)$|) {
16+
+ if ($ENV{NDK_API} =~ m|^android-(\d+)$|) {
917
+ $api = $1;
1018
+ }
1119
# One can probably argue that both clang and gcc should be

0 commit comments

Comments
 (0)