diff mbox series

[bug#43087] gnu: emacs: Strip double wrap.

Message ID 20200828133359.10904-1-leo.prikler@student.tugraz.at
State Accepted
Headers show
Series [bug#43087] gnu: emacs: Strip double wrap. | expand

Checks

Context Check Description
cbaines/applying patch fail View Laminar job

Commit Message

Leo Prikler Aug. 28, 2020, 1:34 p.m. UTC
* gnu/packages/emacs.scm (emacs)[#:phases]: Add 'strip-double-wrap.
---
 gnu/packages/emacs.scm | 11 +++++++++++
 1 file changed, 11 insertions(+)

Comments

Mathieu Othacehe Aug. 29, 2020, 11:24 a.m. UTC | #1
Hello Leo,

> * gnu/packages/emacs.scm (emacs)[#:phases]: Add 'strip-double-wrap.

Pushed, thanks!

Mathieu
Mathieu Othacehe Aug. 29, 2020, 2:04 p.m. UTC | #2
Hey Leo,

> Pushed, thanks!

I did revert this commit because it causes several regressions for
me. For some reason, "notmuch" and "emacs-guix" packages do not build
and Emacs refuses to load any package.

Could you have a look?

Thanks,

Mathieu
Leo Prikler Aug. 29, 2020, 2:25 p.m. UTC | #3
Am Samstag, den 29.08.2020, 16:04 +0200 schrieb Mathieu Othacehe:
> Hey Leo,
> 
> > Pushed, thanks!
> 
> I did revert this commit because it causes several regressions for
> me. For some reason, "notmuch" and "emacs-guix" packages do not build
It seems this is because the phase inadvertently gets propagated to
emacs-minimal et al. just like the restore-pdmp phase.  We could just
delete it where not needed, but perhaps there's a better way of doing
that.  I think we should make emacs-minimal the base package and have
every other emacs package inherit it, so as to not cause too much
cross-pollution.

> and Emacs refuses to load any package.
I don't exactly know, what you mean by that.  Putting aside the
bootstrapping problem of building the package [since emacs-minimal is
broken], I have no issue running this emacs-next with EMACSLOADPATH
already set from my profile.  

> Could you have a look?
I'm on it ;)
diff mbox series

Patch

diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm
index a338abc774..84c1889617 100644
--- a/gnu/packages/emacs.scm
+++ b/gnu/packages/emacs.scm
@@ -191,6 +191,17 @@ 
                            (rename-file real wrapper))
                          pdmp pdmp-real))
              #t))
+         (add-after 'glib-or-gtk-wrap '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 (package-version emacs)))
+                          "bin/emacs")
+               #t)))
          (add-before 'reset-gzip-timestamps 'make-compressed-files-writable
            ;; The 'reset-gzip-timestamps phase will throw a permission error
            ;; if gzip files aren't writable then.  This phase is needed when