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

commit 03718202c6da5a380431b856d705fa3922a0a47b
Author: Morgan Smith <morgan.j.sm...@outlook.com>
AuthorDate: Sun Mar 2 14:31:29 2025 -0500

    guix: emacs-build-system: Add #:lisp-directory.
    
    * guix/build-system/emacs.scm (emacs-build): Add #:lisp-directory.
    * guix/build/emacs-build-system.scm (unpack): Change into lisp-directory
    after unpacking.
    
    Change-Id: I3991af7188de72b29b1c6985ffe7185216cedb35
    Signed-off-by: Liliana Marie Prikler <liliana.prik...@gmail.com>
---
 guix/build-system/emacs.scm       | 2 ++
 guix/build/emacs-build-system.scm | 6 ++++--
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/guix/build-system/emacs.scm b/guix/build-system/emacs.scm
index fc165c21d7..61b9c171b4 100644
--- a/guix/build-system/emacs.scm
+++ b/guix/build-system/emacs.scm
@@ -87,6 +87,7 @@
                       (test-command #f) ; inferred in emacs-build-system
                       (phases '%standard-phases)
                       (outputs '("out"))
+                      (lisp-directory #f)
                       (include (quote %default-include))
                       (exclude (quote %default-exclude))
                       (search-paths '())
@@ -105,6 +106,7 @@
           (use-modules #$@(sexp->gexp modules))
           (emacs-build #:name #$name
                        #:source #+source
+                       #:lisp-directory #$lisp-directory
                        #:system #$system
                        #:test-command #$test-command
                        #:tests? #$tests?
diff --git a/guix/build/emacs-build-system.scm 
b/guix/build/emacs-build-system.scm
index ff35547968..ffa6d3cbb0 100644
--- a/guix/build/emacs-build-system.scm
+++ b/guix/build/emacs-build-system.scm
@@ -67,7 +67,7 @@ name that has been stripped of the hash and version number."
                     (strip-store-file-name file) suffix))))
       (string-append name suffix))))
 
-(define* (unpack #:key source #:allow-other-keys)
+(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)
@@ -76,7 +76,9 @@ archive, a directory, or an Emacs Lisp file."
         (chdir "source")
         (copy-file source (store-file->elisp-source-file source))
         #t)
-      (gnu:unpack #:source source)))
+      (begin
+        (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,

Reply via email to