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 @@ MANIFEST.  Single-file bundles are required by programs such as Git and Lynx."
 | 
				
			||||||
                    `((type . profile-hook)
 | 
					                    `((type . profile-hook)
 | 
				
			||||||
                      (hook . ca-certificate-bundle))))
 | 
					                      (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)
 | 
					(define (glib-schemas manifest)
 | 
				
			||||||
  "Return a derivation that unions all schemas from manifest entries and
 | 
					  "Return a derivation that unions all schemas from manifest entries and
 | 
				
			||||||
creates the Glib 'gschemas.compiled' file."
 | 
					creates the Glib 'gschemas.compiled' file."
 | 
				
			||||||
| 
						 | 
					@ -1672,6 +1712,7 @@ MANIFEST."
 | 
				
			||||||
        fonts-dir-file
 | 
					        fonts-dir-file
 | 
				
			||||||
        ghc-package-cache-file
 | 
					        ghc-package-cache-file
 | 
				
			||||||
        ca-certificate-bundle
 | 
					        ca-certificate-bundle
 | 
				
			||||||
 | 
					        emacs-subdirs
 | 
				
			||||||
        glib-schemas
 | 
					        glib-schemas
 | 
				
			||||||
        gtk-icon-themes
 | 
					        gtk-icon-themes
 | 
				
			||||||
        gtk-im-modules
 | 
					        gtk-im-modules
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -379,6 +379,8 @@ the current build phase."
 | 
				
			||||||
     (G_ "building GHC package cache..."))
 | 
					     (G_ "building GHC package cache..."))
 | 
				
			||||||
    ('ca-certificate-bundle
 | 
					    ('ca-certificate-bundle
 | 
				
			||||||
     (G_ "building CA certificate bundle..."))
 | 
					     (G_ "building CA certificate bundle..."))
 | 
				
			||||||
 | 
					    ('emacs-subdirs
 | 
				
			||||||
 | 
					     (G_ "listing Emacs subdirs..."))
 | 
				
			||||||
    ('glib-schemas
 | 
					    ('glib-schemas
 | 
				
			||||||
     (G_ "generating GLib schema cache..."))
 | 
					     (G_ "generating GLib schema cache..."))
 | 
				
			||||||
    ('gtk-icon-themes
 | 
					    ('gtk-icon-themes
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Reference in a new issue