diff mbox series

[bug#44596,v2,2/2] gnu: knot-resolver: Move manual, examples to separate "doc" output

Message ID b9a1f915cdb00219c20db681199b44463aee2983.1606831469.git.simon@simonsouth.net
State Accepted
Headers show
Series gnu: knot-resolver: Update to 5.2.0; add "doc" output | expand

Checks

Context Check Description
cbaines/submitting builds success
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch success View Laminar job
cbaines/issue success View issue

Commit Message

Simon South Dec. 1, 2020, 2:45 p.m. UTC
* gnu/packages/dns.scm (knot-resolver)[outputs]: Add "doc" output.
[arguments]<phases>: Add "move-doc" phase, which moves the manual (in both
HTML and Info formats) and example configuration files to the "doc" output.
---
 gnu/packages/dns.scm | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
diff mbox series

Patch

diff --git a/gnu/packages/dns.scm b/gnu/packages/dns.scm
index f0c3d6a602..16313df73f 100644
--- a/gnu/packages/dns.scm
+++ b/gnu/packages/dns.scm
@@ -948,6 +948,7 @@  synthesis, and on-the-fly re-configuration.")
                (patches
                 (search-patches "knot-resolver-fix-map-command-on-32-bit.patch"))))
     (build-system meson-build-system)
+    (outputs '("out" "doc"))
     (arguments
      '(#:configure-flags '("-Ddoc=enabled")
        #:phases
@@ -962,6 +963,20 @@  synthesis, and on-the-fly re-configuration.")
          (add-after 'build 'build-doc
            (lambda _
              (invoke "ninja" "doc")))
+         (add-after 'install 'move-doc
+           (lambda* (#:key outputs #:allow-other-keys)
+             ;; Move the manual and the example configuration files to the
+             ;; "doc" output.
+             (let ((out (assoc-ref outputs "out"))
+                   (doc (assoc-ref outputs "doc")))
+               (mkdir-p (string-append doc "/share/doc/knot-resolver"))
+               (for-each
+                (lambda (dir)
+                  (rename-file (string-append out "/share/" dir)
+                               (string-append doc "/share/" dir)))
+                '("doc/knot-resolver/examples"
+                  "doc/knot-resolver/html"
+                  "info")))))
          (add-after 'install 'wrap-binary
            (lambda* (#:key inputs outputs #:allow-other-keys)
              (let* ((out (assoc-ref outputs "out"))