build: emacs-utils: Adjust ‘emacs-compile-directory’ for Emacs 29.

* guix/build/emacs-utils.scm (emacs-compile-directory): After native
compilation, write the bytecode file with ‘comp-write-bytecode-file’.

Signed-off-by: Liliana Marie Prikler <liliana.prikler@gmail.com>
This commit is contained in:
Hilton Chain 2023-09-02 00:15:29 +08:00 committed by Liliana Marie Prikler
parent 506d6ce080
commit 4a00fa9bea
No known key found for this signature in database
GPG key ID: 442A84B8C70E2F87

View file

@ -139,7 +139,7 @@ (define* (emacs-compile-directory dir)
(files (directory-files-recursively ,dir "\\.el$")))
(mapc
(lambda (file)
(let (byte-to-native-output-file
(let (byte-to-native-output-buffer-file
;; First entry is the eln-cache of the homeless shelter,
;; second entry is the install directory.
(eln-dir (and (native-comp-available-p)
@ -148,13 +148,9 @@ (define* (emacs-compile-directory dir)
(native-compile file
(comp-el-to-eln-filename file eln-dir))
(byte-compile-file file))
;; Sadly, we can't use pcase because quasiquote works different in
;; Emacs. See `batch-byte+native-compile' in comp.el for the
;; actual shape of byte-to-native-output-file.
(unless (null byte-to-native-output-file)
(rename-file (car byte-to-native-output-file)
(cdr byte-to-native-output-file)
t))))
;; After native compilation, write the bytecode file.
(unless (null byte-to-native-output-buffer-file)
(comp-write-bytecode-file nil))))
files))
#:dynamic? #t))