Skip to content

Commit

Permalink
patch openssl
Browse files Browse the repository at this point in the history
  • Loading branch information
obfusk committed Jan 2, 2021
1 parent 55604b0 commit 379687a
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
1 change: 1 addition & 0 deletions pythonforandroid/recipes/openssl/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ def build_arch(self, arch):
buildarch,
'-D__ANDROID_API__={}'.format(self.ctx.ndk_api),
]
self.apply_patch('standalone-ndk.patch', arch.arch)
shprint(perl, 'Configure', *config_args, _env=env)
self.apply_patch('disable-sover.patch', arch.arch)

Expand Down
25 changes: 25 additions & 0 deletions pythonforandroid/recipes/openssl/standalone-ndk.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
--- a/Configurations/15-android.conf 2021-01-02 03:49:06.227255874 +0100
+++ b/Configurations/15-android.conf 2021-01-02 03:47:35.758879033 +0100
@@ -107,16 +107,20 @@
}
} elsif (-f "$ndk/AndroidVersion.txt") { #"standalone toolchain"
my $cc = $user{CC} // "clang";
+ my $ndk_api = $ENV{NDK_API};
+ if ($ndk_api =~ m|^android-(\d+)$|) {
+ $api = $1;
+ }
# One can probably argue that both clang and gcc should be
# probed, but support for "standalone toolchain" was added
# *after* announcement that gcc is being phased out, so
# favouring clang is considered adequate. Those who insist
# have option to enforce test for gcc with CC=gcc.
- if (which("$triarch-$cc") !~ m|^$ndk|) {
+ if (which("$triarch$api-$cc") !~ m|^$ndk|) {
die "no NDK $triarch-$cc on \$PATH";
}
$user{CC} = $cc;
- $user{CROSS_COMPILE} = "$triarch-";
+ $user{CROSS_COMPILE} = "$triarch$api-";
} elsif ($user{CC} eq "clang") {
die "no NDK clang on \$PATH";
} else {

0 comments on commit 379687a

Please sign in to comment.