From 51cb6c01060bf5b41aba1317fae47204b015a5c3 Mon Sep 17 00:00:00 2001 From: fujiwarat Date: Mon, 3 Feb 2014 13:07:40 +0900 Subject: Install pygtk2 libraries to python2 site-packages. Review URL: https://codereview.appspot.com/58930044 --- bindings/pygobject/Makefile.am | 13 ++++++++++++- configure.ac | 23 ++++++++++++++++------- ibus/Makefile.am | 8 +++++--- ibus/interface/Makefile.am | 8 +++++--- 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 -# Copyright (c) 2011 Peng Huang +# Copyright (c) 2014 Peng Huang # # 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 -# Copyright (c) 2007-2013 Red Hat, Inc. +# Copyright (c) 2007-2014 Peng Huang +# 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 -# Copyright (c) 2007-2010 Red Hat, Inc. +# Copyright (c) 2007-2014 Peng Huang +# 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 -# Copyright (c) 2007-2010 Red Hat, Inc. +# Copyright (c) 2007-2014 Peng Huang +# 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 \ -- cgit v1.2.3