diff options
author | OPNA2608 <opna2608@protonmail.com> | 2024-04-18 18:33:32 +0200 |
---|---|---|
committer | OPNA2608 <opna2608@protonmail.com> | 2024-05-21 00:10:42 +0200 |
commit | 6539b60f0b289add88d125ec45d748c4241c79b8 (patch) | |
tree | bfdf84766501a210f17afe186851bd641f4eb326 /pkgs/by-name/ay/ayatana-indicator-power | |
parent | d3472a8728c882f4804ec751bfa960991d39c23b (diff) |
ayatana-indicator-power: init at 24.1.0
Diffstat (limited to 'pkgs/by-name/ay/ayatana-indicator-power')
-rw-r--r-- | pkgs/by-name/ay/ayatana-indicator-power/package.nix | 107 |
1 files changed, 107 insertions, 0 deletions
diff --git a/pkgs/by-name/ay/ayatana-indicator-power/package.nix b/pkgs/by-name/ay/ayatana-indicator-power/package.nix new file mode 100644 index 0000000000000..74df2f6eb95fb --- /dev/null +++ b/pkgs/by-name/ay/ayatana-indicator-power/package.nix @@ -0,0 +1,107 @@ +{ stdenv +, lib +, gitUpdater +, fetchFromGitHub +, nixosTests +, cmake +, dbus +, dbus-test-runner +, glib +, gtest +, intltool +, libayatana-common +, libnotify +, librda +, lomiri +, pkg-config +, python3 +, systemd +, wrapGAppsHook3 +}: + +stdenv.mkDerivation (finalAttrs: { + pname = "ayatana-indicator-power"; + version = "24.1.0"; + + src = fetchFromGitHub { + owner = "AyatanaIndicators"; + repo = "ayatana-indicator-power"; + rev = "refs/tags/${finalAttrs.version}"; + hash = "sha256-VUDNy6pPOsjioV5UNiKm8dzYb02ZrZ8CiIiJmAoQYaM="; + }; + + postPatch = '' + # Replace systemd prefix in pkg-config query, use GNUInstallDirs location for /etc + substituteInPlace data/CMakeLists.txt \ + --replace-fail 'pkg_get_variable(SYSTEMD_USER_DIR systemd systemduserunitdir)' 'pkg_get_variable(SYSTEMD_USER_DIR systemd systemduserunitdir DEFINE_VARIABLES prefix=''${CMAKE_INSTALL_PREFIX})' \ + --replace-fail 'XDG_AUTOSTART_DIR "/etc' 'XDG_AUTOSTART_DIR "''${CMAKE_INSTALL_FULL_SYSCONFDIR}' + + # Path needed for build-time codegen + substituteInPlace src/CMakeLists.txt \ + --replace-fail '/usr/share/accountsservice/interfaces/com.lomiri.touch.AccountsService.Sound.xml' '${lomiri.lomiri-schemas}/share/accountsservice/interfaces/com.lomiri.touch.AccountsService.Sound.xml' + ''; + + strictDeps = true; + + nativeBuildInputs = [ + cmake + intltool + pkg-config + wrapGAppsHook3 + ]; + + buildInputs = [ + glib + libayatana-common + libnotify + librda + systemd + ] ++ (with lomiri; [ + cmake-extras + deviceinfo + lomiri-schemas + lomiri-sounds + ]); + + nativeCheckInputs = [ + dbus + (python3.withPackages (ps: with ps; [ + python-dbusmock + ])) + ]; + + checkInputs = [ + dbus-test-runner + gtest + ]; + + cmakeFlags = [ + (lib.cmakeBool "ENABLE_TESTS" finalAttrs.finalPackage.doCheck) + (lib.cmakeBool "ENABLE_LOMIRI_FEATURES" true) + (lib.cmakeBool "ENABLE_DEVICEINFO" true) + (lib.cmakeBool "ENABLE_RDA" true) + (lib.cmakeBool "GSETTINGS_LOCALINSTALL" true) + (lib.cmakeBool "GSETTINGS_COMPILE" true) + ]; + + doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform; + + passthru = { + ayatana-indicators = [ "ayatana-indicator-power" ]; + tests.vm = nixosTests.ayatana-indicators; + updateScript = gitUpdater { }; + }; + + meta = with lib; { + description = "Ayatana Indicator showing power state"; + longDescription = '' + This Ayatana Indicator displays current power management information and + gives the user a way to access power management preferences. + ''; + homepage = "https://github.com/AyatanaIndicators/ayatana-indicator-power"; + changelog = "https://github.com/AyatanaIndicators/ayatana-indicator-power/blob/${finalAttrs.version}/ChangeLog"; + license = licenses.gpl3Only; + maintainers = with maintainers; [ OPNA2608 ]; + platforms = platforms.linux; + }; +}) |