Change:
Upstream ibus-1.5.24 (in nixpkgs) supports gtk4. It will be good if we enable gtk4 support in nixpkgs. I fail to enable it with the following patch.

Discussion:
KDEDIRS = [ "" ]; QT_PLUGIN_PATH = [ "/lib/qt4/plugins" "/lib/kde4/plugins" ]; QTWEBKIT_PLUGIN_PATH = [ "/lib/mozilla/plugins/" ]; <del> GTK_PATH = [ "/lib/gtk-2.0" "/lib/gtk-3.0" ]; </del> <ins> GTK_PATH = [ "/lib/gtk-2.0" "/lib/gtk-3.0" "/lib/gtk-4.0" ]; </ins> XDG_CONFIG_DIRS = [ "/etc/xdg" ]; XDG_DATA_DIRS = [ "/share" ]; MOZ_PLUGIN_PATH = [ "/lib/mozilla/plugins" ]; LIBEXEC_PATH = [ "/lib/libexec" ]; }; <ins> environment.pathsToLink = [ "/lib/gtk-2.0" "/lib/gtk-3.0" "/lib/gtk-4.0" ]; </ins> environment.extraInit = '' unset ASPELL_CONF

{ lib, stdenv , substituteAll , fetchurl <ins> , fetchpatch </ins> , fetchFromGitHub , autoreconfHook , gettext

, vala , wrapGAppsHook , dbus <ins> , systemd </ins> , dconf ? null , glib , gdk-pixbuf , gobject-introspection , gtk2 , gtk3 <ins> , gtk4 </ins> , gtk-doc , runCommand , isocodes

stdenv.mkDerivation rec { pname = "ibus"; <del> version = "1.5.24"; </del> <ins> version = "1.5.26"; </ins> src = fetchFromGitHub { owner = "ibus"; repo = "ibus"; rev = version; <del> sha256 = "sha256-1qx06MlEUjSS067FdQG1Bdi4ZAh3hPcNjUX5PIiC3Sk="; </del> <ins> sha256 = "7Vuj4Gyd+dLUoCkR4SPkfGPwVQPRo2pHk0pRAsmtjxc="; </ins> }; patches = [ <ins> # Fixes systemd unit installation path https://github.com/ibus/ibus/pull/2388 (fetchpatch { url = "https://github.com/ibus/ibus/commit/33b4b3932bfea476a841f8df99e20049b83f4b0e.patch"; sha256 = "kh8SBR+cqsov/B0A2YXLJVq1F171qoSRUKbBPHjPRHI="; }) </ins> (substituteAll { src = ./fix-paths.patch; pythonInterpreter = python3Runtime.interpreter;

(enableFeature enablePython2Library "python-library") (enableFeature enablePython2Library "python2") # XXX: python2 library does not work anyway (enableFeature enableUI "ui") <ins> "--enable-gtk4" </ins> "--enable-install-tests" "--with-unicode-emoji-dir=${unicode-emoji}/share/unicode/emoji" "--with-emoji-annotation-dir=${cldr-emoji-annotation}/share/unicode/cldr/common/annotations"

buildInputs = [ dbus <ins> systemd </ins> dconf gdk-pixbuf gobject-introspection python3.pkgs.pygobject3 # for pygobject overrides gtk2 gtk3 <ins> gtk4 </ins> isocodes json-glib libnotify

<ins> diff --git a/configure.ac b/configure.ac index a3cdb2da..cade9466 100644 </ins> --- a/configure.ac +++ b/configure.ac <del> @@ -429,11 +429,11 @@ </del> <ins> @@ -469,11 +469,11 @@ PKG_CHECK_EXISTS([pygobject-3.0 >= $PYGOBJECT_REQUIRED], </ins> if test "x$enable_pygobject" = "xyes"; then PKG_CHECK_MODULES(PYTHON, [pygobject-3.0 >= $PYGOBJECT_REQUIRED])

AC_SUBST(py2overridesdir) fi fi <del> @@ -462,7 +462,7 @@ </del> <ins> @@ -502,7 +502,7 @@ if test x"$enable_python_library" = x"yes"; then </ins> 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"

AC_SUBST(pkgpython2dir) else enable_python_library="no (disabled, use --enable-python-library to enable)" <ins> diff --git a/data/dconf/Makefile.am b/data/dconf/Makefile.am index 5360f033..6d5e726f 100644 </ins> --- a/data/dconf/Makefile.am +++ b/data/dconf/Makefile.am <del> @@ -50,7 +50,7 @@ </del> <ins> @@ -50,7 +50,7 @@ man_5dir = $(mandir)/man5 </ins> install-data-hook: if test -z "$(DESTDIR)"; then 

fi EXTRA_DIST =  <ins> diff --git a/setup/ibus-setup.in b/setup/ibus-setup.in index 474ce8a8..ee30808e 100644 </ins> --- a/setup/ibus-setup.in +++ b/setup/ibus-setup.in <del> @@ -27,5 +27,5 @@ </del> <ins> @@ -27,5 +27,5 @@ export IBUS_PREFIX=@prefix@ </ins> export IBUS_DATAROOTDIR=@datarootdir@ export IBUS_LOCALEDIR=@localedir@ export IBUS_LIBEXECDIR=${libexecdir} <del> -exec ${PYTHON:-@PYTHON@} @prefix@/share/ibus/setup/main.py $@ +exec @pythonInterpreter@ @prefix@/share/ibus/setup/main.py $@ </del> <ins> -exec ${PYTHON:-@PYTHON@} @prefix@/share/ibus/setup/main.py "$@" +exec @pythonInterpreter@ @prefix@/share/ibus/setup/main.py "$@" </ins>