gnu: knot-resolver: Move manual, examples to separate "doc" output

* 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.

Signed-off-by: 宋文武 <iyzsong@member.fsf.org>
This commit is contained in:
Simon South 2020-12-01 09:45:20 -05:00 committed by 宋文武
parent 4fcff59091
commit 74e3c37ae0
No known key found for this signature in database
GPG key ID: D415BF253B515976

View file

@ -949,6 +949,7 @@ (define-public knot-resolver
(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
@ -963,6 +964,20 @@ (define-public knot-resolver
(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"))