Subject: [bug#29569] Guile-wm +Guile-xcb patches (updates, urls,etc)

From: ng0 <[email-masked]>
Date: Mon, 4 Dec 2017 23:15:44 +0000

So,

I've updated to the latest commits in the hope that it would
fix the problem I have where guile-wm keeps crashing.

It's my first couple of hours with guile-wm and I don't know
the code yet, so I'll look into it why none of the recent commits
fixed it (while the messages said they should).

The state of it is as before. I doubt Guile-wm is stable as it
is in our master.
There are some changes. Like upstream made building with
Guile 2.2 an option, the original home page is gone, development
happens on github, etc.
I've made the change to use 2.2 a commit on its own.
I'll contribute a fix to upstream as soon as I can which will
address the fact that their build system picks 2.2 even when 2.0
is given. This should not happen.

Nice project, with some more work it could replace scrotwm for me.

Rntime crashes (like we have them now) would be good to get
automated tests for these, simulating garbage keystrokes etc.
Long store short, here are 5 patches and I'll contact the
upstream developer soon.
-- 
GnuPG: A88C8ADD129828D7EAC02E52E22F9BBFEE348588
GnuPG: https://c.n0.is/ng0_pubkeys/tree/keys
  WWW: https://n0.is
From 5240b7433a3cff12dcea49d02a940adb905357d4 Mon Sep 17 00:00:00 2001
From: ng0 <[email-masked]>
Date: Mon, 4 Dec 2017 21:35:47 +0000
Subject: [PATCH 1/5] gnu: guile-xcb: Update to 1.3-1.db7d5a3.

* gnu/packages/guile-wm.scm (guile-xcb): Update to 1.3-1.db7d5a3.
(version): Use git-version.
(source): Switch to git-fetch.
(native-inputs): Add texinfo.
(home-page): Update to new location.
---
 gnu/packages/guile-wm.scm | 25 ++++++++++++++++---------
 1 file changed, 16 insertions(+), 9 deletions(-)

diff --git a/gnu/packages/guile-wm.scm b/gnu/packages/guile-wm.scm
index c28c4753c..7a810ad52 100644
--- a/gnu/packages/guile-wm.scm
+++ b/gnu/packages/guile-wm.scm
@@ -2,6 +2,7 @@
 ;;; Copyright © 2013, 2014 Ludovic Courtès <[email-masked]>
 ;;; Copyright © 2016 Alex ter Weele <[email-masked]>
 ;;; Copyright © 2017 Ricardo Wurmus <[email-masked]>
+;;; Copyright © 2017 ng0 <[email-masked]>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -24,22 +25,27 @@
   #:use-module (gnu packages xorg)
   #:use-module (gnu packages guile)
   #:use-module (gnu packages pkg-config)
+  #:use-module (gnu packages texinfo)
   #:use-module (guix packages)
   #:use-module (guix download)
+  #:use-module (guix git-download)
   #:use-module (guix build-system gnu))
 
 (define-public guile-xcb
+  (let ((commit "db7d5a393cc37a56f66541b3f33938b40c6f35b3")
+        (revision "1"))
   (package
     (name "guile-xcb")
-    (version "1.3")
+    (version (git-version "1.3" revision commit))
     (source (origin
-             (method url-fetch)
-             (uri (string-append "http://web.archive.org/web/20150803094848/"
-                                 "http://www.markwitmer.com/dist/guile-xcb-"
-                                 version ".tar.gz"))
+             (method git-fetch)
+             (uri (git-reference
+                   (url "https://github.com/mwitmer/guile-xcb")
+                   (commit commit)))
+             (file-name (git-file-name name version))
              (sha256
               (base32
-               "04dvbqdrrs67490gn4gkq9zk8mqy3mkls2818ha4p0ckhh0pm149"))))
+               "16w4vgzbmnwih4bgfn8rw85ryfvzhc6hyly6bic9sd7hhc82rcnd"))))
     (build-system gnu-build-system)
     (arguments '(;; Parallel builds fail.
                  #:parallel-build? #f
@@ -52,16 +58,17 @@
                                           "--with-guile-site-ccache-dir="
                                           (assoc-ref %outputs "out")
                                           "/share/guile/site/2.0"))))
