summary refs log tree commit diff
diff options
context:
space:
mode:
authorMorgan Smith <Morgan.J.Smith@outlook.com>2020-11-01 23:35:04 -0500
committerNicolas Goaziou <mail@nicolasgoaziou.fr>2020-11-03 10:30:03 +0100
commitb107a19ffb6a6abb7bde3436f3fa359071bd1f5c (patch)
tree2e8075c721d00c4940c2132ec6550179b67480d6
parent7a9e68cc8750a9b378ae54a42d3e882a2e548c95 (diff)
downloadguix-b107a19ffb6a6abb7bde3436f3fa359071bd1f5c.tar.gz
gnu: emacs: Make strip-double-wrap more robust.
* gnu/packages/emacs.scm (emacs) [strip-double-wrap]: Use regex to find emacs
executable.  This works even when the version is changed by package
transformations (e.g., version=git.master).

Signed-off-by: Nicolas Goaziou <mail@nicolasgoaziou.fr>
-rw-r--r--gnu/packages/emacs.scm18
1 files changed, 8 insertions, 10 deletions
diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm
index 4963379d74..baed0b2afa 100644
--- a/gnu/packages/emacs.scm
+++ b/gnu/packages/emacs.scm
@@ -123,6 +123,9 @@
     (build-system glib-or-gtk-build-system)
     (arguments
      `(#:tests? #f                      ; no check target
+       #:modules ((guix build glib-or-gtk-build-system)
+                  (guix build utils)
+                  (ice-9 match))
        #:configure-flags (list "--with-modules"
                                "--with-cairo"
                                "--disable-build-details")
@@ -196,17 +199,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.  The version is
-             ;; accessed using using THIS-PACKAGE so it "just works" for
-             ;; inherited Emacs packages of different versions.
+             ;; able to track emacs back to emacs.desktop.
              (with-directory-excursion (assoc-ref outputs "out")
-               (copy-file (string-append
-                           "bin/emacs-"
-                           ,(let ((this-version (package-version this-package)))
-                              (or (false-if-exception
-                                   (version-major+minor+point this-version))
-                                  (version-major+minor this-version))))
-                          "bin/emacs")
+               (copy-file
+                (match (find-files "bin" "^emacs-")
+                  ((executable . _) executable))
+                "bin/emacs")
                #t)))
          (add-before 'reset-gzip-timestamps 'make-compressed-files-writable
            ;; The 'reset-gzip-timestamps phase will throw a permission error