From cfa7f0cb42672b651a7b34715f9dc4bf11536599 Mon Sep 17 00:00:00 2001 From: Matthieu Gautier Date: Wed, 3 May 2017 11:09:12 +0200 Subject: [PATCH] =?UTF-8?q?Use=20ICU=C2=A0data=20as=20external=20archive?= =?UTF-8?q?=20on=20android=20platform.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On android platform, we load the ICU data as external data, not embeded in the kiwix-lib. So we need to generate correctly the dat file and use it in kiwix-android. --- dependencies.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/dependencies.py b/dependencies.py index afe31fc..8bf08dc 100644 --- a/dependencies.py +++ b/dependencies.py @@ -190,7 +190,13 @@ class Icu(Dependency): class Builder(MakeBuilder): subsource_dir = "source" - configure_option = "--disable-samples --disable-tests --disable-extras --disable-dyload" + + @property + def configure_option(self): + options = "--disable-samples --disable-tests --disable-extras --disable-dyload" + if self.buildEnv.platform_info.build == 'android': + options += " --with-data-packaging=archive" + return options class Icu_native(Icu): @@ -347,6 +353,7 @@ class KiwixAndroid(Dependency): except FileNotFoundError: pass shutil.copytree(pj(self.buildEnv.install_dir, 'kiwix-lib'), pj(self.build_path, 'kiwixlib', 'src', 'main')) + shutil.copy2(pj(self.buildEnv.install_dir, 'share', 'icu', '58.2', 'icudt58l.dat'), pj(self.build_path, 'app', 'src', 'main', 'assets', 'icudt.dat')) class KiwixCustomApp(Dependency): @@ -409,6 +416,7 @@ class KiwixCustomApp(Dependency): except FileNotFoundError: pass shutil.copytree(pj(self.buildEnv.install_dir, 'kiwix-lib'), pj(self.build_path, 'kiwixlib', 'src', 'main')) + shutil.copy2(pj(self.buildEnv.install_dir, 'share', 'icu', '58.2', 'icudt58l.dat'), pj(self.build_path, 'app', 'src', 'main', 'assets', 'icudt.dat')) # Generate custom directory try: