From 6bb7d0d790a39bf399240225729291555410070d Mon Sep 17 00:00:00 2001 From: OPNA2608 Date: Sun, 4 Feb 2024 15:41:55 +0100 Subject: [PATCH] ayatana-indicator-session: init at 23.10.3 --- nixos/tests/ayatana-indicators.nix | 1 + .../ay/ayatana-indicator-session/package.nix | 112 ++++++++++++++++++ 2 files changed, 113 insertions(+) create mode 100644 pkgs/by-name/ay/ayatana-indicator-session/package.nix diff --git a/nixos/tests/ayatana-indicators.nix b/nixos/tests/ayatana-indicators.nix index c9cbbda4c601..a7de640f9e37 100644 --- a/nixos/tests/ayatana-indicators.nix +++ b/nixos/tests/ayatana-indicators.nix @@ -29,6 +29,7 @@ in { packages = with pkgs; [ ayatana-indicator-datetime ayatana-indicator-messages + ayatana-indicator-session ] ++ (with pkgs.lomiri; [ lomiri-indicator-network telephony-service diff --git a/pkgs/by-name/ay/ayatana-indicator-session/package.nix b/pkgs/by-name/ay/ayatana-indicator-session/package.nix new file mode 100644 index 000000000000..e4400a0e2343 --- /dev/null +++ b/pkgs/by-name/ay/ayatana-indicator-session/package.nix @@ -0,0 +1,112 @@ +{ stdenv +, lib +, fetchFromGitHub +, gitUpdater +, nixosTests +, cmake +, dbus +, glib +, gnome +, gsettings-desktop-schemas +, gtest +, intltool +, libayatana-common +, librda +, lomiri +, mate +, pkg-config +, systemd +, wrapGAppsHook +}: + +stdenv.mkDerivation (finalAttrs: { + pname = "ayatana-indicator-session"; + version = "23.10.3"; + + src = fetchFromGitHub { + owner = "AyatanaIndicators"; + repo = "ayatana-indicator-session"; + rev = finalAttrs.version; + hash = "sha256-m2+qZxBrarenR41M41mCteFRXIEGkVDavRWQwM3G4tk="; + }; + + postPatch = '' + # Queries systemd user unit dir via pkg_get_variable, can't override prefix + substituteInPlace data/CMakeLists.txt \ + --replace-fail 'pkg_get_variable(SYSTEMD_USER_DIR systemd systemduserunitdir)' 'set(SYSTEMD_USER_DIR "''${CMAKE_INSTALL_PREFIX}/lib/systemd/user")' \ + --replace-fail '/etc' "\''${CMAKE_INSTALL_SYSCONFDIR}" + ''; + + strictDeps = true; + + nativeBuildInputs = [ + cmake + intltool + pkg-config + wrapGAppsHook + ]; + + buildInputs = [ + lomiri.cmake-extras + glib + gsettings-desktop-schemas + libayatana-common + librda + systemd + + # TODO these bloat the closure size alot, just so the indicator doesn't have the potential to crash. + # is there a better way to give it access to DE-specific schemas as needed? + # https://github.com/AyatanaIndicators/ayatana-indicator-session/blob/88846bad7ee0aa8e0bb122816d06f9bc887eb464/src/service.c#L1387-L1413 + gnome.gnome-settings-daemon + mate.mate-settings-daemon + ]; + + nativeCheckInputs = [ + dbus + ]; + + checkInputs = [ + gtest + ]; + + cmakeFlags = [ + (lib.cmakeBool "ENABLE_TESTS" finalAttrs.finalPackage.doCheck) + (lib.cmakeBool "GSETTINGS_LOCALINSTALL" true) + (lib.cmakeBool "GSETTINGS_COMPILE" true) + (lib.cmakeFeature "CMAKE_CTEST_ARGUMENTS" (lib.concatStringsSep ";" [ + # Exclude tests + "-E" (lib.strings.escapeShellArg "(${lib.concatStringsSep "|" [ + # Currently broken: https://github.com/AyatanaIndicators/ayatana-indicator-session/issues/90 + "^test-service" + ]})") + ])) + ]; + + doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform; + + # DBus communication + enableParallelChecking = false; + + passthru = { + ayatana-indicators = [ "ayatana-indicator-session" ]; + tests.vm = nixosTests.ayatana-indicators; + updateScript = gitUpdater { }; + }; + + meta = with lib; { + description = "Ayatana Indicator showing session management, status and user switching"; + longDescription = '' + This Ayatana Indicator is designed to be placed on the right side of a + panel and give the user easy control for + - changing their instant message status, + - switching to another user, + - starting a guest session, or + - controlling the status of their own session. + ''; + homepage = "https://github.com/AyatanaIndicators/ayatana-indicator-session"; + changelog = "https://github.com/AyatanaIndicators/ayatana-indicator-session/blob/${finalAttrs.version}/ChangeLog"; + license = licenses.gpl3Only; + maintainers = with maintainers; [ OPNA2608 ]; + platforms = platforms.linux; + }; +})