From 5384f07afa2d382d00f82e583ce9fc3309722521 Mon Sep 17 00:00:00 2001 From: Ronan Le Martret Date: Tue, 26 Aug 2014 11:45:41 +0200 Subject: [PATCH] Fix libpinyin for cross compile build. Change-Id: I4d4526fe3292f41789423644d14ce3843f0a572e Signed-off-by: Ronan Le Martret --- .../libpinyin/files/Fix_Crosscompile.patch | 27 ++++++++++++++++++++++ recipes-tizen/libpinyin/libpinyin-extraconf.inc | 21 +++++++++++++++++ recipes-tizen/libpinyin/libpinyin.inc | 2 +- 3 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 recipes-tizen/libpinyin/files/Fix_Crosscompile.patch diff --git a/recipes-tizen/libpinyin/files/Fix_Crosscompile.patch b/recipes-tizen/libpinyin/files/Fix_Crosscompile.patch new file mode 100644 index 0000000..661b35c --- /dev/null +++ b/recipes-tizen/libpinyin/files/Fix_Crosscompile.patch @@ -0,0 +1,27 @@ +diff --git a/data/Makefile.am b/data/Makefile.am +index 1e80530..90d4e02 100644 +--- a/data/Makefile.am ++++ b/data/Makefile.am +@@ -47,6 +47,9 @@ libpinyin_dbdir = $(libdir)/libpinyin/data + + CLEANFILES = $(binary_model_data) + ++utils_storage = ../utils/storage ++utils_training = ../utils/training ++ + interpolation2.text: + wget http://downloads.sourceforge.net/libpinyin/models/model7.text.tar.gz + tar xvf model7.text.tar.gz -C $(top_srcdir)/data +@@ -56,9 +59,9 @@ $(tablefiles): interpolation2.text + + bigram.db: $(textual_model_data) + $(RM) $(binary_model_data) +- ../utils/storage/gen_binary_files --table-dir $(top_srcdir)/data +- ../utils/storage/import_interpolation --table-dir $(top_srcdir)/data < $(top_srcdir)/data/interpolation2.text +- ../utils/training/gen_unigram --table-dir $(top_srcdir)/data ++ $(utils_storage)/gen_binary_files --table-dir $(top_srcdir)/data ++ $(utils_storage)/import_interpolation --table-dir $(top_srcdir)/data < $(top_srcdir)/data/interpolation2.text ++ $(utils_training)/gen_unigram --table-dir $(top_srcdir)/data + + phrase_index.bin pinyin_index.bin $(binfiles): bigram.db + diff --git a/recipes-tizen/libpinyin/libpinyin-extraconf.inc b/recipes-tizen/libpinyin/libpinyin-extraconf.inc index e69de29..e735a20 100644 --- a/recipes-tizen/libpinyin/libpinyin-extraconf.inc +++ b/recipes-tizen/libpinyin/libpinyin-extraconf.inc @@ -0,0 +1,21 @@ +SRC_URI += "file://Fix_Crosscompile.patch" + +DEPENDS_append_class-target += "libpinyin-native" + +EXTRA_OEMAKE_class-target += " utils_storage=${STAGING_BINDIR_NATIVE}" +EXTRA_OEMAKE_class-target += " utils_training=${STAGING_BINDIR_NATIVE}" + +do_compile() { + cd ${S} + LANG=C + export LANG + unset DISPLAY + LD_AS_NEEDED=1; export LD_AS_NEEDED ; + + autotools_do_configure + oe_runmake -j16 + +} + + + diff --git a/recipes-tizen/libpinyin/libpinyin.inc b/recipes-tizen/libpinyin/libpinyin.inc index 2aaf75f..1067e84 100644 --- a/recipes-tizen/libpinyin/libpinyin.inc +++ b/recipes-tizen/libpinyin/libpinyin.inc @@ -69,7 +69,7 @@ do_compile() { EXTRA_OECONF += " --disable-static" do_install() { - echo export RPM_BUILD_ROOT=${D} + export RPM_BUILD_ROOT=${D} cd ${S} LANG=C export LANG -- 2.7.4