Subject: [bug#68722] [PATCH v2] gnu: emacs-ox-tufte: Update to 4.0.3.

From: Suhail <[email-masked]>
Date: Sat, 27 Jan 2024 01:20:15 +0000

* gnu/packages/emacs-xyz.scm (emacs-ox-tufte): Update to 4.0.3 and enable
tests.

Change-Id: Ia0ed2643596cf6a721cc00b06cd26d92cbf5fd3e
---
 gnu/packages/emacs-xyz.scm | 32 +++++++++++++++++++++++++++-----
 1 file changed, 27 insertions(+), 5 deletions(-)

diff --git a/gnu/packages/emacs-xyz.scm b/gnu/packages/emacs-xyz.scm
index 561f41cccf..73f3818e8e 100644
--- a/gnu/packages/emacs-xyz.scm
+++ b/gnu/packages/emacs-xyz.scm
@@ -33494,20 +33494,42 @@ (define-public emacs-ox-reveal
 (define-public emacs-ox-tufte
   (package
     (name "emacs-ox-tufte")
-    (version "4.0.1")
+    (version "4.0.3")
+    (home-page "https://github.com/ox-tufte/ox-tufte")
     (source
      (origin
        (method git-fetch)
        (uri (git-reference
-             (url "https://github.com/ox-tufte/ox-tufte")
+             (url home-page)
              (commit version)))
        (file-name (git-file-name name version))
        (sha256
-        (base32 "1v8jr1k8wfpzwry073rrgkxfpwylxmk7xqabxzp49z40rc7hp26s"))))
+        (base32 "0bb5cik2pgz3kxgzdjddzvs8y2fihjzyvfn5f6kd69n4hi0w6bfd"))))
     (build-system emacs-build-system)
+    (native-inputs (list emacs-buttercup emacs-eldev))
     (propagated-inputs (list emacs-org))
-    (arguments '(#:include (cons "^src/" %default-include)))
-    (home-page "https://github.com/ox-tufte/ox-tufte")
+    (arguments
+     (list
+      #:include #~(cons "^src/" %default-include)
+      #:tests? #t
+      ;; <https://github.com/emacs-eldev/eldev/issues/99#issuecomment-1912637609>
+      #:test-command #~(list "eldev" "-X" "-dtTC" "test")
+      #:phases #~(modify-phases %standard-phases
+                   (add-after 'unpack 'setup-Eldev
+                     (lambda _
+                       (let ((file "Eldev-local")
+                             (content (format
+                                       #f "~s"
+                                       '(dolist (d (split-string
+                                                    (getenv "EMACSLOADPATH")
+                                                    ":" t))
+                                                (ignore-errors
+                                                 (eldev-use-local-dependency
+                                                  d))))))
+                         (setenv "HOME" (getcwd))
+                         (emacs-batch-edit-file file
+                           `(progn (insert ,content)
+                                   (basic-save-buffer)))))))))
     (synopsis "Tufte HTML Org mode export backend")
     (description
      "This is an export backend for Org mode that exports buffers to HTML that

base-commit: 2823253484e49391c6ba3c653a2f9e9f5e5f38ae
-- 
2.43.0