turnon: 1.6.1 -> 1.6.2 (#364647)
[NixPkgs.git] / pkgs / desktops / lomiri / services / hfd-service / default.nix
blob51b5d99237528bd3d3b615ba6198c5e9b2c43b41
2   stdenv,
3   lib,
4   fetchFromGitLab,
5   gitUpdater,
6   accountsservice,
7   cmake,
8   cmake-extras,
9   deviceinfo,
10   libgbinder,
11   libglibutil,
12   pkg-config,
13   qtbase,
14   qtdeclarative,
15   qtfeedback,
18 stdenv.mkDerivation (finalAttrs: {
19   pname = "hfd-service";
20   version = "0.2.2";
22   src = fetchFromGitLab {
23     owner = "ubports";
24     repo = "development/core/hfd-service";
25     rev = finalAttrs.version;
26     hash = "sha256-OpT1vNjnyq66v54EoGOZOUb4HECD4WRJRh9hYMB0GI0=";
27   };
29   postPatch = ''
30     substituteInPlace qt/feedback-plugin/CMakeLists.txt \
31       --replace "\''${CMAKE_INSTALL_LIBDIR}/qt5/plugins" "\''${CMAKE_INSTALL_PREFIX}/${qtbase.qtPluginPrefix}"
33     # Queries pkg-config via pkg_get_variable, can't override prefix
34     substituteInPlace init/CMakeLists.txt \
35       --replace 'pkg_get_variable(SYSTEMD_SYSTEM_DIR systemd systemdsystemunitdir)' 'set(SYSTEMD_SYSTEM_DIR ''${CMAKE_INSTALL_PREFIX}/lib/systemd/system)'
36     substituteInPlace CMakeLists.txt \
37       --replace 'pkg_get_variable(AS_INTERFACES_DIR accountsservice interfacesdir)' 'set(AS_INTERFACES_DIR "''${CMAKE_INSTALL_FULL_DATADIR}/accountsservice/interfaces")' \
38       --replace '../../dbus-1/interfaces' "\''${CMAKE_INSTALL_PREFIX}/\''${DBUS_INTERFACES_DIR}" \
39       --replace 'DESTINATION ''${DBUS_INTERFACES_DIR}' 'DESTINATION ''${CMAKE_INSTALL_PREFIX}/''${DBUS_INTERFACES_DIR}'
40     substituteInPlace src/CMakeLists.txt \
41       --replace "\''${DBUS_INTERFACES_DIR}/org.freedesktop.Accounts.xml" '${accountsservice}/share/dbus-1/interfaces/org.freedesktop.Accounts.xml'
42   '';
44   strictDeps = true;
46   nativeBuildInputs = [
47     cmake
48     pkg-config
49     qtdeclarative
50   ];
52   buildInputs = [
53     accountsservice
54     cmake-extras
55     deviceinfo
56     libgbinder
57     libglibutil
58     qtbase
59     qtdeclarative
60     qtfeedback
61   ];
63   cmakeFlags = [
64     (lib.cmakeBool "ENABLE_LIBHYBRIS" false)
65   ];
67   dontWrapQtApps = true;
69   passthru.updateScript = gitUpdater { };
71   meta = with lib; {
72     description = "DBus-activated service that manages human feedback devices such as LEDs and vibrators on mobile devices";
73     homepage = "https://gitlab.com/ubports/development/core/hfd-service";
74     changelog = "https://gitlab.com/ubports/development/core/hfd-service/-/blob/${finalAttrs.version}/ChangeLog";
75     license = licenses.lgpl3Only;
76     maintainers = teams.lomiri.members;
77     platforms = platforms.linux;
78   };