This is an automated email from the git hooks/post-receive script.

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

The following commit(s) were added to refs/heads/emacs-team by this push:
     new d6b8482422 gnu: emacs-minimal: Add output containing C source files.
d6b8482422 is described below

commit d6b848242266f8b5e911a6a0266044e3d972e10a
Author: Jake Forster <[email protected]>
AuthorDate: Sun Aug 24 03:00:16 2025 +0930

    gnu: emacs-minimal: Add output containing C source files.
    
    * gnu/packages/emacs.scm (emacs-minimal)[outputs]: Add “doc”.
    [arguments]<#:phases>: Add phase ‘install-c-source’.
    {install-site-start}: Attempt to load guix-emacs-c-source.el in 
site-start.el.
    
    Fixes: guix/guix#1540 (Cannot follow references to C functions).
    
    Change-Id: I6d9478443b081b436b5b86b208135f69f35671bd
    Signed-off-by: Liliana Marie Prikler <[email protected]>
---
 gnu/packages/emacs.scm | 22 +++++++++++++++++++++-
 1 file changed, 21 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm
index ed2258c199..b4494e2fad 100644
--- a/gnu/packages/emacs.scm
+++ b/gnu/packages/emacs.scm
@@ -26,6 +26,7 @@
 ;;; Copyright © 2023 Declan Tsien <[email protected]>
 ;;; Copyright © 2023, 2024 Zheng Junjie <[email protected]>
 ;;; Copyright © 2025 Nicolas Graves <[email protected]>
+;;; Copyright © 2025 Jake Forster <[email protected]>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -192,6 +193,7 @@
                             "\"~/.guix-home/include\""
                             "\"/run/current-system/profile/include\"")
                       " ")))))))
+    (outputs '("out" "doc"))
     (build-system gnu-build-system)
     (arguments
      (list
@@ -311,6 +313,21 @@
                   (("/bin//sh") (search-input-file inputs "bin/sh")))
                 (substitute* "test/lisp/eshell/em-script-tests.el"
                   (("/usr/bin/env") (search-input-file inputs "bin/env"))))))
+          (add-before 'configure 'install-c-source
+            (lambda _
+              (let ((dest (string-append #$output:doc "/share/emacs/c-source"))
+                    (lisp-dir (string-append #$output:doc
+                                             "/share/emacs/site-lisp")))
+                (mkdir-p dest)
+                (copy-recursively "src" dest)
+                (mkdir-p lisp-dir)
+                (with-output-to-file (string-append lisp-dir
+                                                    "/guix-emacs-c-source.el")
+                  (lambda ()
+                    (display
+                     (string-append
+                      "(setq find-function-C-source-directory \"" dest 
"\")\n\n"
+                      "(provide 'guix-emacs-c-source)")))))))
           (add-after 'install 'install-site-start
             ;; Use 'guix-emacs' in "site-start.el", which is used autoload the
             ;; Elisp packages found in EMACSLOADPATH.
@@ -338,7 +355,10 @@
                       "(when (require 'guix-emacs nil t)\n"
                       "  (guix-emacs-autoload-packages 'no-reload)\n"
                       "  (advice-add 'package-load-all-descriptors"
-                      " :after #'guix-emacs-load-package-descriptors))"))))
+                      " :after #'guix-emacs-load-package-descriptors))\n\n"
+                      ";; The file guix-emacs-c-source.el is available from 
the"
+                      " 'doc' output.\n"
+                      "(require 'guix-emacs-c-source nil t)"))))
                 ;; Remove the extraneous subdirs.el file, as it causes Emacs to
                 ;; add recursively all the the sub-directories of a profile's
                 ;; share/emacs/site-lisp union when added to EMACSLOADPATH,

Reply via email to