~ubuntu-branches/ubuntu/precise/hime/precise

« back to all changes in this revision

Viewing changes to distro/dev-tools/scripts/test-hime

  • Committer: Package Import Robot
  • Author(s): Yao Wei (魏銘廷)
  • Date: 2012-01-14 00:24:08 UTC
  • Revision ID: package-import@ubuntu.com-20120114002408-e79gagbeg1rt8npv
Tags: upstream-0.9.9
Import upstream version 0.9.9

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
# Copyright and license see bottom of this file
 
3
 
 
4
GTK_2_DEMO_APP=gtk-demo
 
5
GTK_3_DEMO_APP=gtk3-demo
 
6
GTK_QUERY_IMMODULES_2=gtk-query-immodules-2.0
 
7
GTK_QUERY_IMMODULES_3=gtk-query-immodules-3.0
 
8
 
 
9
export HIME_OUTPUT_FILTER=$PWD/filter/nobopomofo
 
10
UTF8_LOCALE=`locale -a | grep utf8 | tail -n 1`
 
11
 
 
12
XIM_NAME=`date +%N | tr -d 0`
 
13
GTK_2_TEMP_FILE=$PWD/gtk2
 
14
GTK_3_TEMP_FILE=$PWD/gtk3
 
15
 
 
16
[ ! -e distro/debian ] && exec echo Please run this script under hime directory, thanks.
 
17
 
 
18
export PATH=$PWD/src:$PATH
 
19
export HIME_TABLE_DIR=$PWD/data
 
20
export HIME_MODULE_DIR=$PWD/src/modules
 
21
export XMODIFIERS=@im=$XIM_NAME
 
22
unset LC_ALL
 
23
export LC_CTYPE=$UTF8_LOCALE
 
24
 
 
25
$GTK_QUERY_IMMODULES_2 | grep -v hime > $GTK_2_TEMP_FILE
 
26
$GTK_QUERY_IMMODULES_3 | grep -v hime > $GTK_3_TEMP_FILE
 
27
LD_LIBRARY_PATH=$PWD/src/im-client/ $GTK_QUERY_IMMODULES_2 $PWD/src/gtk-im/im-hime.so >> $GTK_2_TEMP_FILE
 
28
LD_LIBRARY_PATH=$PWD/src/im-client/ $GTK_QUERY_IMMODULES_3 $PWD/src/gtk3-im/im-hime.so >> $GTK_3_TEMP_FILE
 
29
 
 
30
export LD_PRELOAD=$PWD/src/im-client/libhime-im-client.so
 
31
export GTK_IM_MODULE=hime
 
32
 
 
33
if [ ! -x "$HIME_OUTPUT_FILTER" ]; then
 
34
  echo Warning! Your filter is not executable. Filter has been turned off automatically.
 
35
  unset HIME_OUTPUT_FILTER
 
36
fi
 
37
 
 
38
sh scripts/hime-user-setup $PWD/data $PWD/src
 
39
HIME_TABLE_DIR=data LD_LIBRARY_PATH=$PWD/src/im-client/:$PWD/src XMODIFIERS=@im=$XIM_NAME src/hime &
 
40
HIME_PID=$!
 
41
 
 
42
[ "$GTK_2_DEMO_APP" != "" ] && GTK_IM_MODULE_FILE=$GTK_2_TEMP_FILE $GTK_2_DEMO_APP
 
43
[ "$GTK_3_DEMO_APP" != "" ] && GTK_IM_MODULE_FILE=$GTK_3_TEMP_FILE $GTK_3_DEMO_APP
 
44
 
 
45
[ $(id -u $USER) != "0" ] && kill -HUP $HIME_PID
 
46
 
 
47
rm $GTK_2_TEMP_FILE $GTK_3_TEMP_FILE /tmp/hime-$USER/socket-*-$XIM_NAME
 
48
 
 
49
# Copyright (C) 2007-2011 Wen-Yen Chuang <caleb AT calno DOT com>
 
50
#
 
51
# This library is free software; you can redistribute it and/or
 
52
# modify it under the terms of the GNU Lesser General Public
 
53
# License as published by the Free Software Foundation; either
 
54
# version 2.1 of the License, or (at your option) any later version.
 
55
#
 
56
# This library is distributed in the hope that it will be useful,
 
57
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 
58
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
59
# Lesser General Public License for more details.
 
60
#
 
61
# You should have received a copy of the GNU Lesser General Public
 
62
# License along with this library; if not, write to the Free Software
 
63
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA