From 53402495f436ec2ed63db6e203da38fe0a717ff0 Mon Sep 17 00:00:00 2001 From: OPNA2608 Date: Fri, 2 Feb 2024 20:03:25 +0100 Subject: [PATCH] lomiri.lomiri-push-qml: init at 0-unstable-2022-09-15 --- pkgs/desktops/lomiri/default.nix | 1 + .../lomiri/qml/lomiri-push-qml/default.nix | 74 +++++++++++++++++++ 2 files changed, 75 insertions(+) create mode 100644 pkgs/desktops/lomiri/qml/lomiri-push-qml/default.nix diff --git a/pkgs/desktops/lomiri/default.nix b/pkgs/desktops/lomiri/default.nix index d0d9c777431e..f62bd5746023 100644 --- a/pkgs/desktops/lomiri/default.nix +++ b/pkgs/desktops/lomiri/default.nix @@ -31,6 +31,7 @@ let #### QML / QML-related lomiri-action-api = callPackage ./qml/lomiri-action-api { }; lomiri-notifications = callPackage ./qml/lomiri-notifications { }; + lomiri-push-qml = callPackage ./qml/lomiri-push-qml { }; lomiri-settings-components = callPackage ./qml/lomiri-settings-components { }; lomiri-ui-extras = callPackage ./qml/lomiri-ui-extras { }; lomiri-ui-toolkit = callPackage ./qml/lomiri-ui-toolkit { }; diff --git a/pkgs/desktops/lomiri/qml/lomiri-push-qml/default.nix b/pkgs/desktops/lomiri/qml/lomiri-push-qml/default.nix new file mode 100644 index 000000000000..5fba08098879 --- /dev/null +++ b/pkgs/desktops/lomiri/qml/lomiri-push-qml/default.nix @@ -0,0 +1,74 @@ +{ stdenv +, lib +, fetchFromGitLab +, fetchpatch +, cmake +, lomiri-api +, lomiri-indicator-network +, pkg-config +, qtbase +, qtdeclarative +}: + +stdenv.mkDerivation (finalAttrs: { + pname = "lomiri-push-qml"; + version = "0-unstable-2022-09-15"; + + src = fetchFromGitLab { + owner = "ubports"; + repo = "development/core/lomiri-push-qml"; + rev = "6f87ee5cf92e2af0e0ce672835e71704e236b8c0"; + hash = "sha256-ezLcQRJ7Sq/TVbeGJL3Vq2lzBe7StRRCrWXZs2CCUX8="; + }; + + patches = [ + # Remove when https://gitlab.com/ubports/development/core/lomiri-push-qml/-/merge_requests/6 merged + (fetchpatch { + name = "0001-lomiri-push-qml-Stop-using-qt5_use_modules.patch"; + url = "https://gitlab.com/ubports/development/core/lomiri-push-qml/-/commit/a4268c98b9f50fdd52da69c173d377f78ea93104.patch"; + hash = "sha256-OijTB5+I9/wabT7dX+DkvoEROKzAUIKhBZkkhqq5Oig="; + }) + ]; + + postPatch = '' + # Queries QMake for QML install location, returns QtBase build path + substituteInPlace src/*/PushNotifications/CMakeLists.txt \ + --replace-fail 'qmake -query QT_INSTALL_QML' 'echo ''${CMAKE_INSTALL_PREFIX}/${qtbase.qtQmlPrefix}' \ + ''; + + strictDeps = true; + + nativeBuildInputs = [ + cmake + pkg-config + qtdeclarative # qmlplugindump + ]; + + buildInputs = [ + lomiri-api + lomiri-indicator-network + qtbase + qtdeclarative + ]; + + dontWrapQtApps = true; + + cmakeFlags = [ + # In case anything still depends on deprecated hints + (lib.cmakeBool "ENABLE_UBUNTU_COMPAT" true) + ]; + + preBuild = '' + # For qmlplugindump + export QT_PLUGIN_PATH=${lib.getBin qtbase}/${qtbase.qtPluginPrefix} + ''; + + meta = with lib; { + description = "Lomiri Push Notifications QML plugin"; + homepage = "https://gitlab.com/ubports/development/core/lomiri-push-qml"; + # License file indicates gpl3Only, but de87869c2cdb9819c2ca7c9eca9c5fb8b500a01f says it should be lgpl3Only + license = licenses.lgpl3Only; + maintainers = teams.lomiri.members; + platforms = platforms.linux; + }; +})