Subject: [bug#42885] [PATCHES] 2 more fixes.

From: Brendan Tildesley <[email-masked]>
Date: Sun, 21 Mar 2021 08:00:15 +0100 (CET)

These two patches go after the last 27 patches, fixing up some mistakes I made earlier.
From a222592c08909b67ff2334f617a7b273cc5ab082 Mon Sep 17 00:00:00 2001
From: Brendan Tildesley <[email-masked]>
Date: Sat, 20 Mar 2021 21:28:22 +1100
Subject: [PATCH 1/2] gnu: calibre: Don't install junk temporary files.

* gnu/packages/ebook.scm (calibre):
[arguments]: Unset XDG_DATA_HOME just for installing rapydscript so that
Qtwebengine temporary files aren't put in /share/. Moving the phase
until after the install phase prevents breaking .desktop file installation.
---
 gnu/packages/ebook.scm | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/ebook.scm b/gnu/packages/ebook.scm
index 25a31c9a65..b55af5c865 100644
--- a/gnu/packages/ebook.scm
+++ b/gnu/packages/ebook.scm
@@ -282,8 +282,10 @@ sip-include-dirs = [\"" pyqt "/share/sip" "\"]")))
               ;; AssertionError: b'Skia/PDF' not found in b'' : Print to PDF failed
               (setenv "SKIP_QT_BUILD_TEST" "true")
               #t)))
-         (add-after 'build 'build-extra
+         (add-after 'install 'install-rapydscript
            (lambda* (#:key inputs #:allow-other-keys)
+              ;; Unset so QtWebengine doesn't dump temporary files here.
+             (unsetenv "XDG_DATA_HOME")
              (invoke "python" "setup.py" "rapydscript")
              #t))
          (add-after 'install 'install-man-pages
-- 
2.30.2

From f8fe46256cbfe211b1bbbb624651cfc5b261ee32 Mon Sep 17 00:00:00 2001
From: Brendan Tildesley <[email-masked]>
Date: Sun, 21 Mar 2021 17:18:13 +1100
Subject: [PATCH 2/2] gnu: calibre: Don't delete needed files.

* gnu/packages/ebook.scm (calibre)[snippet]: Don't delete viewer.js
since it's actually used by the html reader.
---
 gnu/packages/ebook.scm | 2 --
 1 file changed, 2 deletions(-)

diff --git a/gnu/packages/ebook.scm b/gnu/packages/ebook.scm
index b55af5c865..6fb525a2c2 100644
--- a/gnu/packages/ebook.scm
+++ b/gnu/packages/ebook.scm
@@ -136,8 +136,6 @@
                 ""))
 
              ;; Remove unneeded resources.
-             (delete-file "resources/viewer.js")
-             (delete-file "resources/viewer.html")
              (delete-file "resources/mozilla-ca-certs.pem")
              (delete-file "resources/calibre-portable.bat")
              (delete-file "resources/calibre-portable.sh")
-- 
2.30.2