Subject: [PATCH] gnu: xournalpp: Fix path to addr2line binary
From: Lars-Dominik Braun <[email-masked]>
To: [email-masked]
Date: Sun, 6 Sep 2020 17:31:46 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

Hi,

I noticed xournalpp’s crash reporter depends on binutils’ addr2line
binary. When running `guix environment --pure --ad-hoc xournalpp --
xournalpp` you can see lines like `sh: addr2line: command not found`.
The attached patch replaces the path by the build-time binutil’s
version.

Cheers,
Lars
From ab65a639b2af2eb67ab325d2bdf0fab07157d9d3 Mon Sep 17 00:00:00 2001
From: Lars-Dominik Braun <[email-masked]>
Date: Sun, 6 Sep 2020 17:27:54 +0200
Subject: [PATCH] gnu: xournalpp: Fix path to addr2line binary

* gnu/packages/pdf.scm [arguments]: Add phase substituting path of
addr2line utility.
---
 gnu/packages/pdf.scm | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/gnu/packages/pdf.scm b/gnu/packages/pdf.scm
index 7649bff695..4c11111323 100644
--- a/gnu/packages/pdf.scm
+++ b/gnu/packages/pdf.scm
@@ -848,6 +848,14 @@ using a stylus.")
              (for-each (lambda (po) (chmod po #o666))
                        (find-files "." "\\.po$"))
              #t))
+         ;; Fix path to addr2line utility, which the crash reporter uses.
+         (add-after 'unpack 'fix-paths
+           (lambda* (#:key inputs #:allow-other-keys)
+             (substitute* "src/util/Stacktrace.cpp"
+               ;; Match only the commandline.
+               (("\"addr2line ")
+                (string-append "\"" (which "addr2line") " ")))
+             #t))
          (add-after 'install 'glib-or-gtk-wrap
            (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-wrap)))))
     (native-inputs
-- 
2.26.2