Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions pythonforandroid/recipes/libsodium/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@


class LibsodiumRecipe(Recipe):
version = '1.0.8'
version = '1.0.16'
url = 'https://github.com/jedisct1/libsodium/releases/download/{version}/libsodium-{version}.tar.gz'
depends = ['python2']
patches = ['size_max_fix.patch']

def should_build(self, arch):
super(LibsodiumRecipe, self).should_build(arch)
Expand All @@ -17,7 +18,7 @@ def build_arch(self, arch):
env = self.get_recipe_env(arch)
with current_directory(self.get_build_dir(arch.arch)):
bash = sh.Command('bash')
shprint(bash, 'configure', '--enable-minimal', '--disable-soname-versions', '--host=arm-linux-androideabi', '--enable-shared', _env=env)

@AndreMiras AndreMiras Nov 4, 2018

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just because I'm curious, why did we skip the --enable-minimal flag?
Edit: never mind, I overlooked your PR comment, thanks!

shprint(bash, 'configure', '--disable-soname-versions', '--host=arm-linux-androideabi', '--enable-shared', _env=env)
shprint(sh.make, _env=env)
shutil.copyfile('src/libsodium/.libs/libsodium.so', join(self.ctx.get_libs_dir(arch.arch), 'libsodium.so'))

Expand Down
12 changes: 12 additions & 0 deletions pythonforandroid/recipes/libsodium/size_max_fix.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
diff -urN libsodium-1.0.16.ori/src/libsodium/include/sodium/export.h libsodium-1.0.16/src/libsodium/include/sodium/export.h
--- libsodium-1.0.16.ori/src/libsodium/include/sodium/export.h 2017-12-12 00:03:07.000000000 +0100
+++ libsodium-1.0.16/src/libsodium/include/sodium/export.h 2018-10-31 09:46:06.051189444 +0100
@@ -47,6 +47,8 @@
# endif
#endif

+#include <limits.h>
+
#define SODIUM_MIN(A, B) ((A) < (B) ? (A) : (B))
#define SODIUM_SIZE_MAX SODIUM_MIN(UINT64_MAX, SIZE_MAX)