Skip to content

Commit

Permalink
lomiri.lomiri-schemas: 0.1.5 -> 0.1.6 (#370966)
Browse files Browse the repository at this point in the history
  • Loading branch information
OPNA2608 authored Jan 16, 2025
2 parents ace00c0 + 2256fa4 commit d3a5ff6
Show file tree
Hide file tree
Showing 7 changed files with 335 additions and 21 deletions.
3 changes: 3 additions & 0 deletions pkgs/by-name/ay/ayatana-indicator-sound/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,9 @@ stdenv.mkDerivation (finalAttrs: {

doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform;

# Starts & talks to D-Bus, breaks under parallelism
enableParallelChecking = false;

passthru = {
ayatana-indicators = {
ayatana-indicator-sound = [
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,196 @@
From 9c4cd4fa938244cc2e319555d372e4e32029964a Mon Sep 17 00:00:00 2001
From: OPNA2608 <[email protected]>
Date: Tue, 14 Jan 2025 23:06:20 +0100
Subject: [PATCH] tests/unittests/qml/tst_AddressBar.qml: Replace wait +
compare with tryCompare

---
tests/unittests/qml/tst_AddressBar.qml | 75 +++++++++++---------------
1 file changed, 30 insertions(+), 45 deletions(-)

diff --git a/tests/unittests/qml/tst_AddressBar.qml b/tests/unittests/qml/tst_AddressBar.qml
index 5c27acff..dc0ec4c6 100644
--- a/tests/unittests/qml/tst_AddressBar.qml
+++ b/tests/unittests/qml/tst_AddressBar.qml
@@ -73,6 +73,15 @@ Item {
name: "AddressBar"
when: windowShown

+ function verifyAddressBarText(text) {
+ tryCompare(addressBar, "text", text)
+ }
+
+ function typeStringAndVerify(text) {
+ typeString(text)
+ verifyAddressBarText(text)
+ }
+
function init() {
addressBar.actualUrl = ""
validatedSpy.clear()
@@ -101,9 +110,7 @@ Item {
}

function test_validUrlShouldNotBeRewritten(data) {
- typeString(data.url)
- wait(500)
- compare(addressBar.text, data.url)
+ typeStringAndVerify(data.url)
keyClick(Qt.Key_Return)
validatedSpy.wait()
compare(addressBar.requestedUrl, data.url)
@@ -120,9 +127,7 @@ Item {
}

function test_urlWithoutSchemeShouldBeRewritten(data) {
- typeString(data.text)
- wait(500)
- compare(addressBar.text, data.text)
+ typeStringAndVerify(data.text)
keyClick(Qt.Key_Return)
validatedSpy.wait()
compare(addressBar.requestedUrl, data.requestedUrl)
@@ -137,9 +142,7 @@ Item {
}

function test_leadingAndTrailingWhitespacesShouldBeTrimmed(data) {
- typeString(data.text)
- wait(500)
- compare(addressBar.text, data.text)
+ typeStringAndVerify(data.text)
keyClick(Qt.Key_Return)
validatedSpy.wait()
compare(addressBar.requestedUrl, data.requestedUrl)
@@ -153,9 +156,7 @@ Item {
}

function test_searchQueryShouldBeRewritten(data) {
- typeString(data.text)
- wait(500)
- compare(addressBar.text, data.text)
+ typeStringAndVerify(data.text)
keyClick(Qt.Key_Return)
validatedSpy.wait()
compare(addressBar.requestedUrl.toString().indexOf(data.start), 0)
@@ -174,9 +175,7 @@ Item {
}

function test_htmlEntitiesShouldBeEscapedInSearchQueries(data) {
- typeString(data.text)
- wait(500)
- compare(addressBar.text, data.text)
+ typeStringAndVerify(data.text)
keyClick(Qt.Key_Return)
validatedSpy.wait()
verify(addressBar.requestedUrl.toString().indexOf("q=" + data.escaped) > 0)
@@ -191,9 +190,7 @@ Item {
}

function test_uppercaseDomainsShouldBeRewritten(data) {
- typeString(data.text)
- wait(500)
- compare(addressBar.text, data.text)
+ typeStringAndVerify(data.text)
keyClick(Qt.Key_Return)
validatedSpy.wait()
compare(addressBar.requestedUrl, data.requestedUrl)
@@ -213,9 +210,7 @@ Item {
}

function test_uppercaseSchemeShouldBeRewritten(data) {
- typeString(data.text)
- wait(500)
- compare(addressBar.text, data.text)
+ typeStringAndVerify(data.text)
keyClick(Qt.Key_Return)
validatedSpy.wait()
compare(addressBar.requestedUrl, data.requestedUrl)
@@ -266,9 +261,7 @@ Item {
}

function test_urlShouldBeSimplifiedWhenUnfocused(data) {
- typeString(data.input)
- wait(500)
- compare(addressBar.text, data.input)
+ typeStringAndVerify(data.input)
keyClick(Qt.Key_Return)
validatedSpy.wait()
addressBar.actualUrl = addressBar.requestedUrl
@@ -289,9 +282,7 @@ Item {

function test_clickingWhenUnfocusedShouldSelectAll() {
var url = "http://example.org/"
- typeString(url)
- wait(500)
- compare(addressBar.text, url)
+ typeStringAndVerify(url)
addressBar.actualUrl = url
clickItem(textInput)
verify(!addressBar.activeFocus)
@@ -301,9 +292,7 @@ Item {

function test_clickingWhenFocusedShouldDeselectText() {
var url = "http://example.org/"
- typeString(url)
- wait(500)
- compare(addressBar.text, url)
+ typeStringAndVerify(url)
addressBar.actualUrl = url
clickItem(textInput)
verify(!addressBar.activeFocus)
@@ -316,9 +305,7 @@ Item {

function test_clickingActionButtonWhenUnfocusedShouldNotSelectAll() {
var url = "http://example.org/"
- typeString(url)
- wait(500)
- compare(addressBar.text, url)
+ typeStringAndVerify(url)
clickItem(textInput)
verify(!addressBar.activeFocus)
clickItem(addressBar.__actionButton)
@@ -355,31 +342,29 @@ Item {
}

function test_unfocusingWhileEditingShouldResetUrl() {
- var url = "http://example.org/"
- typeString(url)
- wait(500)
- compare(addressBar.text, url)
+ var host = "example.org"
+ var url = "http://" + host + "/"
+ typeStringAndVerify(url)
addressBar.actualUrl = url
var clearButton = findChild(addressBar, "clear_button")
verify(clearButton != null)
clickItem(clearButton)
- compare(addressBar.text, "")
+ verifyAddressBarText("")
clickItem(textInput)
- compare(addressBar.text, "example.org")
+ verifyAddressBarText(host)
clickItem(addressBar)
- compare(addressBar.text, url)
+ verifyAddressBarText(url)
}

function test_exitingFindInPageRestoresUrl() {
- addressBar.actualUrl = "http://example.org/"
+ var host = "example.org"
+ addressBar.actualUrl = "http://" + host + "/"
addressBar.findInPageMode = true
verify(addressBar.activeFocus)
compare(addressBar.text, "")
- typeString("hello")
- wait(500)
+ typeStringAndVerify("hello")
addressBar.findInPageMode = false
- wait(500)
- compare(addressBar.text, "example.org")
+ verifyAddressBarText(host)
}
}
}
--
2.47.0

34 changes: 21 additions & 13 deletions pkgs/desktops/lomiri/applications/morph-browser/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
qtdeclarative,
qtquickcontrols2,
qtsystems,
qttools,
qtwebengine,
wrapQtAppsHook,
xvfb-run,
Expand All @@ -38,31 +39,38 @@ stdenv.mkDerivation (finalAttrs: {
hash = "sha256-VxSADFTlaxQUDc81TzGkx54mjAUgY2L+suQC9zYGKo0=";
};

outputs = [
"out"
"doc"
];

patches = [
# Remove when https://gitlab.com/ubports/development/core/morph-browser/-/merge_requests/576 merged & in release
# Remove when version > 1.1.1
(fetchpatch {
name = "0002-morph-browser-Call-i18n-bindtextdomain-with-buildtime-determined-locale-path.patch";
url = "https://gitlab.com/ubports/development/core/morph-browser/-/commit/0527a1e01fb27c62f5e0011274f73bad400e9691.patch";
url = "https://gitlab.com/ubports/development/core/morph-browser/-/commit/3d9777fdc7d5b302a9f17679e4ea125e94468772.patch";
hash = "sha256-zx/pP72uNqAi8TZR4bKeONuqcJyK/vGtPglTA+5R5no=";
})

# Remove when https://gitlab.com/ubports/development/core/morph-browser/-/merge_requests/589 merged & in release
./1001-morph-browser-tst_AddressBar-Replace-wait-and-compare-with-tryCompare.patch
];

postPatch =
''
substituteInPlace src/{Morph,Ubuntu}/CMakeLists.txt \
--replace '/usr/lib/''${CMAKE_LIBRARY_ARCHITECTURE}/qt5/qml' "\''${CMAKE_INSTALL_PREFIX}/${qtbase.qtQmlPrefix}"
--replace-fail '/usr/lib/''${CMAKE_LIBRARY_ARCHITECTURE}/qt5/qml' "\''${CMAKE_INSTALL_PREFIX}/${qtbase.qtQmlPrefix}"
# We normally don't want to use absolute paths in desktop file, but this one is special
# There appears to be some issue in lomiri-app-launch's lookup of relative Icon entries (while lomiri is starting up?)
# that makes the session segfault.
# As a compromise, hardcode /run/current-system
substituteInPlace src/app/webbrowser/morph-browser.desktop.in.in \
--replace 'Icon=@CMAKE_INSTALL_FULL_DATADIR@/morph-browser/morph-browser.svg' 'Icon=/run/current-system/sw/share/icons/hicolor/scalable/apps/morph-browser.svg' \
--replace 'X-Lomiri-Splash-Image=@CMAKE_INSTALL_FULL_DATADIR@/morph-browser/morph-browser-splash.svg' 'X-Lomiri-Splash-Image=lomiri-app-launch/splash/morph-browser.svg'
--replace-fail 'Icon=@CMAKE_INSTALL_FULL_DATADIR@/morph-browser/morph-browser.svg' 'Icon=morph-browser' \
--replace-fail 'X-Lomiri-Splash-Image=@CMAKE_INSTALL_FULL_DATADIR@/morph-browser/morph-browser-splash.svg' 'X-Lomiri-Splash-Image=lomiri-app-launch/splash/morph-browser.svg'
substituteInPlace doc/CMakeLists.txt \
--replace-fail 'COMMAND ''${QDOC_EXECUTABLE} -qt5' 'COMMAND ''${QDOC_EXECUTABLE}'
''
+ lib.optionalString (!finalAttrs.finalPackage.doCheck) ''
substituteInPlace CMakeLists.txt \
--replace 'add_subdirectory(tests)' ""
--replace-fail 'add_subdirectory(tests)' ""
'';

strictDeps = true;
Expand All @@ -71,6 +79,7 @@ stdenv.mkDerivation (finalAttrs: {
cmake
gettext
pkg-config
qttools # qdoc
wrapQtAppsHook
];

Expand Down Expand Up @@ -142,9 +151,8 @@ stdenv.mkDerivation (finalAttrs: {
# Test of morph-browser itself
standalone = nixosTests.morph-browser;

# Lomiri-specific issues with the desktop file may break the entire session, make sure it still works
lomiri-basics = nixosTests.lomiri.desktop-basics;
lomiri-appinteractions = nixosTests.lomiri.desktop-appinteractions;
# Interactions between the Lomiri ecosystem and this browser
inherit (nixosTests.lomiri) desktop-basics desktop-appinteractions;
};
};

Expand Down
26 changes: 18 additions & 8 deletions pkgs/desktops/lomiri/data/lomiri-schemas/default.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
stdenv,
stdenvNoCC,
lib,
fetchFromGitLab,
fetchpatch,
gitUpdater,
testers,
cmake,
Expand All @@ -12,17 +13,26 @@
validatePkgConfig,
}:

stdenv.mkDerivation (finalAttrs: {
stdenvNoCC.mkDerivation (finalAttrs: {
pname = "lomiri-schemas";
version = "0.1.5";
version = "0.1.6";

src = fetchFromGitLab {
owner = "ubports";
repo = "development/core/lomiri-schemas";
rev = finalAttrs.version;
hash = "sha256-OjSMt9XKqGoStF5O2zJTh3drHWe7Vk2cM94OYMSQmoU=";
hash = "sha256-hCKsjZ2xW+Jimm8IT6E6ZaPGwXydiNTxyaHxY0gOEpg=";
};

patches = [
# Remove when version > 0.1.6
(fetchpatch {
name = "0001-lomiri-schemas-Declare-no-compilers-needed.patch";
url = "https://gitlab.com/ubports/development/core/lomiri-schemas/-/commit/6eec0513d2348dcfe49ce5969a091584888a79e5.patch";
hash = "sha256-pbHNeP28WQ9wDdRkgsS8WY24ZKLS3G3h4gEd22DPuH8=";
})
];

strictDeps = true;

nativeBuildInputs = [
Expand All @@ -48,13 +58,13 @@ stdenv.mkDerivation (finalAttrs: {
updateScript = gitUpdater { };
};

meta = with lib; {
meta = {
description = "GSettings / AccountsService schema files for Lomiri";
homepage = "https://gitlab.com/ubports/development/core/lomiri-schemas";
changelog = "https://gitlab.com/ubports/development/core/lomiri-schemas/-/blob/${finalAttrs.version}/ChangeLog";
license = licenses.lgpl21Plus;
maintainers = teams.lomiri.members;
platforms = platforms.linux;
license = lib.licenses.lgpl21Plus;
maintainers = lib.teams.lomiri.members;
platforms = lib.platforms.linux;
pkgConfigModules = [
"lomiri-schemas"
];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,13 @@ stdenv.mkDerivation (finalAttrs: {
hash = "sha256-11pEhFi39Cvqb9Hg47kT8+5hq+bz6WmySqaIdwt1MVk=";
})

# Remove when version > 0.1.9
(fetchpatch {
name = "0002-lomiri-app-launch-Fix-parallel-access-to-_iconFinders.patch";
url = "https://gitlab.com/ubports/development/core/lomiri-app-launch/-/commit/74da7db2d59e91d95129dcaa5f6d8960fbc32eca.patch";
hash = "sha256-3r12eS9uLJIoBqSiKE2xnkfrJ7uPhyvYxXsxXs0cykg=";
})

# Use /run/current-system/sw/bin fallback for desktop file Exec= lookups, propagate to launched applications
./2001-Inject-current-system-PATH.patch
];
Expand Down
Loading

0 comments on commit d3a5ff6

Please sign in to comment.