Skip to content

[libsodium] Updated to last version (1.0.16) #1442

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 10, 2018
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)
Copy link
Member

@AndreMiras AndreMiras Nov 4, 2018

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)