about summary refs log tree commit diff
path: root/pkgs/desktops
diff options
context:
space:
mode:
authorPeder Bergebakken Sundt <pbsds@hotmail.com>2023-12-04 00:39:19 +0100
committerGitHub <noreply@github.com>2023-12-04 00:39:19 +0100
commitcebdb401b1176d3d9715d7fd0a58d2fc80a6bf13 (patch)
treef4c1feb2367524a45eded024255f4b5e3057c433 /pkgs/desktops
parent4d8cc61dc03c1149487122d73cd7981e38690d4b (diff)
parenta8a5758da5b1609aa628b3c7e9aea547a586e703 (diff)
Merge pull request #261020 from OPNA2608/init/lomiri/hfd-service
lomiri.hfd-service: init at 0.2.1
Diffstat (limited to 'pkgs/desktops')
-rw-r--r--pkgs/desktops/lomiri/default.nix1
-rw-r--r--pkgs/desktops/lomiri/services/hfd-service/default.nix75
2 files changed, 76 insertions, 0 deletions
diff --git a/pkgs/desktops/lomiri/default.nix b/pkgs/desktops/lomiri/default.nix
index bcaa19ab27df5..2de3a7c9d409b 100644
--- a/pkgs/desktops/lomiri/default.nix
+++ b/pkgs/desktops/lomiri/default.nix
@@ -20,6 +20,7 @@ let
 
     #### Services
     biometryd = callPackage ./services/biometryd { };
+    hfd-service = callPackage ./services/hfd-service { };
   };
 in
   lib.makeScope libsForQt5.newScope packages
diff --git a/pkgs/desktops/lomiri/services/hfd-service/default.nix b/pkgs/desktops/lomiri/services/hfd-service/default.nix
new file mode 100644
index 0000000000000..cffedb0af6235
--- /dev/null
+++ b/pkgs/desktops/lomiri/services/hfd-service/default.nix
@@ -0,0 +1,75 @@
+{ stdenv
+, lib
+, fetchFromGitLab
+, gitUpdater
+, accountsservice
+, cmake
+, cmake-extras
+, deviceinfo
+, libgbinder
+, libglibutil
+, pkg-config
+, qtbase
+, qtdeclarative
+, qtfeedback
+}:
+
+stdenv.mkDerivation (finalAttrs: {
+  pname = "hfd-service";
+  version = "0.2.1";
+
+  src = fetchFromGitLab {
+    owner = "ubports";
+    repo = "development/core/hfd-service";
+    rev = finalAttrs.version;
+    hash = "sha256-KcHwLTSdo86YCteUsPndoxmLf23SOEhROc5cJQ8GS1Q=";
+  };
+
+  postPatch = ''
+    substituteInPlace qt/feedback-plugin/CMakeLists.txt \
+      --replace "\''${CMAKE_INSTALL_LIBDIR}/qt5/plugins" "\''${CMAKE_INSTALL_PREFIX}/${qtbase.qtPluginPrefix}"
+
+    # Queries pkg-config via pkg_get_variable, can't override prefix
+    substituteInPlace init/CMakeLists.txt \
+      --replace "\''${SYSTEMD_SYSTEM_DIR}" "$out/lib/systemd/system"
+    substituteInPlace CMakeLists.txt \
+      --replace 'pkg_get_variable(AS_INTERFACES_DIR accountsservice interfacesdir)' 'set(AS_INTERFACES_DIR "''${CMAKE_INSTALL_DATADIR}/accountsservice/interfaces")' \
+      --replace 'DESTINATION ''${DBUS_INTERFACES_DIR}' 'DESTINATION ${placeholder "out"}/''${DBUS_INTERFACES_DIR}'
+    substituteInPlace src/CMakeLists.txt \
+      --replace "\''${DBUS_INTERFACES_DIR}/org.freedesktop.Accounts.xml" '${accountsservice}/share/dbus-1/interfaces/org.freedesktop.Accounts.xml'
+  '';
+
+  strictDeps = true;
+
+  nativeBuildInputs = [
+    cmake
+    pkg-config
+  ];
+
+  buildInputs = [
+    accountsservice
+    cmake-extras
+    deviceinfo
+    libgbinder
+    libglibutil
+    qtbase
+    qtdeclarative
+    qtfeedback
+  ];
+
+  cmakeFlags = [
+    "-DENABLE_LIBHYBRIS=OFF"
+  ];
+
+  dontWrapQtApps = true;
+
+  passthru.updateScript = gitUpdater { };
+
+  meta = with lib; {
+    description = "DBus-activated service that manages human feedback devices such as LEDs and vibrators on mobile devices";
+    homepage = "https://gitlab.com/ubports/development/core/hfd-service";
+    license = licenses.lgpl3Only;
+    maintainers = teams.lomiri.members;
+    platforms = platforms.linux;
+  };
+})