librewolf: 132.0.1 -> 132.0.1-1 (#355483)
[NixPkgs.git] / pkgs / by-name / ay / ayatana-indicator-power / package.nix
blob7226c90daa37c8eb3785e168df004f9d4d26e9e2
2   stdenv,
3   lib,
4   gitUpdater,
5   fetchFromGitHub,
6   nixosTests,
7   cmake,
8   dbus,
9   dbus-test-runner,
10   glib,
11   gtest,
12   intltool,
13   libayatana-common,
14   libnotify,
15   librda,
16   lomiri,
17   pkg-config,
18   python3,
19   systemd,
20   wrapGAppsHook3,
23 stdenv.mkDerivation (finalAttrs: {
24   pname = "ayatana-indicator-power";
25   version = "24.5.1";
27   src = fetchFromGitHub {
28     owner = "AyatanaIndicators";
29     repo = "ayatana-indicator-power";
30     rev = "refs/tags/${finalAttrs.version}";
31     hash = "sha256-M7BzyQRPKyXMEY0FTMBXsCemC3+w8upjTHApWkRf71I=";
32   };
34   postPatch = ''
35     # Replace systemd prefix in pkg-config query, use GNUInstallDirs location for /etc
36     substituteInPlace data/CMakeLists.txt \
37       --replace-fail 'pkg_get_variable(SYSTEMD_USER_DIR systemd systemduserunitdir)' 'pkg_get_variable(SYSTEMD_USER_DIR systemd systemduserunitdir DEFINE_VARIABLES prefix=''${CMAKE_INSTALL_PREFIX})' \
38       --replace-fail 'XDG_AUTOSTART_DIR "/etc' 'XDG_AUTOSTART_DIR "''${CMAKE_INSTALL_FULL_SYSCONFDIR}'
40     # Path needed for build-time codegen
41     substituteInPlace src/CMakeLists.txt \
42       --replace-fail '/usr/share/accountsservice/interfaces/com.lomiri.touch.AccountsService.Sound.xml' '${lomiri.lomiri-schemas}/share/accountsservice/interfaces/com.lomiri.touch.AccountsService.Sound.xml'
43   '';
45   strictDeps = true;
47   nativeBuildInputs = [
48     cmake
49     intltool
50     pkg-config
51     wrapGAppsHook3
52   ];
54   buildInputs =
55     [
56       glib
57       libayatana-common
58       libnotify
59       librda
60       systemd
61     ]
62     ++ (with lomiri; [
63       cmake-extras
64       deviceinfo
65       lomiri-schemas
66       lomiri-sounds
67     ]);
69   nativeCheckInputs = [
70     dbus
71     (python3.withPackages (ps: with ps; [ python-dbusmock ]))
72   ];
74   checkInputs = [
75     dbus-test-runner
76     gtest
77   ];
79   cmakeFlags = [
80     (lib.cmakeBool "ENABLE_TESTS" finalAttrs.finalPackage.doCheck)
81     (lib.cmakeBool "ENABLE_LOMIRI_FEATURES" true)
82     (lib.cmakeBool "ENABLE_DEVICEINFO" true)
83     (lib.cmakeBool "ENABLE_RDA" true)
84     (lib.cmakeBool "GSETTINGS_LOCALINSTALL" true)
85     (lib.cmakeBool "GSETTINGS_COMPILE" true)
86   ];
88   doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform;
90   passthru = {
91     ayatana-indicators = {
92       ayatana-indicator-power = [
93         "ayatana"
94         "lomiri"
95       ];
96     };
97     tests.vm = nixosTests.ayatana-indicators;
98     updateScript = gitUpdater { };
99   };
101   meta = {
102     description = "Ayatana Indicator showing power state";
103     longDescription = ''
104       This Ayatana Indicator displays current power management information and
105       gives the user a way to access power management preferences.
106     '';
107     homepage = "https://github.com/AyatanaIndicators/ayatana-indicator-power";
108     changelog = "https://github.com/AyatanaIndicators/ayatana-indicator-power/blob/${finalAttrs.version}/ChangeLog";
109     license = lib.licenses.gpl3Only;
110     maintainers = with lib.maintainers; [ OPNA2608 ];
111     platforms = lib.platforms.linux;
112   };