ag91 / moldable-emacs

Adapting Emacs for moldable development
GNU General Public License v3.0
105 stars 8 forks source link

add guix recipe for local dev #8

Closed ag91 closed 5 months ago

ag91 commented 2 years ago

Attempt at making a guix recipe for moldable-emacs copying from https://github.com/kat-co/guix-channels/blob/upstream-staging/upstream/packages/emacs-xyz.scm#L256-L281 (I just made that using the local code).

kat-co commented 2 years ago

I've updated my version of the package with some additional steps to make the contrib molds work automatically with Guix versions of the binaries:

         #:phases
         (modify-phases %standard-phases
           (add-after 'unpack 'patch-bin-locations
             (lambda* (#:key inputs outputs #:allow-other-keys)
               (let ((file "molds/contrib.el"))
                 (chmod file #o644)
                 (substitute* file
                   (("\\(executable-find \"graph\"\\)")
                    (string-append "(executable-find \"" (which "graph") "\")"))
                   (("\\(executable-find \"dot\"\\)")
                    (string-append "(executable-find \"" (which "graph") "\")")))))))))
      (inputs
       `(("graphviz" ,graphviz)
         ("graph-cli" ,python-graph-cli)))

This turns sexpr's like (executable-find "graph") into (executable-find "/gnu/store/4vkxk3wvmvd5gvijp5qx23p9z5fpbx6s-python-graph-cli-0.1.17/bin/graph")

This allows the moldable-emacs Guix package to work without the user having to install additional tools (they are on the user's machine -- this isn't magic -- but in /gnu/store, and not in the user's path). As Guix changes packages, these references will automatically get updated, and the emacs-moldable-emacs package will automatically update too. I.e., the Guix package definition doesn't necessarily change, but on disk, the elisp code will be different.

Please note, that I have not yet upstreamed python-graph-cli, so you may want to leave out those bits for now.

ag91 commented 5 months ago

I will close this as likely pretty outdated, but feel free to reopen contribute to it if you wish to.