2019-03-30 21:58:45 +01:00
|
|
|
import os
|
2017-08-13 03:24:00 +02:00
|
|
|
from pythonforandroid.recipe import PythonRecipe
|
|
|
|
|
|
|
|
|
2019-03-30 21:58:45 +01:00
|
|
|
# TODO: CompiledComponentsPythonRecipe
|
2017-08-13 03:24:00 +02:00
|
|
|
class Pysha3Recipe(PythonRecipe):
|
|
|
|
version = '1.0.2'
|
|
|
|
url = 'https://github.com/tiran/pysha3/archive/{version}.tar.gz'
|
2019-03-30 21:58:45 +01:00
|
|
|
depends = ['setuptools']
|
|
|
|
call_hostpython_via_targetpython = False
|
2017-08-13 03:24:00 +02:00
|
|
|
|
2019-03-30 21:58:45 +01:00
|
|
|
def get_recipe_env(self, arch=None, with_flags_in_cc=True):
|
2022-12-02 21:15:34 +01:00
|
|
|
env = super().get_recipe_env(arch, with_flags_in_cc)
|
2019-03-30 21:58:45 +01:00
|
|
|
# CFLAGS may only be used to specify C compiler flags, for macro definitions use CPPFLAGS
|
|
|
|
env['CPPFLAGS'] = env['CFLAGS']
|
|
|
|
env['CFLAGS'] = ''
|
|
|
|
# LDFLAGS may only be used to specify linker flags, for libraries use LIBS
|
2022-12-02 21:15:34 +01:00
|
|
|
env['LDFLAGS'] = env['LDFLAGS'].replace('-lm', '')
|
2019-03-30 21:58:45 +01:00
|
|
|
env['LDFLAGS'] += ' -L{}'.format(os.path.join(self.ctx.bootstrap.build_dir, 'libs', arch.arch))
|
|
|
|
env['LIBS'] = ' -lm'
|
|
|
|
env['LDSHARED'] += env['LIBS']
|
|
|
|
return env
|
2017-08-13 03:24:00 +02:00
|
|
|
|
|
|
|
|
|
|
|
recipe = Pysha3Recipe()
|