From debbugs-submit-bounces@debbugs.gnu.org Mon Dec 23 07:43:49 2019 Received: (at 38643) by debbugs.gnu.org; 23 Dec 2019 12:43:49 +0000 Received: from localhost ([127.0.0.1]:50625 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ijN3o-0004qY-3A for submit@debbugs.gnu.org; Mon, 23 Dec 2019 07:43:49 -0500 Received: from eggs.gnu.org ([209.51.188.92]:39720) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ijN3i-0004qJ-Te for 38643@debbugs.gnu.org; Mon, 23 Dec 2019 07:43:42 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:55486) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ijN3d-0003cf-E6 for 38643@debbugs.gnu.org; Mon, 23 Dec 2019 07:43:33 -0500 Received: from lns-bzn-56-82-255-208-147.adsl.proxad.net ([82.255.208.147]:34714 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1ijN3K-0004D7-JS for 38643@debbugs.gnu.org; Mon, 23 Dec 2019 07:43:33 -0500 Resent-To: 38643@debbugs.gnu.org Resent-From: =?utf-8?Q?Ludovic_Court=C3=A8s?= Resent-Date: Mon, 23 Dec 2019 13:43:11 +0100 Resent-Message-ID: <87woankyao.fsf@gnu.org> Received: from solo.fdn.fr ([unix socket]) by solo (Cyrus 2.5.10-Debian-2.5.10-3.2) with LMTPA; Sun, 22 Dec 2019 19:23:19 +0100 X-Sieve: CMU Sieve 2.4 Received: by solo.fdn.fr (Postfix) id 2F3CED09FE; Sun, 22 Dec 2019 19:23:19 +0100 (CET) Received: from eggs.gnu.org (eggs.gnu.org [IPv6:2001:470:142:3::10]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by solo.fdn.fr (Postfix) with ESMTPS id E09ECD09F1 for ; Sun, 22 Dec 2019 19:23:18 +0100 (CET) Received: from fencepost.gnu.org ([2001:470:142:3::e]:46466) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ij5sr-0003WU-OR for ludovic.courtes@fdn.fr; Sun, 22 Dec 2019 13:23:17 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:54762) by fencepost.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1ij5sr-0000bZ-8E for ludo@gnu.org; Sun, 22 Dec 2019 13:23:17 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ij5sn-0003E4-Ag for ludo@gnu.org; Sun, 22 Dec 2019 13:23:17 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.1 required=5.0 tests=BAYES_50,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW,URIBL_BLOCKED autolearn=disabled version=3.3.2 Received: from mail1.protonmail.ch ([185.70.40.18]:19296) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ij5sm-0002xc-I4 for ludo@gnu.org; Sun, 22 Dec 2019 13:23:13 -0500 Date: Sun, 22 Dec 2019 18:23:03 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=default; t=1577038986; bh=178pVWb4Lqd+5UcKGuA7vVF9IvDIWG86LMhfHzrqyBE=; h=Date:To:From:Reply-To:Subject:In-Reply-To:References:Feedback-ID: From; b=QrGz8vplPdeKTA/jb8aZAekhb/r3S1IdTHwWk8VIG4Y5VrfoZTHEfs1u5yH4GGNUH 7UQR3twY33HI6nAOFQmGo2XNWX1GN3AOWIclNEMWaTiWyfor4eSuS6NVWpdGpPiatc mQ+fgmTMQ8mPg7wZ4osJHqiZBiVpPmFtytwR9yUA= To: =?UTF-8?Q?Ludovic_Court=C3=A8s?= From: saffronsnail Subject: Re: [bug#38643] [PATCH] Add spacemacs package Message-ID: In-Reply-To: <87y2vbq8oi.fsf@gnu.org> References: <87y2vbq8oi.fsf@gnu.org> Feedback-ID: vsfXACN0M24HQHstP3yT1JWYyEzu1QcsRFwYKsjva9cdnZDX-Kw3LRJokFNAb7yQbpO_Kd2cGp4Y8Py4b4WW9Q==:Ext:ProtonMail MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 185.70.40.18 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: 1.2 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: > Do I get it right that Spacemacs will try to fetch the packages it needs > via pkg.el (ELPA)? > > Longer-term, it would be nice if it could fetch packages through Guix, > using Emacs-Guix. Are you f [...] Content analysis details: (1.2 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 URIBL_BLOCKED ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [URIs: gnu.org] -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [209.51.188.92 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 1.0 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) 0.0 UNPARSEABLE_RELAY Informational: message has unparseable relay lines 2.5 FREEMAIL_FORGED_REPLYTO Freemail in Reply-To, but not From X-Debbugs-Envelope-To: 38643 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: saffronsnail Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) > Do I get it right that Spacemacs will try to fetch the packages it needs > via pkg.el (ELPA)? > > Longer-term, it would be nice if it could fetch packages through Guix, > using Emacs-Guix. Are you familiar with this part of Spacemacs? I agree that this should be the long-term plan, though I would like to avoi= d the overhead of maintaining each individual ELPA package separately. I have= not `guix import`ed an ELPA package before, but I know that for some other imports manual fixup is needed. Do you know if this is the case for ELPA? I= f so, I would prefer to work on a way to fix that than to manually maintain dozen= s of packages. To answer your question, I am have not worked much with this code but I had to poke around in it a bit to fix a bug. I know that Spacemacs has moved to using a stable (ie, maintained by the Spacemacs team) version of ELPA on th= e versioned release branch, so it might make sense to borrow some of the code form there. But I don't want to maintain a package for the versioned releas= e because of the amount of time that has passed since the last release. In the long-long term, I'd like each Spacemacs layer to be a separate packa= ge that is independently installable (ideally without needing to clone the ent= ire Spacemacs repository). In the shorter term, installing compiled versions of the files in the repso= tiory instead of merely cloning it will be good, though I have not started lookin= g at that yet so I am not sure how much effort that will take. > Please add the new files to gnu/local.mk (and mention that as well in > the commit log.) Done, though I'm not certian that the format of the changelog is correct. I modeled it after historical entries. It didn't look like the files in guix/build are supposed to be included her= e. > Please wrap lines to ~80 characters. :-) Each instance of these have been fixed. When I ran `guix lint` on my packages they warned me about long lines, but = the threshold was above 80 characters - is this a problem with my invocation or= a bug? > I believe this is incorrect ;-), could you adjust it? Copyright has been fixed in both places > Should be =E2=80=98gpl3+=E2=80=99 (meaning =E2=80=9Cversion 3 or any late= r version=E2=80=9D), if I=E2=80=99m not > mistaken. I do not believe this is correct. The `License` section of README.md in the= root of the repository states 'GPLv3', without the '+'. Additionally, the header= in `core/core-command-line.el` states `;;; License: GPLv3`. > We normally use a hyphen instead of underscore in the version string. Fixed > Please wrap lines as well. It seems difficult to format the builder in a way that is both readable and follows the line length standard, so I moved the builder code into the (guix build spacemacs-utils) module and stopped exporting the other symbols= . Is this acceptable? A cursory search didn't find other packages that work t= his way. My concern is that the package is less readable when the builder is in= a separate file, though this is not clearly worse than referring to helpers i= n a separate file. > Please add =E2=80=9C#:use-module (gnu packages emacs)=E2=80=9D add the to= p and refer to > =E2=80=98emacs=E2=80=99 directly, without the =E2=80=98@=E2=80=99 trick. Done! > As per , > please avoid abbreviations and add a docstring. How about calling it > =E2=80=98spacemacs-initialization-string=E2=80=99 or similar? Renamed to `create-initialization-code`, which I believe is the most accura= te way to describe the procedure. Calling it a string made sense at first beca= use the code is stored as a string, but I feel like that is a incedental attrib= ute rather than an essential one. Let me know if you disagree. =3D) > For clarity, I=E2=80=99d recommend writing it as: > > (object->string > '(progn > (setq spacemacs-start-directory "\" spacemacs "/"") > =E2=80=A6)) > > You can use =E2=80=98string-join=E2=80=99 and remove this procedure. It = works like > this: > > --8<---------------cut here---------------start------------->8--- > scheme@(guile-user)> (string-join '("a" "b")) > $2 =3D "a b" > --8<---------------cut here---------------end--------------->8--- I was wanting procedures like these! Thank you! > Please add a docstring. Done! > Nitpick: I=E2=80=99d suggest writing it like this: > > (call-with-output-file output > (lambda (port) > (format port =E2=80=A6))) I have no real preference either way, so I have changed it. I'm curious abo= ut your motivation though - is this just for consistency with the rest of the = code base or is there a different practical/academic/aesthetic reason?. > Could you send an updated patch? Thank you! The updated patch is included below. Thanks, Bryan From d7185438daf8b2cd2e67c033a9a7079820bbafd2 Mon Sep 17 00:00:00 2001 From: Bryan Ferris Date: Wed, 11 Dec 2019 23:57:26 -0800 Subject: [PATCH] gnu: Add emacs-spacemacs * gnu/local.mk (GNU_SYSTEM_MODULES): add spacemacs.scm * gnu/local.mk (dist_patch_DATA): add spacemacs patches listed below * gnu/packages/patches/spacemacs-rolling-release-add-data-dir.patch: New fi= le. * gnu/packages/patches/spacemacs-rolling-release-inhibit-read-only.patch: N= ew file. * gnu/packages/patches/spacemacs-rolling-release-quelpa-permissions.patch: = New file. * gnu/packages/spacemacs.scm: New file. * guix/build/spacemacs-utils.scm: New file. --- gnu/local.mk | 4 + ...acemacs-rolling-release-add-data-dir.patch | 259 ++++++++++++++++++ ...cs-rolling-release-inhibit-read-only.patch | 44 +++ ...s-rolling-release-quelpa-permissions.patch | 53 ++++ gnu/packages/spacemacs.scm | 119 ++++++++ guix/build/spacemacs-utils.scm | 72 +++++ 6 files changed, 551 insertions(+) create mode 100644 gnu/packages/patches/spacemacs-rolling-release-add-data= -dir.patch create mode 100644 gnu/packages/patches/spacemacs-rolling-release-inhibit-= read-only.patch create mode 100644 gnu/packages/patches/spacemacs-rolling-release-quelpa-p= ermissions.patch create mode 100644 gnu/packages/spacemacs.scm create mode 100644 guix/build/spacemacs-utils.scm diff --git a/gnu/local.mk b/gnu/local.mk index 0f62c8e1d7..1ed6dfc7ca 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -456,6 +456,7 @@ GNU_SYSTEM_MODULES =3D=09=09=09=09\ %D%/packages/slang.scm=09=09=09\ %D%/packages/smalltalk.scm=09=09=09\ %D%/packages/sml.scm=09=09=09=09\ + %D%/packages/spacemacs.scm=09=09=09\ %D%/packages/speech.scm=09=09=09\ %D%/packages/sphinx.scm=09=09=09\ %D%/packages/spice.scm=09=09=09\ @@ -1345,6 +1346,9 @@ dist_patch_DATA =3D=09=09=09=09=09=09\ %D%/packages/patches/scalapack-blacs-mpi-deprecations.patch=09\ %D%/packages/patches/scheme48-tests.patch=09=09=09\ %D%/packages/patches/scotch-build-parallelism.patch=09=09\ + %D%/packages/patches/spacemacs-rolling-release-add-data-dir.patch=09\ + %D%/packages/patches/spacemacs-rolling-release-inhibit-read-only.patch= =09\ + %D%/packages/patches/spacemacs-rolling-release-quelpa-permissions.patch= =09\ %D%/packages/patches/scotch-integer-declarations.patch=09\ %D%/packages/patches/sdl-libx11-1.6.patch=09=09=09\ %D%/packages/patches/sdl2-mesa-compat.patch=09=09=09\ diff --git a/gnu/packages/patches/spacemacs-rolling-release-add-data-dir.pa= tch b/gnu/packages/patches/spacemacs-rolling-release-add-data-dir.patch new file mode 100644 index 0000000000..cb92d0b036 --- /dev/null +++ b/gnu/packages/patches/spacemacs-rolling-release-add-data-dir.patch @@ -0,0 +1,259 @@ +Spacemacs uses ~/.emacs.d in 2 ways: to store the code implementing the +spacemacs framework and to track state. When we tell spacemacs that it liv= es +in the store it tries to use the store location to track state as well. Th= is +patch adds a new variable, spacemacs-data-directory, for keeping track of = state. +This defaults to spacemacs-start-directory for upstream compatibility. + +diff --git a/core/core-configuration-layer.el b/core/core-configuration-la= yer.el +index 740b700cf..c8253dc9b 100644 +--- a/core/core-configuration-layer.el ++++ b/core/core-configuration-layer.el +@@ -120,7 +120,7 @@ subdirectory of ROOT is used." + "Hook executed at the end of configuration loading.") + + (defconst configuration-layer--elpa-root-directory +- (concat spacemacs-start-directory "elpa/") ++ (concat spacemacs-data-directory "elpa/") + "Spacemacs ELPA root directory.") + + (defconst configuration-layer--rollback-root-directory +diff --git a/core/core-documentation.el b/core/core-documentation.el +index 96bfc4a87..3a3ef456d 100644 +--- a/core/core-documentation.el ++++ b/core/core-documentation.el +@@ -289,7 +289,7 @@ preprocessors for the exported .org files." + }); + }); + ") +- (publish-target (concat spacemacs-start-directory "export/")) ++ (publish-target (concat spacemacs-data-directory "export/")) + (org-html-htmlize-output-type 'css) + (org-publish-project-alist + `(("spacemacs" +diff --git a/core/core-funcs.el b/core/core-funcs.el +index 28e7290a5..2f09c1df7 100644 +--- a/core/core-funcs.el ++++ b/core/core-funcs.el +@@ -274,7 +274,7 @@ result, incrementing passed-tests and total-tests." + (lambda (fname) + (when (file-exists-p fname) + (delete-file fname))) +- (directory-files-recursively user-emacs-directory "\\.elc$" t))) ++ (directory-files-recursively spacemacs-data-directory "\\.elc$" t))) + (byte-recompile-directory package-user-dir 0 arg)) + + (defun spacemacs/register-repl (feature repl-func &optional tag) +diff --git a/core/core-load-paths.el b/core/core-load-paths.el +index 718b27ce4..90c0c28ad 100644 +--- a/core/core-load-paths.el ++++ b/core/core-load-paths.el +@@ -19,6 +19,11 @@ + (defvar spacemacs-start-directory + user-emacs-directory + "Spacemacs start directory.") ++(defvar spacemacs-data-directory ++ user-emacs-directory ++ "Writable directory for spacemacs data") ++(unless (file-exists-p spacemacs-data-directory) ++ (make-directory spacemacs-data-directory)) + (defconst spacemacs-core-directory + (expand-file-name (concat spacemacs-start-directory "core/")) + "Spacemacs core directory.") +@@ -45,7 +50,7 @@ + (expand-file-name (concat spacemacs-banner-directory "img/heart.png")) + "Purple heart emoji.") + (defconst spacemacs-cache-directory +- (expand-file-name (concat user-emacs-directory ".cache/")) ++ (expand-file-name (concat spacemacs-data-directory ".cache/")) + "Spacemacs storage area for persistent files") + (defconst spacemacs-auto-save-directory + (expand-file-name (concat spacemacs-cache-directory "auto-save/")) +diff --git a/core/core-release-management.el b/core/core-release-managemen= t.el +index 989ccb124..db0f5c76d 100644 +--- a/core/core-release-management.el ++++ b/core/core-release-management.el +@@ -99,6 +99,10 @@ found." + (not (spacemacs//can-check-for-new-version-at-startup))) + (message (concat "Skipping check for new version " + "(reason: last check is too recent)"))) ++ ((and (not force) ++ (or (string-prefix-p "/gnu/store" spacemacs-start-directory) ++ (string-prefix-p "/nix/store" spacemacs-start-directory))) ++ (message (concat "Skipping check for new version (reason: on guix or = nix)"))) + ((require 'async nil t) + (message "Start checking for new version...") + (async-start +diff --git a/core/libs/quelpa.el b/core/libs/quelpa.el +index 70b143657..9da420028 100644 +--- a/core/libs/quelpa.el ++++ b/core/libs/quelpa.el +@@ -79,7 +79,7 @@ the `:upgrade' argument." + :group 'quelpa + :type 'hook) + +-(defcustom quelpa-dir (expand-file-name "quelpa" user-emacs-directory) ++(defcustom quelpa-dir (expand-file-name "quelpa" spacemacs-data-directory= ) + "Where quelpa builds and stores packages." + :group 'quelpa + :type 'string) +diff --git a/tests/core/core-configuration-layer-utest.el b/tests/core/cor= e-configuration-layer-utest.el +index 0d300142b..e5877932c 100644 +--- a/tests/core/core-configuration-layer-utest.el ++++ b/tests/core/core-configuration-layer-utest.el +@@ -880,16 +880,16 @@ + (ert-deftest test-make-layer--make-layer-from-symbol-with-a-dir () + (should (equal (cfgl-layer "layer" + :name 'layer +- :dir spacemacs-start-directory) ++ :dir spacemacs-data-directory) + (configuration-layer/make-layer +- 'layer nil nil spacemacs-start-directory)))) ++ 'layer nil nil spacemacs-data-directory)))) + + (ert-deftest test-make-layer--make-layer-from-spec-with-a-dir () + (should (equal (cfgl-layer "layer" + :name 'layer +- :dir spacemacs-start-directory) ++ :dir spacemacs-data-directory) + (configuration-layer/make-layer +- '(layer :name 'layer) nil nil spacemacs-start-directory= )))) ++ '(layer :name 'layer) nil nil spacemacs-data-directory)= ))) + + (ert-deftest test-make-layer--cannot-make-layer-without-a-directory () + (mocker-let +@@ -908,10 +908,10 @@ + (ert-deftest test-make-layer--make-layer-without-a-dir-requires-an-initia= l-obj () + (let ((layer (cfgl-layer "layer" + :name 'layer +- :dir spacemacs-start-directory))) ++ :dir spacemacs-data-directory))) + (should (equal (cfgl-layer "layer" + :name 'layer +- :dir spacemacs-start-directory) ++ :dir spacemacs-data-directory) + (configuration-layer/make-layer 'layer layer))))) + + ;; load packages +@@ -919,7 +919,7 @@ + (ert-deftest test-make-layer--make-used-layer-loads-packages-file () + (let ((layer (cfgl-layer "layer" + :name 'layer +- :dir spacemacs-start-directory)) ++ :dir spacemacs-data-directory)) + (layer-packages '(pkg1 pkg2 pkg3)) + (mocker-mock-default-record-cls 'mocker-stub-record)) + (mocker-let +@@ -931,13 +931,13 @@ + :variables nil + :packages '(pkg1 pkg2 pkg3) + :selected-packages 'all +- :dir spacemacs-start-directory) ++ :dir spacemacs-data-directory) + (configuration-layer/make-layer 'layer layer 'used)))))) + + (ert-deftest test-make-layer--make-layer-force-load-packages-file-with-va= r () + (let ((layer (cfgl-layer "layer" + :name 'layer +- :dir spacemacs-start-directory)) ++ :dir spacemacs-data-directory)) + (layer-packages '(pkg1 pkg2 pkg3)) + (configuration-layer--load-packages-files t) + (mocker-mock-default-record-cls 'mocker-stub-record)) +@@ -950,13 +950,13 @@ + :variables nil + :packages '(pkg1 pkg2 pkg3) + :selected-packages 'all +- :dir spacemacs-start-directory) ++ :dir spacemacs-data-directory) + (configuration-layer/make-layer 'layer layer)))))) + + (ert-deftest test-make-layer--make-layer-does-not-load-packages-file-by-d= efault () + (let ((layer (cfgl-layer "layer" + :name 'layer +- :dir spacemacs-start-directory)) ++ :dir spacemacs-data-directory)) + (layer-packages '(pkg1)) + (mocker-mock-default-record-cls 'mocker-stub-record)) + (mocker-let +@@ -968,7 +968,7 @@ + (ert-deftest test-make-layer--make-used-layer-can-set-additional-properti= es () + (let ((layer (cfgl-layer "layer" + :name 'layer +- :dir spacemacs-start-directory)) ++ :dir spacemacs-data-directory)) + (layer-specs '(layer :disabled-for pkg8 pkg9 + :can-shadow layer2 layer3 + :variables foo bar toto 1)) +@@ -984,13 +984,13 @@ + :variables '(foo bar toto 1) + :packages '(pkg1 pkg2 pkg3) + :selected-packages 'all +- :dir spacemacs-start-directory) ++ :dir spacemacs-data-directory) + (configuration-layer/make-layer layer-specs layer 'us= ed)))))) + + (ert-deftest test-make-layer--make-not-used-layer-cannot-set-additional-p= roperties () + (let ((layer (cfgl-layer "layer" + :name 'layer +- :dir spacemacs-start-directory)) ++ :dir spacemacs-data-directory)) + (layer-specs '(layer :disabled-for pkg8 pkg9 + :can-shadow layer2 + :variables foo bar toto 1)) +@@ -1002,7 +1002,7 @@ + :variables nil + :packages nil + :selected-packages 'all +- :dir spacemacs-start-directory) ++ :dir spacemacs-data-directory) + (configuration-layer/make-layer layer-specs layer))))) + + (ert-deftest test-make-layer--make-used-layer-can-override-additional-pro= perties () +@@ -1011,7 +1011,7 @@ + :disabled-for '(pkg10) + :can-shadow '() + :variables '(titi tata tutu 1) +- :dir spacemacs-start-directory)) ++ :dir spacemacs-data-directory)) + (layer-specs '(layer :disabled-for pkg8 pkg9 + :can-shadow layer2 + :variables foo bar toto 1)) +@@ -1027,7 +1027,7 @@ + :variables '(foo bar toto 1) + :packages '(pkg1 pkg2 pkg3) + :selected-packages 'all +- :dir spacemacs-start-directory) ++ :dir spacemacs-data-directory) + (configuration-layer/make-layer layer-specs layer 'us= ed)))))) + + (ert-deftest test-make-layer--make-not-used-layer-cannot-override-additio= nal-properties () +@@ -1038,7 +1038,7 @@ + :variables '(titi tata tutu 1) + :packages '(pkg1 pkg2 pkg3) + :selected-packages 'all +- :dir spacemacs-start-directory)) ++ :dir spacemacs-data-directory)) + (layer-specs '(layer :disabled-for pkg8 pkg9 + :can-shadow '(layer2) + :variables foo bar toto 1)) +@@ -1050,7 +1050,7 @@ + :variables '(titi tata tutu 1) + :packages '(pkg1 pkg2 pkg3) + :selected-packages 'all +- :dir spacemacs-start-directory) ++ :dir spacemacs-data-directory) + (configuration-layer/make-layer layer-specs layer))))) + + ;; ----------------------------------------------------------------------= ----- +diff --git a/tests/doc/org-export-ftest.el b/tests/doc/org-export-ftest.el +index 4ee86c897..cdd731eec 100644 +--- a/tests/doc/org-export-ftest.el ++++ b/tests/doc/org-export-ftest.el +@@ -59,6 +59,6 @@ + ;; ----------------------------------------------------------------------= ------- + (ert-deftest test-spacemacs-html-export () + (unwind-protect (spacemacs/publish-doc) +- (delete-directory (concat spacemacs-start-directory ++ (delete-directory (concat spacemacs-data-directory + "export/") + t))) diff --git a/gnu/packages/patches/spacemacs-rolling-release-inhibit-read-on= ly.patch b/gnu/packages/patches/spacemacs-rolling-release-inhibit-read-only= .patch new file mode 100644 index 0000000000..4cb184a898 --- /dev/null +++ b/gnu/packages/patches/spacemacs-rolling-release-inhibit-read-only.patc= h @@ -0,0 +1,44 @@ +The first time that a user runs spacemacs it will open the default +configuration from the source tree and modify the buffer. The buffer is +read-only since the file it opened is, but since we save the file to the u= sers +home directory and not back to it's original location temporarily inhibiti= ng +read-only solves our problem. + +diff --git a/core/core-dotspacemacs.el b/core/core-dotspacemacs.el +index f28249148..3b7872ff0 100644 +--- a/core/core-dotspacemacs.el ++++ b/core/core-dotspacemacs.el +@@ -643,19 +643,20 @@ If ARG is non nil then Ask questions to the user bef= ore installing the dotfile." + (with-current-buffer (find-file-noselect + (concat dotspacemacs-template-directory + ".spacemacs.template")) +- (dolist (p preferences) +- (goto-char (point-min)) +- (re-search-forward (car p)) +- (replace-match (cadr p))) +- (let ((install +- (if (file-exists-p dotspacemacs-filepath) +- (y-or-n-p +- (format "%s already exists. Do you want to overwrite it= ? " +- dotspacemacs-filepath)) t))) +- (when install +- (write-file dotspacemacs-filepath) +- (message "%s has been installed." dotspacemacs-filepath) +- t)))) ++ (let ((inhibit-read-only t)) ++ (dolist (p preferences) ++ (goto-char (point-min)) ++ (re-search-forward (car p)) ++ (replace-match (cadr p))) ++ (let ((install ++ (if (file-exists-p dotspacemacs-filepath) ++ (y-or-n-p ++ (format "%s already exists. Do you want to overwrite = it ? " ++ dotspacemacs-filepath)) t))) ++ (when install ++ (write-file dotspacemacs-filepath) ++ (message "%s has been installed." dotspacemacs-filepath) ++ t))))) + (dotspacemacs/load-file) + ;; force new wizard values to be applied + (dotspacemacs/init)) diff --git a/gnu/packages/patches/spacemacs-rolling-release-quelpa-permissi= ons.patch b/gnu/packages/patches/spacemacs-rolling-release-quelpa-permissio= ns.patch new file mode 100644 index 0000000000..96016d6935 --- /dev/null +++ b/gnu/packages/patches/spacemacs-rolling-release-quelpa-permissions.pat= ch @@ -0,0 +1,53 @@ +When quelpa builds some packages it has to copy files from the store, whic= h +means that they are marked as read-only. This patch sets the permissions o= f +copied files and directories to ensure that they are writable. + +diff --git a/core/libs/quelpa.el b/core/libs/quelpa.el +index 70b143657..9da420028 100644 +@@ -374,8 +374,10 @@ and return TIME-STAMP, otherwise return OLD-TIME-STAM= P." + (delete-directory dir t) + (make-directory dir) + (if (eq type 'file) +- (copy-file file-path dir t t t t) +- (copy-directory file-path dir t t t))) ++ (progn (copy-file file-path dir t t t t) ++ (set-file-modes (expand-file-name (file-name-nondirector= y file-path) dir) #o644)) ++ (progn (copy-directory file-path dir t t t) ++ (set-file-modes dir #o755)))) + (quelpa-build--dump new-stamp-info stamp-file) + (quelpa-file-version file-path type version time-stamp)))) + +@@ -1369,10 +1371,13 @@ FILES is a list of (SOURCE . DEST) relative filepa= th pairs." + (cond + ((file-regular-p file) + (quelpa-build--message "%s -> %s" file newname) +- (copy-file file newname)) ++ (copy-file file newname) ++ (set-file-modes newname #o644)) + ((file-directory-p file) + (quelpa-build--message "%s =3D> %s" file newname) +- (copy-directory file newname)))) ++ (make-directory newname) ++ (set-file-modes newname #o755) ++ (map quelpa-build--copy-file (directory-files file t))))) + + (defun quelpa-build--find-source-file (target files) + "Search for source of TARGET in FILES." +@@ -1463,6 +1468,7 @@ Returns the archive entry for the package." + (if (file-exists-p pkg-target) + (quelpa-build--message "Skipping rebuild of %s" pkg-target) + (copy-file pkg-source pkg-target) ++ (set-file-modes pkg-target #o644) + (let ((enable-local-variables nil) + (make-backup-files nil)) + (with-temp-buffer +@@ -1566,7 +1572,8 @@ attribute with an URL like \"http://domain.tld/path/= to/file.el\"." + (unless (string=3D (file-name-extension url) "el") + (error "<%s> does not end in .el" url)) + (unless (file-directory-p dir) +- (make-directory dir)) ++ (make-directory dir) ++ (set-file-modes dir #o755)) + (url-copy-file url local-path t) + (quelpa-check-hash name config local-path dir 'url))) + diff --git a/gnu/packages/spacemacs.scm b/gnu/packages/spacemacs.scm new file mode 100644 index 0000000000..24b3f23428 --- /dev/null +++ b/gnu/packages/spacemacs.scm @@ -0,0 +1,119 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright =C2=A9 2019 Bryan Ferris +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (gnu packages spacemacs) + #:use-module (gnu packages) + #:use-module (gnu packages base) + #:use-module (gnu packages bash) + #:use-module (gnu packages compression) + #:use-module (gnu packages emacs) + + #:use-module (guix build-system trivial) + #:use-module (guix download) + #:use-module (guix gexp) + #:use-module (guix git-download) + #:use-module ((guix licenses) #:prefix license:) + #:use-module (guix packages) + #:use-module (guix utils)) + +(define-public spacemacs-rolling-release + (let ((commit "1e278a3cb9cd4730ee17416b55fb778b62da2fd0")) + (package + (name "spacemacs-rolling-release") + (version (git-version "0.3.0" "0" commit)) + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/syl20bnr/spacemacs") + (commit commit))) + (sha256 + (base32 + "17yxgchj7qilgljpjai3ad0pzj7k6sq6gqbnxrvcizvkvcnv10z5")) + (file-name (string-append name "-" version)) + (patches + (search-patches + "spacemacs-rolling-release-add-data-dir.patch" + "spacemacs-rolling-release-inhibit-read-only.patch" + "spacemacs-rolling-release-quelpa-permissions.patch")))) + (build-system trivial-build-system) + (native-inputs `(("tar" ,tar) ("xz" ,xz))) + (arguments (list + #:modules '((guix build utils)) + #:builder '(begin (use-modules (guix build utils)) + (setenv "PATH" + (string-append (getenv "PATH")= ":" + (assoc-ref + %build-inputs = "xz") + "/bin")) + (mkdir-p (assoc-ref %outputs "out")) + (system* (string-append + (assoc-ref %build-inputs "ta= r") + "/bin/tar") + "xf" (assoc-ref %build-inputs + "source") + "-C" (assoc-ref %outputs "out= ") + "--strip-components" "1")))) + (synopsis "Automatically configured emacs for both emacs and vim use= rs") + (description "Spacemacs is a configuration framework for emacs desig= ned to +work well for people with experience using either emacs or vim. It has 4 +driving principles: mnemonics, discoverability, consistency, and crowd +configuration. Mnemonics mean that key bindings use letters that stand fo= r the +action they take, making the easier to remember. Discoverability means th= at +help is displayed when partial keybindings are entered, and prepared +configuration units are searchable. Consistency means that bindings for +different use-cases (eg, different programming languages) use the same +keybindings for similar actions. And crowd-configuration means that the +spacemacs community collaborates to provide the best default experience fo= r new +and expert users alike.") + (home-page "https://spacemacs.org") + (license license:gpl3)))) + +(define* (generate-wrapped-emacs-spacemacs emacs spacemacs + #:optional (name "emacs-spacema= cs")) + "Given an emacs package and a spacemacs package, create wrappers that al= low +the use of spacemacs without conflicting with the base emacs." + (package + (name name) + (version (string-append (package-version emacs) "-" + (package-version spacemacs))) + (source #f) + (build-system trivial-build-system) + (inputs `(("sh" ,bash) + ("emacs" ,emacs) + ("spacemacs" ,spacemacs))) + (arguments `(#:modules ((guix build utils) (guix build spacemacs-utils= )) + #:builder (begin + (use-modules ((guix build spacemacs-utils) + #:prefix spacemacs:)) + (spacemacs:builder + #:shell (string-append + (assoc-ref %build-inputs "sh") + "/bin/sh") + #:emacs (string-append + (assoc-ref %build-inputs "emacs") + "/bin/emacs") + #:spacemacs (assoc-ref %build-inputs "spacem= acs") + #:out (string-append + (assoc-ref %outputs "out") "/bin"))))= ) + (home-page (package-home-page spacemacs)) + (synopsis (package-synopsis spacemacs)) + (description (package-description spacemacs)) + (license (package-license spacemacs)))) + +(define-public emacs-spacemacs + (generate-wrapped-emacs-spacemacs emacs spacemacs-rolling-release)) diff --git a/guix/build/spacemacs-utils.scm b/guix/build/spacemacs-utils.sc= m new file mode 100644 index 0000000000..5124c41263 --- /dev/null +++ b/guix/build/spacemacs-utils.scm @@ -0,0 +1,72 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright =C2=A9 2019 Bryan Ferris +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (guix build spacemacs-utils) + #:use-module (guix build utils) + #:use-module (oop goops) + #:use-module (srfi srfi-1) + + #:export (builder)) + +(define (create-initialization-code spacemacs) + "Create elisp code that sets spacemacs-specific variables and then loads= the +spacemacs initialization file" + (object->string + `(progn + (setq spacemacs-start-directory (concat ,spacemacs "/")) + (setq spacemacs-data-directory + (concat (or (getenv "XDG_DATA_DIR") + (concat (getenv "HOME") "/.local/share")) + "/spacemacs/")) + (setq package-user-dir (concat spacemacs-data-directory "elpa/")) + (load-file (concat spacemacs-start-directory "init.el"))))) + +(define (generate-wrapper shell output executable . args) + "create a shell script interpreted by sh-compatible shell `shell` that +executes `executable` passing arguments `args` as well as any passed in fr= om +the command line." + (call-with-output-file + output (lambda (port) + (format port "~A~%~A" + (string-append "#!" shell) + (string-join (list "exec" "-a" shell + executable (string-join args) + "\"$@\""))))) + (chmod output #o555)) + +(define* (builder #:key shell emacs spacemacs out) + "Create exectables that run emacs, the emacs server, and the emacs clien= t +with Spacemacs code preloaded." + (mkdir-p out) + + (generate-wrapper shell + (string-append out "/spacemacs") + emacs " --no-init-file" "--eval" + (string-append "'" + (create-initialization-code spacemacs) + "'")) + + (generate-wrapper shell + (string-append out "/spacemacsdaemon") + (string-append out "/spacemacs") + "--daemon=3Dspacemacs") + + (generate-wrapper shell + (string-append out "/spacemacsclient") + (string-append emacs "client") + "--socket-name" "spacemacs")) -- 2.24.0