Subject: bug#36728: LibreOffice fails to open hyperlinks

From: Chris Marusich <[email-masked]>
Date: Thu, 18 Jul 2019 22:17:46 -0700

Chris Marusich <[email-masked]> writes:

> I have a fix and will post it in a moment.

I've verified that the attached patch fixes the issue.  It took over 4
hours to build libreoffice on 1 core on my x200 laptop (not including
the time it took to build dependencies).  I would normally push this
directly to master because no packages depend on libreoffice, but the
long build time gave me pause.

Should I commit this change to master or to somewhere else?

-- 
Chris
From fd8875e9c8c7403f979617aa689661e2c33e36ed Mon Sep 17 00:00:00 2001
From: Chris Marusich <[email-masked]>
Date: Mon, 15 Jul 2019 22:42:07 -0700
Subject: [PATCH] gnu: libreoffice: Fix xdg-open absolute paths.

Fixes: <https://bugs.gnu.org/36728>.

* gnu/packages/libreoffice.scm (libreoffice) [inputs]: Add xdg-utils.
[arguments][#:phases][prepare-src]: Replace hard-coded absolute paths to
xdg-open in the source with the path to xdg-open in the xdg-utils input.
---
 gnu/packages/libreoffice.scm | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/gnu/packages/libreoffice.scm b/gnu/packages/libreoffice.scm
index 9f5bedd913..026ce92aab 100644
--- a/gnu/packages/libreoffice.scm
+++ b/gnu/packages/libreoffice.scm
@@ -11,6 +11,7 @@
 ;;; Copyright © 2017 Rutger Helling <[email-masked]>
 ;;; Copyright © 2018, 2019 Ricardo Wurmus <[email-masked]>
 ;;; Copyright © 2018 Jonathan Brielmaier <[email-masked]>
+;;; Copyright © 2019 Chris Marusich <[email-masked]>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -53,6 +54,7 @@
   #:use-module (gnu packages documentation)
   #:use-module (gnu packages flex)
   #:use-module (gnu packages fontutils)
+  #:use-module (gnu packages freedesktop)
   #:use-module (gnu packages ghostscript)
   #:use-module (gnu packages gl)
   #:use-module (gnu packages glib)
@@ -1045,6 +1047,7 @@ converting QuarkXPress file format.  It supports versions 3.1 to 4.1.")
        ("unixodbc" ,unixodbc)
        ("unzip" ,unzip)
        ("vigra" ,vigra)
+       ("xdg-utils" ,xdg-utils)
        ("xmlsec" ,xmlsec-nss)
        ("zip" ,zip)))
     (arguments
@@ -1077,6 +1080,13 @@ converting QuarkXPress file format.  It supports versions 3.1 to 4.1.")
                                  (assoc-ref inputs "gpgme")
                                  "/include/gpgme++")))
 
+               ;; /usr/bin/xdg-open doesn't exist on Guix System.
+               (substitute* '("shell/source/unix/exec/shellexec.cxx"
+                              "shell/source/unix/misc/senddoc.sh")
+                 (("/usr/bin/xdg-open")
+                  (string-append (assoc-ref inputs "xdg-utils")
+                                 "/bin/xdg-open")))
+
                #t))
            (add-after 'install 'bin-and-desktop-install
              ;; Create 'soffice' and 'libreoffice' symlinks to the executable
-- 
2.20.1