mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-11-17 04:07:10 -05:00
profiles: Add hook for Emacs subdirs.
* guix/profiles.scm (emacs-subdirs): New variable. (%default-profile-hooks): Add it here. * guix/status.scm (hook-message): Add a message for emacs-subdirs.
This commit is contained in:
parent
45549e9f31
commit
68228d80dd
2 changed files with 43 additions and 0 deletions
|
@ -1115,6 +1115,46 @@ (define (dump file port)
|
|||
`((type . profile-hook)
|
||||
(hook . ca-certificate-bundle))))
|
||||
|
||||
(define (emacs-subdirs manifest)
|
||||
(define build
|
||||
(with-imported-modules (source-module-closure
|
||||
'((guix build profiles)
|
||||
(guix build utils)))
|
||||
#~(begin
|
||||
(use-modules (guix build utils)
|
||||
(guix build profiles)
|
||||
(ice-9 ftw) ; scandir
|
||||
(srfi srfi-1) ; append-map
|
||||
(srfi srfi-26))
|
||||
|
||||
(let ((destdir (string-append #$output "/share/emacs/site-lisp"))
|
||||
(subdirs
|
||||
(append-map
|
||||
(lambda (dir)
|
||||
(filter
|
||||
file-is-directory?
|
||||
(map (cute string-append dir "/" <>)
|
||||
(scandir dir (negate (cute member <> '("." "..")))))))
|
||||
(filter file-exists?
|
||||
(map (cute string-append <> "/share/emacs/site-lisp")
|
||||
'#$(manifest-inputs manifest))))))
|
||||
(mkdir-p destdir)
|
||||
(with-directory-excursion destdir
|
||||
(call-with-output-file "subdirs.el"
|
||||
(lambda (port)
|
||||
(write
|
||||
`(normal-top-level-add-to-load-path
|
||||
(list ,@subdirs))
|
||||
port)
|
||||
(newline port)
|
||||
#t)))))))
|
||||
(gexp->derivation "emacs-subdirs" build
|
||||
#:local-build? #t
|
||||
#:substitutable? #f
|
||||
#:properties
|
||||
`((type . profile-hook)
|
||||
(hook . emacs-subdirs))))
|
||||
|
||||
(define (glib-schemas manifest)
|
||||
"Return a derivation that unions all schemas from manifest entries and
|
||||
creates the Glib 'gschemas.compiled' file."
|
||||
|
@ -1672,6 +1712,7 @@ (define %default-profile-hooks
|
|||
fonts-dir-file
|
||||
ghc-package-cache-file
|
||||
ca-certificate-bundle
|
||||
emacs-subdirs
|
||||
glib-schemas
|
||||
gtk-icon-themes
|
||||
gtk-im-modules
|
||||
|
|
|
@ -379,6 +379,8 @@ (define (hook-message hook-type)
|
|||
(G_ "building GHC package cache..."))
|
||||
('ca-certificate-bundle
|
||||
(G_ "building CA certificate bundle..."))
|
||||
('emacs-subdirs
|
||||
(G_ "listing Emacs subdirs..."))
|
||||
('glib-schemas
|
||||
(G_ "generating GLib schema cache..."))
|
||||
('gtk-icon-themes
|
||||
|
|
Loading…
Reference in a new issue