Merge pull request #329823 from ExpidusOS/fix/pkgsllvm/elfutils
[NixPkgs.git] / pkgs / by-name / sw / swayidle / package.nix
blob0ee08dc7ca1d994b48900bc97e4591666b41ba9a
1 { lib, stdenv, fetchFromGitHub
2 , meson, ninja, pkg-config, scdoc, wayland-scanner
3 , wayland, wayland-protocols, runtimeShell
4 , systemdSupport ? lib.meta.availableOn stdenv.hostPlatform systemd, systemd
5 }:
7 stdenv.mkDerivation rec {
8   pname = "swayidle";
9   version = "1.8.0";
11   src = fetchFromGitHub {
12     owner = "swaywm";
13     repo = "swayidle";
14     rev = version;
15     hash = "sha256-/U6Y9H5ZqIJph3TZVcwr9+Qfd6NZNYComXuC1D9uGHg=";
16   };
18   strictDeps = true;
19   nativeBuildInputs = [ meson ninja pkg-config scdoc wayland-scanner ];
20   buildInputs = [ wayland wayland-protocols ]
21                 ++ lib.optionals systemdSupport [ systemd ];
23   mesonFlags = [ "-Dman-pages=enabled" "-Dlogind=${if systemdSupport then "enabled" else "disabled"}" ];
25   postPatch = ''
26     substituteInPlace main.c \
27       --replace '"sh"' '"${runtimeShell}"'
28   '';
30   meta = with lib; {
31     description = "Idle management daemon for Wayland";
32     inherit (src.meta) homepage;
33     longDescription = ''
34       Sway's idle management daemon. It is compatible with any Wayland
35       compositor which implements the KDE idle protocol.
36     '';
37     license = licenses.mit;
38     mainProgram = "swayidle";
39     maintainers = with maintainers; [ primeos ];
40     platforms = platforms.linux;
41   };