From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id aFSiI3HzYmAbOwEAgWs5BA (envelope-from ) for ; Tue, 30 Mar 2021 11:46:25 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id oCmbHXHzYmA+dQAA1q6Kng (envelope-from ) for ; Tue, 30 Mar 2021 09:46:25 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 153BB17494 for ; Tue, 30 Mar 2021 11:46:24 +0200 (CEST) Received: from localhost ([::1]:44512 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lRAx4-0000Zb-Po for larch@yhetil.org; Tue, 30 Mar 2021 05:46:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37668) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lRAwk-0000ZB-7S for bug-guix@gnu.org; Tue, 30 Mar 2021 05:46:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:38888) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lRAwj-0002hi-W5 for bug-guix@gnu.org; Tue, 30 Mar 2021 05:46:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lRAwj-0006GA-V1 for bug-guix@gnu.org; Tue, 30 Mar 2021 05:46:01 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#45316: [WIP PATCH 1/3] profiles: Add hook for Emacs subdirs. References: <87y2huepw5.fsf@gmail.com> In-Reply-To: <87y2huepw5.fsf@gmail.com> Resent-From: Leo Prikler Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Tue, 30 Mar 2021 09:46:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 45316 X-GNU-PR-Package: guix X-GNU-PR-Keywords: patch To: 45316@debbugs.gnu.org Received: via spool by 45316-submit@debbugs.gnu.org id=B45316.161709753524007 (code B ref 45316); Tue, 30 Mar 2021 09:46:01 +0000 Received: (at 45316) by debbugs.gnu.org; 30 Mar 2021 09:45:35 +0000 Received: from localhost ([127.0.0.1]:50429 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lRAwJ-0006F8-4m for submit@debbugs.gnu.org; Tue, 30 Mar 2021 05:45:35 -0400 Received: from mailrelay.tugraz.at ([129.27.2.202]:23179) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lRAwH-0006Es-3S for 45316@debbugs.gnu.org; Tue, 30 Mar 2021 05:45:34 -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 4F8l1Q1r5pz3yZ6; Tue, 30 Mar 2021 11:45:30 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tugraz.at; s=mailrelay; t=1617097530; bh=ryCPrZC93bh8+ZwZmG0TaY3US7wjhYx/4c/IXSNe66g=; h=From:To:Cc:Subject:Date; b=Zw0A6SNH8DFr2lIaJFWAbEtX1a8Q1KTTvD3yKjOaE6S/b5zOfLQnW044wqjZmqPrL /6pzvVi19yUnlAGu/m50wso39LOrBurtkDKFoKDXop+UViTJOUbgssAgdIvWYZUmZs 3bptlDqGeAighPzN3ltAQjkH5yt9akKUNV6wfRZg= From: Leo Prikler Date: Tue, 30 Mar 2021 11:45:12 +0200 Message-Id: <20210330094514.4819-1-leo.prikler@student.tugraz.at> X-Mailer: git-send-email 2.31.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TUG-Backscatter-control: bt4lQm5Tva3SBgCuw0EnZw X-Spam-Scanner: SpamAssassin 3.003001 X-Spam-Score-relay: -1.9 X-Scanned-By: MIMEDefang 2.74 on 129.27.10.116 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: maxim.cournoyer@gmail.com Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: "bug-Guix" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1617097585; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=ryCPrZC93bh8+ZwZmG0TaY3US7wjhYx/4c/IXSNe66g=; b=n5IqbqndzbF0VirUZ9jpD+LdTQj1WU5xkd1Tui7+5VXl33V2bs6SLHqmL4r94mzGqCwqku W/2nT9OteOiJ0ymQzkr43AWgbtVZFcPnyk+XLj13vgHpJUuR947JYOS8SC15QofJHGmFVr HAa3hDuhgODpckq2fpM5fqXrtRXMnU5omWdEX50zPMOUv3bjhaTNDnVQYMfUByKbAr7tfl oBGPQ6fMEWd+oU0qjm7ANCaNJ/sHiPJk5Nrt1g22hEC7+w+kEcuqPFY1HazzM4sIsQSMTG 1PeXasEE4m9qVItdaS9A9Awyp9G2IzNdUsH4TGegnmT28d0A7zyWzwsvbOoUaw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1617097585; a=rsa-sha256; cv=none; b=HC0OEPPSsohR2DjpQY6k5Ttx1R4c1GoeUGWfyAUPbtDFN0LoP4F1UO9S88cKfC1tXBUNuO mQjgRjwJCf6KV520Urqf019sbkgg6BJMALZogubw+9HivBj0mw6Gy1TEoTh3t1WqQwr+ZU b99TbEeqiNYTalPrTyH3o9YiHqq22mVAitpvRg+yyHTDSHtMNQOxn+yPeINyhfslypPpXQ C5500sNB2RnX+jRw7VDOGM7ce52bHx0TN2vx9mUbvchCJAaN663P5tgYwaxjkp6NqMqqsr /HsoNAVDCULtVncM9dMVE7gH98Xc19FcAkKDolPLhYZoJ9m2nmF1o7UZ8QfBJA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=tugraz.at header.s=mailrelay header.b=Zw0A6SNH; spf=pass (aspmx1.migadu.com: domain of bug-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=bug-guix-bounces@gnu.org X-Migadu-Spam-Score: 3.68 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=tugraz.at header.s=mailrelay header.b=Zw0A6SNH; dmarc=fail reason="SPF not aligned (relaxed)" header.from=student.tugraz.at (policy=none); spf=pass (aspmx1.migadu.com: domain of bug-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=bug-guix-bounces@gnu.org X-Migadu-Queue-Id: 153BB17494 X-Spam-Score: 3.68 X-Migadu-Scanner: scn0.migadu.com X-TUID: 3xV4u77WlQzU * 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