-    (native-inputs `(("pkg-config" ,pkg-config)))
+    (native-inputs `(("pkg-config" ,pkg-config)
+                     ("texinfo" ,texinfo)))
     (inputs `(("guile" ,guile-2.0)
               ("xcb" ,xcb-proto)))
-    (home-page "http://www.markwitmer.com/guile-xcb/guile-xcb.html")
+    (home-page "https://github.com/mwitmer/guile-xcb")
     (synopsis "XCB bindings for Guile")
     (description
      "Guile-XCB implements the XCB protocol and provides all the tools
 necessary to write X client code in Guile Scheme without any external
 dependencies.")
-    (license gpl3+)))
+    (license gpl3+))))
 
 (define-public guile-wm
   (package
-- 
2.15.1

From 2a79a9ee3fbbeca4f6014b55ad6c0834459dcc2d Mon Sep 17 00:00:00 2001
From: ng0 <[email-masked]>
Date: Mon, 4 Dec 2017 21:48:44 +0000
Subject: [PATCH 2/5] gnu: guile-wm: Update to 1.0-1.f3c7b3b.

* gnu/packages/guile-wm.scm (guile-xcb): Update to 1.0-1.f3c7b3b.
(version): Use git-version.
(source): Switch to git-fetch.
(native-inputs): Add texinfo.
(home-page): Update to new location.
---
 gnu/packages/guile-wm.scm | 22 +++++++++++++---------
 1 file changed, 13 insertions(+), 9 deletions(-)

diff --git a/gnu/packages/guile-wm.scm b/gnu/packages/guile-wm.scm
index 7a810ad52..7f302668a 100644
--- a/gnu/packages/guile-wm.scm
+++ b/gnu/packages/guile-wm.scm
@@ -71,18 +71,21 @@ dependencies.")
     (license gpl3+))))
 
 (define-public guile-wm
+  (let ((commit "f3c7b3be719f425ffb87265d34855a73366351be")
+        (revision "1"))
   (package
     (name "guile-wm")
-    (version "1.0")
+    (version (git-version "1.0" revision commit))
     (synopsis "X11 window manager toolkit in Scheme")
     (source (origin
-              (method url-fetch)
-              (uri (string-append "http://web.archive.org/web/20161005084324/"
-                                  "http://www.markwitmer.com/dist/guile-wm-"
-                                  version ".tar.gz"))
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/mwitmer/guile-wm")
+                    (commit commit)))
+              (file-name (git-file-name name version))
               (sha256
                (base32
-                "1l9qcz236jxvryndimjy62cf8zxf8i3f8vg3zpqqjhw15j9mdk3r"))))
+                "086dijnpl5dpglf70d6f9sizyakr313y7blpdjrmbi687j1x3qcl"))))
     (build-system gnu-build-system)
     (arguments
      `( ;; The '.scm' files go to $(datadir), so set that to the
@@ -135,14 +138,15 @@ dependencies.")
                                     Type=Application~%"
                           ,name ,synopsis %output))))
              #t)))))
