From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:39693) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gc3OP-0000hc-Om for guix-patches@gnu.org; Wed, 26 Dec 2018 02:14:14 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gc3OH-0003FI-Vv for guix-patches@gnu.org; Wed, 26 Dec 2018 02:14:11 -0500 Received: from debbugs.gnu.org ([208.118.235.43]:34136) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gc3OE-0003D1-Du for guix-patches@gnu.org; Wed, 26 Dec 2018 02:14:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gc3OE-0002Dv-20 for guix-patches@gnu.org; Wed, 26 Dec 2018 02:14:02 -0500 Subject: [bug#33753] stumpwm-contrib Resent-Message-ID: Date: Tue, 25 Dec 2018 23:13:21 -0800 From: Nam Nguyen Message-ID: <20181226071321.GA28866@antelope> References: <20181215020600.2713-1-namn@berkeley.edu> <20181215025031.GA2694@antelope> <87efaaolla.fsf@gnu.org> <87d0pulp5m.fsf@ambrevar.xyz> <875zvlv8r1.fsf@dustycloud.org> <20181224100129.GA17168@antelope> <87y38fi64j.fsf@ambrevar.xyz> <20181225090121.GA18066@antelope> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181225090121.GA18066@antelope> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: 33753@debbugs.gnu.org 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<------------------------------------------------------------