mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-27 14:52:05 -05:00
build-system/gnu: Copy license files to all the outputs.
Fixes <https://bugs.gnu.org/34702>. Reported by Leo Famulari <leo@famulari.name>. * guix/build/gnu-build-system.scm (install-license-files)[copy-to-directories]: New procedure. Call it to copy license files to all the outputs.
This commit is contained in:
parent
278409e7e9
commit
6db044db45
1 changed files with 14 additions and 5 deletions
|
@ -758,13 +758,23 @@ (define (find-source-directory package)
|
|||
(string-append "../" directory)))
|
||||
directories))))
|
||||
|
||||
(define (copy-to-directories directories sub-directory)
|
||||
(lambda (file)
|
||||
(for-each (if (file-is-directory? file)
|
||||
(cut copy-recursively file <>)
|
||||
(cut install-file file <>))
|
||||
(map (cut string-append <> "/" sub-directory)
|
||||
directories))))
|
||||
|
||||
(let* ((regexp (make-regexp license-file-regexp))
|
||||
(out (or (assoc-ref outputs "out")
|
||||
(match outputs
|
||||
(((_ . output) _ ...)
|
||||
output))))
|
||||
(package (strip-store-file-name out))
|
||||
(directory (string-append out "/share/doc/" package))
|
||||
(outputs (match outputs
|
||||
(((_ . outputs) ...)
|
||||
outputs)))
|
||||
(source (if out-of-source?
|
||||
(find-source-directory
|
||||
(package-name->name+version package))
|
||||
|
@ -777,10 +787,9 @@ (define (find-source-directory package)
|
|||
(begin
|
||||
(format #t "installing ~a license files from '~a'~%"
|
||||
(length files) source)
|
||||
(for-each (lambda (file)
|
||||
(if (file-is-directory? file)
|
||||
(copy-recursively file directory)
|
||||
(install-file file directory)))
|
||||
(for-each (copy-to-directories outputs
|
||||
(string-append "share/doc/"
|
||||
package))
|
||||
(map (cut string-append source "/" <>) files)))
|
||||
(format (current-error-port)
|
||||
"failed to find license files~%"))
|
||||
|
|
Loading…
Reference in a new issue