me
/
guix
Archived
1
0
Fork 0

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 (ex: version=git.master)

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
master
Morgan Smith 2020-10-26 22:01:45 -04:00 committed by Ludovic Courtès
parent 13a7d2a538
commit 8d2465fcfe
No known key found for this signature in database
GPG Key ID: 090B11993D9AEBB5
1 changed files with 5 additions and 11 deletions

View File

@ -1,5 +1,5 @@
;;; GNU Guix --- Functional package management for GNU ;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2019 Ludovic Courtès <ludo@gnu.org> ;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2019, 2021 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2013 Andreas Enge <andreas@enge.fr> ;;; Copyright © 2013 Andreas Enge <andreas@enge.fr>
;;; Copyright © 2014 Taylan Ulrich Bayirli/Kammer <taylanbayirli@gmail.com> ;;; Copyright © 2014 Taylan Ulrich Bayirli/Kammer <taylanbayirli@gmail.com>
;;; Copyright © 2014, 2015, 2016, 2017, 2018, 2019, 2020 Mark H Weaver <mhw@netris.org> ;;; Copyright © 2014, 2015, 2016, 2017, 2018, 2019, 2020 Mark H Weaver <mhw@netris.org>
@ -195,17 +195,11 @@
(lambda* (#:key outputs #:allow-other-keys) (lambda* (#:key outputs #:allow-other-keys)
;; Directly copy emacs-X.Y to emacs, so that it is not wrapped ;; 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 ;; twice. This also fixes a minor issue, where WMs would not be
;; able to track emacs back to emacs.desktop. The version is ;; able to track emacs back to emacs.desktop.
;; accessed using using THIS-PACKAGE so it "just works" for
;; inherited Emacs packages of different versions.
(with-directory-excursion (assoc-ref outputs "out") (with-directory-excursion (assoc-ref outputs "out")
(copy-file (string-append (copy-file
"bin/emacs-" (car (find-files "bin" "^emacs-([0-9]+\\.)+[0-9]+$"))
,(let ((this-version (package-version this-package))) "bin/emacs")
(or (false-if-exception
(version-major+minor+point this-version))
(version-major+minor this-version))))
"bin/emacs")
#t))) #t)))
(add-before 'reset-gzip-timestamps 'make-compressed-files-writable (add-before 'reset-gzip-timestamps 'make-compressed-files-writable
;; The 'reset-gzip-timestamps phase will throw a permission error ;; The 'reset-gzip-timestamps phase will throw a permission error