Skip to content

Commit 3ae66d5

Browse files
author
gon
committed
libsodium-recipe-update to url
libsodium-recipe-update to url libsodium-recipe-update to url libsodium-recipe-update to url libsodium-recipe-update to url libsodium-recipe-update to url
1 parent fbb40ec commit 3ae66d5

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

pythonforandroid/recipes/libsodium/__init__.py

+10-1
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,24 @@
33
from pythonforandroid.logger import shprint
44
from multiprocessing import cpu_count
55
import sh
6+
from packaging import version as packaging_version
67

78

89
class LibsodiumRecipe(Recipe):
910
version = '1.0.16'
10-
url = 'https://github.com/jedisct1/libsodium/releases/download/{version}/libsodium-{version}.tar.gz'
11+
url = 'https://github.com/jedisct1/libsodium/releases/download/{}/libsodium-{}.tar.gz'
1112
depends = []
1213
patches = ['size_max_fix.patch']
1314
built_libraries = {'libsodium.so': 'src/libsodium/.libs'}
1415

16+
@property
17+
def versioned_url(self):
18+
asked_version = packaging_version.parse(self.version)
19+
if asked_version > packaging_version.parse('1.0.16'):
20+
return self._url.format(self.version + '-RELEASE', self.version)
21+
else:
22+
return self._url.format(self.version, self.version)
23+
1524
def build_arch(self, arch):
1625
env = self.get_recipe_env(arch)
1726
with current_directory(self.get_build_dir(arch.arch)):

0 commit comments

Comments
 (0)