From 68e4925e05ee46d79b61858d4b09e945f654e3d859dc1339ad7e22d30ba56f5c Mon Sep 17 00:00:00 2001 From: Marguerite Su Date: Mon, 7 May 2012 08:08:06 +0000 Subject: [PATCH] Accepting request 116621 from home:MargueriteSu:branches:M17N OBS-URL: https://build.opensuse.org/request/show/116621 OBS-URL: https://build.opensuse.org/package/show/M17N/fcitx?expand=0&rev=25 --- fcitx-4.2.3-openSUSE-11.4-lua51.patch | 58 +++++++++++++++++++++++++++ fcitx.changes | 5 +++ fcitx.spec | 12 +++++- 3 files changed, 74 insertions(+), 1 deletion(-) create mode 100644 fcitx-4.2.3-openSUSE-11.4-lua51.patch diff --git a/fcitx-4.2.3-openSUSE-11.4-lua51.patch b/fcitx-4.2.3-openSUSE-11.4-lua51.patch new file mode 100644 index 0000000..0b21bea --- /dev/null +++ b/fcitx-4.2.3-openSUSE-11.4-lua51.patch @@ -0,0 +1,58 @@ +diff --git a/src/module/lua/luawrap.c b/src/module/lua/luawrap.c +index 67883a7..417a1c9 100644 +--- a/src/module/lua/luawrap.c ++++ b/src/module/lua/luawrap.c +@@ -58,13 +58,13 @@ typedef struct _ConverterItem { + UT_hash_handle hh; + } ConverterItem; + +-typedef struct _LuaExtension { ++struct _LuaExtension { + char *name; + lua_State *lua; + UT_hash_handle hh; +-} LuaExtension; ++}; + +-typedef struct _LuaModule { ++struct _LuaModule { + FcitxInstance *fcitx; + LuaExtension *extensions; + CommandItem *commands; +@@ -73,7 +73,7 @@ typedef struct _LuaModule { + ConverterItem *converters; + ConverterItem *current_converter; + size_t shortest_input_trigger_key_length; +-} LuaModule; ++}; + + typedef void (*LuaResultFn)(LuaModule *luamodule, const char *in, const char *out); + +diff --git a/src/module/lua/luawrap.h b/src/module/lua/luawrap.h +index 152d835..592b275 100644 +--- a/src/module/lua/luawrap.h ++++ b/src/module/lua/luawrap.h +@@ -21,18 +21,18 @@ + #ifndef _LUA_WRAP_H_ + #define _LUA_WRAP_H_ + +-typedef struct lua_State lua_State; +-typedef struct _LuaModule LuaModule; +-typedef struct _LuaExtension LuaExtension; +-typedef struct _FcitxInstance FcitxInstance; ++#include + + typedef struct _LuaResultItem { + char *result; + char *help; + } LuaResultItem; + ++typedef struct _LuaModule LuaModule; ++typedef struct _LuaExtension LuaExtension; ++ + // alloc/free luamodule +-LuaModule * LuaModuleAlloc(FcitxInstance *fcitx); ++LuaModule * LuaModuleAlloc(struct _FcitxInstance *fcitx); + void LuaModuleFree(LuaModule *luamodule); + FcitxInstance *GetFcitx(LuaModule *luamodule); + diff --git a/fcitx.changes b/fcitx.changes index cf43a8f..aad67cc 100644 --- a/fcitx.changes +++ b/fcitx.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Mon May 7 02:55:27 UTC 2012 - i@marguerite.su + +- enable lua by default + ------------------------------------------------------------------- Sun May 6 22:57:27 UTC 2012 - i@marguerite.su diff --git a/fcitx.spec b/fcitx.spec index be456c0..b014b9f 100644 --- a/fcitx.spec +++ b/fcitx.spec @@ -30,7 +30,10 @@ Source2: fcitx-README.suse Source3: xim.fcitx.suse.template Source5: pinyin.tar.gz Source6: table.tar.gz +#FIX-FOR-UPSTREAM i@marguerite.su - dont download online Patch1: fix_fcitx_googlecode_resolv_error.patch +#FIX-FOR-UPSTREAM i@marguerite.su - fix lua51 builds on 11.4 +Patch2: fcitx-4.2.3-openSUSE-11.4-lua51.patch BuildRequires: xz BuildRequires: cairo-devel BuildRequires: pango-devel @@ -39,6 +42,11 @@ BuildRequires: dbus-1-glib-devel BuildRequires: update-desktop-files BuildRequires: fdupes BuildRequires: libqt4-devel +%if 0%{?suse_version} <= 1210 +BuildRequires: lua-devel +%else +BuildRequires: lua51-devel +%endif BuildRequires: opencc-devel BuildRequires: intltool BuildRequires: cmake @@ -103,6 +111,7 @@ This package contains fcitx im module for qt4 %prep %setup -q -n %{name}-%{version} %patch1 -p1 +%patch2 -p1 %build mkdir build @@ -114,7 +123,8 @@ cmake .. -DENABLE_GTK2_IM_MODULE=On \ -DCMAKE_INSTALL_PREFIX=%{_prefix} \ -DLIB_INSTALL_DIR=%{_libdir} \ -DENABLE_DEBUG=On \ - -DENABLE_OPENCC=On + -DENABLE_OPENCC=On \ + -DENABLE_LUA=On #copy external data pushd ../data