diff --git a/nixos/tests/miracle-wm.nix b/nixos/tests/miracle-wm.nix index 2bb62222b22a1..bc346a1568152 100644 --- a/nixos/tests/miracle-wm.nix +++ b/nixos/tests/miracle-wm.nix @@ -22,6 +22,8 @@ user = "alice"; }; + programs.ydotool.enable = true; + services.xserver.enable = true; services.displayManager.defaultSession = lib.mkForce "miracle-wm"; @@ -59,7 +61,7 @@ ]; # To help with OCR - etc."xdg/foot/foot.ini".text = lib.generators.toINI { } { + etc."xdg/foot/foot.ini".source = (pkgs.formats.ini { }).generate "foot.ini" { main = { font = "inconsolata:size=16"; }; @@ -69,7 +71,7 @@ regular2 = foreground; }; }; - etc."xdg/alacritty/alacritty.yml".text = lib.generators.toYAML { } { + etc."xdg/alacritty/alacritty.toml".source = (pkgs.formats.toml { }).generate "alacritty.toml" { font = rec { normal.family = "Inconsolata"; bold.family = normal.family; @@ -114,7 +116,17 @@ machine.wait_for_file("/tmp/test-wayland-exit-ok") machine.copy_from_vm("/tmp/test-wayland.out") machine.screenshot("foot_wayland_info") + + # please actually register that we want to close the window + machine.succeed("ydotool mousemove -- 10 10") + machine.sleep(3) + machine.send_chars("exit\n") + + # please actually register that we want to close the window + machine.succeed("ydotool mousemove -- 10 10") + machine.sleep(3) + machine.wait_until_fails("pgrep foot") # Test XWayland @@ -125,7 +137,17 @@ machine.wait_for_file("/tmp/test-x11-exit-ok") machine.copy_from_vm("/tmp/test-x11.out") machine.screenshot("alacritty_glinfo") + + # please actually register that we want to close the window + machine.succeed("ydotool mousemove -- 10 10") + machine.sleep(3) + machine.send_chars("exit\n") + + # please actually register that we want to close the window + machine.succeed("ydotool mousemove -- 10 10") + machine.sleep(3) + machine.wait_until_fails("pgrep alacritty") ''; } diff --git a/nixos/tests/miriway.nix b/nixos/tests/miriway.nix index 14546dd03dff3..012def1c4510c 100644 --- a/nixos/tests/miriway.nix +++ b/nixos/tests/miriway.nix @@ -23,6 +23,8 @@ import ./make-test-python.nix ( user = "alice"; }; + programs.ydotool.enable = true; + services.xserver.enable = true; services.displayManager.defaultSession = lib.mkForce "miriway"; @@ -55,7 +57,7 @@ import ./make-test-python.nix ( ]; # To help with OCR - etc."xdg/foot/foot.ini".text = lib.generators.toINI { } { + etc."xdg/foot/foot.ini".source = (pkgs.formats.ini { }).generate "foot.ini" { main = { font = "inconsolata:size=16"; }; @@ -65,7 +67,7 @@ import ./make-test-python.nix ( regular2 = foreground; }; }; - etc."xdg/alacritty/alacritty.yml".text = lib.generators.toYAML { } { + etc."xdg/alacritty/alacritty.toml".source = (pkgs.formats.toml { }).generate "alacritty.toml" { font = rec { normal.family = "Inconsolata"; bold.family = normal.family; @@ -109,10 +111,18 @@ import ./make-test-python.nix ( machine.wait_for_file("/tmp/test-wayland-exit-ok") machine.copy_from_vm("/tmp/test-wayland.out") machine.screenshot("foot_wayland_info") - # Only succeeds when a mouse is moved inside an interactive session? - # machine.send_chars("exit\n") - # machine.wait_until_fails("pgrep foot") - machine.succeed("pkill foot") + + # please actually register that we want to close the window + machine.succeed("ydotool mousemove -- 10 10") + machine.sleep(3) + + machine.send_chars("exit\n") + + # please actually register that we want to close the window + machine.succeed("ydotool mousemove -- 10 10") + machine.sleep(3) + + machine.wait_until_fails("pgrep foot") # Test XWayland machine.send_key("ctrl-alt-a") @@ -121,10 +131,18 @@ import ./make-test-python.nix ( machine.wait_for_file("/tmp/test-x11-exit-ok") machine.copy_from_vm("/tmp/test-x11.out") machine.screenshot("alacritty_glinfo") - # Only succeeds when a mouse is moved inside an interactive session? - # machine.send_chars("exit\n") - # machine.wait_until_fails("pgrep alacritty") - machine.succeed("pkill alacritty") + + # please actually register that we want to close the window + machine.succeed("ydotool mousemove -- 10 10") + machine.sleep(3) + + machine.send_chars("exit\n") + + # please actually register that we want to close the window + machine.succeed("ydotool mousemove -- 10 10") + machine.sleep(3) + + machine.wait_until_fails("pgrep alacritty") ''; } ) diff --git a/pkgs/servers/mir/common.nix b/pkgs/servers/mir/common.nix index e41798d6aa08d..ccc1150db5b73 100644 --- a/pkgs/servers/mir/common.nix +++ b/pkgs/servers/mir/common.nix @@ -12,7 +12,6 @@ freetype, glib, glm, - glog, libapparmor, libdrm, libepoxy, @@ -112,7 +111,6 @@ stdenv.mkDerivation (finalAttrs: { freetype glib glm - glog libdrm libepoxy libevdev @@ -159,7 +157,12 @@ stdenv.mkDerivation (finalAttrs: { # BadBufferTest.test_truncated_shm_file *doesn't* throw an error as the test expected, mark as such # https://github.com/canonical/mir/pull/1947#issuecomment-811810872 (lib.cmakeBool "MIR_SIGBUS_HANDLER_ENVIRONMENT_BROKEN" true) - (lib.cmakeFeature "MIR_EXCLUDE_TESTS" (lib.strings.concatStringsSep ";" [ ])) + (lib.cmakeFeature "MIR_EXCLUDE_TESTS" ( + lib.strings.concatStringsSep ";" [ + # https://github.com/canonical/mir/issues/3716#issuecomment-2580698552 + "UdevWrapperTest.UdevMonitorDoesNotTriggerBeforeEnabling" + ] + )) # These get built but don't get executed by default, yet they get installed when tests are enabled (lib.cmakeBool "MIR_BUILD_PERFORMANCE_TESTS" false) (lib.cmakeBool "MIR_BUILD_PLATFORM_TEST_HARNESS" false) diff --git a/pkgs/servers/mir/default.nix b/pkgs/servers/mir/default.nix index 57bc70f1a7a40..d040ebeb85259 100644 --- a/pkgs/servers/mir/default.nix +++ b/pkgs/servers/mir/default.nix @@ -29,6 +29,14 @@ in hash = "sha256-k+51piPQandbHdm+ioqpBrb+C7Aqi2kugchAehZ1aiU="; }) + # Always depend on epoxy + # Remove when version > 2.15.0 + (fetchpatch { + name = "0003-mir-cmake-always-require-epoxy.patch"; + url = "https://github.com/canonical/mir/commit/171c42ac3929f946a70505ee42be0ce8220f245a.patch"; + hash = "sha256-QuVZBcHSn/DK+xbjM36Y89+w22vk7NRV4MkbjgvS28A="; + }) + # Fix ignored return value of std::lock_guard # Remove when version > 2.15.0 # Was changed as part of the big platform API change, no individual upstream commit with this fix @@ -44,6 +52,33 @@ in # Partially done in https://github.com/canonical/mir/pull/3192, though one of the calloc was fixed earlier # when some code was moved into that file ./1003-mir-2_15-calloc-args-in-right-order.patch + + # Drop gflags & glog dependencies + # Remove when version > 2.16.4 + (fetchpatch { + name = "0101-Drop-unused-dependency-on-gflags.patch"; + url = "https://github.com/canonical/mir/commit/15a40638e5e9c4b6a11b7fa446ad31e190f485e7.patch"; + includes = [ + "CMakeLists.txt" + "examples/mir_demo_server/CMakeLists.txt" + "examples/mir_demo_server/glog_logger.cpp" + ]; + hash = "sha256-qIsWCOs6Ap0jJ2cpgdO+xJHmSqC6zP+J3ALAfmlA6Vc="; + }) + (fetchpatch { + name = "0102-Drop-the-glog-example.patch"; + url = "https://github.com/canonical/mir/commit/8407da28ddb9a535df2775f224bf5143e8770d52.patch"; + includes = [ + "CMakeLists.txt" + "examples/mir_demo_server/CMakeLists.txt" + "examples/mir_demo_server/glog_logger.cpp" + "examples/mir_demo_server/glog_logger.h" + "examples/mir_demo_server/server_example.cpp" + "examples/mir_demo_server/server_example_log_options.cpp" + "examples/mir_demo_server/server_example_log_options.h" + ]; + hash = "sha256-jVhVR7wZZZGRS40z+HPNoGBLHulvE1nHRKgYhQ6/g9M="; + }) ]; }; }