-    (native-inputs `(("pkg-config" ,pkg-config)))
+    (native-inputs `(("pkg-config" ,pkg-config)
+                     ("texinfo" ,texinfo)))
     (inputs `(("guile" ,guile-2.0)
               ("guile-xcb" ,guile-xcb)))
-    (home-page "http://www.markwitmer.com/guile-xcb/guile-wm.html")
+    (home-page "https://github.com/mwitmer/guile-wm/releases")
     (description
      "Guile-WM is a simple window manager that's completely customizable—you
 have total control of what it does by choosing which modules to include.
 Included with it are a few modules that provide basic TinyWM-like window
 management, some window record-keeping, multi-monitor support, and emacs-like
 keymaps and minibuffer.  At this point, it's just enough to get you started.")
-    (license gpl3+)))
+    (license gpl3+))))
-- 
2.15.1

From 0c289de3c5b226772f7f05c8e8733e0aee9ae20c Mon Sep 17 00:00:00 2001
From: ng0 <[email-masked]>
Date: Mon, 4 Dec 2017 22:08:53 +0000
Subject: [PATCH 3/5] gnu: guile-wm and guile-xcb: Build with guile-2.2.

* gnu/packages/guile-wm.scm (guile-wm): Build with guile-2.2.
(arguments)[configure-flags]: Replace references of "2.0" with "2.2".
(inputs): Use guile-2.2.
* (guile-xcb): Build with guile-2.2.
(arguments)[configure-flags] Use Guile 2.2.
---
 gnu/packages/guile-wm.scm | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/gnu/packages/guile-wm.scm b/gnu/packages/guile-wm.scm
index 7f302668a..918761259 100644
--- a/gnu/packages/guile-wm.scm
+++ b/gnu/packages/guile-wm.scm
@@ -53,14 +53,14 @@
                  #:configure-flags (list (string-append
                                           "--with-guile-site-dir="
                                           (assoc-ref %outputs "out")
-                                          "/share/guile/site/2.0")
+                                          "/share/guile/site/2.2")
                                          (string-append
                                           "--with-guile-site-ccache-dir="
                                           (assoc-ref %outputs "out")
-                                          "/share/guile/site/2.0"))))
+                                          "/share/guile/site/2.2"))))
     (native-inputs `(("pkg-config" ,pkg-config)
                      ("texinfo" ,texinfo)))
-    (inputs `(("guile" ,guile-2.0)
+    (inputs `(("guile" ,guile-2.2)
               ("xcb" ,xcb-proto)))
     (home-page "https://github.com/mwitmer/guile-xcb")
     (synopsis "XCB bindings for Guile")
@@ -92,17 +92,17 @@ dependencies.")
        ;; standard value.
        #:configure-flags (list (string-append "--datadir="
                                               (assoc-ref %outputs "out")
-                                              "/share/guile/site/2.0"))
+                                              "/share/guile/site/2.2"))
        #:phases
        (modify-phases %standard-phases
          (add-before 'configure 'set-go-directory
           (lambda* (#:key outputs #:allow-other-keys)
-            ;; Install .go files to $out/share/guile/site/2.0.
+            ;; Install .go files to $out/share/guile/site/2.2.
             (let ((out (assoc-ref outputs "out")))
               (substitute* "module/Makefile.in"
                 (("^wmdir = .*$")
                  (string-append "wmdir = " out
-                                "/share/guile/site/2.0\n"))))
+                                "/share/guile/site/2.2\n"))))
             #t))
          (add-after 'install 'set-load-path
            (lambda* (#:key inputs outputs #:allow-other-keys)
@@ -111,10 +111,10 @@ dependencies.")
              (let* ((out  (assoc-ref outputs "out"))
                     (prog (string-append out "/bin/guile-wm"))
                     (mods (string-append
-                           out "/share/guile/site/2.0"))
+                           out "/share/guile/site/2.2"))
                     (xcb  (string-append
                            (assoc-ref inputs "guile-xcb")
-                           "/share/guile/site/2.0")))
+                           "/share/guile/site/2.2")))
                (wrap-program
                    prog
                  `("GUILE_LOAD_PATH" ":" prefix (,mods ,xcb))
@@ -140,7 +140,7 @@ dependencies.")
              #t)))))
     (native-inputs `(("pkg-config" ,pkg-config)
                      ("texinfo" ,texinfo)))
