gnomeExtensions.pop-shell: 1.2.0-unstable-2024-10-09 -> 1.2.0-unstable-2024-12-31...
[NixPkgs.git] / pkgs / by-name / wl / wlogout / package.nix
blob3eaf5022eb8369a84b8ab23a1ed9f8abcf4ab834
2   lib,
3   fetchFromGitHub,
4   gitUpdater,
5   gtk-layer-shell,
6   gtk3,
7   libxkbcommon,
8   meson,
9   ninja,
10   pkg-config,
11   scdoc,
12   stdenv,
13   wayland,
14   wayland-protocols,
15   # gtk-layer-shell fails to cross-compile due to a hard dependency
16   # on gobject-introspection.
17   # Disable it when cross-compiling since it's an optional dependency.
18   # This disables transparency support.
19   withGtkLayerShell ? (stdenv.buildPlatform == stdenv.hostPlatform),
22 stdenv.mkDerivation (finalAttrs: {
23   pname = "wlogout";
24   version = "1.2.2";
26   src = fetchFromGitHub {
27     owner = "ArtsyMacaw";
28     repo = "wlogout";
29     rev = finalAttrs.version;
30     hash = "sha256-/tYZy56ku68ziSOhy6Dex9RGy+blkU6CN2ze76y7718=";
31   };
33   outputs = [
34     "out"
35     "man"
36   ];
38   depsBuildBuild = [
39     pkg-config
40   ];
42   nativeBuildInputs = [
43     meson
44     ninja
45     pkg-config
46     scdoc
47   ];
49   buildInputs =
50     [
51       gtk3
52       libxkbcommon
53       wayland
54       wayland-protocols
55     ]
56     ++ lib.optionals withGtkLayerShell [
57       gtk-layer-shell
58     ];
60   strictDeps = true;
62   mesonFlags = [
63     "--datadir=${placeholder "out"}/share"
64     "--sysconfdir=${placeholder "out"}/etc"
65   ];
67   postPatch = ''
68     substituteInPlace style.css \
69       --replace "/usr/share/wlogout" "$out/share/wlogout"
71     substituteInPlace main.c \
72       --replace "/etc/wlogout" "$out/etc/wlogout"
73   '';
75   passthru = {
76     updateScript = gitUpdater { };
77   };
79   meta = {
80     homepage = "https://github.com/ArtsyMacaw/wlogout";
81     description = "Wayland based logout menu";
82     changelog = "https://github.com/ArtsyMacaw/wlogout/releases/tag/${finalAttrs.src.rev}";
83     license = with lib.licenses; [ mit ];
84     mainProgram = "wlogout";
85     maintainers = with lib.maintainers; [ AndersonTorres ];
86     inherit (wayland.meta) platforms;
87   };