Subject: bug#28462: [PATCH] Re: bug#28462: gnucash dies when generating reports in i3, works in GNOME

From: Maxim Cournoyer <[email-masked]>
Date: Tue, 19 Sep 2017 20:40:51 -0400

Hello Adam,

Adam Van Ymeren <[email-masked]> writes:

> Here's a bug report I've been sitting on for a while.  I've been meaning
> to dig in to it further but haven't had the time so I figured I should
> at least post it in case anyone else has experienced this or knows a fix.
>
> Generating reports in gnucash cause it to die when running in the
> default i3 session.
>
> If I run in the default GNOME session it works fine.
>
> I believe the problem is related to not having a running GSettings
> daemon.

As a ratpoison user, I also suffered from problems caused by the lack of
a GSettings backend when not running Gnome; for example, the preferences
would not be saved across GnuCash restarts.

To fix this, I had to manually install dbus and dconf to my profile. The
attached patch automates this by automatically propagating those
dependencies when GnuCash is installed. It would be nicer to make dbus
and dconf work as regular inputs but this would require patching the
sources; I haven't investigated if how feasible this would be.

Could you try the patch and see if it fixes your issues?

>From 3d6f3da4e8a216ed435777f0a038fc90911503a7 Mon Sep 17 00:00:00 2001
From: Maxim Cournoyer <[email-masked]>
Date: Mon, 20 Feb 2017 18:29:28 -0800
Subject: [PATCH] gnu: gnucash: Propagate dbus and dconf.

This ensures that a GSettings backend is present; this is necessary to persist
the GnuCash settings and state.

* gnu/packages/gnucash.scm (gnucash)[propagated-inputs]: Add dbus and dconf.
[phases]: Define HOME, which prevents multiple warnings at build time.
---
 gnu/packages/gnucash.scm | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/gnu/packages/gnucash.scm b/gnu/packages/gnucash.scm
index ac2dce576..c421df80d 100644
--- a/gnu/packages/gnucash.scm
+++ b/gnu/packages/gnucash.scm
@@ -70,12 +70,19 @@
      `(("glib" ,glib "bin") ; glib-compile-schemas, etc.
        ("intltool" ,intltool)
        ("pkg-config" ,pkg-config)))
+    (propagated-inputs
+     `(("dbus" ,dbus)                   ;enable gsettings preference backend
+       ("dconf" ,dconf)))               ;likewise
     (arguments
      `(#:tests? #f ;FIXME: failing at /qof/gnc-date/qof print date dmy buff
        #:configure-flags '("--disable-dbi"
                            "--enable-aqbanking")
        #:phases
        (modify-phases %standard-phases
+         ;; Avoid build time warnings by setting $HOME.
+         (add-before 'build 'set-home
+                     (lambda _
+                       (setenv "HOME" (getenv "TMPDIR"))))
          (add-after
           'install 'wrap-programs
           (lambda* (#:key inputs outputs #:allow-other-keys)
-- 
2.14.1