From 889e2190c68a4e2a4a8dce9f654d36d9ec06f138 Mon Sep 17 00:00:00 2001 From: Huang Peng Date: Sat, 16 Aug 2008 17:52:07 +0800 Subject: [PATCH] Fix bug when do not install ibus in /usr --- daemon/ibus-daemon.in | 5 +++-- daemon/register.py | 7 +++---- gconf/ibus-gconf | 24 ------------------------ 3 files changed, 6 insertions(+), 30 deletions(-) delete mode 100644 gconf/ibus-gconf diff --git a/daemon/ibus-daemon.in b/daemon/ibus-daemon.in index f4a8f24..a572c8b 100644 --- a/daemon/ibus-daemon.in +++ b/daemon/ibus-daemon.in @@ -19,6 +19,7 @@ # Free Software Foundation, Inc., 59 Temple Place, Suite 330, # Boston, MA 02111-1307 USA -export IBUS_PREFIX=@prefix@ -exec python @prefix@/share/ibus/daemon/ibusdaemon.py $@ +prefix=@prefix@ +export IBUS_DATAROOTDIR=@datarootdir@ +exec python @prefix@/share/@PACKAGE@/daemon/ibusdaemon.py $@ diff --git a/daemon/register.py b/daemon/register.py index 2e3cfdd..861548d 100644 --- a/daemon/register.py +++ b/daemon/register.py @@ -25,6 +25,8 @@ import signal import glob import ibus +IBUS_DATAROOTDIR = os.getenv("IBUS_DATAROOTDIR") + class Engine(ibus.Object): def __init__(self, name, lang = "other", icon = "", author = "", credits = "", _exec = "", pid = 0): super(Engine, self).__init__() @@ -122,10 +124,7 @@ class Register(ibus.Object): break def __load(self): - _file = path.abspath(__file__) - _dir = path.dirname(_file) + "./../engine" - _dir = path.abspath(_dir) - _dir = "/usr/share/ibus/engine" + _dir = path.join(IBUS_DATAROOTDIR, "ibus/engine") for _file in glob.glob(_dir + "/*.engine"): engine = self.__load_engine(_file) if (engine.lang, engine.name) in self.__engines: diff --git a/gconf/ibus-gconf b/gconf/ibus-gconf deleted file mode 100644 index 0e3a03c..0000000 --- a/gconf/ibus-gconf +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh -# -# ibus - The Input Bus -# -# Copyright (c) 2007-2008 Huang Peng -# -# This library is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 2 of the License, or (at your option) any later version. -# -# This library is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this program; if not, write to the -# Free Software Foundation, Inc., 59 Temple Place, Suite 330, -# Boston, MA 02111-1307 USA - -export IBUS_PREFIX=/usr -exec python /usr/share/ibus/gconf/main.py $@ - -- 2.7.4