From 429be39416b921a5af31eb76698956cfd9e95fba Mon Sep 17 00:00:00 2001 From: OPNA2608 Date: Wed, 14 Feb 2024 17:58:29 +0100 Subject: [PATCH] lomiri.lomiri-system-settings-security-privacy: init at 1.0.2 --- ...omiri-system-settings-security-privacy.nix | 89 +++++++++++++++++++ pkgs/desktops/lomiri/default.nix | 1 + 2 files changed, 90 insertions(+) create mode 100644 pkgs/desktops/lomiri/applications/lomiri-system-settings/plugins/lomiri-system-settings-security-privacy.nix diff --git a/pkgs/desktops/lomiri/applications/lomiri-system-settings/plugins/lomiri-system-settings-security-privacy.nix b/pkgs/desktops/lomiri/applications/lomiri-system-settings/plugins/lomiri-system-settings-security-privacy.nix new file mode 100644 index 000000000000..29a10f12a829 --- /dev/null +++ b/pkgs/desktops/lomiri/applications/lomiri-system-settings/plugins/lomiri-system-settings-security-privacy.nix @@ -0,0 +1,89 @@ +{ stdenv +, lib +, fetchFromGitLab +, biometryd +, cmake +, libqtdbusmock +, libqtdbustest +, lomiri-system-settings-unwrapped +, pkg-config +, polkit +, python3 +, qtbase +, qtdeclarative +, trust-store +, xvfb-run +}: + +stdenv.mkDerivation (finalAttrs: { + pname = "lomiri-system-settings-security-privacy"; + version = "1.0.2"; + + src = fetchFromGitLab { + owner = "ubports"; + repo = "development/core/lomiri-system-settings-security-privacy"; + rev = finalAttrs.version; + hash = "sha256-d7OgxV362gJ3t5N+DEFgwyK+m6Ij6juRPuxfmbCg68Y="; + }; + + postPatch = '' + # CMake pkg_get_variable cannot replace prefix variable yet + for pcvar in plugin_manifest_dir plugin_private_module_dir plugin_qml_dir; do + pcvarname=$(echo $pcvar | tr '[:lower:]' '[:upper:]') + substituteInPlace CMakeLists.txt \ + --replace-fail "pkg_get_variable($pcvarname LomiriSystemSettings $pcvar)" "set($pcvarname $(pkg-config LomiriSystemSettings --define-variable=prefix=$out --define-variable=libdir=$out/lib --variable=$pcvar))" + done + ''; + + strictDeps = true; + + nativeBuildInputs = [ + cmake + pkg-config + python3 + ]; + + buildInputs = [ + lomiri-system-settings-unwrapped + polkit + qtbase + qtdeclarative + trust-store + ]; + + # QML components and schemas the wrapper needs + propagatedBuildInputs = [ + biometryd + ]; + + nativeCheckInputs = [ + xvfb-run + ]; + + checkInputs = [ + libqtdbusmock + libqtdbustest + ]; + + # Plugin library & modules for LSS + dontWrapQtApps = true; + + cmakeFlags = [ + (lib.cmakeBool "ENABLE_TESTS" finalAttrs.finalPackage.doCheck) + ]; + + doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform; + + preCheck = '' + export QT_PLUGIN_PATH=${lib.getBin qtbase}/${qtbase.qtPluginPrefix} + ''; + + meta = with lib; { + description = "Security and privacy settings plugin for Lomiri system settings"; + homepage = "https://gitlab.com/ubports/development/core/lomiri-system-settings-security-privacy"; + changelog = "https://gitlab.com/ubports/development/core/lomiri-system-settings-security-privacy/-/blob/${finalAttrs.version}/ChangeLog"; + license = licenses.gpl3Only; + maintainers = teams.lomiri.members; + platforms = platforms.linux; + }; +}) diff --git a/pkgs/desktops/lomiri/default.nix b/pkgs/desktops/lomiri/default.nix index 153427e996c8..bdb7005c345a 100644 --- a/pkgs/desktops/lomiri/default.nix +++ b/pkgs/desktops/lomiri/default.nix @@ -9,6 +9,7 @@ let in { #### Core Apps lomiri-system-settings-unwrapped = callPackage ./applications/lomiri-system-settings { }; + lomiri-system-settings-security-privacy = callPackage ./applications/lomiri-system-settings/plugins/lomiri-system-settings-security-privacy.nix { }; lomiri-terminal-app = callPackage ./applications/lomiri-terminal-app { }; morph-browser = callPackage ./applications/morph-browser { };