about summary refs log tree commit diff
path: root/nixpkgs/pkgs/applications/window-managers/dwl/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/applications/window-managers/dwl/default.nix')
-rw-r--r--nixpkgs/pkgs/applications/window-managers/dwl/default.nix33
1 files changed, 29 insertions, 4 deletions
diff --git a/nixpkgs/pkgs/applications/window-managers/dwl/default.nix b/nixpkgs/pkgs/applications/window-managers/dwl/default.nix
index 9a56f865c348..d8f102ed7675 100644
--- a/nixpkgs/pkgs/applications/window-managers/dwl/default.nix
+++ b/nixpkgs/pkgs/applications/window-managers/dwl/default.nix
@@ -2,6 +2,7 @@
 , lib
 , fetchFromGitHub
 , pkg-config
+, libinput
 , libxcb
 , libxkbcommon
 , wayland
@@ -11,31 +12,55 @@
 , patches ? [ ]
 , conf ? null
 , writeText
+, fetchpatch
 }:
 
+let
+  # Add two patches to fix compile errors with wlroots 0.13:
+  totalPatches = patches ++ [
+    # Fix the renamed constant WLR_KEY_PRESSED => WL_KEYBOARD_KEY_STATE_PRESSED
+    # https://github.com/djpohly/dwl/pull/66
+    (fetchpatch {
+      url = "https://github.com/djpohly/dwl/commit/a42613db9d9f6debfa4fb2363d75af9457d238ed.patch";
+      sha256 = "0h76hx1fhazi07gqg7sljh13f91v6bvjy7m9qqmimhvqgfwdcc0j";
+    })
+    # Use the new signature for wlr_backend_autocreate, which removes an argument:
+    # https://github.com/djpohly/dwl/pull/76
+    (fetchpatch {
+      url = "https://github.com/djpohly/dwl/commit/0ff13cf216056a36a261f4eed53c6a864989a9fb.patch";
+      sha256 = "18clpdb4il1vxf1b0cx0qrwild68s9dism8ab66zpmvxs5qag2dm";
+    })
+  ];
+in
+
 stdenv.mkDerivation rec {
   pname = "dwl";
-  version = "0.1";
+  version = "0.2";
 
   src = fetchFromGitHub {
     owner = "djpohly";
     repo = pname;
     rev = "v${version}";
-    sha256 = "QoKaeF5DbSX0xciwc/0VKpubn/001cJjoZ+UzVDX4qE=";
+    sha256 = "gUaFTkpIQDswEubllMgvxPfCaEYFO7mODzjPyW7XsGQ=";
   };
 
   nativeBuildInputs = [ pkg-config ];
   buildInputs = [
+    libinput
     libxcb
     libxkbcommon
     wayland
     wayland-protocols
     wlroots
-  ] ++ lib.optionals enable-xwayland [ xwayland libX11 ];
+  ] ++ lib.optionals enable-xwayland [
+    libX11
+    xwayland
+  ];
 
   # Allow users to set their own list of patches
-  inherit patches;
+  patches = totalPatches;
 
+  # Last line of config.mk enables XWayland
   prePatch = lib.optionalString enable-xwayland ''
     sed -i -e '$ s|^#||' config.mk
   '';