From cf2ef37b619554206f0563958439514fef548cdc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Linh=20Nguy=E1=BB=85n?= Date: Sun, 8 Aug 2021 03:42:29 -0400 Subject: [PATCH] New package: x-unikey-1.0.4 Close: #32405 --- .../patch-src_ukengine_mactab.cpp.patch | 11 +++++++ .../patch-src_ukengine_usrkeymap.cpp.patch | 18 ++++++++++ .../patches/patch-src_xim_install.sh.patch | 8 +++++ srcpkgs/x-unikey/patches/wait-any.patch | 15 +++++++++ srcpkgs/x-unikey/template | 33 +++++++++++++++++++ 5 files changed, 85 insertions(+) create mode 100644 srcpkgs/x-unikey/patches/patch-src_ukengine_mactab.cpp.patch create mode 100644 srcpkgs/x-unikey/patches/patch-src_ukengine_usrkeymap.cpp.patch create mode 100644 srcpkgs/x-unikey/patches/patch-src_xim_install.sh.patch create mode 100644 srcpkgs/x-unikey/patches/wait-any.patch create mode 100644 srcpkgs/x-unikey/template diff --git a/srcpkgs/x-unikey/patches/patch-src_ukengine_mactab.cpp.patch b/srcpkgs/x-unikey/patches/patch-src_ukengine_mactab.cpp.patch new file mode 100644 index 000000000000..4bb7988bb542 --- /dev/null +++ b/srcpkgs/x-unikey/patches/patch-src_ukengine_mactab.cpp.patch @@ -0,0 +1,11 @@ +--- a/src/ukengine/mactab.cpp 2006-04-09 11:46:02 UTC ++++ b/src/ukengine/mactab.cpp +@@ -287,7 +287,7 @@ + char key[MAX_MACRO_KEY_LEN]; + + // Parse the input item +- char * pos = strchr(item, ':'); ++ const char * pos = strchr(item, ':'); + if (pos == NULL) + return -1; + int keyLen = (int)(pos - item); diff --git a/srcpkgs/x-unikey/patches/patch-src_ukengine_usrkeymap.cpp.patch b/srcpkgs/x-unikey/patches/patch-src_ukengine_usrkeymap.cpp.patch new file mode 100644 index 000000000000..88e5d81e1b8b --- /dev/null +++ b/srcpkgs/x-unikey/patches/patch-src_ukengine_usrkeymap.cpp.patch @@ -0,0 +1,18 @@ +--- a/src/ukengine/usrkeymap.cpp 2006-04-08 19:31:40.000000000 -0400 ++++ b/src/ukengine/usrkeymap.cpp +@@ -25,6 +25,7 @@ + #include + using namespace std; + ++#include + #include + #include "usrkeymap.h" + +@@ -262,4 +263,4 @@ + return i; + } + return -1; +-} +\ No newline at end of file ++} + diff --git a/srcpkgs/x-unikey/patches/patch-src_xim_install.sh.patch b/srcpkgs/x-unikey/patches/patch-src_xim_install.sh.patch new file mode 100644 index 000000000000..27c5ed4f9339 --- /dev/null +++ b/srcpkgs/x-unikey/patches/patch-src_xim_install.sh.patch @@ -0,0 +1,8 @@ +--- a/src/xim/install.sh 2018-08-25 14:18:57 UTC ++++ b/src/xim/install.sh +@@ -1,4 +1,5 @@ + #!/bin/sh ++exit 0 + echo + echo "To use UniKey, certain environment variables must be set." + echo "Do you want to set these variables in /etc/profile? (y/N) diff --git a/srcpkgs/x-unikey/patches/wait-any.patch b/srcpkgs/x-unikey/patches/wait-any.patch new file mode 100644 index 000000000000..5aa57fa5cdaf --- /dev/null +++ b/srcpkgs/x-unikey/patches/wait-any.patch @@ -0,0 +1,15 @@ +Index: x-unikey-1.0.4/src/gui/gui.c +=================================================================== +--- x-unikey-1.0.4.orig/src/gui/gui.c ++++ x-unikey-1.0.4/src/gui/gui.c +@@ -40,6 +40,10 @@ + #include "uksync.h" + #include "guiopt.h" + ++#ifndef WAIT_ANY ++#define WAIT_ANY -1 ++#endif ++ + #define PROG_NAME "Unikey XIM Simple GUI" + + /* using global variables is a very bad way of communication. Must do something better!!! */ diff --git a/srcpkgs/x-unikey/template b/srcpkgs/x-unikey/template new file mode 100644 index 000000000000..421d38eeac84 --- /dev/null +++ b/srcpkgs/x-unikey/template @@ -0,0 +1,33 @@ +# Template file for 'x-unikey' +pkgname=x-unikey +version=1.0.4 +revision=1 +build_style=gnu-configure +makedepends="libX11-devel" +short_desc="Vietnamese input method for X" +maintainer="Linh Nguyễn " +license="GPL-2.0-or-later, MIT" +homepage="https://www.unikey.org" +distfiles="${SOURCEFORGE_SITE}/unikey/${pkgname}-${version}.tar.bz2" +checksum=aa7dd444853538bcba0f24c4c19692c34d4553a1df213a260c2628a7116b2dd9 + +CFLAGS="-Wno-narrowing" +CXXFLAGS="-Wno-narrowing" + +if [ "$XBPS_TARGET_LIBC" = musl ]; then + broken="built and run, can't type Vietnamese" +fi + +post_install() { + head -30 src/IMdkit/i18nIMProto.c >dec-hp-sun.license + vlicense dec-hp-sun.license + + vdoc doc/keymap-syntax + vdoc doc/manual + vdoc doc/unikey-manual-0.9.pdf + vsconf doc/options + vsconf doc/ukmacro + vsconf doc/unikeyrc + vcopy doc/im-samples usr/share/examples/$pkgname + rm -r $DESTDIR/usr/share/examples/$pkgname/im-samples/CVS +}