summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfujiwarat <takao.fujiwara1@gmail.com>2014-02-03 13:07:40 +0900
committerfujiwarat <takao.fujiwara1@gmail.com>2014-02-03 13:07:40 +0900
commit51cb6c01060bf5b41aba1317fae47204b015a5c3 (patch)
tree6cff5d0e4b21dceadf1f9655f208017eb6294c9a
parenta6f886a7279dd85b5b0d4caa709a222e34eaa3f7 (diff)
Install pygtk2 libraries to python2 site-packages.
Review URL: https://codereview.appspot.com/58930044
-rw-r--r--bindings/pygobject/Makefile.am13
-rw-r--r--configure.ac23
-rw-r--r--ibus/Makefile.am8
-rw-r--r--ibus/interface/Makefile.am8
4 files changed, 38 insertions, 14 deletions
diff --git a/bindings/pygobject/Makefile.am b/bindings/pygobject/Makefile.am
index d257b044..53b36ef3 100644
--- a/bindings/pygobject/Makefile.am
+++ b/bindings/pygobject/Makefile.am
@@ -3,7 +3,7 @@
# ibus - The Input Bus
#
# Copyright (c) 2012 Daiki Ueno <ueno@unixuser.org>
-# Copyright (c) 2011 Peng Huang <shawn.p.huang@gmail.com>
+# Copyright (c) 2014 Peng Huang <shawn.p.huang@gmail.com>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
@@ -22,6 +22,7 @@
NULL =
+py2_compile = PYTHON=$(PYTHON2) $(SHELL) $(py_compile)
overrides2dir = $(py2overridesdir)
overrides2_DATA = \
gi/overrides/IBus.py \
@@ -52,4 +53,14 @@ EXTRA_DIST = \
test-override-ibus.py \
$(NULL)
+install-data-hook:
+ @for data in $(overrides2_DATA); do \
+ file=`echo $$data | sed -e 's|^.*/||'`; \
+ dlist="$$dlist $$file"; \
+ done; \
+ $(py2_compile) --destdir "$(DESTDIR)" \
+ --basedir "$(overrides2dir)" \
+ $$dlist
+ $(NULL)
+
-include $(top_srcdir)/git.mk
diff --git a/configure.ac b/configure.ac
index 77396ce3..3b2ac622 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2,8 +2,8 @@
#
# ibus - The Input Bus
#
-# Copyright (c) 2007-2013 Peng Huang <shawn.p.huang@gmail.com>
-# Copyright (c) 2007-2013 Red Hat, Inc.
+# Copyright (c) 2007-2014 Peng Huang <shawn.p.huang@gmail.com>
+# Copyright (c) 2007-2014 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
@@ -379,6 +379,10 @@ AC_ARG_WITH(python,
AM_PATH_PYTHON([2.5])
AC_PATH_PROG(PYTHON2, python2)
+if test x"$PYTHON2" = x""; then
+ PYTHON2=$PYTHON
+fi
+
PYGOBJECT_REQUIRED=3.0.0
PKG_CHECK_EXISTS([pygobject-3.0 >= $PYGOBJECT_REQUIRED],
@@ -390,10 +394,7 @@ if test "x$enable_pygobject" = "xyes"; then
pyoverridesdir=`$PYTHON -c "import gi; print(gi._overridesdir)"`
AC_SUBST(pyoverridesdir)
- py2overridesdir="$pyoverridesdir"
- if test x"$PYTHON2" != x""; then
- py2overridesdir=`$PYTHON2 -c "import gi; print(gi._overridesdir)"`
- fi
+ py2overridesdir=`$PYTHON2 -c "import gi; print(gi._overridesdir)"`
AC_SUBST(py2overridesdir)
fi
@@ -416,6 +417,13 @@ if test x"$enable_python_library" = x"yes"; then
AC_SUBST(PYTHON_CFLAGS)
AC_SUBST(PYTHON_INCLUDES)
AC_SUBST(PYTHON_LIBS)
+
+ PYTHON2_PREFIX=`$PYTHON2 -c "import sys; sys.stdout.write(sys.prefix)"`
+ PYTHON2_VERSION=`$PYTHON2 -c "import sys; sys.stdout.write(sys.version[[:3]])"`
+ PYTHON2_LIBDIR="$PYTHON2_PREFIX/lib/python$PYTHON2_VERSION"
+ python2dir="$PYTHON2_LIBDIR/site-packages"
+ pkgpython2dir="$python2dir/ibus"
+ AC_SUBST(pkgpython2dir)
else
enable_python_library="no (disabled, use --enable-python-library to enable)"
fi
@@ -609,7 +617,8 @@ Build options:
Build shared libs $enable_shared
Build static libs $enable_static
CFLAGS $CFLAGS
- python $PYTHON
+ PYTHON $PYTHON
+ PYTHON2 $PYTHON2
Gtk2 immodule dir $GTK2_IM_MODULEDIR
Gtk3 immodule dir $GTK3_IM_MODULEDIR
Build gtk2 immodule $enable_gtk2
diff --git a/ibus/Makefile.am b/ibus/Makefile.am
index f120de13..0ed14823 100644
--- a/ibus/Makefile.am
+++ b/ibus/Makefile.am
@@ -2,8 +2,8 @@
#
# ibus - The Input Bus
#
-# Copyright (c) 2007-2010 Peng Huang <shawn.p.huang@gmail.com>
-# Copyright (c) 2007-2010 Red Hat, Inc.
+# Copyright (c) 2007-2014 Peng Huang <shawn.p.huang@gmail.com>
+# Copyright (c) 2007-2014 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
@@ -23,6 +23,8 @@ SUBDIRS = \
interface \
$(NULL)
+PYTHON = $(PYTHON2)
+
ibus_PYTHON = \
ascii.py \
application.py \
@@ -56,7 +58,7 @@ nodist_ibus_PYTHON = \
_config.py \
$(NULL)
-ibusdir = @pkgpythondir@
+ibusdir = @pkgpython2dir@
EXTRA_DIST = \
_config.py.in \
diff --git a/ibus/interface/Makefile.am b/ibus/interface/Makefile.am
index 6ce510b5..443e8269 100644
--- a/ibus/interface/Makefile.am
+++ b/ibus/interface/Makefile.am
@@ -2,8 +2,8 @@
#
# ibus - The Input Bus
#
-# Copyright (c) 2007-2010 Peng Huang <shawn.p.huang@gmail.com>
-# Copyright (c) 2007-2010 Red Hat, Inc.
+# Copyright (c) 2007-2014 Peng Huang <shawn.p.huang@gmail.com>
+# Copyright (c) 2007-2014 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
@@ -20,6 +20,8 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
# USA
+PYTHON = $(PYTHON2)
+
ibus_interface_PYTHON = \
iconfig.py \
ienginefactory.py \
@@ -31,7 +33,7 @@ ibus_interface_PYTHON = \
__init__.py \
$(NULL)
-ibus_interfacedir = @pkgpythondir@/interface
+ibus_interfacedir = @pkgpython2dir@/interface
CLEANFILES = \
*.pyc \