Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 651200 - app-office/gnucash: Add USE=gtk
Summary: app-office/gnucash: Add USE=gtk
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal enhancement (vote)
Assignee: Aaron W. Swenson
URL: https://bugzilla.gnome.org/show_bug.c...
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2018-03-22 21:07 UTC by Reimundo Heluani
Modified: 2018-09-02 10:59 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
patch on cmakefiles to compile without gnucash (gnucash_compile_without_webkit.patch,1.30 KB, patch)
2018-03-22 21:07 UTC, Reimundo Heluani
Details | Diff
changes in the ebuild to compile without gnucash (gnucash-ebuild.patch,2.62 KB, patch)
2018-03-22 21:08 UTC, Reimundo Heluani
Details | Diff
Patch for version 3.2 CMAKE Files (gnucash_compile_without_webkit.patch,440 bytes, patch)
2018-08-22 11:55 UTC, Reimundo Heluani
Details | Diff
Ebuild for 3.2 (gnucash-3.2-r1.ebuild,3.91 KB, text/plain)
2018-08-22 11:55 UTC, Reimundo Heluani
Details
Build log of 3.2 obscure failiure in the end. (build.log,658.05 KB, text/x-log)
2018-08-22 11:56 UTC, Reimundo Heluani
Details
ebuild for 3.2 (gnucash-3.2-r1.ebuild,3.92 KB, text/plain)
2018-08-22 12:42 UTC, Reimundo Heluani
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Reimundo Heluani 2018-03-22 21:07:42 UTC
Created attachment 524934 [details, diff]
patch on cmakefiles to compile without gnucash

gnucash comes with heavy required packages, specially webkit-gtk and gtk+. For those of us that have some gnucash databases and need to process them in systems without gtk (in particular no gnome nor webkit-gtk) it would be useful to have a way to install libgnucash without installing gnucash. 

