Subject: [PATCH 02/26] gnu: emacs-ert-runner: Adjust following emacs-build-system changes.

From: Maxim Cournoyer <[email-masked]>
Date: Fri, 18 Dec 2020 17:16:59 -0500

* gnu/packages/emacs-xyz.scm (emacs-ert-runner)[phases]{patch-launcher}: New
phase.
{install-executable}: Adjust.
---
 gnu/packages/emacs-xyz.scm | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/emacs-xyz.scm b/gnu/packages/emacs-xyz.scm
index e242bcf5a8..6ae301aeaf 100644
--- a/gnu/packages/emacs-xyz.scm
+++ b/gnu/packages/emacs-xyz.scm
@@ -12367,6 +12367,14 @@ one if it fails.")
     (arguments
      `(#:phases
        (modify-phases %standard-phases
+         (add-after 'unpack 'patch-launcher
+           ;; Do not use -Q, as this implies not loading site-start.el, which
+           ;; is required to make Guix Elisp library packages discoverable.
+           (lambda _
+             (substitute* "bin/ert-runner"
+               (("-Q")
+                (string-join %emacs-quick-arguments)))
+             #t))
 	 (add-after 'install 'install-executable
 	   (lambda* (#:key inputs outputs #:allow-other-keys)
 	     (let ((out (assoc-ref outputs "out"))
@@ -12374,8 +12382,8 @@ one if it fails.")
 				      (getenv "TMPDIR") "/source")))
 	       (substitute* "bin/ert-runner"
 		 (("ERT_RUNNER=\"\\$\\(dirname \\$\\(dirname \\$0\\)\\)")
-		  (string-append "ERT_RUNNER=\"" out
-				 "/share/emacs/site-lisp")))
+		  (string-append "ERT_RUNNER=\""
+                                 (outputs->elpa-install-dir outputs))))
 	       (install-file "bin/ert-runner" (string-append out "/bin"))
 	       (wrap-program (string-append out "/bin/ert-runner")
 		 (list "EMACSLOADPATH" ":" 'prefix
-- 
2.29.2