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
This commit is contained in:
Hillwood Yang 2021-12-16 13:22:36 +00:00 committed by Git OBS Bridge
parent fe8fca61f9
commit b288863901
3 changed files with 82 additions and 44 deletions

4
_multibuild Normal file
View File

@ -0,0 +1,4 @@
<multibuild>
<package>gtk4</package>
</multibuild>

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Thu Dec 16 11:25:07 UTC 2021 - Dominique Leuenberger <dimstar@opensuse.org>
- 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 <ftake@geeko.jp> Sun Oct 3 13:51:18 UTC 2021 - Fuminobu Takeyama <ftake@geeko.jp>

116
ibus.spec
View File

@ -1,5 +1,5 @@
# #
# spec file for package ibus # spec file
# #
# Copyright (c) 2021 SUSE LLC # Copyright (c) 2021 SUSE LLC
# #
@ -16,27 +16,32 @@
# #
%define flavor @BUILD_FLAVOR@%nil
%define with_gtk4 0
%define with_wayland 1 %define with_wayland 1
%define with_emoji 1 %define with_emoji 1
%if 0%{?suse_version} > 1500 || 0%{?sle_version} > 150300
%if "%{flavor}" == "gtk4"
%define with_gtk4 1 %define with_gtk4 1
%else %define nsuffix -%{flavor}
%define with_gtk4 0
%endif %endif
%if ! %{defined _distconfdir} %if ! %{defined _distconfdir}
%define _distconfdir %{_sysconfdir} %define _distconfdir %{_sysconfdir}
%else %else
%define use_usretc 1 %define use_usretc 1
%endif %endif
Name: ibus %define _name ibus
Name: %{_name}%{?nsuffix}
Version: 1.5.25 Version: 1.5.25
Release: 0 Release: 0
Summary: The "Intelligent Input Bus" input method Summary: The "Intelligent Input Bus" input method
License: LGPL-2.1-or-later License: LGPL-2.1-or-later
Group: System/I18n/Chinese Group: System/I18n/Chinese
URL: https://github.com/ibus/ 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 Source2: README.SUSE
Source3: xim.ibus.suse.template Source3: xim.ibus.suse.template
Source4: xim.d-ibus-121 Source4: xim.d-ibus-121
@ -70,6 +75,8 @@ Patch15: ibus-socket-name-compatibility.patch
Patch16: ibus-missing-include.patch Patch16: ibus-missing-include.patch
# PATCH-FIX-UPSTREAM ibus-fix-wrong-cursor-location.patch gh#ibus/ibus#2337 # PATCH-FIX-UPSTREAM ibus-fix-wrong-cursor-location.patch gh#ibus/ibus#2337
Patch17: ibus-fix-wrong-cursor-location.patch Patch17: ibus-fix-wrong-cursor-location.patch
BuildRequires: pkgconfig(iso-codes)
%if ! 0%{?with_gtk4}
BuildRequires: fdupes BuildRequires: fdupes
BuildRequires: gettext-devel BuildRequires: gettext-devel
BuildRequires: gobject-introspection-devel >= 0.9.6 BuildRequires: gobject-introspection-devel >= 0.9.6
@ -84,7 +91,6 @@ BuildRequires: pkgconfig(dbus-glib-1)
BuildRequires: pkgconfig(dconf) >= 0.7.5 BuildRequires: pkgconfig(dconf) >= 0.7.5
BuildRequires: pkgconfig(glib-2.0) >= 2.34.0 BuildRequires: pkgconfig(glib-2.0) >= 2.34.0
BuildRequires: pkgconfig(gtk+-2.0) BuildRequires: pkgconfig(gtk+-2.0)
BuildRequires: pkgconfig(iso-codes)
BuildRequires: pkgconfig(libnotify) >= 0.7 BuildRequires: pkgconfig(libnotify) >= 0.7
BuildRequires: pkgconfig(python3) BuildRequires: pkgconfig(python3)
# copy_deep method is supported since 0.31.1 # copy_deep method is supported since 0.31.1
@ -95,7 +101,7 @@ BuildRequires: pkgconfig(libnotify)
BuildRequires: pkgconfig(vapigen) BuildRequires: pkgconfig(vapigen)
BuildRequires: pkgconfig(xkbcommon) BuildRequires: pkgconfig(xkbcommon)
%if %{with_emoji} %if %{with_emoji}
Requires: %{name}-dict-emoji = %{version} Requires: %{_name}-dict-emoji = %{version}
%endif %endif
Requires: dconf Requires: dconf
Requires: iso-codes Requires: iso-codes
@ -115,6 +121,7 @@ BuildRequires: pkgconfig(wayland-client) >= 1.2.0
BuildRequires: unicode-emoji BuildRequires: unicode-emoji
BuildRequires: pkgconfig(cldr-emoji-annotation) BuildRequires: pkgconfig(cldr-emoji-annotation)
%endif %endif
%endif
%description %description
IBus, short for Intelligent Input Bus, is an input framework. IBus 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 to input characters and possibly show disambiguation windows around
the text cursor. the text cursor.
%if ! 0%{?with_gtk4}
%package -n libibus-1_0-5 %package -n libibus-1_0-5
Summary: IBus libraries Summary: IBus libraries
Group: System/Libraries Group: System/Libraries
@ -151,7 +159,7 @@ This package contains data of emoji dictionary for IBus and other applications
%package gtk %package gtk
Summary: IBus input method support for gtk2 applications Summary: IBus input method support for gtk2 applications
Group: System/I18n/Chinese Group: System/I18n/Chinese
Requires: %{name} = %{version} Requires: %{_name} = %{version}
Supplements: (ibus and gtk2) Supplements: (ibus and gtk2)
%{gtk2_immodule_requires} %{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 Summary: IBus input method support for gtk3 applications
Group: System/I18n/Chinese Group: System/I18n/Chinese
BuildRequires: pkgconfig(gtk+-3.0) BuildRequires: pkgconfig(gtk+-3.0)
Requires: %{name} = %{version} Requires: %{_name} = %{version}
Supplements: (ibus and gtk3) Supplements: (ibus and gtk3)
%{gtk3_immodule_requires} %{gtk3_immodule_requires}
%description gtk3 %description gtk3
This package contains ibus im module for use by 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 %package devel
Summary: Development tools for ibus Summary: Development tools for ibus
Group: Development/Libraries/Other Group: Development/Libraries/Other
@ -199,8 +193,24 @@ docs for ibus.
%lang_package %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 %prep
%setup -q %setup -q -n %{_name}-%{version}
#%patch0 -p1 #%patch0 -p1
%patch4 -p1 %patch4 -p1
%patch8 -p1 %patch8 -p1
@ -226,28 +236,34 @@ cp -r %{SOURCE11} .
%build %build
%configure --disable-static \ %configure --disable-static \
--enable-gtk3 \ --libexecdir=%{_libdir}/ibus \
--enable-vala \ %if %{with_wayland}
--enable-wayland \
%endif
%if %{with_emoji} %if %{with_emoji}
--enable-emoji-dict \ --enable-emoji-dict \
%else %else
--disable-emoji-dict \ --disable-emoji-dict \
%endif %endif
--disable-python2 \
%if ! 0%{?with_gtk4}
--enable-gtk3 \
--enable-vala \
--enable-appindicator \ --enable-appindicator \
--with-python=python3 \ --with-python=python3 \
--disable-python2 \
--enable-python-library \ --enable-python-library \
--enable-introspection \ --enable-introspection \
--enable-dconf \
--enable-gtk-doc \ --enable-gtk-doc \
%if %{with_wayland}
--enable-wayland \
%endif
--enable-surrounding-text \ --enable-surrounding-text \
%if %{with_gtk4} %else
--disable-dconf \
--disable-emoji-dict \
--disable-unicode-dict \
--disable-xim \
--disable-gtk2 \
--disable-gtk3 \
--enable-gtk4 \ --enable-gtk4 \
%endif %endif
--libexecdir=%{_libdir}/ibus
# non-parallel to have reproducible results in spite of non-deterministic build scripts https://github.com/ibus/ibus/issues/2272 # non-parallel to have reproducible results in spite of non-deterministic build scripts https://github.com/ibus/ibus/issues/2272
make make
@ -255,6 +271,10 @@ make
%install %install
%make_install %make_install
# Remove libtool archives
find %{buildroot} -type f -name "*.la" -delete -print
%if ! 0%{?with_gtk4}
# autostart # autostart
mkdir -p %{buildroot}%{_distconfdir}/X11/xim.d/ mkdir -p %{buildroot}%{_distconfdir}/X11/xim.d/
install -m 644 xim.d-ibus-121 %{buildroot}%{_distconfdir}/X11/xim.d/ibus install -m 644 xim.d-ibus-121 %{buildroot}%{_distconfdir}/X11/xim.d/ibus
@ -276,9 +296,6 @@ pushd %{buildroot}%{_distconfdir}/X11/xim.d/
done done
popd popd
# remove static libs
find %{buildroot} -type f -name "*.la" -delete -print
mkdir -p %{buildroot}%{_datadir}/pixmaps mkdir -p %{buildroot}%{_datadir}/pixmaps
ln -sf %{_datadir}/icons/hicolor/48x48/apps/ibus-keyboard.png \ ln -sf %{_datadir}/icons/hicolor/48x48/apps/ibus-keyboard.png \
%{buildroot}%{_datadir}/pixmaps/ibus-keyboard.png %{buildroot}%{_datadir}/pixmaps/ibus-keyboard.png
@ -321,7 +338,16 @@ dconf update
%postun gtk3 %postun gtk3
%{gtk3_immodule_postun} %{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 %post gtk4
%{gtk4_immodule_post} %{gtk4_immodule_post}
@ -336,6 +362,7 @@ if [ $1 -eq 0 ]; then
fi fi
%endif %endif
%if ! 0%{?with_gtk4}
%files %files
%doc AUTHORS README README.SUSE xim.ibus.suse.template %doc AUTHORS README README.SUSE xim.ibus.suse.template
%license COPYING %license COPYING
@ -411,12 +438,6 @@ fi
%files gtk3 %files gtk3
%{_libdir}/gtk-3.0/3.0.0/immodules/im-ibus.so %{_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 %files devel
%{_libdir}/libibus-1.0.so %{_libdir}/libibus-1.0.so
%{_includedir}/ibus-1.0 %{_includedir}/ibus-1.0
@ -427,4 +448,11 @@ fi
%{_datadir}/vala/vapi/ibus-1.0.deps %{_datadir}/vala/vapi/ibus-1.0.deps
%{_datadir}/vala/vapi/ibus-1.0.vapi %{_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 %changelog