3
0
Fork 0
forked from mirrors/nixpkgs
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.

97 lines
2.3 KiB
Nix
Raw Normal View History

{ lib
, stdenv
2021-02-10 01:47:13 +00:00
, fetchFromGitHub
2021-02-25 12:06:43 +00:00
, libinput
2021-02-10 01:47:13 +00:00
, libxcb
, libxkbcommon
, pixman
, pkg-config
2021-02-10 01:47:13 +00:00
, wayland
, wayland-protocols
, wlroots
, writeText
2021-02-10 01:47:13 +00:00
, enable-xwayland ? true, xwayland, libX11
, conf ? null
, patches ? [ ]
2021-02-10 01:47:13 +00:00
}:
let
totalPatches = patches ++ [ ];
in
2021-02-10 01:47:13 +00:00
stdenv.mkDerivation rec {
pname = "dwl";
version = "0.2.2";
2021-02-10 01:47:13 +00:00
src = fetchFromGitHub {
owner = "djpohly";
repo = pname;
rev = "v${version}";
hash = "sha256-T2GqDehBNO8eublqZUmA5WADjnwElzT+bp9Dp1bqSgg=";
2021-02-10 01:47:13 +00:00
};
nativeBuildInputs = [ pkg-config ];
2021-02-10 01:47:13 +00:00
buildInputs = [
2021-02-25 12:06:43 +00:00
libinput
2021-02-10 01:47:13 +00:00
libxcb
libxkbcommon
pixman
2021-02-10 01:47:13 +00:00
wayland
wayland-protocols
wlroots
2021-02-25 12:06:43 +00:00
] ++ lib.optionals enable-xwayland [
libX11
xwayland
];
2021-02-10 01:47:13 +00:00
# Allow users to set their own list of patches
patches = totalPatches;
2021-02-10 01:47:13 +00:00
2021-02-25 12:06:43 +00:00
# Last line of config.mk enables XWayland
2021-02-10 01:47:13 +00:00
prePatch = lib.optionalString enable-xwayland ''
sed -i -e '$ s|^#||' config.mk
'';
# 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";
NIX_CFLAGS_COMPILE = [
# https://github.com/djpohly/dwl/issues/186
"-Wno-error=unused-result"
];
2021-02-10 01:47:13 +00:00
dontConfigure = true;
installPhase = ''
runHook preInstall
install -d $out/bin
install -m755 dwl $out/bin
runHook postInstall
'';
meta = with lib; {
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
'';
license = licenses.gpl3Only;
maintainers = with maintainers; [ AndersonTorres ];
inherit (wayland.meta) platforms;
2021-02-10 01:47:13 +00:00
};
}
# TODO: custom patches from upstream website