Subject: [bug#67260] [PATCH emacs-team v10 1/7] gnu: emacs: Wrap EMACSNATIVELOADPATH.

From: Liliana Marie Prikler <[email-masked]>
Date: Tue, 13 Feb 2024 19:30:50 +0100

* gnu/packages/emacs.scm (emacs-minimal)[wrap-emacs-paths]: Also wrap
EMACSNATIVELOADPATH.
---
 gnu/packages/emacs.scm | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm
index 5f27c551e0..2cdc9b8bca 100644
--- a/gnu/packages/emacs.scm
+++ b/gnu/packages/emacs.scm
@@ -273,7 +273,11 @@ (define-public emacs-minimal
               (let* ((out (assoc-ref outputs "out"))
                      (lisp-dirs (find-files (string-append out "/share/emacs")
                                             "^lisp$"
-                                            #:directories? #t)))
+                                            #:directories? #t))
+                     (native-lisp-dirs (find-files
+                                        (string-append out "/lib/emacs")
+                                        "^native-lisp$"
+                                        #:directories? #t)))
                 (for-each
                  (lambda (prog)
                    (wrap-program prog
@@ -285,7 +289,11 @@ (define-public emacs-minimal
                              (list (search-input-file inputs "/bin/gzip")
                                    ;; for coreutils
                                    (search-input-file inputs "/bin/yes"))))
-                     `("EMACSLOADPATH" suffix ,lisp-dirs)))
+                     `("EMACSLOADPATH" suffix ,lisp-dirs)
+                     ;; Note: the interpretation order of EMACSNATIVELOADPATH
+                     ;; is reversed, so 'prefix functions just like 'suffix
+                     ;; for EMACSLOADPATH.
+                     `("EMACSNATIVELOADPATH" prefix ,native-lisp-dirs)))
                  (find-files (string-append out "/bin")
                              ;; Matches versioned and unversioned emacs binaries.
                              ;; We don't patch emacsclient, because it takes its
-- 
2.41.0