nixpkgs/pkgs/applications/window-managers/dwl/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

101 lines
2.4 KiB
Nix
Raw Normal View History

{ lib
, stdenv
2021-02-10 02:47:13 +01:00
, fetchFromGitHub
, installShellFiles
, libX11
2021-02-25 13:06:43 +01:00
, libinput
2021-02-10 02:47:13 +01:00
, libxcb
, libxkbcommon
, pixman
, pkg-config
, substituteAll
, wayland-scanner
2021-02-10 02:47:13 +01:00
, wayland
, wayland-protocols
, wlroots_0_16
, writeText
, xcbutilwm
, xwayland
, enableXWayland ? true
2021-02-10 02:47:13 +01:00
, conf ? null
}:
let
wlroots = wlroots_0_16;
in
2023-04-16 22:47:20 +02:00
stdenv.mkDerivation (finalAttrs: {
2021-02-10 02:47:13 +01:00
pname = "dwl";
version = "0.4";
2021-02-10 02:47:13 +01:00
src = fetchFromGitHub {
owner = "djpohly";
repo = "dwl";
2023-04-16 22:47:20 +02:00
rev = "v${finalAttrs.version}";
hash = "sha256-OW7K7yMYSzqZWpQ9Vmpy8EgdWvyv3q1uh8A40f6AQF4=";
2021-02-10 02:47:13 +01:00
};
nativeBuildInputs = [
installShellFiles
pkg-config
wayland-scanner
];
2021-02-10 02:47:13 +01:00
buildInputs = [
2021-02-25 13:06:43 +01:00
libinput
2021-02-10 02:47:13 +01:00
libxcb
libxkbcommon
pixman
2021-02-10 02:47:13 +01:00
wayland
wayland-protocols
wlroots
] ++ lib.optionals enableXWayland [
2021-02-25 13:06:43 +01:00
libX11
xcbutilwm
2021-02-25 13:06:43 +01:00
xwayland
];
2021-02-10 02:47:13 +01:00
outputs = [ "out" "man" ];
2021-02-10 02:47:13 +01: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";
makeFlags = [
"PKG_CONFIG=${stdenv.cc.targetPrefix}pkg-config"
"WAYLAND_SCANNER=wayland-scanner"
"PREFIX=$(out)"
"MANDIR=$(man)/share/man/man1"
];
preBuild = ''
makeFlagsArray+=(
2023-02-06 21:49:02 +01:00
XWAYLAND=${lib.optionalString enableXWayland "-DXWAYLAND"}
XLIBS=${lib.optionalString enableXWayland "xcb\\ xcb-icccm"}
)
2021-02-10 02:47:13 +01:00
'';
meta = {
2021-02-10 02:47:13 +01: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-04-16 22:47:20 +02:00
changelog = "https://github.com/djpohly/dwl/releases/tag/v${finalAttrs.version}";
license = lib.licenses.gpl3Only;
maintainers = [ lib.maintainers.AndersonTorres ];
inherit (wayland.meta) platforms;
2021-02-10 02:47:13 +01:00
};
})
2021-02-10 02:47:13 +01:00
# TODO: custom patches from upstream website