diff --git a/trunk/PKGBUILD b/trunk/PKGBUILD index 143906d..c489284 100644 --- a/trunk/PKGBUILD +++ b/trunk/PKGBUILD @@ -6,22 +6,28 @@ pkgname=ibus-pinyin pkgver=1.5.0 -pkgrel=7 +pkgrel=8 pkgdesc='Pinyin (Chinese) input method for the IBus framework' arch=('x86_64') license=('GPL') -source="https://github.com/phuang/ibus-pinyin/" -depends=('ibus' 'pyzy' 'lua51' 'python2-xdg') +url="https://github.com/phuang/ibus-pinyin/" +depends=('ibus' 'pyzy' 'lua') makedepends=('intltool') -source=("https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/ibus/${pkgname}-${pkgver}.tar.gz") -sha512sums=('b0cd849ee3154543747dde8994eec9aed01d67e0d9be308a2f0230cf22f0281cd8fcabd9763b24238547a37e54400bcd8e541937767b93f005d04302f0c00241') +source=("https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/ibus/${pkgname}-${pkgver}.tar.gz" + 'ibus-pinyin-fixes-lua-compile.patch') +sha512sums=('b0cd849ee3154543747dde8994eec9aed01d67e0d9be308a2f0230cf22f0281cd8fcabd9763b24238547a37e54400bcd8e541937767b93f005d04302f0c00241' + '4d62521eca39099f71824c0fdafcdda41b3920a25411e520023dd20343554f691a6c9629c80977849d70724ad7aa31cae1345d452ba6a8d15019f835c91f3913') -build() { +prepare() +{ cd ${pkgname}-${pkgver} + patch -p1 -i ../ibus-pinyin-fixes-lua-compile.patch +} - sed -i -e "s|python|python2|" setup/ibus-setup-pinyin.in +build() { + cd ${pkgname}-${pkgver} - PYTHON=python2 ./configure \ + PYTHON=python3 ./configure \ --prefix=/usr \ --libexecdir=/usr/lib/ibus diff --git a/trunk/ibus-pinyin-fixes-lua-compile.patch b/trunk/ibus-pinyin-fixes-lua-compile.patch new file mode 100644 index 0000000..f0c9834 --- /dev/null +++ b/trunk/ibus-pinyin-fixes-lua-compile.patch @@ -0,0 +1,86 @@ +From c42d0a870697e95301deabe0bcb770a68649c81d Mon Sep 17 00:00:00 2001 +From: Peng Wu +Date: Wed, 31 Jul 2013 10:53:14 +0800 +Subject: [PATCH] fixes lua 5.2 compile + +--- + lua/lua-plugin-init.c | 8 ++++++++ + lua/lua-plugin.c | 9 +++++++++ + 2 files changed, 17 insertions(+) + +Index: ibus-pinyin-1.5.0/lua/lua-plugin-init.c +=================================================================== +--- ibus-pinyin-1.5.0.orig/lua/lua-plugin-init.c ++++ ibus-pinyin-1.5.0/lua/lua-plugin-init.c +@@ -26,6 +26,14 @@ + + #include "lua-plugin.h" + ++#if LUA_VERSION_NUM >= 502 ++/* ugly hack for lua 5.2 */ ++ ++#define lua_objlen lua_rawlen ++ ++#endif ++ ++ + static const luaL_Reg lualibs[] = { + {"", luaopen_base}, + {LUA_TABLIBNAME, luaopen_table}, +@@ -344,7 +352,11 @@ static const luaL_Reg imelib[] = { + }; + + LUALIB_API int luaopen_ime (lua_State *L) { ++#if LUA_VERSION_NUM >= 502 ++ luaL_newlib(L, imelib); ++#else + luaL_register(L, LUA_IMELIBNAME, imelib); ++#endif + return 1; + } + +Index: ibus-pinyin-1.5.0/lua/lua-plugin.c +=================================================================== +--- ibus-pinyin-1.5.0.orig/lua/lua-plugin.c ++++ ibus-pinyin-1.5.0/lua/lua-plugin.c +@@ -25,6 +25,15 @@ + + #include "lua-plugin.h" + ++#if LUA_VERSION_NUM >= 502 ++/* ugly hack for lua 5.2 */ ++ ++#define lua_open luaL_newstate ++ ++#define lua_objlen lua_rawlen ++ ++#endif ++ + #define IBUS_ENGINE_PLUGIN_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), IBUS_TYPE_ENGINE_PLUGIN, IBusEnginePluginPrivate)) + + struct _IBusEnginePluginPrivate{ +Index: ibus-pinyin-1.5.0/lua/lmyoslib.c +=================================================================== +--- ibus-pinyin-1.5.0.orig/lua/lmyoslib.c ++++ ibus-pinyin-1.5.0/lua/lmyoslib.c +@@ -57,7 +57,7 @@ static int getfield (lua_State *L, const + res = (int)lua_tointeger(L, -1); + else { + if (d < 0) +- return luaL_error(L, "field " LUA_QS " missing in date table", key); ++ return luaL_error(L, "field '%s' missing in date table", key); + res = d; + } + lua_pop(L, 1); +@@ -157,7 +157,11 @@ static const luaL_Reg syslib[] = { + + + LUALIB_API int luaopen_myos (lua_State *L) { ++#if LUA_VERSION_NUM >= 502 ++ luaL_newlib(L, syslib); ++#else + luaL_register(L, LUA_OSLIBNAME, syslib); ++#endif + return 1; + } +