guix-commits
[Top][All Lists]
Advanced

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

01/04: guix: emacs-utils: Make emacs-compile-directory forwards-compatib


From: guix-commits
Subject: 01/04: guix: emacs-utils: Make emacs-compile-directory forwards-compatible.
Date: Sat, 9 Mar 2024 02:28:35 -0500 (EST)

lilyp pushed a commit to branch emacs-team
in repository guix.

commit 7f3f70eedbbec74481a0ca9fea4c19250961685e
Author: Liliana Marie Prikler <liliana.prikler@gmail.com>
AuthorDate: Sat Mar 2 16:56:13 2024 +0100

    guix: emacs-utils: Make emacs-compile-directory forwards-compatible.
    
    Newer (development) builds of Emacs 30 mark a number of functions related to
    native compilation as ‘internal’.  Since we rely on such functions and there
    does not appear to be a high-level replacement at the moment, let's work
    around this case.
    
    * guix/build/emacs-utils.scm (emacs-compile-directory): Require comp early
    and check if ‘comp-write-bytecode-file’ is available.
    
    Fixes: Upstream renamed comp-write-bytecode-file 
<https://bugs.gnu.org/69201>
---
 guix/build/emacs-utils.scm | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/guix/build/emacs-utils.scm b/guix/build/emacs-utils.scm
index eca42bf305..aeb364133a 100644
--- a/guix/build/emacs-utils.scm
+++ b/guix/build/emacs-utils.scm
@@ -136,7 +136,14 @@ If native code is not supported, compile to bytecode 
instead."
   (emacs-batch-eval
     `(let ((byte-compile-debug t)       ; for proper exit status
            (byte+native-compile (native-comp-available-p))
-           (files (directory-files-recursively ,dir "\\.el$")))
+           (files (directory-files-recursively ,dir "\\.el$"))
+           (write-bytecode
+            (and (native-comp-available-p)
+                 (progn
+                  (require 'comp)
+                  (if (fboundp 'comp-write-bytecode-file)
+                      'comp-write-bytecode-file
+                      'comp--write-bytecode-file)))))
        (mapc
         (lambda (file)
           (let (byte-to-native-output-buffer-file
@@ -152,7 +159,7 @@ If native code is not supported, compile to bytecode 
instead."
                 (byte-compile-file file))
             ;; After native compilation, write the bytecode file.
             (unless (null byte-to-native-output-buffer-file)
-              (comp-write-bytecode-file nil))))
+              (funcall write-bytecode nil))))
        files))
     #:dynamic? #t))
 



reply via email to

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