aboutsummaryrefslogtreecommitdiff
path: root/misc/xvnkb
diff options
context:
space:
mode:
authorBinh Nguyen <binhnguyen@fastmail.fm>2010-10-24 22:15:29 -0400
committerErik Hanson <erik@slackbuilds.org>2010-10-25 07:55:10 -0500
commit455281380ff95cae6c5909257832830d95301f12 (patch)
tree8e826a4761e1407f72b84b99b8d280d0cf372e0d /misc/xvnkb
parente1347bc2f46376629fce901bc8f7338d28a9c17e (diff)
misc/xvnkb: Added (Vietnamese keyboard input for X-Window)
Signed-off-by: dsomero <xgizzmo@slackbuilds.org>
Diffstat (limited to 'misc/xvnkb')
-rw-r--r--misc/xvnkb/README6
-rw-r--r--misc/xvnkb/patches/gimp-segfault.patch29
-rw-r--r--misc/xvnkb/patches/kdeinit-error.patch12
-rw-r--r--misc/xvnkb/patches/power-consumption.patch18
-rw-r--r--misc/xvnkb/profile.d/xvnkb.csh7
-rw-r--r--misc/xvnkb/profile.d/xvnkb.sh8
-rw-r--r--misc/xvnkb/slack-desc19
-rw-r--r--misc/xvnkb/xvnkb.SlackBuild121
-rw-r--r--misc/xvnkb/xvnkb.info10
9 files changed, 230 insertions, 0 deletions
diff --git a/misc/xvnkb/README b/misc/xvnkb/README
new file mode 100644
index 0000000000000..945bde33b9970
--- /dev/null
+++ b/misc/xvnkb/README
@@ -0,0 +1,6 @@
+xvnkb is a Vietnamese keyboard input for X-Window. It provides an
+useful way for editing Vietnamese on X-Window environment with popular
+input methods and charsets. This software released under GNU GPL
+license.
+
+You will need to re-login after install for xvnkb to work.
diff --git a/misc/xvnkb/patches/gimp-segfault.patch b/misc/xvnkb/patches/gimp-segfault.patch
new file mode 100644
index 0000000000000..3ff7d42c7c1eb
--- /dev/null
+++ b/misc/xvnkb/patches/gimp-segfault.patch
@@ -0,0 +1,29 @@
+diff -urN xvnkb.cvs/Makefile.common xvnkb/Makefile.common
+--- xvnkb.cvs/Makefile.common 2005-01-12 04:21:04.000000000 -0600
++++ xvnkb/Makefile.common 2009-07-09 10:37:22.491007609 -0500
+@@ -6,7 +6,7 @@
+ .PHONY: config debug core core_debug tools uninstall
+
+ CORE=xvnkb.so.$(VERSION)
+-CORE_OBJS=xvnkb.o visckey.o property.o
++CORE_OBJS=xvnkb.o visckey.o
+
+ GUI=xvnkb
+ GUI_OBJS=data.o flash.o main.o event.o mainwin.o menu.o hotkey.o systray.o \
+diff -urN xvnkb.cvs/xvnkb.c xvnkb/xvnkb.c
+--- xvnkb.cvs/xvnkb.c 2009-06-27 06:32:54.000000000 -0500
++++ xvnkb/xvnkb.c 2009-07-09 10:37:02.505973519 -0500
+@@ -49,7 +49,7 @@
+ long sym;
+ } vk_hotkey_info;
+ /*----------------------------------------------------------------------------*/
+-Window root = -1;
++static Window root = -1;
+ Window focus = -1;
+ /*----------------------------------------------------------------------------*/
+ static KeyCode rk = 0;
+@@ -422,3 +422,4 @@
+ return 0;
+ }
+ /*----------------------------------------------------------------------------*/
++#include "property.c"
diff --git a/misc/xvnkb/patches/kdeinit-error.patch b/misc/xvnkb/patches/kdeinit-error.patch
new file mode 100644
index 0000000000000..849bcd1092134
--- /dev/null
+++ b/misc/xvnkb/patches/kdeinit-error.patch
@@ -0,0 +1,12 @@
+diff -urN xvnkb.cvs/Makefile.common xvnkb/Makefile.common
+--- xvnkb.cvs/Makefile.common 2005-01-12 04:21:04.000000000 -0600
++++ xvnkb/Makefile.common 2009-07-09 12:44:28.789974861 -0500
+@@ -19,7 +19,7 @@
+ $(CC) -fpic $(CFLAGS) $(FPTR) $(VK_OPT) -DVERSION=\"$(VERSION)\" -Wall -I$(XLIB_INC) -c $<
+
+ $(CORE): $(CORE_OBJS)
+- $(CC) $(CFLAGS) $(DLFLAGS) $(CORE_OBJS) -o $@ -L$(XLIB_PATH) $(LIBDL)
++ $(CC) $(CFLAGS) $(DLFLAGS) $(CORE_OBJS) -o $@ -L$(XLIB_PATH) $(LIBDL) -lX11
+
+ $(GUI): $(GUI_OBJS)
+ $(CC) $(CFLAGS) $(GUI_OBJS) -o $@ -L$(XLIB_PATH) $(LIBS) $(XFT_LIBS)
diff --git a/misc/xvnkb/patches/power-consumption.patch b/misc/xvnkb/patches/power-consumption.patch
new file mode 100644
index 0000000000000..99130bf71ff6b
--- /dev/null
+++ b/misc/xvnkb/patches/power-consumption.patch
@@ -0,0 +1,18 @@
+--- main.c 2006/02/25 20:31:25 1.7
++++ main.c 2009/06/27 11:10:55 1.8
+@@ -89,8 +89,14 @@
+ /*----------------------------------------------------------------------------*/
+ void VKMainProcess()
+ {
++ int xfd = ConnectionNumber(display);
++
+ while( !vk_done ) {
+- usleep(1000);
++ struct timeval tv = {1, 0};
++ fd_set rfds;
++ FD_ZERO(&rfds);
++ FD_SET(xfd, &rfds);
++ select(xfd+1, &rfds, 0, 0, &tv);
+
+ if( vk_timeout && vk_flash_on )
+ VKHideFlash();
diff --git a/misc/xvnkb/profile.d/xvnkb.csh b/misc/xvnkb/profile.d/xvnkb.csh
new file mode 100644
index 0000000000000..fb54b48630990
--- /dev/null
+++ b/misc/xvnkb/profile.d/xvnkb.csh
@@ -0,0 +1,7 @@
+#!/bin/csh
+# xvnkb.so need to be preloaded for xvnkb to work
+if ( $?LD_PRELOAD ) then
+ setenv LD_PRELOAD ${LD_PRELOAD}:/usr/lib/xvnkb.so
+else
+ setenv LD_PRELOAD /usr/lib/xvnkb.so
+endif
diff --git a/misc/xvnkb/profile.d/xvnkb.sh b/misc/xvnkb/profile.d/xvnkb.sh
new file mode 100644
index 0000000000000..4bebaabd55bae
--- /dev/null
+++ b/misc/xvnkb/profile.d/xvnkb.sh
@@ -0,0 +1,8 @@
+#!/bin/sh
+# xvnkb.so need to be preloaded for xvnkb to work
+if [ ! "$LD_PRELOAD" = "" ]; then
+ LD_PRELOAD=$LD_PRELOAD:/usr/lib/xvnkb.so
+else
+ LD_PRELOAD=/usr/lib/xvnkb.so
+fi
+export LD_PRELOAD
diff --git a/misc/xvnkb/slack-desc b/misc/xvnkb/slack-desc
new file mode 100644
index 0000000000000..c6d143bb9db59
--- /dev/null
+++ b/misc/xvnkb/slack-desc
@@ -0,0 +1,19 @@
+# HOW TO EDIT THIS FILE:
+# The "handy ruler" below makes it easier to edit a package description. Line
+# up the first '|' above the ':' following the base package name, and the '|'
+# on the right side marks the last column you can put a character in. You must
+# make exactly 11 lines for the formatting to be correct. It's also
+# customary to leave one space after the ':'.
+
+ |-----handy-ruler------------------------------------------------------|
+xvnkb: xvnkb (Vietnamese keyboard input for X-Window)
+xvnkb:
+xvnkb: xvnkb is a Vietnamese keyboard input for X-Window. It provides an
+xvnkb: useful way for editing Vietnamese on X-Window environment with popular
+xvnkb: input methods and charsets. This software released under GNU GPL
+xvnkb: license.
+xvnkb:
+xvnkb: Homepage: http://xvnkb.sourceforge.net/
+xvnkb:
+xvnkb:
+xvnkb:
diff --git a/misc/xvnkb/xvnkb.SlackBuild b/misc/xvnkb/xvnkb.SlackBuild
new file mode 100644
index 0000000000000..5d4c45305a3ed
--- /dev/null
+++ b/misc/xvnkb/xvnkb.SlackBuild
@@ -0,0 +1,121 @@
+#!/bin/sh
+
+# Slackware build script for xvnkb
+
+# Copyright 2010 Binh Nguyen <binhnguyen@fastmail.fm>
+# All rights reserved.
+#
+# Redistribution and use of this script, with or without modification, is
+# permitted provided that the following conditions are met:
+#
+# 1. Redistributions of this script must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR IMPLIED
+# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+PRGNAM=xvnkb
+VERSION=${VERSION:-0.2.9a}
+BUILD=${BUILD:-1}
+TAG=${TAG:-_SBo}
+
+if [ -z "$ARCH" ]; then
+ case "$( uname -m )" in
+ i?86) ARCH=i486 ;;
+ arm*) ARCH=arm ;;
+ *) ARCH=$( uname -m ) ;;
+ esac
+fi
+
+CWD=$(pwd)
+TMP=${TMP:-/tmp/SBo}
+PKG=$TMP/package-$PRGNAM
+OUTPUT=${OUTPUT:-/tmp}
+
+if [ "$ARCH" = "i486" ]; then
+ SLKCFLAGS="-O2 -march=i486 -mtune=i686"
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "i686" ]; then
+ SLKCFLAGS="-O2 -march=i686 -mtune=i686"
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "x86_64" ]; then
+ SLKCFLAGS="-O2 -fPIC"
+ LIBDIRSUFFIX="64"
+else
+ SLKCFLAGS="-O2"
+ LIBDIRSUFFIX=""
+fi
+
+set -eu
+
+rm -rf $PKG
+mkdir -p $TMP $PKG $OUTPUT
+cd $TMP
+rm -rf $PRGNAM-$VERSION
+tar xvf $CWD/$PRGNAM-$VERSION.tar.bz2
+cd $PRGNAM-$VERSION
+chown -R root:root .
+find . \
+ \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
+ -exec chmod 755 {} \; -o \
+ \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
+ -exec chmod 644 {} \;
+
+# Apply some patches provided by xvnkb's author
+# http://forum.vnoss.org/topic6667.html
+patch -p1 < $CWD/patches/gimp-segfault.patch
+patch -p1 < $CWD/patches/kdeinit-error.patch
+patch -p0 < $CWD/patches/power-consumption.patch
+
+CFLAGS="$SLKCFLAGS" \
+./configure \
+ --prefix=/usr \
+ --libdir=/usr/lib${LIBDIRSUFFIX} \
+ --sysconfdir=/etc \
+ --localstatedir=/var \
+ --mandir=/usr/man \
+ --infodir=/usr/info \
+ --docdir=/usr/doc/$PRGNAM-$VERSION \
+ --localedir=/usr/share/locale \
+ --build=$ARCH-slackware-linux
+
+make
+
+install -D -m 0755 xvnkb $PKG/usr/bin/xvnkb
+install -D -m 0755 tools/xvnkb_ctrl $PKG/usr/bin/xvnkb_ctrl
+install -D -m 0755 xvnkb.so.$VERSION $PKG/usr/lib${LIBDIRSUFFIX}/xvnkb.so.$VERSION
+
+# Create a version-independent name for xvnkb shared object
+ln -sf xvnkb.so.$VERSION $PKG/usr/lib${LIBDIRSUFFIX}/xvnkb.so
+
+find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
+ | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
+
+# Add profile scripts
+mkdir -p $PKG/etc/profile.d
+cat $CWD/profile.d/xvnkb.sh > $PKG/etc/profile.d/xvnkb.sh
+cat $CWD/profile.d/xvnkb.csh > $PKG/etc/profile.d/xvnkb.csh
+chmod 0755 $PKG/etc/profile.d/*
+
+# Make sure 64-bit system is served well too ;)
+sed -i "s/lib/lib${LIBDIRSUFFIX}/" $PKG/etc/profile.d/*
+
+mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
+cp -a AUTHORS ChangeLog COPYING INSTALL* LICENSE README* THANKS TODO VERSION \
+ doc/* \
+ $PKG/usr/doc/$PRGNAM-$VERSION
+cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
+
+mkdir -p $PKG/install
+cat $CWD/slack-desc > $PKG/install/slack-desc
+
+cd $PKG
+/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
diff --git a/misc/xvnkb/xvnkb.info b/misc/xvnkb/xvnkb.info
new file mode 100644
index 0000000000000..9ebacdb61faf7
--- /dev/null
+++ b/misc/xvnkb/xvnkb.info
@@ -0,0 +1,10 @@
+PRGNAM="xvnkb"
+VERSION="0.2.9a"
+HOMEPAGE="http://xvnkb.sourceforge.net/"
+DOWNLOAD="http://xvnkb.sourceforge.net/xvnkb-0.2.9a.tar.bz2"
+MD5SUM="cd242c03831c31cc5b294aa9870a0dc4"
+DOWNLOAD_x86_64=""
+MD5SUM_x86_64=""
+MAINTAINER="Binh Nguyen"
+EMAIL="binhnguyen@fastmail.fm"
+APPROVED="dsomero"