guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

branch master updated: gnu: guile-emacs: Support running emacs from the


From: guix-commits
Subject: branch master updated: gnu: guile-emacs: Support running emacs from the store.
Date: Sun, 08 Dec 2024 11:24:01 -0500

This is an automated email from the git hooks/post-receive script.

janneke pushed a commit to branch master
in repository guix.

The following commit(s) were added to refs/heads/master by this push:
     new e46bc3d928 gnu: guile-emacs: Support running emacs from the store.
e46bc3d928 is described below

commit e46bc3d928282c74a7b2d9af6af81972002f0a17
Author: Janneke Nieuwenhuizen <janneke@gnu.org>
AuthorDate: Sun Dec 8 15:36:38 2024 +0100

    gnu: guile-emacs: Support running emacs from the store.
    
    * gnu/packages/emacs.scm (guile-emacs)[argumets]: Replace stage
    "wrap-emacs-paths" to restrict EMACSLOADPATH.
    [native-search-paths]: Remove.
    
    Change-Id: Ie2c222a53a5bd79b1a8a0b8424a90e6e06b77fb9
---
 gnu/packages/emacs.scm | 44 ++++++++++++++++++++++++++++++++++----------
 1 file changed, 34 insertions(+), 10 deletions(-)

diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm
index c32d28b404..8140f61882 100644
--- a/gnu/packages/emacs.scm
+++ b/gnu/packages/emacs.scm
@@ -678,6 +678,39 @@ editor (with wide ints)" )
               (delete 'restore-emacs-pdmp)
               (delete 'build-trampolines)
               (delete 'install-site-start)
+              (replace 'wrap-emacs-paths
+                ;; Restrict EMACSLOADPATH to builtin packages.
+                (lambda _
+                  (let ((lisp-dirs (list (string-append
+                                          #$output "/share/emacs/"
+                                          #$upstream-version "/lisp")))
+                        (inputs '#$(map (match-lambda
+                                          ((name directory)
+                                           #~(#$name . #$directory)))
+                                        (package-inputs this-package))))
+                    (for-each
+                     (lambda (prog)
+                       (wrap-program prog
+                         ;; Some variants rely on uname being in PATH for 
Tramp.
+                         ;; Tramp paths can't be hardcoded, because they need 
to
+                         ;; be portable.
+                         `("PATH" suffix
+                           ,(map dirname
+                                 (list (search-input-file inputs "/bin/gzip")
+                                       ;; for coreutils
+                                       (search-input-file inputs "/bin/yes"))))
+                         ;; We use "=" because loading non-builtin packages is
+                         ;; currently not supported and prevents guile-emacs
+                         ;; from running.
+                         `("EMACSLOADPATH" = ,lisp-dirs)))
+                     (find-files
+                      (string-append #$output "/bin")
+                      ;; Matches versioned and unversioned emacs binaries.
+                      ;; We don't patch emacsclient, because it takes its
+                      ;; environment variables from emacs.
+                      ;; Likewise, we don't need to patch helper binaries
+                      ;; like etags, ctags or ebrowse.
+                      "^emacs(-[0-9]+(\\.[0-9]+)*)?$")))))
               (add-after 'unpack 'help-patch-progam-file-names
                 (lambda _
                   (call-with-output-file "lisp/obsolete/terminal.el"
@@ -685,16 +718,7 @@ editor (with wide ints)" )
               (add-after 'configure 'touch-lisp/finder-inf.el
                 (lambda _
                   (call-with-output-file "lisp/finder-inf.el"
-                    (lambda (port) (display port)))))))))
-      (native-search-paths
-       (list (search-path-specification
-              ;;guile-emacs needs this non-standard load-path for now
-              (variable "EMACSLOADPATH")
-              (files
-               (list (string-append "share/emacs/" upstream-version "/lisp"))))
-             (search-path-specification
-              (variable "INFOPATH")
-              (files '("share/info"))))))))
+                    (lambda (port) (display port))))))))))))
 
 (define-public m17n-db
   (package



reply via email to

[Prev in Thread] Current Thread [Next in Thread]