unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: Morgan Smith <Morgan.J.Smith@outlook.com>
To: guix-devel@gnu.org
Cc: 43277@debbugs.gnu.org
Subject: bug#43277: [PATCH] gnu: emacs-next: Fix load path and version
Date: Tue, 22 Sep 2020 09:05:51 -0400	[thread overview]
Message-ID: <DM5PR1001MB2105E63A2DCDC4F78819B162C53B0@DM5PR1001MB2105.namprd10.prod.outlook.com> (raw)
In-Reply-To: <DM5PR1001MB210564F9A72336BF27BFA57FC5230@DM5PR1001MB2105.namprd10.prod.outlook.com> (Morgan J. Smith's message of "Mon, 14 Sep 2020 18:08:19 -0400")

Hello guix-devel,

I fear this patch may get lost (as it has not received feedback since I
posted it on Sept 14th (ok maybe I'm just being impatient but I'd like
to think emacs-next is an important package)) so I've decided to post it
in guix-devel. While I'm here I might as well add some much needed
information.

The emacs-next package has been broken since it was re-added on August
31st. It was added by me so this my fault. It's broken because the
EMACSLOADPATH environment variable only contains the lisp location for
your user profile and doesn't include the lisp bundled with
emacs-next. If you have emacs and emacs-next installed at the same time,
emacs-next appears to work as expected because it's using the lisp
installed with emacs. I'm not sure if there is a way to make sure people
only install emacs or emacs-next, but you should only install one.

I created the below patch on Sept 14th, and have been using it daily
since then with no issues.

The version goes from 28.0.50.1 to 28.0.50. The "1" is the build number
which gets incremented every time you run "make" (so not actually part
of the version). Also it's important to get the version correct as I use
it to refer to the binary.

When we copy the binary in 'string-double-wrap, I've decided to just
string split on #\-. This is remove the end of the git-version string so
we're left with just 28.0.50.

I need to copy the native-search-paths section from emacs and place it
into emacs-next. It would be cooler if the native-search-paths sections
was thunked so I could pull the this-package trick again to get the
right version, but I think this is the only way.

Thanks,

Morgan

Morgan.J.Smith@outlook.com writes:

> From: Morgan Smith <Morgan.J.Smith@outlook.com>
>
> * gnu/packages/emacs.scm (emacs):
> [strip-double-wrap] Modify to work with emacs-next
>
> * gnu/packages/emacs.scm (emacs-next):
> [version] Change version from 28.0.50.1 to 28.0.50
> [arguments] Removed field
> [native-search-paths] New field
> ---
>
> The problem turned out to be that EMACSLOADPATH wasn't being set
> properly.  This patch fixes that.
>
>
>
>  gnu/packages/emacs.scm | 37 ++++++++++++++++---------------------
>  1 file changed, 16 insertions(+), 21 deletions(-)
>
> diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm
> index 03c28ee7a7..b3d099257d 100644
> --- a/gnu/packages/emacs.scm
> +++ b/gnu/packages/emacs.scm
> @@ -196,11 +196,12 @@
>             (lambda* (#:key outputs #:allow-other-keys)
>               ;; Directly copy emacs-X.Y to emacs, so that it is not wrapped
>               ;; twice.  This also fixes a minor issue, where WMs would not be
> -             ;; able to track emacs back to emacs.desktop.
> +             ;; able to track emacs back to emacs.desktop.  It's done using
> +             ;; this-package so emacs-next can reuse it
>               (with-directory-excursion (assoc-ref outputs "out")
>                 (copy-file (string-append
>                             "bin/emacs-"
> -                           ,(version-major+minor (package-version emacs)))
> +                           ,(car (string-split (package-version this-package) #\-)))
>                            "bin/emacs")
>                 #t)))
>           (add-before 'reset-gzip-timestamps 'make-compressed-files-writable
> @@ -279,11 +280,10 @@ languages.")
>  
>  (define-public emacs-next
>    (let ((commit "2ea34662c20f71d35dd52a5ed996542c7386b9cb")
> -        (revision "0")
> -        (emacs-version "28.0.50.1"))
> +        (revision "0"))
>      (package/inherit emacs
>        (name "emacs-next")
> -      (version (git-version emacs-version revision commit))
> +      (version (git-version "28.0.50" revision commit))
>        (source
>         (origin
>           (inherit (package-source emacs))
> @@ -295,24 +295,19 @@ languages.")
>           (sha256
>            (base32
>             "0igjm9kwiswn2dpiy2k9xikbdfc7njs07ry48fqz70anljj8y7y3"))))
> -      (arguments
> -       (substitute-keyword-arguments (package-arguments emacs)
> -         ((#:phases phases)
> -          `(modify-phases ,phases
> -             (replace 'strip-double-wrap
> -               (lambda* (#:key outputs #:allow-other-keys)
> -                 ;; Directly copy emacs-X.Y to emacs, so that it is not wrapped
> -                 ;; twice.  This also fixes a minor issue, where WMs would not be
> -                 ;; able to track emacs back to emacs.desktop.
> -                 (with-directory-excursion (assoc-ref outputs "out")
> -                   (copy-file (string-append
> -                               "bin/emacs-"
> -                               ,(version-major+minor+point (package-version emacs-next)))
> -                              "bin/emacs")
> -                   #t)))))))
>        (native-inputs
>         `(("autoconf" ,autoconf)
> -         ,@(package-native-inputs emacs))))))
> +         ,@(package-native-inputs emacs)))
> +
> +      (native-search-paths
> +       (list (search-path-specification
> +              (variable "EMACSLOADPATH")
> +              ;; The versioned entry is for the Emacs' builtin libraries.
> +              (files (list "share/emacs/site-lisp"
> +                           (string-append "share/emacs/" (car (string-split version #\-)) "/lisp"))))
> +             (search-path-specification
> +              (variable "INFOPATH")
> +              (files '("share/info"))))))))
>  
>  (define-public emacs-minimal
>    ;; This is the version that you should use as an input to packages that just




  reply	other threads:[~2020-09-22 14:22 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-08 12:13 bug#43277: emacs-next is broke, "seq" missing Martin Becze
2020-09-08 12:40 ` Malte Gerdes
2020-09-08 13:17   ` Martin Becze
2020-09-08 14:01 ` Michael Rohleder
2020-09-08 15:07   ` Martin Becze
2020-09-11 20:09 ` Pierre Langlois
2020-09-14 22:08 ` bug#43277: [PATCH] gnu: emacs-next: Fix load path and version Morgan.J.Smith
2020-09-22 13:05   ` Morgan Smith [this message]
2020-09-22 18:35   ` Pierre Langlois
2020-09-26 12:08     ` Morgan Smith
2020-10-01 15:05     ` Maxim Cournoyer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DM5PR1001MB2105E63A2DCDC4F78819B162C53B0@DM5PR1001MB2105.namprd10.prod.outlook.com \
    --to=morgan.j.smith@outlook.com \
    --cc=43277@debbugs.gnu.org \
    --cc=guix-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).