* [bug#33753] [PATCH 1/3] gnu: Add stumpwm-contrib.
@ 2018-12-15 2:06 Nam Nguyen
2018-12-15 2:09 ` [bug#33753] [PATCH 2/3] gnu: Add stumpwm-cpu Nam Nguyen
` (4 more replies)
0 siblings, 5 replies; 23+ messages in thread
From: Nam Nguyen @ 2018-12-15 2:06 UTC (permalink / raw)
To: 33753; +Cc: Nam Nguyen
* gnu/packages/lisp.scm (stumpwm-contrib): New variable.
---
gnu/packages/lisp.scm | 36 ++++++++++++++++++++++++++++++++++++
1 file changed, 36 insertions(+)
diff --git a/gnu/packages/lisp.scm b/gnu/packages/lisp.scm
index d1c0a2ef3..b9e6c0e42 100644
--- a/gnu/packages/lisp.scm
+++ b/gnu/packages/lisp.scm
@@ -12,6 +12,7 @@
;;; Copyright © 2018 Alex Vong <alexvong1995@gmail.com>
;;; Copyright © 2018 Pierre Neidhardt <mail@ambrevar.xyz>
;;; Copyright © 2018 Pierre Langlois <pierre.langlois@gmx.com>
+;;; Copyright © 2018 Nam Nguyen <namn@berkeley.edu>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -991,6 +992,41 @@ productive, customizable lisp based systems.")
(inherit (sbcl-package->cl-source-package stumpwm))
(name "cl-stumpwm")))
+(define stumpwm-contrib
+ (let ((commit "bd47cec14f7299711ac29468d2e1364d38a81bee")
+ (revision "1"))
+ (package
+ (name "stumpwm-contrib")
+ (version (git-version "0.0.1" revision commit))
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/stumpwm/stumpwm-contrib.git")
+ (commit commit)))
+ (file-name (string-append name "-" version "-checkout"))
+ (sha256
+ (base32 "0kh9vpmxssjvxgvl6ihpn0qh4l660n64iq80ivhagdvr8s045ddj"))))
+ (inputs
+ `(("stumpwm" ,stumpwm "lib")))
+ (build-system asdf-build-system/sbcl)
+ (arguments
+ '(#:phases
+ ;; Make stumpwm-contrib more modular. Child modules must copy
+ ;; their source to $(out)/share/common-lisp/stumpwm-contrib.
+ (modify-phases %standard-phases
+ (add-after 'check 'delete-plugins
+ (lambda* (#:key outputs #:allow-other-keys)
+ (delete-file-recursively
+ (string-append (assoc-ref outputs "out")
+ "/share/common-lisp/sbcl-source"))
+ #t)))))
+ (home-page "https://github.com/stumpwm/stumpwm-contrib")
+ (synopsis "Collection of StumpWM modules")
+ (description "Modules are a way to extend StumpWM using Lisp
+code.")
+ (license (list license:gpl2+ license:gpl3+ license:bsd-2)))))
+
;; 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
^ permalink raw reply related [flat|nested] 23+ messages in thread
* [bug#33753] [PATCH 2/3] gnu: Add stumpwm-cpu.
2018-12-15 2:06 [bug#33753] [PATCH 1/3] gnu: Add stumpwm-contrib Nam Nguyen
@ 2018-12-15 2:09 ` Nam Nguyen
2018-12-15 2:09 ` [bug#33753] [PATCH 3/3] gnu: emacs-stumpwm-mode: Use source and version of stumpwm-cpu Nam Nguyen
2018-12-15 2:50 ` [bug#33753] stumpwm-contrib Nam Nguyen
` (3 subsequent siblings)
4 siblings, 1 reply; 23+ messages in thread
From: Nam Nguyen @ 2018-12-15 2:09 UTC (permalink / raw)
To: 33753; +Cc: Nam Nguyen
* 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
^ permalink raw reply related [flat|nested] 23+ messages in thread
* [bug#33753] [PATCH 3/3] gnu: emacs-stumpwm-mode: Use source and version of stumpwm-cpu.
2018-12-15 2:09 ` [bug#33753] [PATCH 2/3] gnu: Add stumpwm-cpu Nam Nguyen
@ 2018-12-15 2:09 ` Nam Nguyen
0 siblings, 0 replies; 23+ messages in thread
From: Nam Nguyen @ 2018-12-15 2:09 UTC (permalink / raw)
To: 33753; +Cc: Nam Nguyen
* gnu/packages/emacs.scm (emacs-stumpwm-mode): Use source and version of stumpwm-cpu.
---
gnu/packages/emacs.scm | 44 ++++++++++++++++--------------------------
1 file changed, 17 insertions(+), 27 deletions(-)
diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm
index 358f32cab..07d2c2104 100644
--- a/gnu/packages/emacs.scm
+++ b/gnu/packages/emacs.scm
@@ -122,6 +122,7 @@
#:use-module (gnu packages video)
#:use-module (gnu packages haskell)
#:use-module (gnu packages wordnet)
+ #:use-module (gnu packages lisp)
#:use-module (guix utils)
#:use-module (srfi srfi-1)
#:use-module (ice-9 match))
@@ -10822,33 +10823,22 @@ bookmarks and history.")
(license license:gpl3+))))
(define-public emacs-stumpwm-mode
- (let ((commit "8fbe071d2c6c040794060a354eb377218dc10b35")
- (revision "1"))
- (package
- (name "emacs-stumpwm-mode")
- (version (string-append "0.0.1-" revision "."
- (string-take commit 7)))
- (source (origin
- (method git-fetch)
- (uri (git-reference
- (url "https://github.com/stumpwm/stumpwm-contrib.git")
- (commit commit)))
- (file-name (string-append name "-" version "-checkout"))
- (sha256
- (base32
- "1dfwsvz1c8w6j4jp0kzaz78ml3f5dp0a5pvf090kwpbpg176r7iq"))))
- (build-system emacs-build-system)
- (arguments
- `(#:phases
- (modify-phases %standard-phases
- (add-after 'unpack 'chdir-elisp
- ;; Elisp directory is not in root of the source.
- (lambda _
- (chdir "util/swm-emacs"))))))
- (home-page "https://github.com/stumpwm/stumpwm-contrib")
- (synopsis "Emacs minor-mode for Stumpwm")
- (description "Emacs minor-mode for Stumpwm")
- (license license:gpl3+))))
+ (package
+ (name "emacs-stumpwm-mode")
+ (version (package-version stumpwm-cpu))
+ (source (package-source stumpwm-cpu))
+ (build-system emacs-build-system)
+ (arguments
+ `(#:phases
+ (modify-phases %standard-phases
+ (add-after 'unpack 'chdir-elisp
+ ;; Elisp directory is not in root of the source.
+ (lambda _
+ (chdir "util/swm-emacs"))))))
+ (home-page "https://github.com/stumpwm/stumpwm-contrib")
+ (synopsis "Emacs minor-mode for Stumpwm")
+ (description "Emacs minor-mode for Stumpwm")
+ (license license:gpl3+)))
(define-public emacs-irfc
(package
--
2.20.0
^ permalink raw reply related [flat|nested] 23+ messages in thread
* [bug#33753] stumpwm-contrib
2018-12-15 2:06 [bug#33753] [PATCH 1/3] gnu: Add stumpwm-contrib Nam Nguyen
2018-12-15 2:09 ` [bug#33753] [PATCH 2/3] gnu: Add stumpwm-cpu Nam Nguyen
@ 2018-12-15 2:50 ` Nam Nguyen
2018-12-21 17:06 ` Ludovic Courtès
2018-12-24 9:21 ` [bug#33753] [PATCH 1/3] gnu: Add stumpwm modules Nam Nguyen
` (2 subsequent siblings)
4 siblings, 1 reply; 23+ messages in thread
From: Nam Nguyen @ 2018-12-15 2:50 UTC (permalink / raw)
To: 33753
I am trying to make stumpwm-contrib less of a "grab bag" and more modular
and well-tested by breaking all the stumpwm extensions/modules into
separate recipes.
stumpwm-contrib deletes the source code and child
recipes copies their source code from their directory to
$(out)/share/common-lisp/stumpwm-contrib.
To test this, install stumpwm and stumpwm-cpu.
~/.stumpwmrc
********************************************************************************
(set-module-dir "~/.guix-profile/share/common-lisp/sbcl-bundle-systems")
(load-module "cpu")
(setf *screen-mode-line-format* '("%c %C %t %f [%n] %W"))
;; %c (CPU usage as %)
;; %C (CPU usage as bar graph)
;; %t (CPU temperature)
;; %f (CPU frequency)
********************************************************************************
To toggle the mode-line:
C-t semicolon mode-line <RET>
I violated the "Don't Repeat Yourself" (DRY) principle and have
stumpwm-{battery-portable,cpu,mem,pinentry,winner-mode} all tested and
working. I will postpone submission of those until stumpwm-cpu has been
accepted. All these submodules are nearly identical with only different
cat and mod variables. pinentry has some additional inputs. This results
in a lot of repeated code that looks nearly identical to stumpwm-cpu.
Another concern I had was for ~/.stumpwmrc, including sbcl-bundle-systems
(which contains symlinks to the compiled code) is necessary for
stumpwm-pinentry to work correctly. The other plugins can just use the
stumpwm-contrib directory I created.
;; (set-module-dir "~/.guix-profile/share/common-lisp/stumpwm-contrib")
(set-module-dir "~/.guix-profile/share/common-lisp/sbcl-bundle-systems")
Documentation (org-mode files) can be found in the stumpwm-contrib
directory.
Here is the general directory structure:
********************************************************************************
/home/user/.guix-profile/share/common-lisp:
.
..
sbcl-bundle-systems
stumpwm-contrib
/home/user/.guix-profile/share/common-lisp/sbcl-bundle-systems:
.
..
battery-portable.asd -> /gnu/store/...-stumpwm-battery-portable-0.0.1-1.bd47cec/share/common-lisp/sbcl-bundle-systems/battery-portable.asd
cpu.asd -> /gnu/store/...-stumpwm-cpu-0.0.1-1.bd47cec/share/common-lisp/sbcl-bundle-systems/cpu.asd
mem.asd -> /gnu/store/...-stumpwm-mem-0.0.1-1.bd47cec/share/common-lisp/sbcl-bundle-systems/mem.asd
pinentry.asd -> /gnu/store/...-stumpwm-pinentry-0.0.1-1.bd47cec/share/common-lisp/sbcl-bundle-systems/pinentry.asd
swm-gaps.asd -> /gnu/store/...-stumpwm-gaps-0.0.1-1.bd47cec/share/common-lisp/sbcl-bundle-systems/swm-gaps.asd
winner-mode.asd -> /gnu/store/...-stumpwm-winner-mode-0.0.1-1.bd47cec/share/common-lisp/sbcl-bundle-systems/winner-mode.asd
/home/user/.guix-profile/share/common-lisp/stumpwm-contrib:
.
..
battery-portable -> /gnu/store/...-stumpwm-battery-portable-0.0.1-1.bd47cec/share/common-lisp/stumpwm-contrib/battery-portable
cpu -> /gnu/store/...-stumpwm-cpu-0.0.1-1.bd47cec/share/common-lisp/stumpwm-contrib/cpu
mem -> /gnu/store/...-stumpwm-mem-0.0.1-1.bd47cec/share/common-lisp/stumpwm-contrib/mem
pinentry -> /gnu/store/...-stumpwm-pinentry-0.0.1-1.bd47cec/share/common-lisp/stumpwm-contrib/pinentry
swm-gaps -> /gnu/store/...-stumpwm-gaps-0.0.1-1.bd47cec/share/common-lisp/stumpwm-contrib/swm-gaps
winner-mode -> /gnu/store/...-stumpwm-winner-mode-0.0.1-1.bd47cec/share/common-lisp/stumpwm-contrib/winner-mode
/home/user/.guix-profile/share/common-lisp/stumpwm-contrib/cpu:
.
..
cpu.asd
cpu.lisp
package.lisp
README.org
********************************************************************************
Summary of questions:
1. Should the entire repository be bundled together instead of breaking
it into individual modules?
2. Should asdf-build-system/source be used instead of sbcl? I had initially
copied the entire repository with all the source code, and it still worked.
3. Is there a way to by more DRY?
4. Should the stumpwm-contrib directory be named sbcl-sources (can't
recall the default directory of asdf-build-system/source)?
^ permalink raw reply [flat|nested] 23+ messages in thread
* [bug#33753] stumpwm-contrib
2018-12-15 2:50 ` [bug#33753] stumpwm-contrib Nam Nguyen
@ 2018-12-21 17:06 ` Ludovic Courtès
2018-12-21 18:18 ` Pierre Neidhardt
0 siblings, 1 reply; 23+ messages in thread
From: Ludovic Courtès @ 2018-12-21 17:06 UTC (permalink / raw)
To: Nam Nguyen; +Cc: Pierre Neidhardt, 33753
Hello!
Pierre, Chris: could you provide feedback to Nam? I don’t use Stump
(yet!) so I wouldn’t know what to suggest.
https://issues.guix.info/issue/33753
Thanks,
Ludo’.
Nam Nguyen <namn@berkeley.edu> skribis:
> I am trying to make stumpwm-contrib less of a "grab bag" and more modular
> and well-tested by breaking all the stumpwm extensions/modules into
> separate recipes.
>
> stumpwm-contrib deletes the source code and child
> recipes copies their source code from their directory to
> $(out)/share/common-lisp/stumpwm-contrib.
>
> To test this, install stumpwm and stumpwm-cpu.
>
> ~/.stumpwmrc
> ********************************************************************************
> (set-module-dir "~/.guix-profile/share/common-lisp/sbcl-bundle-systems")
> (load-module "cpu")
>
> (setf *screen-mode-line-format* '("%c %C %t %f [%n] %W"))
>
> ;; %c (CPU usage as %)
> ;; %C (CPU usage as bar graph)
> ;; %t (CPU temperature)
> ;; %f (CPU frequency)
> ********************************************************************************
>
> To toggle the mode-line:
> C-t semicolon mode-line <RET>
>
> I violated the "Don't Repeat Yourself" (DRY) principle and have
> stumpwm-{battery-portable,cpu,mem,pinentry,winner-mode} all tested and
> working. I will postpone submission of those until stumpwm-cpu has been
> accepted. All these submodules are nearly identical with only different
> cat and mod variables. pinentry has some additional inputs. This results
> in a lot of repeated code that looks nearly identical to stumpwm-cpu.
>
> Another concern I had was for ~/.stumpwmrc, including sbcl-bundle-systems
> (which contains symlinks to the compiled code) is necessary for
> stumpwm-pinentry to work correctly. The other plugins can just use the
> stumpwm-contrib directory I created.
>
> ;; (set-module-dir "~/.guix-profile/share/common-lisp/stumpwm-contrib")
> (set-module-dir "~/.guix-profile/share/common-lisp/sbcl-bundle-systems")
>
> Documentation (org-mode files) can be found in the stumpwm-contrib
> directory.
>
> Here is the general directory structure:
> ********************************************************************************
> /home/user/.guix-profile/share/common-lisp:
> .
> ..
> sbcl-bundle-systems
> stumpwm-contrib
>
> /home/user/.guix-profile/share/common-lisp/sbcl-bundle-systems:
> .
> ..
> battery-portable.asd -> /gnu/store/...-stumpwm-battery-portable-0.0.1-1.bd47cec/share/common-lisp/sbcl-bundle-systems/battery-portable.asd
> cpu.asd -> /gnu/store/...-stumpwm-cpu-0.0.1-1.bd47cec/share/common-lisp/sbcl-bundle-systems/cpu.asd
> mem.asd -> /gnu/store/...-stumpwm-mem-0.0.1-1.bd47cec/share/common-lisp/sbcl-bundle-systems/mem.asd
> pinentry.asd -> /gnu/store/...-stumpwm-pinentry-0.0.1-1.bd47cec/share/common-lisp/sbcl-bundle-systems/pinentry.asd
> swm-gaps.asd -> /gnu/store/...-stumpwm-gaps-0.0.1-1.bd47cec/share/common-lisp/sbcl-bundle-systems/swm-gaps.asd
> winner-mode.asd -> /gnu/store/...-stumpwm-winner-mode-0.0.1-1.bd47cec/share/common-lisp/sbcl-bundle-systems/winner-mode.asd
>
> /home/user/.guix-profile/share/common-lisp/stumpwm-contrib:
> .
> ..
> battery-portable -> /gnu/store/...-stumpwm-battery-portable-0.0.1-1.bd47cec/share/common-lisp/stumpwm-contrib/battery-portable
> cpu -> /gnu/store/...-stumpwm-cpu-0.0.1-1.bd47cec/share/common-lisp/stumpwm-contrib/cpu
> mem -> /gnu/store/...-stumpwm-mem-0.0.1-1.bd47cec/share/common-lisp/stumpwm-contrib/mem
> pinentry -> /gnu/store/...-stumpwm-pinentry-0.0.1-1.bd47cec/share/common-lisp/stumpwm-contrib/pinentry
> swm-gaps -> /gnu/store/...-stumpwm-gaps-0.0.1-1.bd47cec/share/common-lisp/stumpwm-contrib/swm-gaps
> winner-mode -> /gnu/store/...-stumpwm-winner-mode-0.0.1-1.bd47cec/share/common-lisp/stumpwm-contrib/winner-mode
>
> /home/user/.guix-profile/share/common-lisp/stumpwm-contrib/cpu:
> .
> ..
> cpu.asd
> cpu.lisp
> package.lisp
> README.org
> ********************************************************************************
>
> Summary of questions:
> 1. Should the entire repository be bundled together instead of breaking
> it into individual modules?
> 2. Should asdf-build-system/source be used instead of sbcl? I had initially
> copied the entire repository with all the source code, and it still worked.
> 3. Is there a way to by more DRY?
> 4. Should the stumpwm-contrib directory be named sbcl-sources (can't
> recall the default directory of asdf-build-system/source)?
^ permalink raw reply [flat|nested] 23+ messages in thread
* [bug#33753] stumpwm-contrib
2018-12-21 17:06 ` Ludovic Courtès
@ 2018-12-21 18:18 ` Pierre Neidhardt
[not found] ` <875zvlv8r1.fsf@dustycloud.org>
0 siblings, 1 reply; 23+ messages in thread
From: Pierre Neidhardt @ 2018-12-21 18:18 UTC (permalink / raw)
To: Ludovic Courtès; +Cc: Nam Nguyen, 33753
[-- Attachment #1: Type: text/plain, Size: 928 bytes --]
Hi Nam,
Well, I don't use StumpWM (I'm on EXWM) but I know the ASDF build system, so
maybe I can help a bit.
> : 1. Should the entire repository be bundled together instead of breaking
> : it into individual modules?
One package per .asd.
> : 2. Should asdf-build-system/source be used instead of sbcl? I had initially
> : copied the entire repository with all the source code, and it still worked.
No, since StumpWM only supports sbcl, stick to the sbcl build system.
> : 3. Is there a way to by more DRY?
I haven't looked into the details, but you could probably use a a function /
macro to define those packages.
Lots of other packages do this, e.g. linux, gcc, clang, etc.
> : 4. Should the stumpwm-contrib directory be named sbcl-sources (can't
> : recall the default directory of asdf-build-system/source)?
Sorry, which directory exactly?
--
Pierre Neidhardt
https://ambrevar.xyz/
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]
^ permalink raw reply [flat|nested] 23+ messages in thread
* [bug#33753] [PATCH 1/3] gnu: Add stumpwm modules.
2018-12-15 2:06 [bug#33753] [PATCH 1/3] gnu: Add stumpwm-contrib Nam Nguyen
2018-12-15 2:09 ` [bug#33753] [PATCH 2/3] gnu: Add stumpwm-cpu Nam Nguyen
2018-12-15 2:50 ` [bug#33753] stumpwm-contrib Nam Nguyen
@ 2018-12-24 9:21 ` Nam Nguyen
2018-12-24 9:21 ` [bug#33753] [PATCH 2/3] gnu: Add sbcl-percent-encoding Nam Nguyen
2018-12-24 9:21 ` [bug#33753] [PATCH 3/3] gnu: emacs-stumpwm-mode: Use source and version of stumpwm-cpu Nam Nguyen
2018-12-25 8:19 ` [bug#33753] [PATCH 1/3] gnu: Add stumpwm modules Nam Nguyen
2020-03-23 7:16 ` [bug#33753] [PATCH 0/3] ttf-fonts module in StumpWM Oleg Pykhalov
4 siblings, 2 replies; 23+ messages in thread
From: Nam Nguyen @ 2018-12-24 9:21 UTC (permalink / raw)
To: 33753; +Cc: Nam Nguyen
* gnu/packages/lisp.scm (stumpwm-contrib, stumpwm-module)
(stumpwm-cpu, stumpwm-mem, stumpwm-hostname, stumpwm-battery-portable)
(stumpwm-winner-mode, stumpwm-swm-gaps)
(stumpwm-pinentry): New variables.
---
gnu/packages/lisp.scm | 111 ++++++++++++++++++++++++++++++++++++++++++
1 file changed, 111 insertions(+)
diff --git a/gnu/packages/lisp.scm b/gnu/packages/lisp.scm
index 261e720e2..711c57cbc 100644
--- a/gnu/packages/lisp.scm
+++ b/gnu/packages/lisp.scm
@@ -12,6 +12,7 @@
;;; Copyright © 2018 Alex Vong <alexvong1995@gmail.com>
;;; Copyright © 2018 Pierre Neidhardt <mail@ambrevar.xyz>
;;; Copyright © 2018 Pierre Langlois <pierre.langlois@gmx.com>
+;;; Copyright © 2018 Nam Nguyen <namn@berkeley.edu>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -1032,6 +1033,116 @@ productive, customizable lisp based systems.")
(inherit (sbcl-package->cl-source-package stumpwm))
(name "cl-stumpwm")))
+(define stumpwm-contrib
+ (let ((commit "bd47cec14f7299711ac29468d2e1364d38a81bee")
+ (revision "1"))
+ (package
+ (name "stumpwm-contrib")
+ (version (git-version "0.0.1" revision commit))
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/stumpwm/stumpwm-contrib.git")
+ (commit commit)))
+ (file-name (string-append name "-" version "-checkout"))
+ (sha256
+ (base32
+ "0kh9vpmxssjvxgvl6ihpn0qh4l660n64iq80ivhagdvr8s045ddj"))))
+ (inputs
+ `(("stumpwm" ,stumpwm "lib")))
+ (build-system asdf-build-system/sbcl)
+ (arguments
+ '(#:tests? #f ; No tests exist.
+ #:phases
+ (modify-phases %standard-phases
+ ;; Delete all sources.
+ (add-after 'check 'delete-modules
+ (lambda* (#:key outputs #:allow-other-keys)
+ (delete-file-recursively
+ (string-append (assoc-ref outputs "out")
+ "/share/common-lisp/sbcl-source"))
+ #t)))))
+ (home-page "https://github.com/stumpwm/stumpwm-contrib")
+ (synopsis "Collection of StumpWM modules")
+ (description "Modules are a way to extend StumpWM using Lisp
+code.")
+ (license (list license:gpl2+ ; TODO: swm-gaps Missing license?
+ license:gpl3+ ; cpu, mem, battery-portable,
+ ; winner-mode, pinentry
+ license:bsd-2))))) ; hostname
+
+(define* (stumpwm-module mod cat syn desc)
+ (package (inherit stumpwm-contrib)
+ (name (string-append "stumpwm-" mod))
+ (arguments
+ (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
+ ;; Keep module's sources.
+ (add-before 'delete-modules 'copy-module-sources
+ (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 syn)
+ (description desc)))
+
+(define-public stumpwm-cpu
+ (stumpwm-module "cpu" "modeline"
+ "Display CPU info"
+ "Display CPU info in the StumpWM modeline."))
+
+(define-public stumpwm-mem
+ (stumpwm-module "mem" "modeline"
+ "Display memory info"
+ "Display memory info in the StumpWM modeline."))
+
+(define-public stumpwm-hostname
+ (stumpwm-module "hostname" "modeline"
+ "Display hostname"
+ "Display hostname in the StumpWM modeline."))
+
+(define-public stumpwm-battery-portable
+ (stumpwm-module "battery-portable" "modeline"
+ "Display laptop battery info"
+ "Display laptop battery info in the StumpWM
+modeline."))
+
+(define-public stumpwm-winner-mode
+ (stumpwm-module "winner-mode" "util"
+ "Emacs' winner-mode for StumpWM"
+ "Winner mode records changes in the window
+configuration so that changes can be undone. It hooks into StumpWM to
+dump layouts. This only works per group."))
+
+(define-public stumpwm-swm-gaps
+ (stumpwm-module "swm-gaps" "util"
+ "Pretty (useless) gaps for StumpWM"
+ "Add gaps to StumpWM running along various borders."))
+
+(define-public stumpwm-pinentry
+ (let ((pinentry (stumpwm-module "pinentry" "util"
+ "Integrate GnuPG Agent with StumpWM"
+ "GnuPG Agent uses
+@code{stumpwm-pinentry} to ask for your password.")))
+ (package (inherit pinentry)
+ (inputs
+ `(("sbcl-cffi" ,sbcl-cffi)
+ ("sbcl-usocket-server" ,sbcl-usocket-server)
+ ("sbcl-percent-encoding" ,sbcl-percent-encoding)
+ ,@(package-inputs stumpwm-contrib)))
+ (propagated-inputs
+ `(("netcat" ,netcat))))))
+
;; 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.1
^ permalink raw reply related [flat|nested] 23+ messages in thread
* [bug#33753] [PATCH 2/3] gnu: Add sbcl-percent-encoding.
2018-12-24 9:21 ` [bug#33753] [PATCH 1/3] gnu: Add stumpwm modules Nam Nguyen
@ 2018-12-24 9:21 ` Nam Nguyen
2018-12-24 9:21 ` [bug#33753] [PATCH 3/3] gnu: emacs-stumpwm-mode: Use source and version of stumpwm-cpu Nam Nguyen
1 sibling, 0 replies; 23+ messages in thread
From: Nam Nguyen @ 2018-12-24 9:21 UTC (permalink / raw)
To: 33753; +Cc: Nam Nguyen
* gnu/packages/lisp.scm (sbcl-percent-encoding): New variable.
---
gnu/packages/lisp.scm | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/gnu/packages/lisp.scm b/gnu/packages/lisp.scm
index 711c57cbc..84da001b2 100644
--- a/gnu/packages/lisp.scm
+++ b/gnu/packages/lisp.scm
@@ -1502,6 +1502,30 @@ the string into one of the standard Common Lisp number types, if possible, or
else @code{parse-number} signals an error of type @code{invalid-number}.")
(license license:bsd-3)))
+(define-public sbcl-percent-encoding
+ (package
+ (name "sbcl-percent-encoding")
+ (version "20121013")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (string-append "http://beta.quicklisp.org/archive/percent-encoding/"
+ "2012-10-13/percent-encoding-"
+ version "-git.tgz"))
+ (sha256
+ (base32
+ "1dlf77c1iha1d7h6fzmv090mf8p6w20fqjrd5zcbh2kiicyabhfb"))))
+ (inputs
+ `(("sbcl-anaphora" ,sbcl-anaphora)
+ ("sbcl-babel" ,sbcl-babel)
+ ("sbcl-fiveam" ,sbcl-fiveam)))
+ (build-system asdf-build-system/sbcl)
+ (home-page "https://common-lisp.net/project/percent-encoding/")
+ (synopsis "Library for percent-encoding (URI encoding) for Common Lisp")
+ (description "@code{percent-encoding} is a URI encoding library for
+Common Lisp, as defined in RFC 3986.")
+ (license license:expat)))
+
(define-public sbcl-iterate
(package
(name "sbcl-iterate")
--
2.20.1
^ permalink raw reply related [flat|nested] 23+ messages in thread
* [bug#33753] [PATCH 3/3] gnu: emacs-stumpwm-mode: Use source and version of stumpwm-cpu.
2018-12-24 9:21 ` [bug#33753] [PATCH 1/3] gnu: Add stumpwm modules Nam Nguyen
2018-12-24 9:21 ` [bug#33753] [PATCH 2/3] gnu: Add sbcl-percent-encoding Nam Nguyen
@ 2018-12-24 9:21 ` Nam Nguyen
1 sibling, 0 replies; 23+ messages in thread
From: Nam Nguyen @ 2018-12-24 9:21 UTC (permalink / raw)
To: 33753; +Cc: Nam Nguyen
* gnu/packages/emacs.scm (emacs-stumpwm-mode): Use source and version of stumpwm-cpu.
---
gnu/packages/emacs.scm | 14 +++-----------
1 file changed, 3 insertions(+), 11 deletions(-)
diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm
index 7fdcfb1a3..2e6962695 100644
--- a/gnu/packages/emacs.scm
+++ b/gnu/packages/emacs.scm
@@ -122,6 +122,7 @@
#:use-module (gnu packages video)
#:use-module (gnu packages haskell)
#:use-module (gnu packages wordnet)
+ #:use-module (gnu packages lisp)
#:use-module (guix utils)
#:use-module (srfi srfi-1)
#:use-module (ice-9 match))
@@ -10864,17 +10865,8 @@ bookmarks and history.")
(revision "1"))
(package
(name "emacs-stumpwm-mode")
- (version (string-append "0.0.1-" revision "."
- (string-take commit 7)))
- (source (origin
- (method git-fetch)
- (uri (git-reference
- (url "https://github.com/stumpwm/stumpwm-contrib.git")
- (commit commit)))
- (file-name (string-append name "-" version "-checkout"))
- (sha256
- (base32
- "1dfwsvz1c8w6j4jp0kzaz78ml3f5dp0a5pvf090kwpbpg176r7iq"))))
+ (version (package-version stumpwm-cpu))
+ (source (package-source stumpwm-cpu))
(build-system emacs-build-system)
(arguments
`(#:phases
--
2.20.1
^ permalink raw reply related [flat|nested] 23+ messages in thread
* [bug#33753] stumpwm-contrib
[not found] ` <875zvlv8r1.fsf@dustycloud.org>
@ 2018-12-24 10:01 ` Nam Nguyen
2018-12-24 10:14 ` Pierre Neidhardt
0 siblings, 1 reply; 23+ messages in thread
From: Nam Nguyen @ 2018-12-24 10:01 UTC (permalink / raw)
To: 33753; +Cc: mail
Hi all,
> you could probably use a a function / macro to define those packages
Thank you for pointing me to examples. This helped me refactor.
> : 4. Should the stumpwm-contrib directory be named sbcl-sources (can't
> : recall the default directory of asdf-build-system/source)?
> Sorry, which directory exactly?
If I use asdf-build-system/source instead of sbcl I get the sources for
cpu stored in:
~/.guix-profile/share/common-lisp/source/cpu
Instead, I arbitrarily created stumpwm-contrib to store the sources:
~/.guix-profile/share/common-lisp/stumpwm-contrib/cpu
To rephrase question #4: Should I rename stumpwm-contrib to be "source"
to be more consistent with the "default" naming, or is stumpwm-contrib
sufficient?
As noted before, ~/.stumpwmrc will have to contain the precompiled code in:
(set-module-dir "~/.guix-profile/share/common-lisp/sbcl-bundle-systems")
in order to work with the more advanced plugins like pinentry.
AIUI, stumpwm-contrib/cpu contains the source code and documentation
org-mode files, and sbcl-bundle-systems contains the precompiled code.
This time, I included all the modules for review, as refactoring helped
to shorten the patches.
^ permalink raw reply [flat|nested] 23+ messages in thread
* [bug#33753] stumpwm-contrib
2018-12-24 10:01 ` Nam Nguyen
@ 2018-12-24 10:14 ` Pierre Neidhardt
2018-12-24 10:20 ` Efraim Flashner
2018-12-25 9:01 ` Nam Nguyen
0 siblings, 2 replies; 23+ messages in thread
From: Pierre Neidhardt @ 2018-12-24 10:14 UTC (permalink / raw)
To: Nam Nguyen; +Cc: 33753
[-- Attachment #1: Type: text/plain, Size: 905 bytes --]
> If I use asdf-build-system/source instead of sbcl I get the sources for
> cpu stored in:
> ~/.guix-profile/share/common-lisp/source/cpu
But you should not use asdf-build-system/source for StumpWM since it's not
supported by any Lisp other than SBCL, right?
> As noted before, ~/.stumpwmrc will have to contain the precompiled code in:
> (set-module-dir "~/.guix-profile/share/common-lisp/sbcl-bundle-systems")
> in order to work with the more advanced plugins like pinentry.
And then you would not need this line either if I'm not mistaken.
> AIUI,
What is AIUI? :/
> stumpwm-contrib/cpu contains the source code and documentation
> org-mode files, and sbcl-bundle-systems contains the precompiled code.
Both are included with asdf-build-system/sbcl. Is this OK in this context?
Sorry, no time for testing at the moment.
--
Pierre Neidhardt
https://ambrevar.xyz/
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]
^ permalink raw reply [flat|nested] 23+ messages in thread
* [bug#33753] stumpwm-contrib
2018-12-24 10:14 ` Pierre Neidhardt
@ 2018-12-24 10:20 ` Efraim Flashner
2018-12-25 9:01 ` Nam Nguyen
1 sibling, 0 replies; 23+ messages in thread
From: Efraim Flashner @ 2018-12-24 10:20 UTC (permalink / raw)
To: Pierre Neidhardt; +Cc: Nam Nguyen, 33753
[-- Attachment #1: Type: text/plain, Size: 345 bytes --]
On Mon, Dec 24, 2018 at 11:14:20AM +0100, Pierre Neidhardt wrote:
>
> > AIUI,
>
> What is AIUI? :/
>
as i understand it
--
Efraim Flashner <efraim@flashner.co.il> אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 23+ messages in thread
* [bug#33753] [PATCH 1/3] gnu: Add stumpwm modules.
2018-12-15 2:06 [bug#33753] [PATCH 1/3] gnu: Add stumpwm-contrib Nam Nguyen
` (2 preceding siblings ...)
2018-12-24 9:21 ` [bug#33753] [PATCH 1/3] gnu: Add stumpwm modules Nam Nguyen
@ 2018-12-25 8:19 ` Nam Nguyen
2018-12-25 8:19 ` [bug#33753] [PATCH 2/3] gnu: Add sbcl-percent-encoding Nam Nguyen
2020-03-23 7:16 ` [bug#33753] [PATCH 0/3] ttf-fonts module in StumpWM Oleg Pykhalov
4 siblings, 1 reply; 23+ messages in thread
From: Nam Nguyen @ 2018-12-25 8:19 UTC (permalink / raw)
To: 33753
* gnu/packages/lisp.scm (stumpwm-cpu, stumpwm-mem, stumpwm-hostname)
(stumpwm-battery-portable, stumpwm-winner-mode, stumpwm-swm-gaps)
(stumpwm-pinentry): New public variables.
(stumpwm-contrib, stumpwm-module): New private variables.
---
gnu/packages/lisp.scm | 104 ++++++++++++++++++++++++++++++++++++++++++
1 file changed, 104 insertions(+)
diff --git a/gnu/packages/lisp.scm b/gnu/packages/lisp.scm
index 261e720e2..4fb9a8a00 100644
--- a/gnu/packages/lisp.scm
+++ b/gnu/packages/lisp.scm
@@ -12,6 +12,7 @@
;;; Copyright © 2018 Alex Vong <alexvong1995@gmail.com>
;;; Copyright © 2018 Pierre Neidhardt <mail@ambrevar.xyz>
;;; Copyright © 2018 Pierre Langlois <pierre.langlois@gmx.com>
+;;; Copyright © 2018 Nam Nguyen <namn@berkeley.edu>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -1032,6 +1033,109 @@ productive, customizable lisp based systems.")
(inherit (sbcl-package->cl-source-package stumpwm))
(name "cl-stumpwm")))
+(define stumpwm-contrib
+ (let ((commit "bd47cec14f7299711ac29468d2e1364d38a81bee")
+ (revision "1"))
+ (package
+ (name "stumpwm-contrib")
+ (version (git-version "0.0.1" revision commit))
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/stumpwm/stumpwm-contrib.git")
+ (commit commit)))
+ (file-name (string-append name "-" version "-checkout"))
+ (sha256
+ (base32
+ "0kh9vpmxssjvxgvl6ihpn0qh4l660n64iq80ivhagdvr8s045ddj"))))
+ (build-system asdf-build-system/sbcl)
+ (inputs
+ `(("stumpwm" ,stumpwm "lib")))
+ (home-page "https://github.com/stumpwm/stumpwm-contrib")
+ (synopsis "Collection of StumpWM modules")
+ (description "Modules are a way to extend StumpWM using Lisp
+code.")
+ (license (list license:gpl2+ ; TODO: swm-gaps Missing license?
+ license:gpl3+ ; cpu, mem, battery-portable,
+ ; winner-mode, pinentry
+ license:bsd-2))))) ; hostname
+
+(define* (stumpwm-module mod cat syn desc)
+ (package (inherit stumpwm-contrib)
+ (name (string-append "stumpwm-" mod))
+ (arguments
+ `(#:tests? #f ; No tests exist.
+ #:asd-file (string-append ,cat "/" ,mod "/" ,mod ".asd")
+ #:asd-system-name ,mod
+ #:phases
+ (modify-phases %standard-phases
+ ;; Keep this module's sources and delete the rest.
+ (add-after 'check 'copy-module-sources
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let* ((out (assoc-ref outputs "out"))
+ (clisp (string-append out "/share/common-lisp"))
+ (sbcl-source (string-append clisp "/sbcl-source"))
+ (source (string-append sbcl-source "/"
+ ,mod "/" ,cat "/" ,mod))
+ (tmp (string-append out "/" ,mod)))
+ (mkdir-p tmp)
+ (copy-recursively source tmp)
+ (delete-file-recursively sbcl-source)
+ (copy-recursively tmp
+ (string-append sbcl-source "/" ,mod))
+ (delete-file-recursively tmp))
+ #t)))))
+ (synopsis syn)
+ (description desc)))
+
+(define-public stumpwm-cpu
+ (stumpwm-module "cpu" "modeline"
+ "Display CPU info"
+ "Display CPU info in the StumpWM modeline."))
+
+(define-public stumpwm-mem
+ (stumpwm-module "mem" "modeline"
+ "Display memory info"
+ "Display memory info in the StumpWM modeline."))
+
+(define-public stumpwm-hostname
+ (stumpwm-module "hostname" "modeline"
+ "Display hostname"
+ "Display hostname in the StumpWM modeline."))
+
+(define-public stumpwm-battery-portable
+ (stumpwm-module "battery-portable" "modeline"
+ "Display laptop battery info"
+ "Display laptop battery info in the StumpWM
+modeline."))
+
+(define-public stumpwm-winner-mode
+ (stumpwm-module "winner-mode" "util"
+ "Emacs' winner-mode for StumpWM"
+ "Winner mode records changes in the window
+configuration so that changes can be undone. It hooks into StumpWM to
+dump layouts. This only works per group."))
+
+(define-public stumpwm-swm-gaps
+ (stumpwm-module "swm-gaps" "util"
+ "Pretty (useless) gaps for StumpWM"
+ "Add gaps to StumpWM running along various borders."))
+
+(define-public stumpwm-pinentry
+ (let ((pinentry (stumpwm-module "pinentry" "util"
+ "Integrate GnuPG Agent with StumpWM"
+ "GnuPG Agent uses
+@code{stumpwm-pinentry} to ask for your password.")))
+ (package (inherit pinentry)
+ (inputs
+ `(("sbcl-cffi" ,sbcl-cffi)
+ ("sbcl-usocket-server" ,sbcl-usocket-server)
+ ("sbcl-percent-encoding" ,sbcl-percent-encoding)
+ ,@(package-inputs stumpwm-contrib)))
+ (propagated-inputs
+ `(("netcat" ,netcat))))))
+
;; 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.1
^ permalink raw reply related [flat|nested] 23+ messages in thread
* [bug#33753] [PATCH 2/3] gnu: Add sbcl-percent-encoding.
2018-12-25 8:19 ` [bug#33753] [PATCH 1/3] gnu: Add stumpwm modules Nam Nguyen
@ 2018-12-25 8:19 ` Nam Nguyen
0 siblings, 0 replies; 23+ messages in thread
From: Nam Nguyen @ 2018-12-25 8:19 UTC (permalink / raw)
To: 33753
* gnu/packages/lisp.scm (sbcl-percent-encoding): New variable.
---
gnu/packages/lisp.scm | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/gnu/packages/lisp.scm b/gnu/packages/lisp.scm
index 4fb9a8a00..5d99c7dfb 100644
--- a/gnu/packages/lisp.scm
+++ b/gnu/packages/lisp.scm
@@ -1495,6 +1495,30 @@ the string into one of the standard Common Lisp number types, if possible, or
else @code{parse-number} signals an error of type @code{invalid-number}.")
(license license:bsd-3)))
+(define-public sbcl-percent-encoding
+ (package
+ (name "sbcl-percent-encoding")
+ (version "20121013")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (string-append "http://beta.quicklisp.org/archive/percent-encoding/"
+ "2012-10-13/percent-encoding-"
+ version "-git.tgz"))
+ (sha256
+ (base32
+ "1dlf77c1iha1d7h6fzmv090mf8p6w20fqjrd5zcbh2kiicyabhfb"))))
+ (inputs
+ `(("sbcl-anaphora" ,sbcl-anaphora)
+ ("sbcl-babel" ,sbcl-babel)
+ ("sbcl-fiveam" ,sbcl-fiveam)))
+ (build-system asdf-build-system/sbcl)
+ (home-page "https://common-lisp.net/project/percent-encoding/")
+ (synopsis "Library for percent-encoding (URI encoding) for Common Lisp")
+ (description "@code{percent-encoding} is a URI encoding library for
+Common Lisp, as defined in RFC 3986.")
+ (license license:expat)))
+
(define-public sbcl-iterate
(package
(name "sbcl-iterate")
--
2.20.1
^ permalink raw reply related [flat|nested] 23+ messages in thread
* [bug#33753] stumpwm-contrib
2018-12-24 10:14 ` Pierre Neidhardt
2018-12-24 10:20 ` Efraim Flashner
@ 2018-12-25 9:01 ` Nam Nguyen
2018-12-26 7:13 ` Nam Nguyen
2018-12-27 10:51 ` Pierre Neidhardt
1 sibling, 2 replies; 23+ messages in thread
From: Nam Nguyen @ 2018-12-25 9:01 UTC (permalink / raw)
To: Pierre Neidhardt; +Cc: 33753
> Sorry, no time for testing at the moment.
No worries. Thanks for letting me know.
> Both are included with asdf-build-system/sbcl. Is this OK in this context?
In this context, the entire repo is contained in sbcl-source.
COPYING media/ minor-mode/ modeline/ README.org update-readme.sh util/
I've resorted to a clunky way of deleting everything but the util/cpu
subdirectory that I care about retaining.
cp -r sbcl-source/util/cpu out/cpu
rm -rf sbcl-source
cp -r out/cpu sbcl-source/cpu
I have cleaned up the code a bit in these latest two patches so that
there is only one phase that does this. The directories look like so:
---8<------------------------------------------------------------
~/.guix-profile/share/common-lisp/sbcl-source$ ls
battery-portable cpu hostname mem pinentry swm-gaps winner-mode
~/.guix-profile/share/common-lisp/sbcl-bundle-systems$ ls
battery-portable.asd cpu.asd hostname.asd mem.asd pinentry.asd swm-gaps.asd winner-mode.asd
---8<------------------------------------------------------------
> (set-module-dir "~/.guix-profile/share/common-lisp/sbcl-bundle-systems")
> And then you would not need this line either if I'm not mistaken.
I referred to the documentation[1], and it seems that module-dir can be set.
In order not to set module-dir at runtime, perhaps the stumpwm recipe
can be configured[2] with the correct module-dir?
I suppose it would be more user-friendly to not have to use set-module-dir
and just use the modules directly (like how emacs works with guix). If
this is option is more desired, I can try configuring stumpwm and will
report back.
---8<------------------------------------------------------------
(defvar *load-path* nil
"A list of paths in which modules can be found, by default it is
populated by any asdf systems found in `*module-dir*' set from the
configure script when StumpWM was built, or later by the user using
`add-to-load-path'")
---8<------------------------------------------------------------
[1] https://github.com/stumpwm/stumpwm/wiki/Modules
[2] https://github.com/stumpwm/stumpwm/blob/master/module.lisp
^ permalink raw reply [flat|nested] 23+ messages in thread
* [bug#33753] stumpwm-contrib
2018-12-25 9:01 ` Nam Nguyen
@ 2018-12-26 7:13 ` Nam Nguyen
2018-12-27 10:51 ` Pierre Neidhardt
1 sibling, 0 replies; 23+ messages in thread
From: Nam Nguyen @ 2018-12-26 7:13 UTC (permalink / raw)
To: 33753
I did some investigating by querying within stumpwm.
C-t ; brings up a stumpwm prompt.
---8<------------------------------------------------------------
eval-line (print *module-dir*)
/gnu/store/...stumpwm-18.11-lib/.stumpwm.d/modules/
---8<------------------------------------------------------------
It seems to set *module-dir* at build time to be
/gnu/store/...stumpwm-18.11-lib/.stumpwm.d/modules/. However, this .stump.d
doesn't exist and it was created when stumpwm was compiled. There are
also potentially a FHS assumption with (getenv "HOME") and it happens to
evaluate to the /gnu/store item.
StumpWM gives option #1 of setting module-dir at build time of
StumpWM. I could try patching
---8<------------------------------------------------------------
> (pathname-as-directory (concat (getenv "HOME") "/.stumpwm.d/modules"))
---8<------------------------------------------------------------
in order to store the modules at some standard, system-wide location? Hard
coding it as /var/guix/profiles/per-user/user/guix-profile/share/common-lisp
is incorrect because guix won't build as the user. Maybe I can force stumpwm
and the stumpwm-contrib modules to use the same stumpwm library. This seems
tricky/impossible, though, since they are all individual modules.
StumpWM also offers option #2 of calling set-module-dir to set this
variable at run-time in ~/.stumpwmrc. This is how it currently works and
it seems more simple.
---8<------------------- ~/.stumpwmrc --------------------------
(set-module-dir "~/.guix-profile/share/common-lisp/sbcl-bundle-systems")
---8<------------------------------------------------------------
*module-dir* is essentially a seed for *load-path*, which is where the
files like cpu.asd and cpu--system.fasl are. With the current setup,
load-path is populated correctly.
---8<------------------------------------------------------------
eval-line (print *load-path*)
/gnu/store/stumpwm-cpu/lib/sbcl/"
...
/gnu/store/stumpwm-mem/lib/sbcl/"
---8<------------------------------------------------------------
Option #3 is to use "add-to-load-path", but that seems similar to
Option #1. I suppose this is a matter of investigating how stumpwm
handles its modules/extensions. What I know thus far points me to err
toward setting module-dir at run-time, since it is a one-liner.
Relevant snippets from module.lisp
(https://github.com/stumpwm/stumpwm/blob/master/module.lisp)
---8<------------------------------------------------------------
(defvar *module-dir*
(pathname-as-directory (concat (getenv "HOME") "/.stumpwm.d/modules"))
"The location of the contrib modules on your system.")
(defun build-load-path (path)
"Maps subdirectories of path, returning a list of all subdirs in the
path which contain any files ending in .asd"
...
(defvar *load-path* nil
"A list of paths in which modules can be found, by default it is
populated by any asdf systems found in `*module-dir*' set from the
configure script when StumpWM was built, or later by the user using
`add-to-load-path'")
(defun set-module-dir (dir)
"Sets the location of the for StumpWM to find modules"
(when (stringp dir)
(setf dir (pathname (concat dir "/"))))
(setf *module-dir* dir)
(init-load-path *module-dir*))
---8<------------------------------------------------------------
^ permalink raw reply [flat|nested] 23+ messages in thread
* [bug#33753] stumpwm-contrib
2018-12-25 9:01 ` Nam Nguyen
2018-12-26 7:13 ` Nam Nguyen
@ 2018-12-27 10:51 ` Pierre Neidhardt
1 sibling, 0 replies; 23+ messages in thread
From: Pierre Neidhardt @ 2018-12-27 10:51 UTC (permalink / raw)
To: Nam Nguyen; +Cc: 33753
[-- Attachment #1: Type: text/plain, Size: 105 bytes --]
OK, thanks for the details. I'll look into this later.
--
Pierre Neidhardt
https://ambrevar.xyz/
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]
^ permalink raw reply [flat|nested] 23+ messages in thread
* [bug#33753] [PATCH 0/3] ttf-fonts module in StumpWM
2018-12-15 2:06 [bug#33753] [PATCH 1/3] gnu: Add stumpwm-contrib Nam Nguyen
` (3 preceding siblings ...)
2018-12-25 8:19 ` [bug#33753] [PATCH 1/3] gnu: Add stumpwm modules Nam Nguyen
@ 2020-03-23 7:16 ` Oleg Pykhalov
2020-03-23 7:24 ` [bug#33753] [PATCH 1/3] gnu: Add sbcl-clx-truetype Oleg Pykhalov
4 siblings, 1 reply; 23+ messages in thread
From: Oleg Pykhalov @ 2020-03-23 7:16 UTC (permalink / raw)
To: 33753; +Cc: Oleg Pykhalov
Hello. I wish to push the following if you don't mind. We probably could
make a better solution later, but I think it's good enough for now. WDYT?
This patch series allows you to use ttf-fonts module in StumpWM.
Oleg Pykhalov (3):
gnu: Add sbcl-clx-truetype.
gnu: emacs-stumpwm-mode: Update to 0.0.1-1.dd5b037.
gnu: Add sbcl-stumpwm-ttf-fonts.
doc/guix-cookbook.texi | 41 +++++++++++++++++++++++++++++++++++++-
gnu/packages/emacs-xyz.scm | 4 ++--
gnu/packages/lisp-xyz.scm | 35 ++++++++++++++++++++++++++++++++
gnu/packages/wm.scm | 33 +++++++++++++++++++++++++++++-
4 files changed, 109 insertions(+), 4 deletions(-)
--
2.25.1
^ permalink raw reply [flat|nested] 23+ messages in thread
* [bug#33753] [PATCH 1/3] gnu: Add sbcl-clx-truetype.
2020-03-23 7:16 ` [bug#33753] [PATCH 0/3] ttf-fonts module in StumpWM Oleg Pykhalov
@ 2020-03-23 7:24 ` Oleg Pykhalov
2020-03-23 7:24 ` [bug#33753] [PATCH 2/3] gnu: emacs-stumpwm-mode: Update to 0.0.1-1.dd5b037 Oleg Pykhalov
` (2 more replies)
0 siblings, 3 replies; 23+ messages in thread
From: Oleg Pykhalov @ 2020-03-23 7:24 UTC (permalink / raw)
To: 33753; +Cc: Oleg Pykhalov
* gnu/packages/lisp-xyz.scm (sbcl-clx-truetype): New variable.
---
gnu/packages/lisp-xyz.scm | 35 +++++++++++++++++++++++++++++++++++
1 file changed, 35 insertions(+)
diff --git a/gnu/packages/lisp-xyz.scm b/gnu/packages/lisp-xyz.scm
index 043c219e5e..d0af123171 100644
--- a/gnu/packages/lisp-xyz.scm
+++ b/gnu/packages/lisp-xyz.scm
@@ -18,6 +18,7 @@
;;; Copyright © 2019 Brett Gilio <brettg@gnu.org>
;;; Copyright © 2020 Konrad Hinsen <konrad.hinsen@fastmail.net>
;;; Copyright © 2020 Dimakis Dimakakos <me@bendersteed.tech>
+;;; Copyright © 2020 Oleg Pykhalov <go.wigust@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -619,6 +620,40 @@ from other CLXes around the net.")
(define-public ecl-clx
(sbcl-package->ecl-package sbcl-clx))
+(define-public sbcl-clx-truetype
+ (package
+ (name "sbcl-clx-truetype")
+ (version "2016-08-25")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (string-append
+ "http://beta.quicklisp.org/archive/clx-truetype/" version
+ "/clx-truetype-" (string-delete #\- version) "-git.tgz"))
+ (sha256
+ (base32
+ "0ndy067rg9w6636gxwlpnw7f3ck9nrnjb03444pprik9r3c9in67"))
+ (modules '((guix build utils)))
+ (snippet
+ '(begin
+ (substitute* "package.lisp"
+ ((":export") ":export\n :+font-cache-filename+"))
+ #t))))
+ (build-system asdf-build-system/sbcl)
+ (inputs
+ `(("clx" ,sbcl-clx)
+ ("zpb-ttf" ,sbcl-zpb-ttf)
+ ("cl-vectors" ,sbcl-cl-vectors)
+ ("cl-paths-ttf" ,sbcl-cl-paths-ttf)
+ ("cl-fad" ,sbcl-cl-fad)
+ ("cl-store" ,sbcl-cl-store)
+ ("trivial-features" ,sbcl-trivial-features)))
+ (home-page "http://beta.quicklisp.org/archive/clx-truetype/")
+ (synopsis "Antialiased TrueType font rendering using CLX and XRender")
+ (description "CLX-TrueType is pure common lisp solution for
+antialiased TrueType font rendering using CLX and XRender extension.")
+ (license license:expat)))
+
(define-public sbcl-cl-ppcre-unicode
(package (inherit sbcl-cl-ppcre)
(name "sbcl-cl-ppcre-unicode")
--
2.25.1
^ permalink raw reply related [flat|nested] 23+ messages in thread
* [bug#33753] [PATCH 2/3] gnu: emacs-stumpwm-mode: Update to 0.0.1-1.dd5b037.
2020-03-23 7:24 ` [bug#33753] [PATCH 1/3] gnu: Add sbcl-clx-truetype Oleg Pykhalov
@ 2020-03-23 7:24 ` Oleg Pykhalov
2020-03-23 7:24 ` [bug#33753] [PATCH 3/3] gnu: Add sbcl-stumpwm-ttf-fonts Oleg Pykhalov
2020-03-23 9:06 ` [bug#33753] [PATCH 1/3] gnu: Add sbcl-clx-truetype Guillaume Le Vaillant
2 siblings, 0 replies; 23+ messages in thread
From: Oleg Pykhalov @ 2020-03-23 7:24 UTC (permalink / raw)
To: 33753; +Cc: Oleg Pykhalov
* gnu/packages/emacs-xyz.scm (emacs-stumpwm-mode): Update to 0.0.1-1.dd5b037.
---
gnu/packages/emacs-xyz.scm | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/gnu/packages/emacs-xyz.scm b/gnu/packages/emacs-xyz.scm
index fe2210ac79..0069c19a2b 100644
--- a/gnu/packages/emacs-xyz.scm
+++ b/gnu/packages/emacs-xyz.scm
@@ -14536,7 +14536,7 @@ bookmarks and history.")
(license license:gpl3+)))
(define-public emacs-stumpwm-mode
- (let ((commit "5328f85fbf6a8b08c758c17b9435368bf7a68f39"))
+ (let ((commit "dd5b037923ec7d3cc27c55806bcec5a1b8cf4e91"))
(package
(name "emacs-stumpwm-mode")
(version (git-version "0.0.1" "1" commit))
@@ -14548,7 +14548,7 @@ bookmarks and history.")
(file-name (git-file-name name version))
(sha256
(base32
- "00kf4k8bqadi5s667wb96sn549v2kvw01zwszjrg7nhd805m1ng6"))))
+ "0ahxdj9f884afpzxczx6mx7l4nwg4kw6afqaq7lwhf7lxcwylldn"))))
(build-system emacs-build-system)
(arguments
`(#:phases
--
2.25.1
^ permalink raw reply related [flat|nested] 23+ messages in thread
* [bug#33753] [PATCH 3/3] gnu: Add sbcl-stumpwm-ttf-fonts.
2020-03-23 7:24 ` [bug#33753] [PATCH 1/3] gnu: Add sbcl-clx-truetype Oleg Pykhalov
2020-03-23 7:24 ` [bug#33753] [PATCH 2/3] gnu: emacs-stumpwm-mode: Update to 0.0.1-1.dd5b037 Oleg Pykhalov
@ 2020-03-23 7:24 ` Oleg Pykhalov
2020-03-23 9:06 ` [bug#33753] [PATCH 1/3] gnu: Add sbcl-clx-truetype Guillaume Le Vaillant
2 siblings, 0 replies; 23+ messages in thread
From: Oleg Pykhalov @ 2020-03-23 7:24 UTC (permalink / raw)
To: 33753; +Cc: Oleg Pykhalov
* gnu/packages/wm.scm (sbcl-stumpwm-ttf-fonts): New variable.
* doc/guix-cookbook.texi (Customizing a Window Manager): Document
SBCL-STUMPWM-TTF-FONTS installation and configuration.
---
doc/guix-cookbook.texi | 41 ++++++++++++++++++++++++++++++++++++++++-
gnu/packages/wm.scm | 33 ++++++++++++++++++++++++++++++++-
2 files changed, 72 insertions(+), 2 deletions(-)
diff --git a/doc/guix-cookbook.texi b/doc/guix-cookbook.texi
index 477b7e3dff..84a9bb38a4 100644
--- a/doc/guix-cookbook.texi
+++ b/doc/guix-cookbook.texi
@@ -11,6 +11,7 @@
Copyright @copyright{} 2019 Ricardo Wurmus@*
Copyright @copyright{} 2019 Efraim Flashner@*
Copyright @copyright{} 2019 Pierre Neidhardt@*
+Copyright @copyright{} 2020 Oleg Pykhalov@*
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3 or
@@ -1319,7 +1320,8 @@ chapter is to demonstrate some advanced configuration concepts.
reference.
@menu
-* Customizing the Kernel:: Creating and using a custom Linux kernel on Guix System.
+* Customizing the Kernel:: Creating and using a custom Linux kernel on Guix System.
+* Customizing a Window Manager:: Handle customization of a Window manager on Guix System.
@end menu
@node Customizing the Kernel
@@ -1562,6 +1564,43 @@ likely that you'll need to modify the initrd on a machine using a custom
kernel, since certain modules which are expected to be built may not be
available for inclusion into the initrd.
+@node Customizing a Window Manager
+@section Customizing a Window Manager
+@cindex wm
+
+@node StumpWM
+@subsection StumpWM
+@cindex stumpwm
+
+You could install StumpWM with a Guix system by adding
+@code{stumpwm-checkout} and optionally @code{`(,stumpwm-checkout "lib")}
+packages to a system configuration file, e.g. @file{/etc/config.scm}.
+
+An example configuration can look like this:
+
+@lisp
+(operating-system
+ ;; …
+ (packages (append (list sbcl stumpwm-checkout `(,stumpwm-checkout "lib"))
+ %base-packages)))
+@end lisp
+
+@cindex stumpwm fonts
+By default StumpWM uses X11 fonts, which could be small or pixelated on
+your system. You could fix this by installing StumpWM contrib Lisp
+module @code{sbcl-stumpwm-ttf-fonts}, adding it to Guix system packages.
+
+Then you need to add the following code to a StumpWM configuration file
+@file{~/.stumpwm.d/init.lisp}:
+
+@lisp
+(require :ttf-fonts)
+(setf xft:*font-dirs* '("/run/current-system/profile/share/fonts/"))
+(setf clx-truetype:+font-cache-filename+ (concat (getenv "HOME") "/.fonts/font-cache.sexp"))
+(xft:cache-fonts)
+(set-font (make-instance 'xft:font :family "DejaVu Sans Mono" :subfamily "Book" :size 11))
+@end lisp
+
@c *********************************************************************
@node Advanced package management
@chapter Advanced package management
diff --git a/gnu/packages/wm.scm b/gnu/packages/wm.scm
index 25ec278e2c..7217d985f2 100644
--- a/gnu/packages/wm.scm
+++ b/gnu/packages/wm.scm
@@ -14,7 +14,7 @@
;;; Copyright © 2016 Ivan Vilata i Balaguer <ivan@selidor.net>
;;; Copyright © 2017 Mekeor Melire <mekeor.melire@gmail.com>
;;; Copyright © 2017, 2019 Marius Bakke <mbakke@fastmail.com>
-;;; Copyright © 2017 Oleg Pykhalov <go.wigust@gmail.com>
+;;; Copyright © 2017, 2020 Oleg Pykhalov <go.wigust@gmail.com>
;;; Copyright © 2018, 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
;;; Copyright © 2018 Pierre-Antoine Rouby <contact@parouby.fr>
;;; Copyright © 2018, 2019 Meiyo Peng <meiyo@riseup.net>
@@ -1660,6 +1660,37 @@ productive, customizable lisp based systems.")
(define-public sbcl-stumpwm+slynk
(deprecated-package "sbcl-stumpwm-with-slynk" stumpwm+slynk))
+(define-public sbcl-stumpwm-ttf-fonts
+ (let ((commit "dd5b037923ec7d3cc27c55806bcec5a1b8cf4e91")
+ (revision "1"))
+ (package
+ (name "sbcl-ttf-fonts")
+ (version (git-version "0.0.1" revision commit)) ;no upstream release
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/stumpwm/stumpwm-contrib.git")
+ (commit commit)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "0ahxdj9f884afpzxczx6mx7l4nwg4kw6afqaq7lwhf7lxcwylldn"))))
+ (inputs
+ `(("stumpwm" ,stumpwm "lib")
+ ("clx-truetype" ,sbcl-clx-truetype)))
+ (build-system asdf-build-system/sbcl)
+ (arguments
+ '(#:phases
+ (modify-phases %standard-phases
+ (add-after 'unpack 'chdir
+ (lambda _
+ (chdir "util/ttf-fonts"))))))
+ (home-page "https://github.com/stumpwm/stumpwm-contrib")
+ (synopsis "Implementation of TTF font rendering for Lisp")
+ (description "This package provides a Lisp implementation of TTF font
+rendering.")
+ (license (list license:gpl2+ license:gpl3+ license:bsd-2)))))
+
(define-public lemonbar
(let ((commit "35183ab81d2128dbb7b6d8e119cc57846bcefdb4")
(revision "1"))
--
2.25.1
^ permalink raw reply related [flat|nested] 23+ messages in thread
* [bug#33753] [PATCH 1/3] gnu: Add sbcl-clx-truetype.
2020-03-23 7:24 ` [bug#33753] [PATCH 1/3] gnu: Add sbcl-clx-truetype Oleg Pykhalov
2020-03-23 7:24 ` [bug#33753] [PATCH 2/3] gnu: emacs-stumpwm-mode: Update to 0.0.1-1.dd5b037 Oleg Pykhalov
2020-03-23 7:24 ` [bug#33753] [PATCH 3/3] gnu: Add sbcl-stumpwm-ttf-fonts Oleg Pykhalov
@ 2020-03-23 9:06 ` Guillaume Le Vaillant
2020-03-30 20:24 ` bug#33753: " Oleg Pykhalov
2 siblings, 1 reply; 23+ messages in thread
From: Guillaume Le Vaillant @ 2020-03-23 9:06 UTC (permalink / raw)
To: 33753; +Cc: Oleg Pykhalov
[-- Attachment #1: Type: text/plain, Size: 546 bytes --]
Oleg Pykhalov <go.wigust@gmail.com> skribis:
> * gnu/packages/lisp-xyz.scm (sbcl-clx-truetype): New variable.
The author of clx-truetype suggests using truetype-clx instead (see
https://github.com/quicklisp/quicklisp-projects/issues/1774). Have you
checked if that would work for the ttf-fonts module of stumpwm-contrib?
If not, maybe we could get the sources from a fork of the original
repository that disappeared instead of fetching the Quicklisp archive
(for example, https://github.com/l04m33/clx-truetype has clx-truetype
version 0.1).
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 227 bytes --]
^ permalink raw reply [flat|nested] 23+ messages in thread
* bug#33753: [PATCH 1/3] gnu: Add sbcl-clx-truetype.
2020-03-23 9:06 ` [bug#33753] [PATCH 1/3] gnu: Add sbcl-clx-truetype Guillaume Le Vaillant
@ 2020-03-30 20:24 ` Oleg Pykhalov
0 siblings, 0 replies; 23+ messages in thread
From: Oleg Pykhalov @ 2020-03-30 20:24 UTC (permalink / raw)
To: Guillaume Le Vaillant; +Cc: 33753-done, 33753
[-- Attachment #1: Type: text/plain, Size: 685 bytes --]
Hi,
Apologies for a delay.
Guillaume Le Vaillant <glv@posteo.net> writes:
> The author of clx-truetype suggests using truetype-clx instead (see
> https://github.com/quicklisp/quicklisp-projects/issues/1774). Have you
> checked if that would work for the ttf-fonts module of stumpwm-contrib?
>
> If not, maybe we could get the sources from a fork of the original
> repository that disappeared instead of fetching the Quicklisp archive
> (for example, https://github.com/l04m33/clx-truetype has clx-truetype
> version 0.1).
I've tested in a VM, it works. Thank you for noticing this!
Also I pushed stumpish package in addition to this series.
Regards,
Oleg.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]
^ permalink raw reply [flat|nested] 23+ messages in thread
end of thread, other threads:[~2020-03-30 20:25 UTC | newest]
Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-12-15 2:06 [bug#33753] [PATCH 1/3] gnu: Add stumpwm-contrib Nam Nguyen
2018-12-15 2:09 ` [bug#33753] [PATCH 2/3] gnu: Add stumpwm-cpu Nam Nguyen
2018-12-15 2:09 ` [bug#33753] [PATCH 3/3] gnu: emacs-stumpwm-mode: Use source and version of stumpwm-cpu Nam Nguyen
2018-12-15 2:50 ` [bug#33753] stumpwm-contrib Nam Nguyen
2018-12-21 17:06 ` Ludovic Courtès
2018-12-21 18:18 ` Pierre Neidhardt
[not found] ` <875zvlv8r1.fsf@dustycloud.org>
2018-12-24 10:01 ` Nam Nguyen
2018-12-24 10:14 ` Pierre Neidhardt
2018-12-24 10:20 ` Efraim Flashner
2018-12-25 9:01 ` Nam Nguyen
2018-12-26 7:13 ` Nam Nguyen
2018-12-27 10:51 ` Pierre Neidhardt
2018-12-24 9:21 ` [bug#33753] [PATCH 1/3] gnu: Add stumpwm modules Nam Nguyen
2018-12-24 9:21 ` [bug#33753] [PATCH 2/3] gnu: Add sbcl-percent-encoding Nam Nguyen
2018-12-24 9:21 ` [bug#33753] [PATCH 3/3] gnu: emacs-stumpwm-mode: Use source and version of stumpwm-cpu Nam Nguyen
2018-12-25 8:19 ` [bug#33753] [PATCH 1/3] gnu: Add stumpwm modules Nam Nguyen
2018-12-25 8:19 ` [bug#33753] [PATCH 2/3] gnu: Add sbcl-percent-encoding Nam Nguyen
2020-03-23 7:16 ` [bug#33753] [PATCH 0/3] ttf-fonts module in StumpWM Oleg Pykhalov
2020-03-23 7:24 ` [bug#33753] [PATCH 1/3] gnu: Add sbcl-clx-truetype Oleg Pykhalov
2020-03-23 7:24 ` [bug#33753] [PATCH 2/3] gnu: emacs-stumpwm-mode: Update to 0.0.1-1.dd5b037 Oleg Pykhalov
2020-03-23 7:24 ` [bug#33753] [PATCH 3/3] gnu: Add sbcl-stumpwm-ttf-fonts Oleg Pykhalov
2020-03-23 9:06 ` [bug#33753] [PATCH 1/3] gnu: Add sbcl-clx-truetype Guillaume Le Vaillant
2020-03-30 20:24 ` bug#33753: " Oleg Pykhalov
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.