diff mbox series

[bug#60826,gnome-team,v4,4/4] gnu: shared-mime-info: Add doc output.

Message ID c31e467318325128e49fc045315ce0e817d789bb.1687462396.git.mirai@makinata.eu
State New
Headers show
Series None | expand

Commit Message

Bruno Victal June 22, 2023, 7:33 p.m. UTC
* gnu/packages/freedesktop.scm (shared-mime-info)
[arguments]<#:phases>: Add 'install-doc phase.
[outputs]: Add 'doc' output.
[native-inputs]: Add docbook-xml-4.1.2, docbook-xsl and xmlto.
---
 gnu/packages/freedesktop.scm | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

Comments

Liliana Marie Prikler June 22, 2023, 7:56 p.m. UTC | #1
Am Donnerstag, dem 22.06.2023 um 20:33 +0100 schrieb Bruno Victal:
> * gnu/packages/freedesktop.scm (shared-mime-info)
> [arguments]<#:phases>: Add 'install-doc phase.
> [outputs]: Add 'doc' output.
> [native-inputs]: Add docbook-xml-4.1.2, docbook-xsl and xmlto.
For the commit message, "Install documentation." is preferable.  The
ChangeLog LGTM, for the implementation I'll wait for CI.

Cheers
Liliana Marie Prikler June 25, 2023, 6:21 a.m. UTC | #2
Am Donnerstag, dem 22.06.2023 um 21:56 +0200 schrieb Liliana Marie
Prikler:
> Am Donnerstag, dem 22.06.2023 um 20:33 +0100 schrieb Bruno Victal:
> > * gnu/packages/freedesktop.scm (shared-mime-info)
> > [arguments]<#:phases>: Add 'install-doc phase.
> > [outputs]: Add 'doc' output.
> > [native-inputs]: Add docbook-xml-4.1.2, docbook-xsl and xmlto.
> For the commit message, "Install documentation." is preferable.  The
> ChangeLog LGTM, for the implementation I'll wait for CI.
Pushed with some of the announced changes, though notably I forgot to
the headline of this commit.

Cheers
diff mbox series

Patch

diff --git a/gnu/packages/freedesktop.scm b/gnu/packages/freedesktop.scm
index b16fa5d387..65781fed11 100644
--- a/gnu/packages/freedesktop.scm
+++ b/gnu/packages/freedesktop.scm
@@ -545,11 +545,24 @@  (define-public shared-mime-info
                                  (not (string-prefix? "./tests/mime-detection"
                                                       file))))))
                 (for-each patch-shebang
-                          (find-files "." pred #:stat lstat))))))))
+                          (find-files "." pred #:stat lstat)))))
+          ;; The docs have no install rule.
+          (add-after 'install 'install-doc
+            (lambda* (#:key source #:allow-other-keys)
+              (let ((dest (string-append #$output:doc "/share/doc")))
+                (with-directory-excursion "data/shared-mime-info-spec-html"
+                  (install-file "shared-mime-info-spec.html"
+                                (string-append dest "/html")))
+                (install-file (string-append source
+                                             "/data/shared-mime-info-spec.xml")
+                              dest)))))))
     (inputs
      (list glib libxml2))
     (native-inputs
-     (list gettext-minimal pkg-config python xdgmime))
+     (list gettext-minimal pkg-config python xdgmime
+           ;; For 'doc' output.
+           docbook-xml-4.1.2 docbook-xsl xmlto))
+    (outputs (list "out" "doc"))
     (home-page "https://www.freedesktop.org/wiki/Software/shared-mime-info")
     (synopsis "Database of common MIME types")
     (description