From 554bf1ccd3cbd3ca55db9b58ddbae197585317d4 Mon Sep 17 00:00:00 2001 From: Liliana Marie Prikler Date: Tue, 25 Aug 2026 21:58:57 +0200 Subject: build-system: emacs: Use gnu:unpack on directories. * guix/build/emacs-build-system.scm (unpack): Use gnu:unpack if source is a directory. Reported-by: Sergey Trofimov Fixes: guix/guix#5659 --- guix/build/emacs-build-system.scm | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/guix/build/emacs-build-system.scm b/guix/build/emacs-build-system.scm index 2d2d7524cd4..60b9e65b4f5 100644 --- a/guix/build/emacs-build-system.scm +++ b/guix/build/emacs-build-system.scm @@ -70,15 +70,17 @@ name that has been stripped of the hash and version number." (define* (unpack #:key source lisp-directory #:allow-other-keys) "Unpack SOURCE into the build directory. SOURCE may be a compressed archive, a directory, or an Emacs Lisp file." - (if (string-suffix? ".el" source) - (begin - (mkdir "source") - (chdir "source") - (copy-file source (store-file->elisp-source-file source)) - #t) - (begin - (gnu:unpack #:source source) - (and=> lisp-directory chdir)))) + (cond + ((file-is-directory? source) + (gnu:unpack #:source source) + (and=> lisp-directory chdir)) + ((string-suffix? ".el" source) + (mkdir "source") + (chdir "source") + (copy-file source (store-file->elisp-source-file source))) + (else + (gnu:unpack #:source source) + (and=> lisp-directory chdir)))) (define* (expand-load-path #:key (prepend-source? #t) #:allow-other-keys) "Expand EMACSLOADPATH, so that inputs, whose code resides in subdirectories, -- cgit v1.2.3