summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelix Yan2020-12-17 20:31:24 +0000
committerFelix Yan2020-12-17 20:31:24 +0000
commitb87364ba9584fc06b06fd1bac2ae87ac6b7efa74 (patch)
tree540442b3f9e67c0048b360ddf21a7d28505e44a4
parent32866004ac08ddc8bead5de5bad83629747faa23 (diff)
downloadaur-b87364ba9584fc06b06fd1bac2ae87ac6b7efa74.tar.gz
convert to use python3 (FS#62995)
-rw-r--r--PKGBUILD22
-rw-r--r--ibus-pinyin-fixes-lua-compile.patch86
2 files changed, 100 insertions, 8 deletions
diff --git a/PKGBUILD b/PKGBUILD
index 143906d59907..809bef036e11 100644
--- a/PKGBUILD
+++ b/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 \
+ ./configure \
--prefix=/usr \
--libexecdir=/usr/lib/ibus
diff --git a/ibus-pinyin-fixes-lua-compile.patch b/ibus-pinyin-fixes-lua-compile.patch
new file mode 100644
index 000000000000..f0c98343b288
--- /dev/null
+++ b/ibus-pinyin-fixes-lua-compile.patch
@@ -0,0 +1,86 @@
+From c42d0a870697e95301deabe0bcb770a68649c81d Mon Sep 17 00:00:00 2001
+From: Peng Wu <alexepico@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;
+ }
+