From: Leo Prikler <leo.prikler@student.tugraz.at>
To: 45316@debbugs.gnu.org
Cc: maxim.cournoyer@gmail.com
Subject: bug#45316: [WIP PATCH 1/3] profiles: Add hook for Emacs subdirs.
Date: Tue, 30 Mar 2021 11:45:12 +0200 [thread overview]
Message-ID: <20210330094514.4819-1-leo.prikler@student.tugraz.at> (raw)
In-Reply-To: <87y2huepw5.fsf@gmail.com>
* guix/profiles.scm (emacs-subdirs): New variable.
(%default-profile-hooks): Add it here.
* guix/status.scm (hook-message): Add a message for emacs-subdirs.
---
guix/profiles.scm | 41 +++++++++++++++++++++++++++++++++++++++++
guix/status.scm | 2 ++
2 files changed, 43 insertions(+)
diff --git a/guix/profiles.scm b/guix/profiles.scm
index 67d90532c1..26fe266a61 100644
--- a/guix/profiles.scm
+++ b/guix/profiles.scm
@@ -1115,6 +1115,46 @@ MANIFEST. Single-file bundles are required by programs such as Git and Lynx."
`((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 @@ MANIFEST."
fonts-dir-file
ghc-package-cache-file
ca-certificate-bundle
+ emacs-subdirs
glib-schemas
gtk-icon-themes
gtk-im-modules
diff --git a/guix/status.scm b/guix/status.scm
index d47bf1700c..ccde3d3063 100644
--- a/guix/status.scm
+++ b/guix/status.scm
@@ -379,6 +379,8 @@ the current build phase."
(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
--
2.31.0
next prev parent reply other threads:[~2021-03-30 9:46 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-18 22:00 bug#45316: [PATCH]: Re-introduce Emacs packages specific installation prefix Maxim Cournoyer
2020-12-18 22:16 ` bug#45316: [PATCH 01/26] build-systems/emacs: Install packages in their own directory Maxim Cournoyer
2020-12-18 22:16 ` bug#45316: [PATCH 02/26] gnu: emacs-ert-runner: Adjust following emacs-build-system changes Maxim Cournoyer
2020-12-18 22:17 ` bug#45316: [PATCH 03/26] gnu: emacs-xyz: Do not use --quick or -Q Maxim Cournoyer
2020-12-18 22:17 ` bug#45316: [PATCH 04/26] gnu: cedille: Adjust following emacs-build-system changes Maxim Cournoyer
2020-12-18 22:17 ` bug#45316: [PATCH 05/26] gnu: emacs-libgit: " Maxim Cournoyer
2020-12-18 22:17 ` bug#45316: [PATCH 06/26] gnu: emacs-typit: " Maxim Cournoyer
2020-12-18 22:17 ` bug#45316: [PATCH 07/26] gnu: emacs-flycheck-grammalecte: " Maxim Cournoyer
2020-12-18 22:17 ` bug#45316: [PATCH 08/26] gnu: emacs-scel: " Maxim Cournoyer
2020-12-18 22:17 ` bug#45316: [PATCH 09/26] gnu: emacs-chess: " Maxim Cournoyer
2020-12-18 22:17 ` bug#45316: [PATCH 10/26] gnu: emacs-org-contrib: " Maxim Cournoyer
2020-12-18 22:17 ` bug#45316: [PATCH 11/26] gnu: emacs-edbi: " Maxim Cournoyer
2020-12-18 22:17 ` bug#45316: [PATCH 12/26] gnu: emacs-telega: " Maxim Cournoyer
2020-12-18 22:17 ` bug#45316: [PATCH 13/26] gnu: emacs-rime: " Maxim Cournoyer
2020-12-18 22:17 ` bug#45316: [PATCH 14/26] gnu: emacs-haskell-snippets: " Maxim Cournoyer
2020-12-18 22:17 ` bug#45316: [PATCH 15/26] gnu: guile-wisp: " Maxim Cournoyer
2020-12-18 22:17 ` bug#45316: [PATCH 16/26] gnu: emacs-pdf-tools: " Maxim Cournoyer
2020-12-18 22:17 ` bug#45316: [PATCH 17/26] gnu: emacs-emacsql: " Maxim Cournoyer
2020-12-18 22:17 ` bug#45316: [PATCH 18/26] gnu: emacs-racer: " Maxim Cournoyer
2020-12-18 22:17 ` bug#45316: [PATCH 19/26] gnu: emacs-magit: " Maxim Cournoyer
2020-12-18 22:17 ` bug#45316: [PATCH 20/26] gnu: emacs-org-super-agenda: " Maxim Cournoyer
2020-12-18 22:17 ` bug#45316: [PATCH 21/26] gnu: notmuch: " Maxim Cournoyer
2020-12-18 22:17 ` bug#45316: [PATCH 22/26] gnu: emacs-howm: " Maxim Cournoyer
2020-12-18 22:17 ` bug#45316: [PATCH 23/26] gnu: emacs-rjsx-mode: " Maxim Cournoyer
2020-12-18 22:17 ` bug#45316: [PATCH 24/26] gnu: emacs-sudo-edit: Update to commit 0e2c32b, fix tests Maxim Cournoyer
2020-12-18 22:17 ` bug#45316: [PATCH 25/26] gnu: emacs-sly-named-readtables: Adjust following emacs-build-system changes Maxim Cournoyer
2020-12-18 22:17 ` bug#45316: [PATCH 26/26] gnu: emacs-realgud: " Maxim Cournoyer
2021-03-30 9:45 ` Leo Prikler [this message]
2021-03-30 9:45 ` bug#45316: [WIP PATCH 2/3] build-system: emacs: Use subdirectories again Leo Prikler
2021-03-30 9:45 ` bug#45316: [WIP PATCH 3/3] gnu: emacs-libgit: Adjust to changes in emacs-build-system Leo Prikler
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210330094514.4819-1-leo.prikler@student.tugraz.at \
--to=leo.prikler@student.tugraz.at \
--cc=45316@debbugs.gnu.org \
--cc=maxim.cournoyer@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).