GNU bug report logs - #30884
[PATCH 0/6] gnu: Add emacs-epkg.

Previous Next

Package: guix-patches;

Reported by: Oleg Pykhalov <go.wigust <at> gmail.com>

Date: Tue, 20 Mar 2018 16:31:01 UTC

Severity: normal

Tags: patch

Done: Oleg Pykhalov <go.wigust <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #58 received at 30884 <at> debbugs.gnu.org (full text, mbox):

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: Oleg Pykhalov <go.wigust <at> gmail.com>
Cc: bug#30884 <30884 <at> debbugs.gnu.org>,
 Ludovic Courtès <ludo <at> gnu.org>
Subject: Re: [bug#30884] Status: [PATCH 0/6] gnu: Add emacs-epkg.
Date: Wed, 18 Apr 2018 21:09:06 -0400
Hi Oleg,

Oleg Pykhalov <go.wigust <at> gmail.com> writes:

> Hello Ludovic,
>
> Thank you for review!
>
> I've applied all your suggestions except ‘set-emacs-load-path’.  First
> of all this procedure is not exported.

Phases are typically not exported individually, but as an alist of all
the phases of the build system, as `%standard-phases'.

> Another pitfall is ‘Invalid
> keyword’ error.
>
> diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm
> index 6258dbaed..d290a61b4 100644
> --- a/gnu/packages/emacs.scm
> +++ b/gnu/packages/emacs.scm
> @@ -7733,7 +7733,8 @@ object has been freed.")
>                    ,@%gnu-build-system-modules
>                    (guix build emacs-utils))
>         #:imported-modules (,@%gnu-build-system-modules
> -                           (guix build emacs-utils))
> +                           (guix build emacs-utils)
> +                           (guix build emacs-build-system))
>         #:phases
>         (modify-phases %standard-phases
>           (delete 'configure)
> @@ -7744,22 +7745,8 @@ object has been freed.")
>               #t))
>           (add-after 'patch-elisp-shell-shebangs 'setenv-emacsloadpath
>             (lambda* (#:key inputs #:allow-other-keys)
> -             (define (el-dir store-dir)
> -               (match (find-files store-dir "\\.el$")
> -                 ((f1 f2 ...) (dirname f1))
> -                 (_ "")))
> -             (define emacs-prefix? (cut string-prefix? "emacs-" <>))
> -             (let* ((emacs-load-paths
> -                     (map (match-lambda
> -                            (((? emacs-prefix? name) . dir)
> -                             (string-append (el-dir dir) ":"))
> -                            (_ ""))
> -                          inputs))
> -                    (emacs-load-path-value
> -                     (string-concatenate emacs-load-paths)))
> -               (format #t "environment variable `EMACSLOADPATH' set to ~a\n"
> -                       emacs-load-path-value)
> -               (setenv "EMACSLOADPATH" emacs-load-path-value))
> +             ((@@ (guix build emacs-build-system) set-emacs-load-path)
> +               inputs)

As `set-emacs-load-path' is a phase itself, it expects to be called as
such, with keyworded arguments. It would be simpler to just insert the
phase as in:

--8<---------------cut here---------------start------------->8---
;; Add this to the define-module top level definition:
;; (define-module (gnu packages emacs)
;; ...
;; #:use-module ((guix build emacs-build-system) #:prefix emacs:)
;; ...

(add-after 'patch-elisp-shell-shebangs
           (assoc-ref emacs:%standard-phases 'set-emacs-load-path))
--8<---------------cut here---------------start------------->8---

HTH,

Maxim




This bug report was last modified 7 years and 36 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.