summaryrefslogtreecommitdiffstats
path: root/daemon
diff options
context:
space:
mode:
authorHuang Peng <shawn.p.huang@gmail.com>2008-08-16 17:52:07 +0800
committerHuang Peng <shawn.p.huang@gmail.com>2008-08-16 17:52:07 +0800
commit889e2190c68a4e2a4a8dce9f654d36d9ec06f138 (patch)
tree66b2746c901b11c8962e35c8c04d8073756cb794 /daemon
parent16d674dd9f2561328ab7e1a5a42d32c12d11ec5f (diff)
Fix bug when do not install ibus in /usr
Diffstat (limited to 'daemon')
-rw-r--r--daemon/ibus-daemon.in5
-rw-r--r--daemon/register.py7
2 files changed, 6 insertions, 6 deletions
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: