[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug#72406] [PATCH emacs-team WIP v4 04/24] build-system: emacs: Handle
From: |
Liliana Marie Prikler |
Subject: |
[bug#72406] [PATCH emacs-team WIP v4 04/24] build-system: emacs: Handle variants in elpa naming. |
Date: |
Sun, 11 Aug 2024 14:58:44 +0200 |
* guix/build/emacs-build-system.scm (%emacs-prefix): New variable.
(package-name-version->elpa-name-version): Infer the prefix to strip from the
emacs used to compile the package.
---
guix/build/emacs-build-system.scm | 25 +++++++++++++++++++------
1 file changed, 19 insertions(+), 6 deletions(-)
diff --git a/guix/build/emacs-build-system.scm
b/guix/build/emacs-build-system.scm
index aa083c6409..1894ac4c23 100644
--- a/guix/build/emacs-build-system.scm
+++ b/guix/build/emacs-build-system.scm
@@ -316,16 +316,29 @@ (define* (validate-compiled-autoloads #:key outputs
#:allow-other-keys)
(autoloads (find-files out "-autoloads.elc$")))
(emacs-batch-eval (format #f "(mapc #'load '~s)" autoloads))))
-(define (emacs-package? name)
- "Check if NAME correspond to the name of an Emacs package."
- (string-prefix? "emacs-" name))
+(define %emacs-prefix
+ (make-parameter #f))
(define (package-name-version->elpa-name-version name-ver)
"Convert the Guix package NAME-VER to the corresponding ELPA name-version
format. Essentially drop the prefix used in Guix."
- (if (emacs-package? name-ver) ; checks for "emacs-" prefix
- (string-drop name-ver (string-length "emacs-"))
- name-ver))
+ ;; Get the preferred emacs prefix
+ (or (%emacs-prefix)
+ (%emacs-prefix
+ (let ((emacs (if (string-prefix? "/" (%emacs)) ; absolute file name
+ (%emacs)
+ (which "emacs"))))
+ (string-append
+ (package-name->name+version
+ (strip-store-file-name (dirname (dirname emacs))))
+ "-"))))
+
+ (cond
+ ((string-prefix? (%emacs-prefix) name-ver)
+ (string-drop name-ver (string-length (%emacs-prefix))))
+ ((string-prefix? "emacs-" name-ver)
+ (string-drop name-ver (string-length "emacs-")))
+ (else name-ver)))
(define (store-directory->elpa-name-version store-dir)
"Given a store directory STORE-DIR return the part of the basename after the
--
2.45.2
- [bug#72406] [PATCH emacs-team WIP v4 00/24] Build variants for other Emacsen, Liliana Marie Prikler, 2024/08/11
- [bug#72406] [PATCH emacs-team WIP v4 01/24] build-system: emacs: Define package-with-explicit-emacs., Liliana Marie Prikler, 2024/08/11
- [bug#72406] [PATCH emacs-team WIP v4 06/24] gnu: emacs-libgit: Build variants., Liliana Marie Prikler, 2024/08/11
- [bug#72406] [PATCH emacs-team WIP v4 04/24] build-system: emacs: Handle variants in elpa naming.,
Liliana Marie Prikler <=
- [bug#72406] [PATCH emacs-team WIP v4 08/24] gnu: emacs-tablist: Define variants., Liliana Marie Prikler, 2024/08/11
- [bug#72406] [PATCH emacs-team WIP v4 07/24] gnu: emacs-eweouz: Build variants., Liliana Marie Prikler, 2024/08/11
- [bug#72406] [PATCH emacs-team WIP v4 02/24] build-system: emacs: Make emacs the default variant., Liliana Marie Prikler, 2024/08/11
- [bug#72406] [PATCH emacs-team WIP v4 12/24] gnu: emacs-dash: Define variants., Liliana Marie Prikler, 2024/08/11
- [bug#72406] [PATCH emacs-team WIP v4 11/24] gnu: emacs-bui: Define variants., Liliana Marie Prikler, 2024/08/11
- [bug#72406] [PATCH emacs-team WIP v4 10/24] gnu: emacs-fontaine: Reindent., Liliana Marie Prikler, 2024/08/11
- [bug#72406] [PATCH emacs-team WIP v4 15/24] gnu: emacs-geiser-guile: Define variants., Liliana Marie Prikler, 2024/08/11
- [bug#72406] [PATCH emacs-team WIP v4 05/24] etc: Provide snippet for defining emacs variants., Liliana Marie Prikler, 2024/08/11
- [bug#72406] [PATCH emacs-team WIP v4 09/24] gnu: emacs-pdf-tools: Build variants., Liliana Marie Prikler, 2024/08/11
- [bug#72406] [PATCH emacs-team WIP v4 14/24] gnu: emacs-geiser: Define variants., Liliana Marie Prikler, 2024/08/11