2021-02-16 07:33:02 +01:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, pkg-config
|
|
|
|
, meson
|
|
|
|
, ninja
|
|
|
|
, scdoc
|
|
|
|
, gtk3
|
|
|
|
, libxkbcommon
|
|
|
|
, wayland
|
|
|
|
, wayland-protocols
|
2021-11-06 12:35:41 +01:00
|
|
|
, gtk-layer-shell
|
2021-11-23 19:59:04 +01:00
|
|
|
# gtk-layer-shell fails to cross-compile due to a hard dependency
|
|
|
|
# on gobject-introspection.
|
|
|
|
# Disable it when cross-compiling since it's an optional dependency.
|
|
|
|
# This disables transparency support.
|
|
|
|
, withGtkLayerShell ? (stdenv.buildPlatform == stdenv.hostPlatform)
|
2021-02-16 07:33:02 +01:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "wlogout";
|
|
|
|
version = "1.1.1";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "ArtsyMacaw";
|
|
|
|
repo = "wlogout";
|
|
|
|
rev = version;
|
|
|
|
sha256 = "cTscfx+erHVFHwwYpN7pADQWt5sq75sQSyXSP/H8kOs=";
|
|
|
|
};
|
|
|
|
|
2022-05-05 22:55:47 +02:00
|
|
|
strictDeps = true;
|
2021-05-03 21:29:01 +02:00
|
|
|
depsBuildBuild = [ pkg-config ];
|
2021-02-16 07:33:02 +01:00
|
|
|
nativeBuildInputs = [ pkg-config meson ninja scdoc ];
|
|
|
|
buildInputs = [
|
|
|
|
gtk3
|
|
|
|
libxkbcommon
|
|
|
|
wayland
|
|
|
|
wayland-protocols
|
2021-11-23 19:59:04 +01:00
|
|
|
] ++ lib.optionals withGtkLayerShell [
|
2021-11-06 12:35:41 +01:00
|
|
|
gtk-layer-shell
|
2021-02-16 07:33:02 +01:00
|
|
|
];
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace style.css \
|
|
|
|
--replace "/usr/share/wlogout" "$out/share/${pname}"
|
|
|
|
|
|
|
|
substituteInPlace main.c \
|
|
|
|
--replace "/etc/wlogout" "$out/etc/${pname}"
|
|
|
|
'';
|
|
|
|
|
|
|
|
mesonFlags = [
|
|
|
|
"--datadir=${placeholder "out"}/share"
|
|
|
|
"--sysconfdir=${placeholder "out"}/etc"
|
|
|
|
];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://github.com/ArtsyMacaw/wlogout";
|
|
|
|
description = "A wayland based logout menu";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ AndersonTorres ];
|
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
# TODO: shell completions
|