From 11d6318a0136536734f48e49b4f4f6b5e08f9b57 Mon Sep 17 00:00:00 2001 From: Symphorien Gibol Date: Tue, 2 Jun 2020 22:34:59 +0200 Subject: [PATCH] Revert "Revert "ibus: fix dconf db installation"" This reverts commit ee5cba24c31896b6aeb0af4e21b93b878e54f747. --- nixos/tests/installed-tests/ibus.nix | 14 +++++--------- pkgs/tools/inputmethods/ibus/default.nix | 12 +++++++++++- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/nixos/tests/installed-tests/ibus.nix b/nixos/tests/installed-tests/ibus.nix index af54b612b507..a4bc2a7d7de0 100644 --- a/nixos/tests/installed-tests/ibus.nix +++ b/nixos/tests/installed-tests/ibus.nix @@ -5,16 +5,12 @@ makeInstalledTest { testConfig = { i18n.inputMethod.enabled = "ibus"; + systemd.user.services.ibus-daemon = { + serviceConfig.ExecStart = "${pkgs.ibus}/bin/ibus-daemon --xim --verbose"; + wantedBy = [ "graphical-session.target" ]; + partOf = [ "graphical-session.target" ]; + }; }; - preTestScript = '' - # ibus has ibus-desktop-testing-runner but it tries to manage desktop session so we just spawn ibus-daemon ourselves - machine.succeed("ibus-daemon --daemonize --verbose") - ''; - withX11 = true; - - # TODO: ibus-daemon is currently crashing or something - # maybe make ibus systemd service that auto-restarts? - meta.broken = true; } diff --git a/pkgs/tools/inputmethods/ibus/default.nix b/pkgs/tools/inputmethods/ibus/default.nix index 644fd5eef3b2..238e133495c9 100644 --- a/pkgs/tools/inputmethods/ibus/default.nix +++ b/pkgs/tools/inputmethods/ibus/default.nix @@ -16,6 +16,7 @@ , gtk2 , gtk3 , gtk-doc +, runCommand , isocodes , cldr-emoji-annotation , unicode-character-database @@ -47,6 +48,14 @@ let makeWrapper ${glib.dev}/bin/glib-mkenums $out/bin/glib-mkenums --unset PYTHONPATH ''; }; + # make-dconf-override-db.sh needs to execute dbus-launch in the sandbox, + # it will fail to read /etc/dbus-1/session.conf unless we add this flag + dbus-launch = runCommand "sandbox-dbus-launch" { + nativeBuildInputs = [ makeWrapper ]; + } '' + makeWrapper ${dbus}/bin/dbus-launch $out/bin/dbus-launch \ + --add-flags --config-file=${dbus.daemon}/share/dbus-1/session.conf + ''; in stdenv.mkDerivation rec { @@ -71,7 +80,7 @@ stdenv.mkDerivation rec { outputs = [ "out" "dev" "installedTests" ]; postPatch = '' - echo \#!${runtimeShell} > data/dconf/make-dconf-override-db.sh + patchShebangs --build data/dconf/make-dconf-override-db.sh cp ${buildPackages.gtk-doc}/share/gtk-doc/data/gtk-doc.make . ''; @@ -105,6 +114,7 @@ stdenv.mkDerivation rec { python3BuildEnv vala wrapGAppsHook + dbus-launch ]; propagatedBuildInputs = [