Subject: add herbstluftwm window manager package (v0.7.2) to guix (gnu/packages/wm.scm)

From: Kyle Andrews <[email-masked]>
Date: Sat, 14 Sep 2019 17:04:30 -0400

I'd like to provide a package definition for the herbstluftwm window
manager so that it may be included into guix. Please see the attached
patch. 

Regards,

Kyle Andrews

From 2d8537fc42c3424024d2f20aeb618e2ad1b5998c Mon Sep 17 00:00:00 2001
From: Kyle Andrews <[email-masked]>
Date: Sat, 14 Sep 2019 15:43:53 -0400
Subject: [PATCH] Add herbstluftwm to the list of available window managers.

---
 gnu/packages/wm.scm | 62 +++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 62 insertions(+)

diff --git a/gnu/packages/wm.scm b/gnu/packages/wm.scm
index c4b15cc755..d81a916ff3 100644
--- a/gnu/packages/wm.scm
+++ b/gnu/packages/wm.scm
@@ -89,6 +89,7 @@
   #:use-module (gnu packages pretty-print)
   #:use-module (gnu packages logging)
   #:use-module (gnu packages serialization)
+  #:use-module (gnu packages bash)
   #:use-module (gnu packages commencement) ; TODO remove when default gcc version >=7
   #:use-module (guix download)
   #:use-module (guix git-download))
@@ -128,6 +129,67 @@
 the leaves of a full binary tree.")
     (license license:bsd-2)))
 
+
+(define-public herbstluftwm
+  (package
+    (name "herbstluftwm")
+    (version "0.7.2")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append "https://herbstluftwm.org/tarballs/herbstluftwm-"
+			   version
+			   ".tar.gz"))
+       (sha256
+	(base32
+	 "1kc18aj9j3nfz6fj4qxg9s3gg4jvn6kzi3ii24hfm0vqdpy17xnz"))
+       (file-name (string-append "herbstluftwm-" version ".tar.gz"))))
+     (build-system gnu-build-system)
+     (inputs `(("dzen"        ,dzen)
+	       ("dmenu"       ,dmenu)
+	       ("glib"        ,glib)
+	       ("glibmm"      ,glibmm)
+	       ("xterm"       ,xterm)
+	       ("bash"        ,bash)
+	       ("xsetroot"    ,xsetroot)
+	       ("libx11"      ,libx11)
+	       ("libxext"     ,libxext)
+	       ("libxinerama" ,libxinerama)))
+     (native-inputs
+      `(("pkg-config" ,pkg-config)))
+     (arguments
+      '(#:phases
+	(modify-phases %standard-phases
+	  (delete 'configure)
+	  (delete 'check)
+	  (add-after 'install 'install-xsession
+	    (lambda* (#:key outputs #:allow-other-keys)
+	      (let* ((out (assoc-ref outputs "out"))
+		     (xsessions (string-append out "/share/xsessions")))
+		(mkdir-p xsessions)
+		(call-with-output-file
+		    (string-append xsessions "/herbstluftwm.desktop")
+		  (lambda (port)
+		    (format port "~
+                     [Desktop Entry]~@
+                     Name=herbstluftwm~@
+                     Comment=Manual tiling window manager~@
+                     Exec=~a/bin/herbstluftwm~@
+                     Type=XSession~%" out)))))))
+	#:tests? #f
+	#:make-flags
+	(let ((out (assoc-ref %outputs "out")))
+	  (list "CC=gcc"
+		(string-append "PREFIX=''")
+		(string-append "DESTDIR=" out)
+		(string-append "BASHCOMPLETIONDIR=" out
+			       "/etc/bash_completion.d")))))
+     (synopsis "Herbstluftwm Window Manager for X11")
+     (description "X11 Tiling Window Manager")
+     (home-page "https://herbstluftwm.org")
+     (license license:bsd-2)))
+
+
 (define-public i3status
   (package
     (name "i3status")
-- 
2.23.0