8000 Merge pull request #1627 from AndreMiras/feature/ticket1360_cleanup_L… · inclement/python-for-android@adcc591 · GitHub
[go: up one dir, main page]

Skip to content

Commit adcc591

Browse files
authored
Merge pull request kivy#1627 from AndreMiras/feature/ticket1360_cleanup_LDSHARED
Clean-up LDSHARED, fixes kivy#1360
2 parents 99e9664 + bc0c378 commit adcc591

File tree

2 files changed

+8
-30
lines changed

2 files changed

+8
-30
lines changed

pythonforandroid/recipes/pycryptodome/__init__.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,5 @@ class PycryptodomeRecipe(PythonRecipe):
66
url = 'https://github.com/Legrandin/pycryptodome/archive/v{version}.tar.gz'
77
depends = ['setuptools', 'cffi']
88

9-
def get_recipe_env(self, arch=None, with_flags_in_cc=True):
10-
env = super(PycryptodomeRecipe, self).get_recipe_env(arch, with_flags_in_cc)
11-
# sets linker to use the correct gcc (cross compiler)
12-
env['LDSHARED'] = env['CC'] + ' -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions'
13-
return env
14-
159

1610
recipe = PycryptodomeRecipe()

pythonforandroid/recipes/secp256k1/__init__.py

Lines changed: 8 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
import os
2-
from pythonforandroid.recipe import PythonRecipe
2+
from pythonforandroid.recipe import CppCompiledComponentsPythonRecipe
33

44

5-
class Secp256k1Recipe(PythonRecipe):
5+
class Secp256k1Recipe(CppCompiledComponentsPythonRecipe):
66

7-
url = 'https://github.com/ludbb/secp256k1-py/archive/master.zip'
7+
version = '0.13.2.4'
8+
url = 'https://github.com/ludbb/secp256k1-py/archive/{version}.tar.gz'
89

910
call_hostpython_via_targetpython = False
1011

@@ -17,29 +18,12 @@ class Secp256k1Recipe(PythonRecipe):
8000
1718
"cross_compile.patch", "drop_setup_requires.patch",
1819
"pkg-config.patch", "find_lib.patch", "no-download.patch"]
1920

20-
def get_recipe_env(self, arch=None, with_flags_in_cc=True):
21-
env = super(Secp256k1Recipe, self).get_recipe_env(arch, with_flags_in_cc)
22-
# sets linker to use the correct gcc (cross compiler)
23-
env['LDSHARED'] = env['CC'] + ' -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions'
21+
def get_recipe_env(self, arch=None):
22+
env = super(Secp256k1Recipe, self).get_recipe_env(arch)
2423
libsecp256k1 = self.get_recipe('libsecp256k1', self.ctx)
2524
libsecp256k1_dir = libsecp256k1.get_build_dir(arch.arch)
26-
env['LDFLAGS'] += ' -L{}'.format(libsecp256k1_dir)
27-
env['CFLAGS'] = ' -I' + os.path.join(libsecp256k1_dir, 'include')
28-
# only keeps major.minor (discards patch)
29-
python_version = self.ctx.python_recipe.version[0:3]
30-
# required additional library and path for Crystax
31-
if self.ctx.ndk == 'crystax':
32-
ndk_dir_python = os.path.join(self.ctx.ndk_dir, 'sources/python/', python_version)
33-
env['LDFLAGS'] += ' -L{}'.format(os.path.join(ndk_dir_python, 'libs', arch.arch))
34-
env['LDFLAGS'] += ' -lpython{}m'.format(python_version)
35-
# until `pythonforandroid/archs.py` gets merged upstr 7CAF eam:
36-
# https://github.com/kivy/python-for-android/pull/1250/files#diff-569e13021e33ced8b54385f55b49cbe6
37-
env['CFLAGS'] += ' -I{}/include/python/'.format(ndk_dir_python)
38-
else:
39-
env['PYTHON_ROOT'] = self.ctx.get_python_install_dir()
40-
env['CFLAGS'] += ' -I' + env['PYTHON_ROOT'] + '/include/python{}'.format(python_version)
41-
env['LDFLAGS'] += " -lpython{}".format(python_version)
42-
env['LDFLAGS'] += " -lsecp256k1"
25+
env['CFLAGS'] += ' -I' + os.path.join(libsecp256k1_dir, 'include')
26+
env['LDFLAGS'] += ' -L{} -lsecp256k1'.format(libsecp256k1_dir)
4327
return env
4428

4529

0 commit comments

Comments
 (0)
0