From eee7a132d686cb8d9c36c632523649745487b503 Mon Sep 17 00:00:00 2001 From: fujiwarat Date: Wed, 27 Jul 2016 11:25:32 +0900 Subject: Fix make dist 'make dist' has different directories between builddir and srcdir. src/tests/runtest gets the builddir of ibus-memconf from the srcdir of memconf.xml and the builddir of ibus-engine-simple from the srcdir of simple.xml. bindings/pygobject/test-override-ibus.py runs IBus.Keymap.new() and gets the path of keymaps from IBUS_KEYMAP_PATH variable. bindings/vala/ibus-1.0.vapi needs to be cleaned by 'make distclean'. R=shawn.p.huang@gmail.com Review URL: https://codereview.appspot.com/305950043 --- Makefile.am | 1 - bindings/pygobject/Makefile.am | 4 +++- bindings/vala/Makefile.am | 6 ++++-- src/ibuskeymap.c | 6 +++++- src/tests/runtest | 5 ++++- 5 files changed, 16 insertions(+), 6 deletions(-) diff --git a/Makefile.am b/Makefile.am index 425d1ec2..38515c67 100644 --- a/Makefile.am +++ b/Makefile.am @@ -90,7 +90,6 @@ install-data-hook: DISTCHECK_CONFIGURE_FLAGS = \ --enable-gtk-doc \ --disable-schemas-install \ - --disable-introspection \ $(NULL) dist-hook: diff --git a/bindings/pygobject/Makefile.am b/bindings/pygobject/Makefile.am index 53b36ef3..238a537a 100644 --- a/bindings/pygobject/Makefile.am +++ b/bindings/pygobject/Makefile.am @@ -3,7 +3,7 @@ # ibus - The Input Bus # # Copyright (c) 2012 Daiki Ueno -# Copyright (c) 2014 Peng Huang +# Copyright (c) 2014-2016 Peng Huang # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -39,10 +39,12 @@ if ENABLE_TESTS TESTS += test-override-ibus.py endif +# IBus.Keymap() accesses keymap files TESTS_ENVIRONMENT = \ PYTHONPATH=$(top_srcdir)/tests:$${PYTHONPATH:+:$$PYTHONPATH} \ LD_LIBRARY_PATH=$(top_builddir)/src/.libs:$$LD_LIBRARY_PATH \ GI_TYPELIB_PATH=$(top_builddir)/src:$$GI_TYPELIB_PATH \ + IBUS_KEYMAP_PATH=$(top_srcdir)/data/keymaps \ $(NULL) LOG_COMPILER = $(PYTHON) -B diff --git a/bindings/vala/Makefile.am b/bindings/vala/Makefile.am index 5a354238..f3eb0d40 100644 --- a/bindings/vala/Makefile.am +++ b/bindings/vala/Makefile.am @@ -2,8 +2,8 @@ # # ibus - The Input Bus # -# Copyright (c) 2007-2015 Peng Huang -# Copyright (c) 2007-2015 Red Hat, Inc. +# Copyright (c) 2007-2016 Peng Huang +# Copyright (c) 2007-2016 Red Hat, Inc. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -43,6 +43,8 @@ vapidir = $(datadir)/vala/vapi vapi_DATA = $(VAPIGEN_VAPIS) $(VAPIGEN_VAPIS:.vapi=.deps) MAINTAINERCLEANFILES = $(VAPIGEN_VAPIS) +# for make distclean +CONFIG_CLEAN_FILES = $(VAPIGEN_VAPIS) EXTRA_DIST = \ $(VAPIGEN_VAPIS) \ diff --git a/src/ibuskeymap.c b/src/ibuskeymap.c index 79550332..d7428c5d 100644 --- a/src/ibuskeymap.c +++ b/src/ibuskeymap.c @@ -159,13 +159,17 @@ static gboolean ibus_keymap_load (const gchar *name, KEYMAP keymap) { + const gchar *envstr; gchar *fname; FILE *pf; gchar buf[256]; gint lineno; - fname = g_build_filename (IBUS_DATA_DIR, "keymaps", name, NULL); + if ((envstr = g_getenv ("IBUS_KEYMAP_PATH")) != NULL) + fname = g_build_filename (envstr, name, NULL); + else + fname = g_build_filename (IBUS_DATA_DIR, "keymaps", name, NULL); if (fname == NULL) { return FALSE; diff --git a/src/tests/runtest b/src/tests/runtest index 81dc62d1..91c4e95f 100755 --- a/src/tests/runtest +++ b/src/tests/runtest @@ -66,9 +66,12 @@ func_cleanup () { func_copy_component () { file=$1 base=`func_basename $file` + libexecdir=`func_dirname $file` + # top_srcdir != top_builddir in make dist + libexecdir=`echo "$libexecdir" | sed -e "s|$top_srcdir|$top_builddir|"` if test -f $file.in; then mkdir -p components - sed 's|@libexecdir@|'`func_dirname $file`'|g' < $file.in > components/$base + sed "s|@libexecdir@|$libexecdir|g" < $file.in > components/$base fi } -- cgit v1.2.1