From fe8fca61f9551085d754ebcb4bdb4c9bb33ac884e024f055fd7ac91ebe310874 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Wed, 6 Oct 2021 06:16:51 +0000 Subject: [PATCH 1/4] Accepting request 923267 from home:ftake:branches:M17N - Enable GTK 4 IM Module for Leap 15.4 and Tumbleweed - Remove ibus-python-install-dir.patch * Not used for build anymore OBS-URL: https://build.opensuse.org/request/show/923267 OBS-URL: https://build.opensuse.org/package/show/M17N/ibus?expand=0&rev=257 --- baselibs.conf | 18 ++++++++++++-- ibus-python-install-dir.patch | 13 ---------- ibus.changes | 7 ++++++ ibus.spec | 45 +++++++++++++++++++++++++++++++++-- 4 files changed, 66 insertions(+), 17 deletions(-) delete mode 100644 ibus-python-install-dir.patch 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 From b288863901db6e96fb7a60a85fcdb627fac9c959c3679e45da3a43803b023923 Mon Sep 17 00:00:00 2001 From: Hillwood Yang Date: Thu, 16 Dec 2021 13:22:36 +0000 Subject: [PATCH 2/4] Accepting request 940880 from home:dimstar:Factory - Split build of gtk4 module into an own flavor, allowing us to break a build cycle. OBS-URL: https://build.opensuse.org/request/show/940880 OBS-URL: https://build.opensuse.org/package/show/M17N/ibus?expand=0&rev=258 --- _multibuild | 4 ++ ibus.changes | 6 +++ ibus.spec | 116 ++++++++++++++++++++++++++++++++------------------- 3 files changed, 82 insertions(+), 44 deletions(-) create mode 100644 _multibuild diff --git a/_multibuild b/_multibuild new file mode 100644 index 0000000..9ef0130 --- /dev/null +++ b/_multibuild @@ -0,0 +1,4 @@ + + gtk4 + + diff --git a/ibus.changes b/ibus.changes index 9ff39e7..46c0117 100644 --- a/ibus.changes +++ b/ibus.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Thu Dec 16 11:25:07 UTC 2021 - Dominique Leuenberger + +- Split build of gtk4 module into an own flavor, allowing us to + break a build cycle. + ------------------------------------------------------------------- Sun Oct 3 13:51:18 UTC 2021 - Fuminobu Takeyama diff --git a/ibus.spec b/ibus.spec index 0249eaf..2c438e3 100644 --- a/ibus.spec +++ b/ibus.spec @@ -1,5 +1,5 @@ # -# spec file for package ibus +# spec file # # Copyright (c) 2021 SUSE LLC # @@ -16,27 +16,32 @@ # +%define flavor @BUILD_FLAVOR@%nil + +%define with_gtk4 0 %define with_wayland 1 %define with_emoji 1 -%if 0%{?suse_version} > 1500 || 0%{?sle_version} > 150300 + +%if "%{flavor}" == "gtk4" %define with_gtk4 1 -%else -%define with_gtk4 0 +%define nsuffix -%{flavor} %endif + %if ! %{defined _distconfdir} %define _distconfdir %{_sysconfdir} %else %define use_usretc 1 %endif -Name: ibus +%define _name ibus +Name: %{_name}%{?nsuffix} Version: 1.5.25 Release: 0 Summary: The "Intelligent Input Bus" input method License: LGPL-2.1-or-later Group: System/I18n/Chinese URL: https://github.com/ibus/ -Source: https://github.com/ibus/ibus/releases/download/%{version}/%{name}-%{version}.tar.gz +Source: https://github.com/ibus/ibus/releases/download/%{version}/%{_name}-%{version}.tar.gz Source2: README.SUSE Source3: xim.ibus.suse.template Source4: xim.d-ibus-121 @@ -70,6 +75,8 @@ Patch15: ibus-socket-name-compatibility.patch Patch16: ibus-missing-include.patch # PATCH-FIX-UPSTREAM ibus-fix-wrong-cursor-location.patch gh#ibus/ibus#2337 Patch17: ibus-fix-wrong-cursor-location.patch +BuildRequires: pkgconfig(iso-codes) +%if ! 0%{?with_gtk4} BuildRequires: fdupes BuildRequires: gettext-devel BuildRequires: gobject-introspection-devel >= 0.9.6 @@ -84,7 +91,6 @@ BuildRequires: pkgconfig(dbus-glib-1) BuildRequires: pkgconfig(dconf) >= 0.7.5 BuildRequires: pkgconfig(glib-2.0) >= 2.34.0 BuildRequires: pkgconfig(gtk+-2.0) -BuildRequires: pkgconfig(iso-codes) BuildRequires: pkgconfig(libnotify) >= 0.7 BuildRequires: pkgconfig(python3) # copy_deep method is supported since 0.31.1 @@ -95,7 +101,7 @@ BuildRequires: pkgconfig(libnotify) BuildRequires: pkgconfig(vapigen) BuildRequires: pkgconfig(xkbcommon) %if %{with_emoji} -Requires: %{name}-dict-emoji = %{version} +Requires: %{_name}-dict-emoji = %{version} %endif Requires: dconf Requires: iso-codes @@ -115,6 +121,7 @@ BuildRequires: pkgconfig(wayland-client) >= 1.2.0 BuildRequires: unicode-emoji BuildRequires: pkgconfig(cldr-emoji-annotation) %endif +%endif %description IBus, short for Intelligent Input Bus, is an input framework. IBus @@ -122,6 +129,7 @@ plugins then provide the particular logic how to translate keypresses to input characters and possibly show disambiguation windows around the text cursor. +%if ! 0%{?with_gtk4} %package -n libibus-1_0-5 Summary: IBus libraries Group: System/Libraries @@ -151,7 +159,7 @@ This package contains data of emoji dictionary for IBus and other applications %package gtk Summary: IBus input method support for gtk2 applications Group: System/I18n/Chinese -Requires: %{name} = %{version} +Requires: %{_name} = %{version} Supplements: (ibus and gtk2) %{gtk2_immodule_requires} @@ -162,27 +170,13 @@ This package contains ibus im module for use by gtk2. Summary: IBus input method support for gtk3 applications Group: System/I18n/Chinese BuildRequires: pkgconfig(gtk+-3.0) -Requires: %{name} = %{version} +Requires: %{_name} = %{version} Supplements: (ibus and gtk3) %{gtk3_immodule_requires} %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 @@ -199,8 +193,24 @@ docs for ibus. %lang_package +%else + +%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 +BuildRequires: pkgconfig(dbus-1) +Requires: %{_name} = %{version} +Supplements: (ibus and gtk4) +%{gtk4_immodule_requires} + +%description gtk4 +This package contains ibus im module for use by gtk4. +%endif + %prep -%setup -q +%setup -q -n %{_name}-%{version} #%patch0 -p1 %patch4 -p1 %patch8 -p1 @@ -226,28 +236,34 @@ cp -r %{SOURCE11} . %build %configure --disable-static \ - --enable-gtk3 \ - --enable-vala \ + --libexecdir=%{_libdir}/ibus \ +%if %{with_wayland} + --enable-wayland \ +%endif %if %{with_emoji} --enable-emoji-dict \ %else --disable-emoji-dict \ %endif + --disable-python2 \ +%if ! 0%{?with_gtk4} + --enable-gtk3 \ + --enable-vala \ --enable-appindicator \ --with-python=python3 \ - --disable-python2 \ --enable-python-library \ --enable-introspection \ - --enable-dconf \ --enable-gtk-doc \ -%if %{with_wayland} - --enable-wayland \ -%endif --enable-surrounding-text \ -%if %{with_gtk4} +%else + --disable-dconf \ + --disable-emoji-dict \ + --disable-unicode-dict \ + --disable-xim \ + --disable-gtk2 \ + --disable-gtk3 \ --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 make @@ -255,6 +271,10 @@ make %install %make_install +# Remove libtool archives +find %{buildroot} -type f -name "*.la" -delete -print + +%if ! 0%{?with_gtk4} # autostart mkdir -p %{buildroot}%{_distconfdir}/X11/xim.d/ install -m 644 xim.d-ibus-121 %{buildroot}%{_distconfdir}/X11/xim.d/ibus @@ -276,9 +296,6 @@ pushd %{buildroot}%{_distconfdir}/X11/xim.d/ done popd -# remove static libs -find %{buildroot} -type f -name "*.la" -delete -print - mkdir -p %{buildroot}%{_datadir}/pixmaps ln -sf %{_datadir}/icons/hicolor/48x48/apps/ibus-keyboard.png \ %{buildroot}%{_datadir}/pixmaps/ibus-keyboard.png @@ -321,7 +338,16 @@ dconf update %postun gtk3 %{gtk3_immodule_postun} -%if %{with_gtk4} +%else + +# cleanup stuff that is packaged as part of the main ibus flavor +rm -rf %{buildroot}%{_datadir} +rm -rf %{buildroot}%{_includedir} +rm -rf %{buildroot}%{_bindir} +rm -rf %{buildroot}%{_libdir}/ibus +rm -rf %{buildroot}%{_libdir}/libibus* +rm -rf %{buildroot}%{_libdir}/pkgconfig + %post gtk4 %{gtk4_immodule_post} @@ -336,6 +362,7 @@ if [ $1 -eq 0 ]; then fi %endif +%if ! 0%{?with_gtk4} %files %doc AUTHORS README README.SUSE xim.ibus.suse.template %license COPYING @@ -411,12 +438,6 @@ fi %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 @@ -427,4 +448,11 @@ fi %{_datadir}/vala/vapi/ibus-1.0.deps %{_datadir}/vala/vapi/ibus-1.0.vapi +%else + +%files gtk4 +%dir %{_libdir}/gtk-4.0/4.0.0/immodules +%{_libdir}/gtk-4.0/4.0.0/immodules/libim-ibus.so +%endif + %changelog From 8bd142283838ab5b94e8914b163b5cc8e5ddfa2b888d93e4efb736bd9f1c91fb Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Sun, 26 Dec 2021 08:27:43 +0000 Subject: [PATCH 3/4] Accepting request 941914 from home:dimstar:Factory - Fix name of gtk4 flavor generated packages (was ibus-gtk4-gtk4). OBS-URL: https://build.opensuse.org/request/show/941914 OBS-URL: https://build.opensuse.org/package/show/M17N/ibus?expand=0&rev=259 --- ibus.changes | 5 +++++ ibus.spec | 12 ++++++------ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/ibus.changes b/ibus.changes index 46c0117..f975427 100644 --- a/ibus.changes +++ b/ibus.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue Dec 21 14:51:48 UTC 2021 - Dominique Leuenberger + +- Fix name of gtk4 flavor generated packages (was ibus-gtk4-gtk4). + ------------------------------------------------------------------- Thu Dec 16 11:25:07 UTC 2021 - Dominique Leuenberger diff --git a/ibus.spec b/ibus.spec index 2c438e3..dac805e 100644 --- a/ibus.spec +++ b/ibus.spec @@ -24,7 +24,7 @@ %if "%{flavor}" == "gtk4" %define with_gtk4 1 -%define nsuffix -%{flavor} +%define nsuffix _%{flavor} %endif %if ! %{defined _distconfdir} @@ -195,7 +195,7 @@ docs for ibus. %else -%package gtk4 +%package -n %{_name}-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 @@ -205,7 +205,7 @@ Requires: %{_name} = %{version} Supplements: (ibus and gtk4) %{gtk4_immodule_requires} -%description gtk4 +%description -n %{_name}-gtk4 This package contains ibus im module for use by gtk4. %endif @@ -348,10 +348,10 @@ rm -rf %{buildroot}%{_libdir}/ibus rm -rf %{buildroot}%{_libdir}/libibus* rm -rf %{buildroot}%{_libdir}/pkgconfig -%post gtk4 +%post -n %{_name}-gtk4 %{gtk4_immodule_post} -%postun gtk4 +%postun -n %{_name}-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 @@ -450,7 +450,7 @@ fi %else -%files gtk4 +%files -n %{_name}-gtk4 %dir %{_libdir}/gtk-4.0/4.0.0/immodules %{_libdir}/gtk-4.0/4.0.0/immodules/libim-ibus.so %endif From ba00dea3c6967c334e240e24f7e1c59369c326bbb984f361626f270021cdbea5 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Wed, 5 Jan 2022 17:03:49 +0000 Subject: [PATCH 4/4] Accepting request 944023 from home:dimstar:Factory - Do not introduce ibus-gtk4-32bit unless there will be demand for it: drop its definition from baselibs.conf. OBS-URL: https://build.opensuse.org/request/show/944023 OBS-URL: https://build.opensuse.org/package/show/M17N/ibus?expand=0&rev=260 --- baselibs.conf | 14 -------------- ibus.changes | 6 ++++++ ibus.spec | 2 +- 3 files changed, 7 insertions(+), 15 deletions(-) diff --git a/baselibs.conf b/baselibs.conf index 93b2be3..fbbfe45 100644 --- a/baselibs.conf +++ b/baselibs.conf @@ -22,20 +22,6 @@ ibus-gtk3 postun "%{_bindir}/gtk-query-immodules-3.0 --update-cache" postun "%endif" 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.changes b/ibus.changes index f975427..9a26a21 100644 --- a/ibus.changes +++ b/ibus.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Wed Jan 5 11:56:17 UTC 2022 - Dominique Leuenberger + +- Do not introduce ibus-gtk4-32bit unless there will be demand for + it: drop its definition from baselibs.conf. + ------------------------------------------------------------------- Tue Dec 21 14:51:48 UTC 2021 - Dominique Leuenberger diff --git a/ibus.spec b/ibus.spec index dac805e..a71acb6 100644 --- a/ibus.spec +++ b/ibus.spec @@ -1,7 +1,7 @@ # # spec file # -# Copyright (c) 2021 SUSE LLC +# Copyright (c) 2022 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed