diff --git a/baselibs.conf b/baselibs.conf index d48abc6..93b2be3 100644 --- a/baselibs.conf +++ b/baselibs.conf @@ -9,7 +9,7 @@ ibus-gtk postun "%else" postun "%{_bindir}/gtk-query-immodules-2.0 --update-cache" postun "%endif" - supplements "packageand(ibus:gtk2-)" + supplements "(ibus and gtk2-)" ibus-gtk3 post "%if "%_lib" == "lib64"" post "%{_bindir}/gtk-query-immodules-3.0-64 --update-cache" @@ -21,7 +21,21 @@ ibus-gtk3 postun "%else" postun "%{_bindir}/gtk-query-immodules-3.0 --update-cache" postun "%endif" - supplements "packageand(ibus:gtk3-)" + supplements "(ibus and gtk3-)" +ibus-gtk4 + post "if [[ -x %{_bindir}/gio-querymodules-64 ]]; then" + post " %{_bindir}/gio-querymodules-64 %{_libdir}/gtk-4.0/4.0.0/immodules" + post "else" + post " %{_bindir}/gio-querymodules %{_libdir}/gtk-4.0/4.0.0/immodules" + post "fi" + postun "if [ $1 -eq 0 ]; then" + postun " if [[ -x %{_bindir}/gio-querymodules-64 ]]; then" + postun " %{_bindir}/gio-querymodules-64 %{_libdir}/gtk-4.0/4.0.0/immodules" + postun " else" + postun " %{_bindir}/gio-querymodules %{_libdir}/gtk-4.0/4.0.0/immodules" + postun " fi" + postun "fi" + supplements "(ibus and gtk4-)" libibus-1_0-5 obsoletes "libibus2- < " diff --git a/ibus-python-install-dir.patch b/ibus-python-install-dir.patch deleted file mode 100644 index f06ac2f..0000000 --- a/ibus-python-install-dir.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/configure.ac b/configure.ac -index 9a502ec..42aaadf 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -420,7 +420,7 @@ if test x"$enable_python_library" = x"yes"; then - - 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" -+ PYTHON2_LIBDIR="$libdir/python$PYTHON2_VERSION" - python2dir="$PYTHON2_LIBDIR/site-packages" - pkgpython2dir="$python2dir/ibus" - AC_SUBST(pkgpython2dir) diff --git a/ibus.changes b/ibus.changes index bb33463..9ff39e7 100644 --- a/ibus.changes +++ b/ibus.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Sun Oct 3 13:51:18 UTC 2021 - Fuminobu Takeyama + +- Enable GTK 4 IM Module for Leap 15.4 and Tumbleweed +- Remove ibus-python-install-dir.patch + * Not used for build anymore + ------------------------------------------------------------------- Wed Sep 8 13:04:55 UTC 2021 - Predrag Ivanović diff --git a/ibus.spec b/ibus.spec index 7e8d5e9..0249eaf 100644 --- a/ibus.spec +++ b/ibus.spec @@ -18,6 +18,11 @@ %define with_wayland 1 %define with_emoji 1 +%if 0%{?suse_version} > 1500 || 0%{?sle_version} > 150300 +%define with_gtk4 1 +%else +%define with_gtk4 0 +%endif %if ! %{defined _distconfdir} %define _distconfdir %{_sysconfdir} %else @@ -39,8 +44,6 @@ Source7: macros.ibus Source10: ibus-autostart Source11: ibus-autostart.desktop Source99: baselibs.conf -# PATCH-FIX-OPENSUSE ibus-python-install-dir.patch ftake@geeko.jp -Patch0: ibus-python-install-dir.patch # PATFH-FIX-OPENSUSE ibus-xim-fix-re-focus-after-lock.patch bnc#874869 tiwai@suse.de # Fix lost XIM input after screenlock Patch4: ibus-xim-fix-re-focus-after-lock.patch @@ -166,6 +169,20 @@ Supplements: (ibus and gtk3) %description gtk3 This package contains ibus im module for use by gtk3. +%if %{with_gtk4} +%package gtk4 +Summary: IBus input method support for gtk4 applications +# on 15.4, both gtk4-devel and gtk4-devel-32bit provide pkgconfig(gtk4) +Group: System/I18n/Chinese +BuildRequires: gtk4-devel +Requires: %{name} = %{version} +Supplements: (ibus and gtk4) +%{gtk4_immodule_requires} + +%description gtk4 +This package contains ibus im module for use by gtk4. +%endif + %package devel Summary: Development tools for ibus Group: Development/Libraries/Other @@ -227,6 +244,9 @@ cp -r %{SOURCE11} . --enable-wayland \ %endif --enable-surrounding-text \ +%if %{with_gtk4} + --enable-gtk4 \ +%endif --libexecdir=%{_libdir}/ibus # non-parallel to have reproducible results in spite of non-deterministic build scripts https://github.com/ibus/ibus/issues/2272 @@ -301,6 +321,21 @@ dconf update %postun gtk3 %{gtk3_immodule_postun} +%if %{with_gtk4} +%post gtk4 +%{gtk4_immodule_post} + +%postun gtk4 +#{gtk4_immodule_postun} there is a syntax error in the macro from gtk4-devel +if [ $1 -eq 0 ]; then + if [[ -x %{_bindir}/gio-querymodules-64 ]]; then + %{_bindir}/gio-querymodules-64 %{_libdir}/gtk-4.0/4.0.0/immodules + else + %{_bindir}/gio-querymodules %{_libdir}/gtk-4.0/4.0.0/immodules + fi +fi +%endif + %files %doc AUTHORS README README.SUSE xim.ibus.suse.template %license COPYING @@ -376,6 +411,12 @@ dconf update %files gtk3 %{_libdir}/gtk-3.0/3.0.0/immodules/im-ibus.so +%if %{with_gtk4} +%files gtk4 +%dir %{_libdir}/gtk-4.0/4.0.0/immodules +%{_libdir}/gtk-4.0/4.0.0/immodules/libim-ibus.so +%endif + %files devel %{_libdir}/libibus-1.0.so %{_includedir}/ibus-1.0