diff options
Diffstat (limited to 'guix/build')
-rw-r--r-- | guix/build/cmake-build-system.scm | 3 | ||||
-rw-r--r-- | guix/build/gnu-build-system.scm | 27 | ||||
-rw-r--r-- | guix/build/utils.scm | 1 |
3 files changed, 31 insertions, 0 deletions
diff --git a/guix/build/cmake-build-system.scm b/guix/build/cmake-build-system.scm index 128ab28fe5..c82d9fef87 100644 --- a/guix/build/cmake-build-system.scm +++ b/guix/build/cmake-build-system.scm @@ -2,6 +2,7 @@ ;;; Copyright © 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org> ;;; Copyright © 2013 Cyril Roelandt <tipecaml@gmail.com> ;;; Copyright © 2014, 2015 Andreas Enge <andreas@enge.fr> +;;; Copyright © 2017 Efraim Flashner <efraim@flashner.co.il> ;;; ;;; This file is part of GNU Guix. ;;; @@ -53,6 +54,8 @@ build-type)) '()) ,(string-append "-DCMAKE_INSTALL_PREFIX=" out) + ;; ensure that the libraries are installed into /lib + "-DCMAKE_INSTALL_LIBDIR=lib" ;; add input libraries to rpath "-DCMAKE_INSTALL_RPATH_USE_LINK_PATH=TRUE" ;; add (other) libraries of the project itself to rpath diff --git a/guix/build/gnu-build-system.scm b/guix/build/gnu-build-system.scm index e37b751403..7b43361f99 100644 --- a/guix/build/gnu-build-system.scm +++ b/guix/build/gnu-build-system.scm @@ -29,6 +29,7 @@ #:use-module (srfi srfi-26) #:use-module (rnrs io ports) #:export (%standard-phases + %license-file-regexp gnu-build)) ;; Commentary: @@ -641,6 +642,31 @@ which cannot be found~%" outputs) #t) +(define %license-file-regexp + ;; Regexp matching license files. + "^(COPYING.*|LICEN[CS]E.*|[Ll]icen[cs]e.*|Copy[Rr]ight(\\.(txt|md))?)$") + +(define* (install-license-files #:key outputs + (license-file-regexp %license-file-regexp) + #:allow-other-keys) + "Install license files matching LICENSE-FILE-REGEXP to 'share/doc'." + (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)) + (files (scandir "." (lambda (file) + (regexp-exec regexp file))))) + (format #t "installing ~a license files~%" (length files)) + (for-each (lambda (file) + (if (file-is-directory? file) + (copy-recursively file directory) + (install-file file directory))) + files) + #t)) + (define %standard-phases ;; Standard build phases, as a list of symbol/procedure pairs. (let-syntax ((phases (syntax-rules () @@ -654,6 +680,7 @@ which cannot be found~%" validate-documentation-location delete-info-dir-file patch-dot-desktop-files + install-license-files reset-gzip-timestamps compress-documentation))) diff --git a/guix/build/utils.scm b/guix/build/utils.scm index 7391307c87..d7ed3d5177 100644 --- a/guix/build/utils.scm +++ b/guix/build/utils.scm @@ -29,6 +29,7 @@ #:use-module (ice-9 regex) #:use-module (ice-9 rdelim) #:use-module (ice-9 format) + #:use-module (ice-9 threads) #:use-module (rnrs bytevectors) #:use-module (rnrs io ports) #:re-export (alist-cons |