From e7ce14a5c07c232f95bbef673409d3b7b278eff3 Mon Sep 17 00:00:00 2001
From: Rutherther <rutherther@proton.me>
Date: Sat, 10 Aug 2024 13:49:50 +0200
Subject: [PATCH] feat: add new version of dwl

---
 ruther/packages/dwl.scm | 95 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 95 insertions(+)
 create mode 100644 ruther/packages/dwl.scm

diff --git a/ruther/packages/dwl.scm b/ruther/packages/dwl.scm
new file mode 100644
index 0000000..52a7849
--- /dev/null
+++ b/ruther/packages/dwl.scm
@@ -0,0 +1,95 @@
+(define-module (ruther packages dwl)
+  #:use-module (guix packages)
+  #:use-module (gnu packages xdisorg)
+  #:use-module (gnu packages gl)
+  #:use-module (gnu packages wm)
+  #:use-module (gnu packages freedesktop)
+  #:use-module (gnu packages pkg-config)
+
+  #:use-module (guix download)
+  #:use-module (guix git-download))
+
+(define-public libdrm-2.4.122
+  (package/inherit libdrm
+    (version "2.4.122")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append
+             "https://dri.freedesktop.org/libdrm/libdrm-"
+             version
+             ".tar.xz"))
+       (sha256
+        (base32 "0lgjj9ign3cl27hzmqnxr7xwv21mm486pifc029wmzvxfydhgxfr"))))))
+
+(define-public mesa-libdrm-2.4.122
+  ((package-input-rewriting `((,libdrm . ,libdrm-2.4.122))) mesa))
+
+(define-public wayland-1.23
+  (package
+    (inherit wayland)
+    (name "wayland")
+    (version "1.23.0")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append "https://gitlab.freedesktop.org/" name
+                           "/" name  "/-/releases/" version "/downloads/"
+                           name "-" version ".tar.xz"))
+       (sha256
+        (base32
+         "1cjswi1d7hp6lhvcnrdrxry7qhjvdgrn5y3lb5mn4rry9mby3cq5"))))))
+
+(define-public wayland-protocols-1.35
+  (package/inherit wayland-protocols
+    (name "wayland-protocols")
+    (version "1.35")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append "https://gitlab.freedesktop.org/wayland/"
+                           name "/-/releases/" version "/downloads/"
+                           name "-" version ".tar.xz"))
+       (sha256
+        (base32
+         "1awm7p1457zwzjhjdhg560hvg30ys8lqlmhw6hcwhg8k51m738ip"))))
+    (inputs (modify-inputs (package-inputs wayland-protocols)
+                     (replace "wayland" wayland-1.23)))))
+
+(define-public wlroots-0.18
+  (package/inherit wlroots
+    (name "wlroots")
+    (version "0.18.0")
+    (source
+        (origin
+          (method git-fetch)
+          (uri (git-reference
+                (url "https://gitlab.freedesktop.org/wlroots/wlroots")
+                (commit version)))
+          (file-name (git-file-name name version))
+          (sha256
+            (base32 "13avi2805wrfkghgc7ar273p61svmm85k3g3hg9bf2gaxsz6f91f"))))
+    (native-inputs (modify-inputs (package-native-inputs wlroots)
+                     (replace "wayland" wayland-1.23)))
+    (propagated-inputs (modify-inputs (package-propagated-inputs wlroots)
+                         (replace "mesa" mesa-libdrm-2.4.122)
+                         (replace "wayland-protocols" wayland-protocols-1.35)))))
+
+(define-public dwl-0.7
+  (package/inherit dwl
+    (name "dwl")
+    (version "0.7")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://codeberg.org/dwl/dwl.git")
+             (commit "v0.7-rc1")))
+       (sha256
+        (base32 "0sm5rzaf8gmjhrs8bi8wm1whsi9r3b6xypmhv88s64hqgcbs1ymf"))))
+    (native-inputs
+     (modify-inputs (package-native-inputs dwl)
+       (append wayland-1.23)))
+    (inputs
+     (list
+      wlroots-0.18))))
-- 
2.48.1