16 , gobject-introspection
24 , unicode-character-database
39 python3Runtime = python3.withPackages (ps: with ps; [ pygobject3 ]);
40 python3BuildEnv = python3.buildEnv.override {
41 # ImportError: No module named site
43 makeWrapper ${glib.dev}/bin/gdbus-codegen $out/bin/gdbus-codegen --unset PYTHONPATH
44 makeWrapper ${glib.dev}/bin/glib-genmarshal $out/bin/glib-genmarshal --unset PYTHONPATH
45 makeWrapper ${glib.dev}/bin/glib-mkenums $out/bin/glib-mkenums --unset PYTHONPATH
48 # make-dconf-override-db.sh needs to execute dbus-launch in the sandbox,
49 # it will fail to read /etc/dbus-1/session.conf unless we add this flag
50 dbus-launch = runCommand "sandbox-dbus-launch"
52 nativeBuildInputs = [ makeWrapper ];
54 makeWrapper ${dbus}/bin/dbus-launch $out/bin/dbus-launch \
55 --add-flags --config-file=${dbus}/share/dbus-1/session.conf
59 stdenv.mkDerivation rec {
63 src = fetchFromGitHub {
67 sha256 = "sha256-YMCtLIK/9iUdS37Oiow7WMhFFPKhomNXvzWbLzlUkdQ=";
72 src = ./fix-paths.patch;
73 pythonInterpreter = python3Runtime.interpreter;
74 pythonSitePackages = python3.sitePackages;
76 ./build-without-dbus-launch.patch
79 outputs = [ "out" "dev" "installedTests" ];
82 # Maintainer does not want to create separate tarballs for final release candidate and release versions,
83 # so we need to set `ibus_released` to `1` in `configure.ac`. Otherwise, anyone running `ibus version` gets
84 # a version with an inaccurate `-rcX` suffix.
85 # https://github.com/ibus/ibus/issues/2584
86 substituteInPlace configure.ac --replace "m4_define([ibus_released], [0])" "m4_define([ibus_released], [1])"
88 patchShebangs --build data/dconf/make-dconf-override-db.sh
89 cp ${buildPackages.gtk-doc}/share/gtk-doc/data/gtk-doc.make .
90 substituteInPlace bus/services/org.freedesktop.IBus.session.GNOME.service.in --replace "ExecStart=sh" "ExecStart=${runtimeShell}"
91 substituteInPlace bus/services/org.freedesktop.IBus.session.generic.service.in --replace "ExecStart=sh" "ExecStart=${runtimeShell}"
94 preAutoreconf = "touch ChangeLog";
97 # The `AX_PROG_{CC,CXX}_FOR_BUILD` autoconf macros can pick up unwrapped GCC binaries,
98 # so we set `{CC,CXX}_FOR_BUILD` to override that behavior.
99 # https://github.com/NixOS/nixpkgs/issues/21751
100 "CC_FOR_BUILD=${stdenv.cc}/bin/cc"
101 "CXX_FOR_BUILD=${stdenv.cc}/bin/c++"
103 (lib.enableFeature (dconf != null) "dconf")
104 (lib.enableFeature (libnotify != null) "libnotify")
105 (lib.enableFeature withWayland "wayland")
106 (lib.enableFeature enableUI "ui")
109 "--enable-install-tests"
110 "--with-unicode-emoji-dir=${unicode-emoji}/share/unicode/emoji"
111 "--with-emoji-annotation-dir=${cldr-annotations}/share/unicode/cldr/common/annotations"
112 "--with-ucd-dir=${unicode-character-database}/share/unicode"
116 "test_execsdir=${placeholder "installedTests"}/libexec/installed-tests/ibus"
117 "test_sourcesdir=${placeholder "installedTests"}/share/installed-tests/ibus"
120 nativeBuildInputs = [
130 gobject-introspection
133 propagatedBuildInputs = [
142 python3.pkgs.pygobject3 # for pygobject overrides
149 ] ++ lib.optionals withWayland [
154 enableParallelBuilding = true;
156 doCheck = false; # requires X11 daemon
157 doInstallCheck = true;
158 installCheckPhase = ''
159 $out/bin/ibus version
163 # It has some hardcoded FHS paths and also we do not use it
164 # since we set up the environment in NixOS tests anyway.
165 moveToOutput "bin/ibus-desktop-testing-runner" "$installedTests"
169 # set necessary environment also for tests
170 for f in $installedTests/libexec/installed-tests/ibus/*; do
177 installed-tests = nixosTests.installed-tests.ibus;
182 homepage = "https://github.com/ibus/ibus";
183 description = "Intelligent Input Bus, input method framework";
184 license = licenses.lgpl21Plus;
185 platforms = platforms.linux;
186 maintainers = with maintainers; [ ttuegel ];