upstream provides a way of compiling libgnucash and not gnucash with -DWITH_GNUCASH=NO. I've ran into some small compilation issues but I managed to get with minor changes on the ebuild a working system with libgnucash installed and not gnucash. I am attaching the diffs I used in case anyone is interested. These are certainly not production ebuilds since I just got rid of the docs (instead of solving for the missing gnucash.1 file that CMake would complain otherwise) and I got rid of scm-gnome-utils which I don't know if it will bite me later. But a little testing shows my scripts work parsing my gnucash databases.
Comment 1 Reimundo Heluani 2018-03-22 21:08:37 UTC
Created attachment 524936 [details, diff]
changes in the ebuild to compile without gnucash
Comment 2 Mart Raudsepp gentoo-dev 2018-03-25 19:07:16 UTC
IUSE=+gui would sound more appropriate to me, really.
Comment 3 Pacho Ramos gentoo-dev 2018-03-28 18:31:28 UTC
(In reply to Mart Raudsepp from comment #2)
> IUSE=+gui would sound more appropriate to me, really.

I agree, also, please forward your patch to upstream too -> bugzilla.gnome.org

Thanks
Comment 4 Reimundo Heluani 2018-03-29 11:50:18 UTC
(In reply to Pacho Ramos from comment #3)
> (In reply to Mart Raudsepp from comment #2)
> > IUSE=+gui would sound more appropriate to me, really.
> 
> I agree, also, please forward your patch to upstream too ->
> bugzilla.gnome.org
> 
> Thanks

I have already opened a bug in 

https://bugzilla.gnome.org/show_bug.cgi?id=794617
Comment 5 Reimundo Heluani 2018-07-23 10:29:37 UTC
Gnucash has moved their bugzilla and this bug is now tracked in 

https://bugs.gnucash.org/show_bug.cgi?id=794617

It seems that the compilation issues have been solved upstream. I would still recommend a gtk (or gui or whatever) use flag in the Gentoo ebuild.
Comment 6 Aaron W. Swenson gentoo-dev 2018-08-11 11:49:49 UTC
Would you redo this for 3.2? I think upstream has fixed the cmakefiles.

I'll do a revbump with whatever changes are needed.
Comment 7 Mart Raudsepp gentoo-dev 2018-08-11 11:57:00 UTC
(In reply to Mart Raudsepp from comment #2)
> IUSE=+gui would sound more appropriate to me, really.
Comment 8 Reimundo Heluani 2018-08-22 11:53:09 UTC
(In reply to Aaron W. Swenson from comment #6)
> Would you redo this for 3.2? I think upstream has fixed the cmakefiles.
> 
> I'll do a revbump with whatever changes are needed.

The fix upstream still does not work for me, I  still need to get rid of the doc directory or CMAKE will complain about some file, so still need to apply part of the previous patch:

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5e10a09..cdbdb7a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -770,7 +770,9 @@ set(SCHEME_INSTALLED_CACHE_DIR ${PKGLIBDIR}/scm/ccache/${GUILE_EFFECTIVE_VERSION
 # The subdirectories
 add_subdirectory (borrowed)
 add_subdirectory (data)
+if (WITH_GNUCASH)
 add_subdirectory (doc)
+endif (WITH_GNUCASH)
 add_subdirectory (po)
 add_subdirectory (common)
 add_subdirectory (libgnucash)

3.2 builds fine with the attached ebuild. Unfortunately it fails in install without any descriptive error. This might be related to upgrading python yesterday here. I'm posting the build.log and the patch and ebuild for 3.2 that I used.
Comment 9 Reimundo Heluani 2018-08-22 11:53:23 UTC
(In reply to Aaron W. Swenson from comment #6)
> Would you redo this for 3.2? I think upstream has fixed the cmakefiles.
> 
> I'll do a revbump with whatever changes are needed.

The fix upstream still does not work for me, I  still need to get rid of the doc directory or CMAKE will complain about some file, so still need to apply part of the previous patch:

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5e10a09..cdbdb7a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -770,7 +770,9 @@ set(SCHEME_INSTALLED_CACHE_DIR ${PKGLIBDIR}/scm/ccache/${GUILE_EFFECTIVE_VERSION
 # The subdirectories
 add_subdirectory (borrowed)
 add_subdirectory (data)
+if (WITH_GNUCASH)
 add_subdirectory (doc)
+endif (WITH_GNUCASH)
 add_subdirectory (po)
 add_subdirectory (common)
 add_subdirectory (libgnucash)

3.2 builds fine with the attached ebuild. Unfortunately it fails in install without any descriptive error. This might be related to upgrading python yesterday here. I'm posting the build.log and the patch and ebuild for 3.2 that I used.
Comment 10 Reimundo Heluani 2018-08-22 11:55:26 UTC
Created attachment 544446 [details, diff]
Patch for version 3.2 CMAKE Files
Comment 11 Reimundo Heluani 2018-08-22 11:55:55 UTC
Created attachment 544448 [details]
Ebuild for 3.2
Comment 12 Reimundo Heluani 2018-08-22 11:56:54 UTC
Created attachment 544450 [details]
Build log of 3.2 obscure failiure in the end.
Comment 13 Mart Raudsepp gentoo-dev 2018-08-22 12:28:39 UTC
I think it should be default enabled, thus IUSE=+gui, not just gui.
Why is gnome-common conditional to USE=gui? That makes no sense, given what gnome-common is. HOWEVER, it doesn't make any sense at all, as gnome-common ships some m4macro files, which are for autotools, but afaik, we use cmake here, so I suspect gnome-common as dep as a whole is redundant.
Comment 14 Reimundo Heluani 2018-08-22 12:42:39 UTC
Created attachment 544454 [details]
ebuild for 3.2
Comment 15 Reimundo Heluani 2018-08-22 12:43:35 UTC
(In reply to Mart Raudsepp from comment #13)
> I think it should be default enabled, thus IUSE=+gui, not just gui.
> Why is gnome-common conditional to USE=gui? That makes no sense, given what
> gnome-common is. HOWEVER, it doesn't make any sense at all, as gnome-common
> ships some m4macro files, which are for autotools, but afaik, we use cmake
> here, so I suspect gnome-common as dep as a whole is redundant.

I think you're right, but I can't test it here, that's why I added that flag instead of removing gnome-common (which I didn't want to install anyway). Incidentally it was a stupid mistake on my part that prevented installing. Now it's working fine here 3.2 without gtk
Comment 16 Mart Raudsepp gentoo-dev 2018-08-22 12:44:39 UTC
I'd remove it, it only ships m4, which even with autotools would be needed only if eautoreconf is ran
Comment 17 Larry the Git Cow gentoo-dev 2018-08-29 10:48:06 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=37c1feba2c76814bb66da36d7fd8916396a99037

commit 37c1feba2c76814bb66da36d7fd8916396a99037
Author:     Aaron W. Swenson <titanofold@gentoo.org>
AuthorDate: 2018-08-29 10:47:53 +0000
Commit:     Aaron W. Swenson <titanofold@gentoo.org>
CommitDate: 2018-08-29 10:47:53 +0000

    app-office/gnucash: Add option to disable GUI
    
    Thanks to Reimundo Heluani for working on this.
    
    Closes: https://bugs.gentoo.org/651200
    Package-Manager: Portage-2.3.40, Repoman-2.3.9

 app-office/gnucash/files/gnucash-3.2-no-gui.patch |  14 ++
 app-office/gnucash/gnucash-3.2-r1.ebuild          | 173 ++++++++++++++++++++++
 app-office/gnucash/metadata.xml                   |   4 +
 3 files changed, 191 insertions(+)
Comment 18 Mart Raudsepp gentoo-dev 2018-08-29 11:18:44 UTC
What happened about comment #13 and #16?
Comment 19 Aaron W. Swenson gentoo-dev 2018-09-01 20:49:44 UTC
(In reply to Mart Raudsepp from comment #18)
> What happened about comment #13 and #16?

Eh, I thought the changes were already made.

And, I've looked through the code now, gnome-common is mentioned anywhere. And, the functions provided by it aren't called either, so we can safely remove the dependency.

I'm doing another revbump.
Comment 20 Mart Raudsepp gentoo-dev 2018-09-01 21:15:19 UTC
revbump isn't necessary if it's just this change. It's a build time depend only and various other things would pull it in anyways, etc.
Comment 21 Larry the Git Cow gentoo-dev 2018-09-02 10:59:05 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a01091ba11a5bbb94aebcb04bfee6c8df7b7de22

commit a01091ba11a5bbb94aebcb04bfee6c8df7b7de22
Author:     Aaron W. Swenson <titanofold@gentoo.org>
AuthorDate: 2018-09-02 10:58:50 +0000
Commit:     Aaron W. Swenson <titanofold@gentoo.org>
CommitDate: 2018-09-02 10:58:50 +0000

    app-office/gnucash: Drop gnome-common, src_prepare
    
    The dependency on gnome-base/gnome-common turned out to be entirely
    unnecessary. There are no functions from that package that are needed
    by Gnucash’s build system.
    
    Drop the src_prepare and apply the no-gui.patch
    unconditionally. Whether it has an effect depends on the build flag
    being enabled.
    
    Bug: https://bugs.gentoo.org/651200
    Closes: https://bugs.gentoo.org/664916
    Package-Manager: Portage-2.3.40, Repoman-2.3.9

 app-office/gnucash/gnucash-3.2-r2.ebuild | 169 +++++++++++++++++++++++++++++++
 1 file changed, 169 insertions(+)