all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* How to package gnucash-docs
@ 2017-09-06 10:42 Chris Marusich
  2017-09-07  8:33 ` Ludovic Courtès
  0 siblings, 1 reply; 2+ messages in thread
From: Chris Marusich @ 2017-09-06 10:42 UTC (permalink / raw)
  To: guix-devel


[-- Attachment #1.1: Type: text/plain, Size: 1128 bytes --]

Hi,

I've noticed that the "help document" for GnuCash doesn't show up in
Yelp on GNOME.  Apparently, this is because most (if not all) of the
GnuCash documentation is packaged separately in gnucash-docs, which
hasn't been added to Guix yet.  I've added it successfully (see attached
patch), but I'm looking for guidance on how to make the following
improvements.

First, "make check" fails because xmllint tries to look up a DTD on the
Internet when validating the XML for dozens of documents.  This isn't a
huge problem because I can simply skip the tests.  I've manually
verified that at least some of the documentation shows up correctly (in
multiple languages, even!) in Yelp on GNOME, which is better than no
documentation at all.  However, it'd be nice if I could make the tests
pass.  Is there any trick for making xmllint work in a sandboxed build?

Second, I'm not sure if gnucash-docs should exist as a separate package
in Guix.  I feel like it would be nicer if I could just add this as a
"doc" output of the gnucash package.  How can I accomplish that?

Thank you for your help!

-- 
Chris

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: 0001-gnu-Add-gnucash-docs.patch --]
[-- Type: text/x-patch, Size: 3116 bytes --]

From 89eca236514f7c86bdf0f6d93d4348bb0cab43bc Mon Sep 17 00:00:00 2001
From: Chris Marusich <cmmarusich@gmail.com>
Date: Wed, 6 Sep 2017 03:15:05 -0700
Subject: [PATCH] gnu: Add gnucash-docs.

* gnu/packages/gnucash.scm (gnucash-docs): Add it.
---
 gnu/packages/gnucash.scm | 39 ++++++++++++++++++++++++++++++++++++++-
 1 file changed, 38 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/gnucash.scm b/gnu/packages/gnucash.scm
index ac2dce576..2d71e89dd 100644
--- a/gnu/packages/gnucash.scm
+++ b/gnu/packages/gnucash.scm
@@ -23,8 +23,11 @@
   #:use-module (guix packages)
   #:use-module (guix download)
   #:use-module (guix build-system gnu)
+  #:use-module (guix build-system glib-or-gtk)
   #:use-module (gnu packages)
   #:use-module (gnu packages autotools)
+  #:use-module (gnu packages docbook)
+  #:use-module (gnu packages documentation)
   #:use-module (gnu packages gnome)
   #:use-module (gnu packages gnupg)
   #:use-module (gnu packages glib)
@@ -52,7 +55,7 @@
        (base32
         "0g2risryfgplxh6cxpsl7fn255vipgsx38b4l081h665nqwmz5nv"))
       (patches (search-patches "gnucash-price-quotes-perl.patch"))))
-    (build-system gnu-build-system)
+    (build-system glib-or-gtk-build-system)
     (inputs
      `(("guile" ,guile-2.0)
        ("icu4c" ,icu4c)
@@ -114,6 +117,40 @@ import and transaction matching.  It also automates several tasks, such as
 financial calculations or scheduled transactions.")
     (license license:gpl3+)))
 
+(define-public gnucash-docs
+  (package
+    (name "gnucash-docs")
+    (version (package-version gnucash))
+    (source
+     (origin
+      (method url-fetch)
+      (uri (string-append "mirror://sourceforge/gnucash/gnucash-docs/"
+                          version "/gnucash-docs-" version ".tar.gz"))
+      (sha256
+       (base32
+        "0dfb4m4084apav9kjsc4mfbj99xsyxm59qhpm1nxvhybn5h6qr3r"))))
+    (build-system gnu-build-system)
+    ;; These are native-inputs because they seem to only be required for
+    ;; building the documentation.
+    (native-inputs
+     `(("libxml2" ,libxml2)
+       ("libxslt" ,libxslt)
+       ("docbook-xsl" ,docbook-xsl)
+       ("scrollkeeper" ,scrollkeeper)))
+    ;; Disable tests since xmllint tries to access the Internet, which fails.
+    ;; We can enable tests if we figure out how to make it work offline.
+    (arguments '(#:tests? #f))
+    (home-page "http://www.gnucash.org/")
+    (synopsis "Documentation for GnuCash")
+    (description
+     "User guide and other documentation for GnuCash in various languages.
+This package exists because the GnuCash project maintains its documentation in
+an entirely separate package from the actual GnuCash program.  To read the
+documentation, install this package and then access the program's help as
+usual, either from within GnuCash or by directly using your desktop
+environment's help reader (e.g. Yelp in the case of GNOME.)")
+    (license (list license:fdl1.1+ license:gpl3+))))
+
 (define-public gwenhywfar
   (package
     (name "gwenhywfar")
-- 
2.14.1


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: How to package gnucash-docs
  2017-09-06 10:42 How to package gnucash-docs Chris Marusich
@ 2017-09-07  8:33 ` Ludovic Courtès
  0 siblings, 0 replies; 2+ messages in thread
From: Ludovic Courtès @ 2017-09-07  8:33 UTC (permalink / raw)
  To: Chris Marusich; +Cc: guix-devel

Hello!

Chris Marusich <cmmarusich@gmail.com> skribis:

> First, "make check" fails because xmllint tries to look up a DTD on the
> Internet when validating the XML for dozens of documents.

Usually it’s a matter of defining XML_CATALOG_FILES (which happens
automatically if libxml2 is an input), or something similar.  If you
grep gnu/packages/*.scm, you’ll find instances of this that either add
libxml2 as an input, or modify the XML DTD URL to refer to the local
DTD.

> Second, I'm not sure if gnucash-docs should exist as a separate package
> in Guix.  I feel like it would be nicer if I could just add this as a
> "doc" output of the gnucash package.  How can I accomplish that?

If upstream makes it a separate package, I think it’s OK to make it a
separate package too.

Now, if you really want to make it a single package, it’s also possible,
by simply adding extra phases in ‘gnucash’ to build the doc.

HTH!

Ludo’.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-09-07  8:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-06 10:42 How to package gnucash-docs Chris Marusich
2017-09-07  8:33 ` Ludovic Courtès

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.