Subject: [PATCH emacs-team WIP v4 09/24] gnu: emacs-pdf-tools: Build variants.

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

* gnu/packages/emacs-xyz.scm (emacs-pdf-tools)[native-inputs]: Replace
emacs-minimal with emacs.
[properties]: Add ‘minimal-variant’, ‘next-variant’ and ‘pgtk-variant’.
(emacs-minimal-pdf-tools, emacs-next-pdf-tools, emacs-pgtk-pdf-tools):
New variables.
---
 gnu/packages/emacs-xyz.scm | 29 +++++++++++++++++++++++++++--
 1 file changed, 27 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/emacs-xyz.scm b/gnu/packages/emacs-xyz.scm
index f1fa21e034..68520a2622 100644
--- a/gnu/packages/emacs-xyz.scm
+++ b/gnu/packages/emacs-xyz.scm
@@ -5963,7 +5963,7 @@ (define-public emacs-pdf-tools
          (add-after 'emacs-install 'emacs-build
            (assoc-ref emacs:%standard-phases 'build)))))
     (native-inputs
-     (list autoconf automake emacs-minimal pkg-config))
+     (list autoconf automake emacs pkg-config))
     (inputs
      (list cairo glib libpng poppler zlib))
     (propagated-inputs
@@ -5975,7 +5975,32 @@ (define-public emacs-pdf-tools
 files.  The key difference is that pages are not pre-rendered by
 e.g. ghostscript and stored in the file-system, but rather created on-demand
 and stored in memory.")
-    (license license:gpl3+)))
+    (license license:gpl3+)
+    (properties
+     `((minimal-variant . ,(delay emacs-minimal-pdf-tools))
+       (next-variant . ,(delay emacs-next-pdf-tools))
+       (pgtk-variant . ,(delay emacs-pgtk-pdf-tools))))))
+
+(define-public emacs-minimal-pdf-tools
+  (package/inherit emacs-pdf-tools
+    (name "emacs-minimal-pdf-tools")
+    (native-inputs (modify-inputs (package-native-inputs emacs-pdf-tools)
+                     (replace "emacs" emacs-minimal)))
+    (propagated-inputs (list emacs-minimal-tablist))))
+
+(define-public emacs-next-pdf-tools
+  (package/inherit emacs-pdf-tools
+    (name "emacs-next-pdf-tools")
+    (native-inputs (modify-inputs (package-native-inputs emacs-pdf-tools)
+                     (replace "emacs" emacs-next)))
+    (propagated-inputs (list emacs-next-tablist))))
+
+(define-public emacs-pgtk-pdf-tools
+  (package/inherit emacs-pdf-tools
+    (name "emacs-pgtk-pdf-tools")
+    (native-inputs (modify-inputs (package-native-inputs emacs-pdf-tools)
+                     (replace "emacs" emacs-pgtk)))
+    (propagated-inputs (list emacs-pgtk-tablist))))
 
 (define-public emacs-saveplace-pdf-view
   (package
-- 
2.45.2