2022-02-10 20:34:41 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
2021-02-13 14:23:35 +00:00
|
|
|
, fetchFromGitHub
|
2023-02-02 18:25:31 +00:00
|
|
|
, installShellFiles
|
|
|
|
, libX11
|
2021-03-09 03:18:52 +00:00
|
|
|
, libinput
|
2021-02-13 14:23:35 +00:00
|
|
|
, libxcb
|
|
|
|
, libxkbcommon
|
2021-05-20 23:08:51 +00:00
|
|
|
, pixman
|
2022-02-10 20:34:41 +00:00
|
|
|
, pkg-config
|
2023-02-02 18:25:31 +00:00
|
|
|
, substituteAll
|
2021-02-13 14:23:35 +00:00
|
|
|
, wayland
|
|
|
|
, wayland-protocols
|
2023-02-02 18:25:31 +00:00
|
|
|
, wlroots_0_16
|
2022-02-10 20:34:41 +00:00
|
|
|
, writeText
|
2023-02-02 18:25:31 +00:00
|
|
|
, xcbutilwm
|
|
|
|
, xwayland
|
|
|
|
, enableXWayland ? true
|
2021-02-13 14:23:35 +00:00
|
|
|
, conf ? null
|
|
|
|
}:
|
|
|
|
|
2021-04-08 16:26:57 +00:00
|
|
|
let
|
2023-02-02 18:25:31 +00:00
|
|
|
wlroots = wlroots_0_16;
|
2021-04-08 16:26:57 +00:00
|
|
|
in
|
2023-02-02 18:25:31 +00:00
|
|
|
stdenv.mkDerivation (self: {
|
2021-02-13 14:23:35 +00:00
|
|
|
pname = "dwl";
|
2023-02-02 18:25:31 +00:00
|
|
|
version = "0.4";
|
2021-02-13 14:23:35 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "djpohly";
|
2023-02-02 18:25:31 +00:00
|
|
|
repo = "dwl";
|
|
|
|
rev = "v${self.version}";
|
|
|
|
hash = "sha256-OW7K7yMYSzqZWpQ9Vmpy8EgdWvyv3q1uh8A40f6AQF4=";
|
2021-02-13 14:23:35 +00:00
|
|
|
};
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
installShellFiles
|
|
|
|
pkg-config
|
|
|
|
];
|
2022-02-10 20:34:41 +00:00
|
|
|
|
2021-02-13 14:23:35 +00:00
|
|
|
buildInputs = [
|
2021-03-09 03:18:52 +00:00
|
|
|
libinput
|
2021-02-13 14:23:35 +00:00
|
|
|
libxcb
|
|
|
|
libxkbcommon
|
2021-05-20 23:08:51 +00:00
|
|
|
pixman
|
2021-02-13 14:23:35 +00:00
|
|
|
wayland
|
|
|
|
wayland-protocols
|
|
|
|
wlroots
|
2023-02-02 18:25:31 +00:00
|
|
|
] ++ lib.optionals enableXWayland [
|
2021-03-09 03:18:52 +00:00
|
|
|
libX11
|
2023-02-02 18:25:31 +00:00
|
|
|
xcbutilwm
|
2021-03-09 03:18:52 +00:00
|
|
|
xwayland
|
|
|
|
];
|
2021-02-13 14:23:35 +00:00
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
outputs = [ "out" "man" ];
|
2021-02-13 14:23:35 +00:00
|
|
|
|
|
|
|
# Allow users to set an alternative config.def.h
|
|
|
|
postPatch = let
|
|
|
|
configFile = if lib.isDerivation conf || builtins.isPath conf
|
|
|
|
then conf
|
|
|
|
else writeText "config.def.h" conf;
|
|
|
|
in lib.optionalString (conf != null) "cp ${configFile} config.def.h";
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
preBuild = ''
|
|
|
|
makeFlagsArray+=(
|
|
|
|
XWAYLAND=${if enableXWayland then "-DXWAYLAND" else ""}
|
|
|
|
XLIBS=${if enableXWayland then "xcb\\ xcb-icccm" else ""}
|
|
|
|
)
|
2021-02-13 14:23:35 +00:00
|
|
|
'';
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
installFlags = [
|
|
|
|
"PREFIX=$(out)"
|
|
|
|
"MANDIR=$(man)/share/man/man1"
|
|
|
|
];
|
|
|
|
|
|
|
|
meta = {
|
2021-02-13 14:23:35 +00:00
|
|
|
homepage = "https://github.com/djpohly/dwl/";
|
|
|
|
description = "Dynamic window manager for Wayland";
|
|
|
|
longDescription = ''
|
|
|
|
dwl is a compact, hackable compositor for Wayland based on wlroots. It is
|
|
|
|
intended to fill the same space in the Wayland world that dwm does in X11,
|
|
|
|
primarily in terms of philosophy, and secondarily in terms of
|
|
|
|
functionality. Like dwm, dwl is:
|
|
|
|
|
|
|
|
- Easy to understand, hack on, and extend with patches
|
|
|
|
- One C source file (or a very small number) configurable via config.h
|
|
|
|
- Limited to 2000 SLOC to promote hackability
|
|
|
|
- Tied to as few external dependencies as possible
|
|
|
|
'';
|
2023-02-02 18:25:31 +00:00
|
|
|
changelog = "https://github.com/djpohly/dwl/releases/tag/v${self.version}";
|
|
|
|
license = lib.licenses.gpl3Only;
|
|
|
|
maintainers = [ lib.maintainers.AndersonTorres ];
|
2022-02-10 20:34:41 +00:00
|
|
|
inherit (wayland.meta) platforms;
|
2021-02-13 14:23:35 +00:00
|
|
|
};
|
2023-02-02 18:25:31 +00:00
|
|
|
})
|
2021-02-13 14:23:35 +00:00
|
|
|
# TODO: custom patches from upstream website
|