Subject: bug#28365: closed (Re: [bug#28365] [PATCH] gnu: emacs-ess: Include the etc directory in the build)

From: [email-masked] (GNU bug Tracking System)
Date: Thu, 07 Sep 2017 08:06:02 +0000

Your bug report

#28365: [PATCH] gnu: emacs-ess: Include the etc directory in the build

which was filed against the guix-patches package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
28365: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=28365
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: [bug#28365] [PATCH] gnu: emacs-ess: Include the etc directory in the build
From: Roel Janssen <[email-masked]>
To: Kyle Meyer <[email-masked]>
Cc: [email-masked]
Date: Thu, 07 Sep 2017 10:05:31 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

Kyle Meyer writes:

> Roel Janssen <[email-masked]> writes:
>
>> When loading ESS "the standard way":
>>   (require 'ess-site)
>>
>> it fails to load because it cannot find the "etc" directory that should
>> ship with this package.
>
> Thanks, I hit this too.  Here's a fix that I have locally but hadn't
> sent yet.
>
> -- >8 --
> diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm
> index 9c0f9bc89..a47e90a40 100644
> --- a/gnu/packages/emacs.scm
> +++ b/gnu/packages/emacs.scm
> @@ -3206,7 +3206,14 @@ E-Prime forbids the use of the \"to be\" form to strengthen your writing.")
>                                    version ".tgz"))
>                (sha256
>                 (base32
> -                "0w7mbbajn377gdmvnd21mpyr368b2ia46gq6cb99y4y5rspf9pcg"))))
> +                "0w7mbbajn377gdmvnd21mpyr368b2ia46gq6cb99y4y5rspf9pcg"))
> +              (modules '((guix build utils)))
> +              (snippet
> +               ;; Add an entry to ess-etc-directory-list that is relative to
> +               ;; guix.d/.
> +               '(substitute* "lisp/ess-site.el"
> +                  (("^  '\\(\"\\.\\./etc/ess/\"" line)
> +                   (string-append line " \"../../../etc/ess/\""))))))
>      (build-system gnu-build-system)
>      (arguments
>       `(#:tests? #f ; There is no test suite.
> -- >8 --
>
> That teaches ess-etc-directory-list about $PROFILE/share/emacs/etc/.  I
> prefer your solution because I think it's less fragile.
>
> I just have a minor comment on the patch description.
>
>> Subject: [PATCH] gnu: emacs-ess: Include the etc directory in the build
>>  output.
>>
>> * gnu/packages/emacs.scm (emacs-ess):  Also copy the etc directory.
>
> That doesn't seem quite right because the etc directory is already
> included in the build; it's under $PROFILE/share/emacs/etc/.  Perhaps
> this should instead say something like "Relocate the etc directory so
> that ESS can find it."

You're right.  I didn't know that the directory was at
$PROFILE/share/emacs/etc/.

So I adjusted the commit message and pushed in
eaff063aa0f478f23b78c5db8ba0d465b3f691cd.

Thanks!

Kind regards,
Roel Janssen

Subject: [PATCH] gnu: emacs-ess: Include the etc directory in the build
From: Roel Janssen <[email-masked]>
To: guix-patches <[email-masked]>
Date: Wed, 06 Sep 2017 12:20:41 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

>From f8ae717ae7dd5db7f7c0c477b7c871b843607de5 Mon Sep 17 00:00:00 2001
From: Roel Janssen <[email-masked]>
Date: Wed, 6 Sep 2017 12:14:18 +0200
Subject: [PATCH] gnu: emacs-ess: Include the etc directory in the build
 output.

* gnu/packages/emacs.scm (emacs-ess):  Also copy the etc directory.
---
 gnu/packages/emacs.scm | 35 +++++++++++++++++++----------------
 1 file changed, 19 insertions(+), 16 deletions(-)

diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm
index bc01d5777..1e29f357c 100644
--- a/gnu/packages/emacs.scm
+++ b/gnu/packages/emacs.scm
@@ -3209,22 +3209,25 @@ E-Prime forbids the use of the \"to be\" form to strengthen your writing.")
                 "0w7mbbajn377gdmvnd21mpyr368b2ia46gq6cb99y4y5rspf9pcg"))))
     (build-system gnu-build-system)
     (arguments
-     `(#:tests? #f ; There is no test suite.
-       #:make-flags (list (string-append "PREFIX=" %output)
-                          (string-append "LISPDIR=" %output
-                                         "/share/emacs/site-lisp/guix.d/ess"))
-       #:phases
-       (modify-phases %standard-phases
-         (delete 'configure)
-         (add-before 'build 'more-shebang-patching
-           (lambda* (#:key inputs #:allow-other-keys)
-             (substitute* "Makeconf"
-               (("SHELL = /bin/sh")
-                (string-append "SHELL = " (which "sh"))))))
-         ;; FIXME: the texlive-union insists on regenerating fonts.  It stores
-         ;; them in HOME, so it needs to be writeable.
-         (add-before 'build 'set-HOME
-           (lambda _ (setenv "HOME" "/tmp") #t)))))
+     (let ((base-directory "/share/emacs/site-lisp/guix.d/ess"))
+       `(#:tests? #f ; There is no test suite.
+         #:make-flags (list (string-append "PREFIX=" %output)
+                            (string-append "ETCDIR=" %output "/"
+                                           ,base-directory "/etc")
+                            (string-append "LISPDIR=" %output "/"
+                                           ,base-directory))
+         #:phases
+         (modify-phases %standard-phases
+           (delete 'configure)
+           (add-before 'build 'more-shebang-patching
+             (lambda* (#:key inputs #:allow-other-keys)
+               (substitute* "Makeconf"
+                 (("SHELL = /bin/sh")
+                  (string-append "SHELL = " (which "sh"))))))
+           ;; FIXME: the texlive-union insists on regenerating fonts.  It stores
+           ;; them in HOME, so it needs to be writeable.
+           (add-before 'build 'set-HOME
+             (lambda _ (setenv "HOME" "/tmp") #t))))))
     (inputs
      `(("emacs" ,emacs-minimal)
        ("r-minimal" ,r-minimal)))
-- 
2.14.1

Dear Guix,

When loading ESS "the standard way":
  (require 'ess-site)

it fails to load because it cannot find the "etc" directory that should
ship with this package.

This patch puts that directory and its contents (as generated by the
build system) into $PROFILE/share/emacs/site-lisp/guix.d/ess/etc.

After this change, I was able to load ESS "the standard way".

Thanks for your time.

Kind regards,
Roel Janssen