From patchwork Thu Apr 8 17:49:35 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leo Prikler X-Patchwork-Id: 28384 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 02F7127BC6E; Thu, 8 Apr 2021 18:51:41 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS, T_DKIM_INVALID,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 9F0AA27BC6F for ; Thu, 8 Apr 2021 18:51:36 +0100 (BST) Received: from localhost ([::1]:34790 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lUYoZ-00056u-Op for patchwork@mira.cbaines.net; Thu, 08 Apr 2021 13:51:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39772) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lUYo2-00052D-Em for guix-patches@gnu.org; Thu, 08 Apr 2021 13:51:06 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:36654) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lUYo2-0004KG-7C for guix-patches@gnu.org; Thu, 08 Apr 2021 13:51:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lUYo2-0003i4-3e for guix-patches@gnu.org; Thu, 08 Apr 2021 13:51:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#47661] [PATCH 01/33] profiles: Add hook for Emacs subdirs. References: <20210408174616.13112-1-leo.prikler@student.tugraz.at> In-Reply-To: <20210408174616.13112-1-leo.prikler@student.tugraz.at> Resent-From: Leo Prikler Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 08 Apr 2021 17:51:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 47661 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 47661@debbugs.gnu.org Received: via spool by 47661-submit@debbugs.gnu.org id=B47661.161790423814068 (code B ref 47661); Thu, 08 Apr 2021 17:51:02 +0000 Received: (at 47661) by debbugs.gnu.org; 8 Apr 2021 17:50:38 +0000 Received: from localhost ([127.0.0.1]:48161 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lUYnc-0003ei-U8 for submit@debbugs.gnu.org; Thu, 08 Apr 2021 13:50:37 -0400 Received: from mailrelay.tugraz.at ([129.27.2.202]:6561) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lUYna-0003eY-QZ for 47661@debbugs.gnu.org; Thu, 08 Apr 2021 13:50:35 -0400 Received: from localhost.localdomain (194-96-13-79.adsl.highway.telekom.at [194.96.13.79]) by mailrelay.tugraz.at (Postfix) with ESMTPSA id 4FGTLv3Ld8z1LWpG for <47661@debbugs.gnu.org>; Thu, 8 Apr 2021 19:50:31 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 mailrelay.tugraz.at 4FGTLv3Ld8z1LWpG DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tugraz.at; s=mailrelay; t=1617904231; bh=J5bj57+Yt74u733Mf6T+Jaghn2u4TETbyXrzxPV4JCg=; h=From:To:Subject:Date:From; b=QPBYa1YKo4cuQMh8M1UOeS9xmrJkTyFzqI0dpHPrhBdujY/Ey3NEJMoTTdrIe4Z1p 74HVbo/j/uFAs1QZuPuvrTmDtYx1LPBsejBo183Zw577WHMNbq0/eT3wXSm0HMwDeQ 8Zubo80O43QMqjArfLIk6Mgs0J/vzEOePoWTNWlE= From: Leo Prikler Date: Thu, 8 Apr 2021 19:49:35 +0200 Message-Id: <20210408175007.13360-1-leo.prikler@student.tugraz.at> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 X-TUG-Backscatter-control: bt4lQm5Tva3SBgCuw0EnZw X-Scanned-By: MIMEDefang 2.74 on 129.27.10.117 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * 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 362ae2882c..2683678201 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