[arch-commits] Commit in ibus-pinyin/trunk (2 files)

Felix Yan felixonmars at archlinux.org
Thu Dec 17 20:31:25 UTC 2020


    Date: Thursday, December 17, 2020 @ 20:31:24
  Author: felixonmars
Revision: 778015

upgpkg: ibus-pinyin 1.5.0-8: convert to use python3 (FS#62995)

Added:
  ibus-pinyin/trunk/ibus-pinyin-fixes-lua-compile.patch
Modified:
  ibus-pinyin/trunk/PKGBUILD

-------------------------------------+
 PKGBUILD                            |   22 +++++---
 ibus-pinyin-fixes-lua-compile.patch |   86 ++++++++++++++++++++++++++++++++++
 2 files changed, 100 insertions(+), 8 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2020-12-17 20:30:39 UTC (rev 778014)
+++ PKGBUILD	2020-12-17 20:31:24 UTC (rev 778015)
@@ -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')
 
+prepare()
+{
+  cd ${pkgname}-${pkgver}
+  patch -p1 -i ../ibus-pinyin-fixes-lua-compile.patch
+}
+
 build() {
   cd ${pkgname}-${pkgver}
 
-  sed -i -e "s|python|python2|" setup/ibus-setup-pinyin.in
-
-  PYTHON=python2 ./configure \
+  ./configure \
     --prefix=/usr \
     --libexecdir=/usr/lib/ibus
 

Added: ibus-pinyin-fixes-lua-compile.patch
===================================================================
--- ibus-pinyin-fixes-lua-compile.patch	                        (rev 0)
+++ ibus-pinyin-fixes-lua-compile.patch	2020-12-17 20:31:24 UTC (rev 778015)
@@ -0,0 +1,86 @@
+From c42d0a870697e95301deabe0bcb770a68649c81d Mon Sep 17 00:00:00 2001
+From: Peng Wu <alexepico at gmail.com>
+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;
+ }
+ 



More information about the arch-commits mailing list