Skip to content

Commit 55f57e6

Browse files
author
Gonzalo Atienza
committed
PyProjectRecipe and ldflag malformation
1 parent 3d3c545 commit 55f57e6

File tree

1 file changed

+17
-11
lines changed

1 file changed

+17
-11
lines changed

pythonforandroid/recipes/pynacl/__init__.py

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,33 @@
1-
from pythonforandroid.recipe import CompiledComponentsPythonRecipe
1+
from pythonforandroid.recipe import PyProjectRecipe
22
import os
33

44

5-
class PyNaCLRecipe(CompiledComponentsPythonRecipe):
5+
class PyNaCLRecipe(PyProjectRecipe):
66
name = 'pynacl'
77
version = '1.3.0'
88
url = 'https://github.com/pyca/pynacl/archive/refs/tags/{version}.tar.gz'
99

1010
depends = ['hostpython3', 'six', 'setuptools', 'cffi', 'libsodium']
1111
call_hostpython_via_targetpython = False
1212

13-
def get_recipe_env(self, arch):
14-
env = super().get_recipe_env(arch)
13+
def get_recipe_env(self, arch, **kwargs):
14+
env = super().get_recipe_env(arch, **kwargs)
1515
env['SODIUM_INSTALL'] = 'system'
1616

1717
libsodium_build_dir = self.get_recipe(
18-
'libsodium', self.ctx).get_build_dir(arch.arch)
19-
env['CFLAGS'] += ' -I{}'.format(os.path.join(libsodium_build_dir,
20-
'src/libsodium/include'))
21-
env['LDFLAGS'] += ' -L{}'.format(
22-
self.ctx.get_libs_dir(arch.arch) +
23-
'-L{}'.format(self.ctx.libs_dir)) + ' -L{}'.format(
24-
libsodium_build_dir)
18+
'libsodium', self.ctx
19+
).get_build_dir(arch.arch)
20+
21+
env['CFLAGS'] += ' -I{}'.format(
22+
os.path.join(libsodium_build_dir, 'src/libsodium/include')
23+
)
24+
25+
for ldflag in [
26+
self.ctx.get_libs_dir(arch.arch),
27+
self.ctx.libs_dir,
28+
libsodium_build_dir
29+
]:
30+
env['LDFLAGS'] += ' -L{}'.format(ldflag)
2531

2632
return env
2733

0 commit comments

Comments
 (0)