2017-08-13 03:24:00 +02:00
|
|
|
from os.path import join
|
2022-12-02 21:15:34 +01:00
|
|
|
from pythonforandroid.recipe import CppCompiledComponentsPythonRecipe
|
2017-08-13 03:24:00 +02:00
|
|
|
|
|
|
|
|
2022-12-02 21:15:34 +01:00
|
|
|
class PyICURecipe(CppCompiledComponentsPythonRecipe):
|
2017-08-13 03:24:00 +02:00
|
|
|
version = '1.9.2'
|
2022-12-02 21:15:34 +01:00
|
|
|
url = ('https://pypi.python.org/packages/source/P/PyICU/'
|
|
|
|
'PyICU-{version}.tar.gz')
|
2019-03-30 21:58:45 +01:00
|
|
|
depends = ["icu"]
|
2022-12-02 21:15:34 +01:00
|
|
|
patches = ['locale.patch']
|
2017-08-13 03:24:00 +02:00
|
|
|
|
|
|
|
def get_recipe_env(self, arch):
|
2022-12-02 21:15:34 +01:00
|
|
|
env = super().get_recipe_env(arch)
|
2017-08-13 03:24:00 +02:00
|
|
|
|
|
|
|
icu_include = join(
|
2022-12-02 21:15:34 +01:00
|
|
|
self.ctx.get_python_install_dir(arch.arch), "include", "icu")
|
2017-08-13 03:24:00 +02:00
|
|
|
|
2022-12-02 21:15:34 +01:00
|
|
|
icu_recipe = self.get_recipe('icu', self.ctx)
|
|
|
|
icu_link_libs = icu_recipe.built_libraries.keys()
|
|
|
|
env["PYICU_LIBRARIES"] = ":".join(lib[3:-3] for lib in icu_link_libs)
|
|
|
|
env["CPPFLAGS"] += " -I" + icu_include
|
|
|
|
env["LDFLAGS"] += " -L" + join(
|
|
|
|
icu_recipe.get_build_dir(arch.arch), "icu_build", "lib"
|
|
|
|
)
|
2017-08-13 03:24:00 +02:00
|
|
|
|
2022-12-02 21:15:34 +01:00
|
|
|
return env
|
2017-08-13 03:24:00 +02:00
|
|
|
|
|
|
|
|
|
|
|
recipe = PyICURecipe()
|