From e81c7debf2bbadc30fe9e5400826e7abb04d801b Mon Sep 17 00:00:00 2001 From: OPNA2608 Date: Mon, 23 Feb 2026 22:25:42 +0100 Subject: [PATCH 1/8] mir_2_15: Fix build with Boost 1.89 --- pkgs/servers/mir/common.nix | 8 ++++++++ pkgs/servers/mir/default.nix | 17 +++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/pkgs/servers/mir/common.nix b/pkgs/servers/mir/common.nix index fa19b6d35f01..b9e7c4e3a3f6 100644 --- a/pkgs/servers/mir/common.nix +++ b/pkgs/servers/mir/common.nix @@ -96,6 +96,14 @@ stdenv.mkDerivation ( substituteInPlace src/platform/graphics/CMakeLists.txt \ --replace-fail "/usr/include/drm/drm_fourcc.h" "${lib.getDev libdrm}/include/libdrm/drm_fourcc.h" \ --replace-fail "/usr/include/libdrm/drm_fourcc.h" "${lib.getDev libdrm}/include/libdrm/drm_fourcc.h" + '' + # Boost.System was deprecated & dropped + + lib.optionalString (lib.strings.versionOlder version "2.23.0") '' + substituteInPlace \ + tests/CMakeLists.txt \ + tests/unit-tests/CMakeLists.txt \ + tests/mir_test_framework/CMakeLists.txt \ + --replace-fail 'Boost::system' "" ''; strictDeps = true; diff --git a/pkgs/servers/mir/default.nix b/pkgs/servers/mir/default.nix index 4671f0ddca2c..86e5c791a886 100644 --- a/pkgs/servers/mir/default.nix +++ b/pkgs/servers/mir/default.nix @@ -110,6 +110,23 @@ in ]; hash = "sha256-gzLVQW9Z6y+s2D7pKtp0ondQrjkzZ5iUYhGDPqFXD5M="; }) + + # Drop deprecated & removed Boost.System + # Remove when version > 2.22.2 + (fetchpatch { + name = "0301-mir-Disable-boost_system.patch"; + url = "https://github.com/canonical/mir/commit/0261aa6ce700311ee2b8723294451cdade1bc219.patch"; + excludes = [ + # hunk errors + "tests/CMakeLists.txt" + "tests/mir_test_framework/CMakeLists.txt" + "tests/unit-tests/CMakeLists.txt" + + # doesn't exist + "tests/window_management_tests/CMakeLists.txt" + ]; + hash = "sha256-UqClQFHzA1th2P7NH67dMJtncw8n/ey9RlPD5Z3VPk0="; + }) ]; }; } From cc8c910e542e5c2b4d203eec1606fa6496bf1518 Mon Sep 17 00:00:00 2001 From: OPNA2608 Date: Tue, 24 Feb 2026 13:29:10 +0100 Subject: [PATCH 2/8] net-cpp: Fix build with Boost 1.89 --- pkgs/by-name/ne/net-cpp/package.nix | 31 +++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/pkgs/by-name/ne/net-cpp/package.nix b/pkgs/by-name/ne/net-cpp/package.nix index 49a7d8db8614..961af44c5a4f 100644 --- a/pkgs/by-name/ne/net-cpp/package.nix +++ b/pkgs/by-name/ne/net-cpp/package.nix @@ -2,11 +2,11 @@ stdenv, lib, fetchFromGitLab, + fetchpatch, gitUpdater, makeFontsConf, testers, - # https://gitlab.com/ubports/development/core/lib-cpp/net-cpp/-/issues/5 - boost186, + boost, cmake, curl, doxygen, @@ -46,11 +46,26 @@ stdenv.mkDerivation (finalAttrs: { "doc" ]; - postPatch = lib.optionalString finalAttrs.finalPackage.doCheck '' - # Use wrapped python. Removing just the /usr/bin doesn't seem to work? - substituteInPlace tests/httpbin.h.in \ - --replace '/usr/bin/python3' '${lib.getExe pythonEnv}' - ''; + patches = [ + # Remove when version > 3.2.0 + (fetchpatch { + name = "0001-net-cpp-fix-compatibility-with-Boost-1.88.patch"; + url = "https://gitlab.com/ubports/development/core/lib-cpp/net-cpp/-/commit/9ff8651b11eb9dc0f64147001e10a57d1546a626.patch"; + hash = "sha256-IEa3nhnv0oa5WmhIDG3OMrZmmoAZFeedAzKXAKVTIQg="; + }) + ]; + + postPatch = + # https://gitlab.com/ubports/development/core/lib-cpp/net-cpp/-/merge_requests/22, too basic to bother with fetchpatch + '' + substituteInPlace src/CMakeLists.txt \ + --replace-fail 'find_package(Boost COMPONENTS system' 'find_package(Boost COMPONENTS' + '' + + lib.optionalString finalAttrs.finalPackage.doCheck '' + # Use wrapped python. Removing just the /usr/bin doesn't seem to work? + substituteInPlace tests/httpbin.h.in \ + --replace '/usr/bin/python3' '${lib.getExe pythonEnv}' + ''; strictDeps = true; @@ -63,7 +78,7 @@ stdenv.mkDerivation (finalAttrs: { ]; buildInputs = [ - boost186 + boost curl ]; From f8fae2858a17d1245c3f8c97020336bb8f101540 Mon Sep 17 00:00:00 2001 From: OPNA2608 Date: Mon, 23 Feb 2026 22:26:23 +0100 Subject: [PATCH 3/8] persistent-cache-cpp: Fix build with Boost 1.89 --- pkgs/by-name/pe/persistent-cache-cpp/package.nix | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pkgs/by-name/pe/persistent-cache-cpp/package.nix b/pkgs/by-name/pe/persistent-cache-cpp/package.nix index 0db45ec2837d..e3651b102035 100644 --- a/pkgs/by-name/pe/persistent-cache-cpp/package.nix +++ b/pkgs/by-name/pe/persistent-cache-cpp/package.nix @@ -2,6 +2,7 @@ stdenv, lib, fetchFromGitLab, + fetchpatch, gitUpdater, testers, boost, @@ -32,6 +33,15 @@ stdenv.mkDerivation (finalAttrs: { "doc" ]; + patches = [ + # Remove when version > 1.0.9 + (fetchpatch { + name = "0001-persistent-cache-cpp-Fix-compatibility-with-Boost-1.89.patch"; + url = "https://gitlab.com/ubports/development/core/lib-cpp/persistent-cache-cpp/-/commit/121397b58bdb2d6750a41bec0cf1676e4e9b8cf5.patch"; + hash = "sha256-QKPf5E49NNZ+rzCCknJNQjcd/bEgHuh23RBM892Xz1o="; + }) + ]; + postPatch = '' # Wrong concatenation substituteInPlace data/libpersistent-cache-cpp.pc.in \ From e47f4fd34d1f1b3f7b78d2200fcefdf4ce2d01e7 Mon Sep 17 00:00:00 2001 From: OPNA2608 Date: Mon, 23 Feb 2026 22:36:10 +0100 Subject: [PATCH 4/8] lomiri.biometryd: Fix compatibility with Boost 1.89 --- .../lomiri/services/biometryd/default.nix | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/pkgs/desktops/lomiri/services/biometryd/default.nix b/pkgs/desktops/lomiri/services/biometryd/default.nix index e02025cb850d..db01da04bb95 100644 --- a/pkgs/desktops/lomiri/services/biometryd/default.nix +++ b/pkgs/desktops/lomiri/services/biometryd/default.nix @@ -2,10 +2,10 @@ stdenv, lib, fetchFromGitLab, + fetchpatch, gitUpdater, testers, - # https://gitlab.com/ubports/development/core/biometryd/-/issues/8 - boost186, + boost, cmake, cmake-extras, dbus, @@ -39,6 +39,15 @@ stdenv.mkDerivation (finalAttrs: { "dev" ]; + patches = [ + # Remove when version > 0.4.0 + (fetchpatch { + name = "0001-biometryd-Fix-compatibility-with-Boost-1.87.patch"; + url = "https://gitlab.com/ubports/development/core/biometryd/-/commit/8def6dfb18ee56971f0f64e3622af2a5a39ab0f6.patch"; + hash = "sha256-PddZRML4Gc+s4aNeOyZwJJjmPSixMGFVFNcrO9dNDSI="; + }) + ]; + postPatch = '' # Substitute systemd's prefix in pkg-config call substituteInPlace data/CMakeLists.txt \ @@ -66,7 +75,7 @@ stdenv.mkDerivation (finalAttrs: { ]; buildInputs = [ - boost186 + boost cmake-extras dbus dbus-cpp From d08b09fb652bce2521998522974c027edd603fbe Mon Sep 17 00:00:00 2001 From: OPNA2608 Date: Mon, 23 Feb 2026 22:26:54 +0100 Subject: [PATCH 5/8] lomiri.lomiri-thumbnailer: Fix build with Boost 1.89 --- .../lomiri/services/lomiri-thumbnailer/default.nix | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pkgs/desktops/lomiri/services/lomiri-thumbnailer/default.nix b/pkgs/desktops/lomiri/services/lomiri-thumbnailer/default.nix index ef3ef0f8b044..a19023f42b5d 100644 --- a/pkgs/desktops/lomiri/services/lomiri-thumbnailer/default.nix +++ b/pkgs/desktops/lomiri/services/lomiri-thumbnailer/default.nix @@ -76,6 +76,14 @@ stdenv.mkDerivation (finalAttrs: { # Tests run in parallel to other builds, don't suck up cores substituteInPlace tests/headers/compile_headers.py \ --replace-fail 'max_workers=multiprocessing.cpu_count()' "max_workers=1" + '' + # https://gitlab.com/ubports/development/core/lomiri-thumbnailer/-/merge_requests/31 + # Too simple to bother with fetchpatch + + '' + substituteInPlace CMakeLists.txt \ + --replace-fail \ + 'find_package(Boost COMPONENTS filesystem iostreams regex system REQUIRED)' \ + 'find_package(Boost COMPONENTS filesystem iostreams regex REQUIRED)' ''; strictDeps = true; From 9ac0afd956a1d27758f0e1dc4e2ea20011e97f2d Mon Sep 17 00:00:00 2001 From: OPNA2608 Date: Tue, 24 Feb 2026 17:50:40 +0100 Subject: [PATCH 6/8] lomiri.lomiri-telephony-service: Disable tests where libnotify 0.8.8 aborts --- .../lomiri-telephony-service/default.nix | 42 +++++++++---------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/pkgs/desktops/lomiri/services/lomiri-telephony-service/default.nix b/pkgs/desktops/lomiri/services/lomiri-telephony-service/default.nix index 0c387ce96abb..6675c88c140b 100644 --- a/pkgs/desktops/lomiri/services/lomiri-telephony-service/default.nix +++ b/pkgs/desktops/lomiri/services/lomiri-telephony-service/default.nix @@ -8,6 +8,7 @@ ayatana-indicator-messages, bash, cmake, + ctestCheckHook, dbus, dbus-glib, dbus-test-runner, @@ -111,6 +112,7 @@ stdenv.mkDerivation (finalAttrs: { ]; nativeCheckInputs = [ + ctestCheckHook dbus-test-runner dconf gnome-keyring @@ -124,27 +126,6 @@ stdenv.mkDerivation (finalAttrs: { # These rely on libphonenumber reformatting inputs to certain results # Seem to be broken for a small amount of numbers, maybe libphonenumber version change? (lib.cmakeBool "SKIP_QML_TESTS" true) - (lib.cmakeFeature "CMAKE_CTEST_ARGUMENTS" ( - lib.concatStringsSep ";" [ - # Exclude tests - "-E" - (lib.strings.escapeShellArg "(${ - lib.concatStringsSep "|" [ - # Flaky, randomly failing to launch properly & stuck until test timeout - # https://gitlab.com/ubports/development/core/lomiri-telephony-service/-/issues/70 - "^HandlerTest" - "^OfonoAccountEntryTest" - "^TelepathyHelperSetupTest" - "^AuthHandlerTest" - "^ChatManagerTest" - "^AccountEntryTest" - "^AccountEntryFactoryTest" - "^PresenceRequestTest" - "^CallEntryTest" - ] - })") - ] - )) ]; env.NIX_CFLAGS_COMPILE = toString [ @@ -158,6 +139,25 @@ stdenv.mkDerivation (finalAttrs: { # Starts & talks to D-Bus services, breaks with parallelism enableParallelChecking = false; + disabledTests = [ + # Flaky, randomly failing to launch properly & stuck until test timeout + # https://gitlab.com/ubports/development/core/lomiri-telephony-service/-/issues/70 + "AccountEntryTest" + "AccountEntryFactoryTest" + "AuthHandlerTest" + "CallEntryTest" + "ChatManagerTest" + "HandlerTest" + "OfonoAccountEntryTest" + "PresenceRequestTest" + "TelepathyHelperSetupTest" + + # Failing most of the time since libnotify 0.8.8 + # https://gitlab.com/ubports/development/core/lomiri-telephony-service/-/issues/75 + "ApproverTest" + "MessagingMenuTest" + ]; + preCheck = '' export QT_QPA_PLATFORM=minimal export QT_PLUGIN_PATH=${ From a3b5d348d707849162ca9a92feda4c4e37f6d6d0 Mon Sep 17 00:00:00 2001 From: OPNA2608 Date: Tue, 24 Feb 2026 21:14:49 +0100 Subject: [PATCH 7/8] lomiri.lomiri-polkit-agent: Fix test compatibility with libnotify 0.8.8 --- ...1001-Fix-compat-with-libnotify-0.8.8.patch | 36 +++++++++++++++++++ .../services/lomiri-polkit-agent/default.nix | 5 +++ 2 files changed, 41 insertions(+) create mode 100644 pkgs/desktops/lomiri/services/lomiri-polkit-agent/1001-Fix-compat-with-libnotify-0.8.8.patch diff --git a/pkgs/desktops/lomiri/services/lomiri-polkit-agent/1001-Fix-compat-with-libnotify-0.8.8.patch b/pkgs/desktops/lomiri/services/lomiri-polkit-agent/1001-Fix-compat-with-libnotify-0.8.8.patch new file mode 100644 index 000000000000..a741c5442cd0 --- /dev/null +++ b/pkgs/desktops/lomiri/services/lomiri-polkit-agent/1001-Fix-compat-with-libnotify-0.8.8.patch @@ -0,0 +1,36 @@ +From df28165c0955ab963aeda41ffda86651115f4efb Mon Sep 17 00:00:00 2001 +From: OPNA2608 +Date: Tue, 24 Feb 2026 21:04:37 +0100 +Subject: [PATCH] tests/authentication-test.cpp: Fix compat with libnotify + 0.8.8 + +--- + tests/authentication-test.cpp | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +diff --git a/tests/authentication-test.cpp b/tests/authentication-test.cpp +index 8c74867..2fee42d 100644 +--- a/tests/authentication-test.cpp ++++ b/tests/authentication-test.cpp +@@ -245,12 +245,16 @@ TEST_F(AuthenticationTest, BasicRequest) + EXPECT_EQ("Cancel", dialogs[0].actions[3]); + + /* Hints */ +-#if (NOTIFY_VERSION_MAJOR >= 0) && (NOTIFY_VERSION_MINOR >= 8) ++#if NOTIFY_CHECK_VERSION(0, 8, 0) ++#if NOTIFY_CHECK_VERSION(0, 8, 8) ++ EXPECT_EQ(4, dialogs[0].hints.size()); ++#else + EXPECT_EQ(3, dialogs[0].hints.size()); ++#endif // NOTIFY_CHECK_VERSION(0, 8, 8) + EXPECT_NE(dialogs[0].hints.end(), dialogs[0].hints.find("sender-pid")); + #else + EXPECT_EQ(2, dialogs[0].hints.size()); +-#endif ++#endif // NOTIFY_CHECK_VERSION(0, 8, 0) + EXPECT_NE(dialogs[0].hints.end(), dialogs[0].hints.find("x-lomiri-snap-decisions")); + EXPECT_NE(dialogs[0].hints.end(), dialogs[0].hints.find("x-lomiri-private-menu-model")); + +-- +2.51.2 + diff --git a/pkgs/desktops/lomiri/services/lomiri-polkit-agent/default.nix b/pkgs/desktops/lomiri/services/lomiri-polkit-agent/default.nix index 468d847f1469..daea4403b05b 100644 --- a/pkgs/desktops/lomiri/services/lomiri-polkit-agent/default.nix +++ b/pkgs/desktops/lomiri/services/lomiri-polkit-agent/default.nix @@ -27,6 +27,11 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-JKU2lm5wco9aC2cu3lgJ9OfGAzKQO/wQXFPEdb9Uz3Y="; }; + patches = [ + # Remove when https://gitlab.com/ubports/development/core/lomiri-polkit-agent/-/merge_requests/17 merged & in release + ./1001-Fix-compat-with-libnotify-0.8.8.patch + ]; + strictDeps = true; nativeBuildInputs = [ From 773e580c04242a7fb59eda9fa0b4827cef09eb2d Mon Sep 17 00:00:00 2001 From: OPNA2608 Date: Wed, 25 Feb 2026 17:58:02 +0100 Subject: [PATCH 8/8] nixosTests.lomiri: Drop OCR to determine terminal startup Instead change the foreground colour to smth unique, and look for it on the screen. --- nixos/tests/lomiri.nix | 53 +++++++++++++++++++++++++++++------------- 1 file changed, 37 insertions(+), 16 deletions(-) diff --git a/nixos/tests/lomiri.nix b/nixos/tests/lomiri.nix index 45b4b59c3103..b548288c62c6 100644 --- a/nixos/tests/lomiri.nix +++ b/nixos/tests/lomiri.nix @@ -9,7 +9,18 @@ let # In case it ever shows up in the VM, we could OCR for it instead wallpaperText = "Lorem ipsum"; - # tmpfiles setup to make OCRing on terminal output more reliable + # setup to make OCRing on terminal output more reliable + terminalTextColour = { + r = 91; + g = 113; + b = 102; + }; + terminalTextColourString = + lib: + let + toHex = component: lib.optionalString (component < 16) "0" + lib.trivial.toHexString component; + in + "#${toHex terminalTextColour.r}${toHex terminalTextColour.g}${toHex terminalTextColour.b}"; terminalOcrTmpfilesSetup = { pkgs, @@ -18,7 +29,7 @@ let }: let white = "255, 255, 255"; - black = "0, 0, 0"; + foreground = "${toString terminalTextColour.r}, ${toString terminalTextColour.g}, ${toString terminalTextColour.b}"; colorSection = color: { Color = color; Bold = true; @@ -27,9 +38,9 @@ let terminalColors = pkgs.writeText "customized.colorscheme" ( lib.generators.toINI { } { Background = colorSection white; - Foreground = colorSection black; - Color2 = colorSection black; - Color2Intense = colorSection black; + Foreground = colorSection foreground; + Color2 = colorSection foreground; + Color2Intense = colorSection foreground; } ); terminalConfig = pkgs.writeText "terminal.ubports.conf" ( @@ -75,7 +86,7 @@ let }; }; - sharedTestFunctions = '' + sharedTestFunctions = lib: '' from collections.abc import Callable import tempfile import subprocess @@ -120,6 +131,17 @@ let ) return check_for_color_continued_presence_retry + def ensure_terminal_running() -> None: + """ + Ensure that lomiri-terminal-app has finished starting up. + """ + + terminalTextColor: str = "${terminalTextColourString lib}" + with machine.nested("Waiting for the screen to have terminalTextColor {} on it:".format(terminalTextColor)): + retry(check_for_color(terminalTextColor)) + with machine.nested("Ensuring terminalTextColor {} stays present on the screen:".format(terminalTextColor)): + retry(fn=check_for_color_continued_presence(terminalTextColor), timeout_seconds=5) + def ensure_lomiri_running() -> None: """ Ensure that Lomiri has finished starting up. @@ -183,7 +205,6 @@ let # Using the keybind has a chance of instantly closing the menu again? Just click the button mouse_click(15, 15) - ''; makeIndicatorTest = @@ -237,7 +258,7 @@ let testScript = { nodes, ... }: - sharedTestFunctions + (sharedTestFunctions lib) + '' start_all() machine.wait_for_unit("multi-user.target") @@ -330,7 +351,7 @@ in testScript = { nodes, ... }: - sharedTestFunctions + (sharedTestFunctions lib) + '' start_all() machine.wait_for_unit("multi-user.target") @@ -451,7 +472,7 @@ in testScript = { nodes, ... }: - sharedTestFunctions + (sharedTestFunctions lib) + '' start_all() machine.wait_for_unit("multi-user.target") @@ -463,7 +484,7 @@ in # Working terminal keybind is good with subtest("terminal keybind works"): machine.send_key("ctrl-alt-t") - wait_for_text(r"(${user}|machine)") + ensure_terminal_running() machine.screenshot("terminal_opens") machine.send_key("alt-f4") @@ -474,7 +495,7 @@ in # Just try the terminal again, we know that it should work machine.send_chars("Terminal\n") - wait_for_text(r"(${user}|machine)") + ensure_terminal_running() machine.send_key("alt-f4") # We want support for X11 apps @@ -598,7 +619,7 @@ in testScript = { nodes, ... }: - sharedTestFunctions + (sharedTestFunctions lib) + '' start_all() machine.wait_for_unit("multi-user.target") @@ -610,7 +631,7 @@ in # Working terminal keybind is good with subtest("terminal keybind works"): machine.send_key("ctrl-alt-t") - wait_for_text(r"(${user}|machine)") + ensure_terminal_running() machine.screenshot("terminal_opens") # for the LSS lomiri-content-hub test to work reliably, we need to kick off peer collecting @@ -744,7 +765,7 @@ in testScript = { nodes, ... }: - sharedTestFunctions + (sharedTestFunctions lib) + '' start_all() machine.wait_for_unit("multi-user.target") @@ -773,7 +794,7 @@ in # Lomiri in desktop mode should use the correct keymap with subtest("lomiri session keymap works"): machine.send_key("ctrl-alt-t") - wait_for_text(r"(${user}|machine)") + ensure_terminal_running() machine.screenshot("terminal_opens") machine.send_chars("touch ${pwInput}\n")