-    (inputs `(("guile" ,guile-2.0)
+    (inputs `(("guile" ,guile-2.2)
               ("guile-xcb" ,guile-xcb)))
     (home-page "https://github.com/mwitmer/guile-wm/releases")
     (description
-- 
2.15.1

From c24e45c9aad4841f78be540dc4f49ca00e6834b9 Mon Sep 17 00:00:00 2001
From: ng0 <[email-masked]>
Date: Mon, 4 Dec 2017 22:14:58 +0000
Subject: [PATCH 4/5] gnu: guile-xcb: Fix up indentation.

* gnu/packages/guile-wm.scm (guile-xcb): Fix up indentation.
---
 gnu/packages/guile-wm.scm | 65 +++++++++++++++++++++++------------------------
 1 file changed, 32 insertions(+), 33 deletions(-)

diff --git a/gnu/packages/guile-wm.scm b/gnu/packages/guile-wm.scm
index 918761259..5a21975fd 100644
--- a/gnu/packages/guile-wm.scm
+++ b/gnu/packages/guile-wm.scm
@@ -34,41 +34,40 @@
 (define-public guile-xcb
   (let ((commit "db7d5a393cc37a56f66541b3f33938b40c6f35b3")
         (revision "1"))
-  (package
-    (name "guile-xcb")
-    (version (git-version "1.3" revision commit))
-    (source (origin
-             (method git-fetch)
-             (uri (git-reference
-                   (url "https://github.com/mwitmer/guile-xcb")
-                   (commit commit)))
-             (file-name (git-file-name name version))
-             (sha256
-              (base32
-               "16w4vgzbmnwih4bgfn8rw85ryfvzhc6hyly6bic9sd7hhc82rcnd"))))
-    (build-system gnu-build-system)
-    (arguments '(;; Parallel builds fail.
-                 #:parallel-build? #f
-
-                 #:configure-flags (list (string-append
-                                          "--with-guile-site-dir="
-                                          (assoc-ref %outputs "out")
-                                          "/share/guile/site/2.2")
-                                         (string-append
-                                          "--with-guile-site-ccache-dir="
-                                          (assoc-ref %outputs "out")
-                                          "/share/guile/site/2.2"))))
-    (native-inputs `(("pkg-config" ,pkg-config)
-                     ("texinfo" ,texinfo)))
-    (inputs `(("guile" ,guile-2.2)
-              ("xcb" ,xcb-proto)))
-    (home-page "https://github.com/mwitmer/guile-xcb")
-    (synopsis "XCB bindings for Guile")
-    (description
-     "Guile-XCB implements the XCB protocol and provides all the tools
+    (package
+      (name "guile-xcb")
+      (version (git-version "1.3" revision commit))
+      (source (origin
+                (method git-fetch)
+                (uri (git-reference
+                      (url "https://github.com/mwitmer/guile-xcb")
+                      (commit commit)))
+                (file-name (git-file-name name version))
+                (sha256
+                 (base32
+                  "16w4vgzbmnwih4bgfn8rw85ryfvzhc6hyly6bic9sd7hhc82rcnd"))))
+      (build-system gnu-build-system)
+      (arguments '(;; Parallel builds fail.
+                   #:parallel-build? #f
+                   #:configure-flags (list (string-append
+                                            "--with-guile-site-dir="
+                                            (assoc-ref %outputs "out")
+                                            "/share/guile/site/2.2")
+                                           (string-append
+                                            "--with-guile-site-ccache-dir="
+                                            (assoc-ref %outputs "out")
+                                            "/share/guile/site/2.2"))))
+      (native-inputs `(("pkg-config" ,pkg-config)
+                       ("texinfo" ,texinfo)))
+      (inputs `(("guile" ,guile-2.2)
+                ("xcb" ,xcb-proto)))
+      (home-page "https://github.com/mwitmer/guile-xcb")
+      (synopsis "XCB bindings for Guile")
+      (description
+       "Guile-XCB implements the XCB protocol and provides all the tools
 necessary to write X client code in Guile Scheme without any external
 dependencies.")
-    (license gpl3+))))
+      (license gpl3+))))
 
 (define-public guile-wm
   (let ((commit "f3c7b3be719f425ffb87265d34855a73366351be")
-- 
2.15.1

From 1da280f71f792a6a9e8bcafa029c7a6c368ae52b Mon Sep 17 00:00:00 2001
From: ng0 <[email-masked]>
Date: Mon, 4 Dec 2017 22:18:40 +0000
Subject: [PATCH 5/5] gnu: guile-wm: Fix up indentation.

* gnu/packages/guile-wm.scm (guile-wm): Fix up indentation.
---
 gnu/packages/guile-wm.scm | 138 +++++++++++++++++++++++-----------------------
 1 file changed, 69 insertions(+), 69 deletions(-)

diff --git a/gnu/packages/guile-wm.scm b/gnu/packages/guile-wm.scm
index 5a21975fd..06c839910 100644
--- a/gnu/packages/guile-wm.scm
+++ b/gnu/packages/guile-wm.scm
@@ -72,80 +72,80 @@ dependencies.")
 (define-public guile-wm
   (let ((commit "f3c7b3be719f425ffb87265d34855a73366351be")
         (revision "1"))
-  (package
-    (name "guile-wm")
-    (version (git-version "1.0" revision commit))
-    (synopsis "X11 window manager toolkit in Scheme")
-    (source (origin
-              (method git-fetch)
-              (uri (git-reference
-                    (url "https://github.com/mwitmer/guile-wm")
-                    (commit commit)))
-              (file-name (git-file-name name version))
-              (sha256
-               (base32
-                "086dijnpl5dpglf70d6f9sizyakr313y7blpdjrmbi687j1x3qcl"))))
-    (build-system gnu-build-system)
-    (arguments
-     `( ;; The '.scm' files go to $(datadir), so set that to the
-       ;; standard value.
-       #:configure-flags (list (string-append "--datadir="
-                                              (assoc-ref %outputs "out")
-                                              "/share/guile/site/2.2"))
-       #:phases
-       (modify-phases %standard-phases
-         (add-before 'configure 'set-go-directory
-          (lambda* (#:key outputs #:allow-other-keys)
-            ;; Install .go files to $out/share/guile/site/2.2.
-            (let ((out (assoc-ref outputs "out")))
-              (substitute* "module/Makefile.in"
-                (("^wmdir = .*$")
-                 (string-append "wmdir = " out
-                                "/share/guile/site/2.2\n"))))
-            #t))
-         (add-after 'install 'set-load-path
-           (lambda* (#:key inputs outputs #:allow-other-keys)
-             ;; Put Guile-XCB's and Guile-WM's modules in the
-             ;; search path of PROG.
-             (let* ((out  (assoc-ref outputs "out"))
-                    (prog (string-append out "/bin/guile-wm"))
-                    (mods (string-append
-                           out "/share/guile/site/2.2"))
-                    (xcb  (string-append
-                           (assoc-ref inputs "guile-xcb")
-                           "/share/guile/site/2.2")))
-               (wrap-program
-                   prog
-                 `("GUILE_LOAD_PATH" ":" prefix (,mods ,xcb))
-                 `("GUILE_LOAD_COMPILED_PATH" ":" prefix
-                   (,mods ,xcb))))
-             #t))
-         (add-after 'install 'install-xsession
-           (lambda* (#:key outputs #:allow-other-keys)
-             ;; add a .desktop file to xsessions
-             (let ((xsessions (string-append
-                               %output "/share/xsessions")))
-               (mkdir-p xsessions)
-               (call-with-output-file (string-append
-                                       xsessions "/guile-wm.desktop")
-                 (lambda (port)
-                   (format port
-                          "[Desktop Entry]~@
+    (package
+      (name "guile-wm")
+      (version (git-version "1.0" revision commit))
+      (synopsis "X11 window manager toolkit in Scheme")
+      (source (origin
+                (method git-fetch)
+                (uri (git-reference
+                      (url "https://github.com/mwitmer/guile-wm")
+                      (commit commit)))
+                (file-name (git-file-name name version))
+                (sha256
+                 (base32
+                  "086dijnpl5dpglf70d6f9sizyakr313y7blpdjrmbi687j1x3qcl"))))
+      (build-system gnu-build-system)
+      (arguments
+       `( ;; The '.scm' files go to $(datadir), so set that to the
+         ;; standard value.
+         #:configure-flags (list (string-append "--datadir="
+                                                (assoc-ref %outputs "out")
+                                                "/share/guile/site/2.2"))
+         #:phases
+         (modify-phases %standard-phases
+           (add-before 'configure 'set-go-directory
+             (lambda* (#:key outputs #:allow-other-keys)
+               ;; Install .go files to $out/share/guile/site/2.2.
+               (let ((out (assoc-ref outputs "out")))
+                 (substitute* "module/Makefile.in"
+                   (("^wmdir = .*$")
+                    (string-append "wmdir = " out
+                                   "/share/guile/site/2.2\n"))))
+               #t))
+           (add-after 'install 'set-load-path
+             (lambda* (#:key inputs outputs #:allow-other-keys)
+               ;; Put Guile-XCB's and Guile-WM's modules in the
+               ;; search path of PROG.
+               (let* ((out  (assoc-ref outputs "out"))
+                      (prog (string-append out "/bin/guile-wm"))
+                      (mods (string-append
+                             out "/share/guile/site/2.2"))
+                      (xcb  (string-append
+                             (assoc-ref inputs "guile-xcb")
+                             "/share/guile/site/2.2")))
+                 (wrap-program
+                     prog
+                   `("GUILE_LOAD_PATH" ":" prefix (,mods ,xcb))
+                   `("GUILE_LOAD_COMPILED_PATH" ":" prefix
+                     (,mods ,xcb))))
+               #t))
+           (add-after 'install 'install-xsession
+             (lambda* (#:key outputs #:allow-other-keys)
+               ;; add a .desktop file to xsessions
+               (let ((xsessions (string-append
+                                 %output "/share/xsessions")))
+                 (mkdir-p xsessions)
+                 (call-with-output-file (string-append
+                                         xsessions "/guile-wm.desktop")
+                   (lambda (port)
+                     (format port
+                             "[Desktop Entry]~@
                                     Name=~a~@
                                     Comment=~a~@
                                     Exec=~a/bin/guile-wm~@
                                     Type=Application~%"
-                          ,name ,synopsis %output))))
-             #t)))))
-    (native-inputs `(("pkg-config" ,pkg-config)
-                     ("texinfo" ,texinfo)))
-    (inputs `(("guile" ,guile-2.2)
-              ("guile-xcb" ,guile-xcb)))
-    (home-page "https://github.com/mwitmer/guile-wm/releases")
-    (description
-     "Guile-WM is a simple window manager that's completely customizable—you
+                             ,name ,synopsis %output))))
+               #t)))))
+      (native-inputs `(("pkg-config" ,pkg-config)
+                       ("texinfo" ,texinfo)))
+      (inputs `(("guile" ,guile-2.2)
+                ("guile-xcb" ,guile-xcb)))
+      (home-page "https://github.com/mwitmer/guile-wm/releases")
+      (description
+       "Guile-WM is a simple window manager that's completely customizable—you
 have total control of what it does by choosing which modules to include.
 Included with it are a few modules that provide basic TinyWM-like window
 management, some window record-keeping, multi-monitor support, and emacs-like
 keymaps and minibuffer.  At this point, it's just enough to get you started.")
-    (license gpl3+))))
+      (license gpl3+))))
-- 
2.15.1