Subject: [PATCH 2/3] gnu: Add stumpwm-cpu.

From: Nam Nguyen <[email-masked]>
Date: Fri, 14 Dec 2018 18:09:07 -0800

* gnu/packages/lisp.scm (stumpwm-cpu): New variable.
---
 gnu/packages/lisp.scm | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/gnu/packages/lisp.scm b/gnu/packages/lisp.scm
index b9e6c0e42..308159982 100644
--- a/gnu/packages/lisp.scm
+++ b/gnu/packages/lisp.scm
@@ -1027,6 +1027,32 @@ productive, customizable lisp based systems.")
 code.")
       (license (list license:gpl2+ license:gpl3+ license:bsd-2)))))
 
+(define-public stumpwm-cpu
+  (package (inherit stumpwm-contrib)
+    (name "stumpwm-cpu")
+    (arguments
+     (let ((cat "modeline")
+           (mod "cpu"))
+       (substitute-keyword-arguments (package-arguments stumpwm-contrib)
+         ((#:asd-file _ "") (string-append cat "/" mod "/" mod ".asd"))
+         ((#:asd-system-name _ #f) mod)
+         ((#:phases phases)
+          `(modify-phases ,phases
+             (add-before 'delete-plugins 'copy-plugin-source
+               (lambda* (#:key outputs #:allow-other-keys)
+                 (let* ((out (assoc-ref outputs "out"))
+                        (clisp (string-append out "/share/common-lisp"))
+                        (source (string-append clisp "/sbcl-source/"
+                                               ,mod "/" ,cat "/" ,mod))
+                        (dest (string-append clisp "/stumpwm-contrib/"
+                                             ,mod)))
+                   (mkdir-p dest)
+                   (copy-recursively source dest))
+                 #t)))))))
+    (synopsis "Add CPU info to the StumpWM modeline")
+    (description "Add CPU info to the StumpWM modeline.")
+    (license license:gpl3+)))
+
 ;; The slynk that users expect to install includes all of slynk's contrib
 ;; modules.  Therefore, we build the base module and all contribs first; then
 ;; we expose the union of these as `sbcl-slynk'.  The following variable
-- 
2.20.0