Subject: [bug#72406] [PATCH emacs-team WIP v4 03/24] build-system: emacs: Define common variants.

From: Liliana Marie Prikler <[email-masked]>
Date: Sun, 11 Aug 2024 14:58:43 +0200

* guix/build-system/emacs.scm (package-with-emacs-minimal)
(package-with-emacs-next, package-with-emacs-pgtk): New variables.
---
 guix/build-system/emacs.scm | 29 ++++++++++++++++++++++++++++-
 1 file changed, 28 insertions(+), 1 deletion(-)

diff --git a/guix/build-system/emacs.scm b/guix/build-system/emacs.scm
index 88304b9ce1..9ab8b493a7 100644
--- a/guix/build-system/emacs.scm
+++ b/guix/build-system/emacs.scm
@@ -31,7 +31,13 @@ (define-module (guix build-system emacs)
   #:use-module (guix build-system gnu)
   #:export (%emacs-build-system-modules
             emacs-build
-            emacs-build-system)
+            emacs-build-system
+            package-with-explicit-emacs
+            ;; Common variants.
+            package-with-emacs-minimal
+            package-with-emacs-next
+            package-with-emacs-no-x-toolkit
+            package-with-emacs-pgtk)
   #:re-export (%default-include         ;for convenience
                %default-exclude))
 
@@ -181,4 +187,25 @@ (define* (package-with-explicit-emacs emacs old-prefix new-prefix
 
   (package-mapping transform cut?))
 
+(define package-with-emacs-minimal
+  (package-with-explicit-emacs (delay (resolve-emacs 'emacs-minimal))
+                               "emacs-" "emacs-minimal-"
+                               #:variant-property 'emacs-minimal-variant))
+
+(define package-with-emacs-next
+  (package-with-explicit-emacs (delay (resolve-emacs 'emacs-next))
+                               "emacs-" "emacs-next-"
+                               #:variant-property 'emacs-next-variant))
+
+;; We prefer emacs-minimal, but sometimes the "minimal" variant still needs
+;; X support.
+(define package-with-emacs-no-x-toolkit
+  (package-with-explicit-emacs (delay (resolve-emacs 'emacs-no-x-toolkit))
+                               "emacs-" "emacs-no-x-toolkit-"))
+
+(define package-with-emacs-pgtk
+  (package-with-explicit-emacs (delay (resolve-emacs 'emacs-pgtk))
+                               "emacs-" "emacs-pgtk-"
+                               #:variant-property 'emacs-pgtk-variant))
+
 ;;; emacs.scm ends here
-- 
2.45.2