summaryrefslogtreecommitdiff
path: root/guix/build-system
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2017-11-05 21:32:02 +0100
committerLudovic Courtès <ludo@gnu.org>2017-11-08 22:43:56 +0100
commita864d563025f7408204af8540f8611a56bd3c939 (patch)
tree8e8ecc1efa95cc3ffb1ae0cc6875e86321d152a0 /guix/build-system
parentdcc00f54c619118d11982383102d2e9a1b86d080 (diff)
downloadgnu-guix-a864d563025f7408204af8540f8611a56bd3c939.tar
gnu-guix-a864d563025f7408204af8540f8611a56bd3c939.tar.gz
build-system/gnu: Add 'install-license-files' phase.
Suggested by Dave Love <fx@gnu.org>. * guix/build-system/gnu.scm (%license-file-regexp): New variable. (gnu-build): Add #:license-file-regexp and use it. (gnu-cross-build): Likewise. * guix/build/gnu-build-system.scm (%license-file-regexp): New variable. (install-license-files): New procedure. (%standard-phases): Add it.
Diffstat (limited to 'guix/build-system')
-rw-r--r--guix/build-system/gnu.scm8
1 files changed, 8 insertions, 0 deletions
diff --git a/guix/build-system/gnu.scm b/guix/build-system/gnu.scm
index 047ace7e6b..f54afe167c 100644
--- a/guix/build-system/gnu.scm
+++ b/guix/build-system/gnu.scm
@@ -273,6 +273,10 @@ standard packages used as implicit inputs of the GNU build system."
(build (if target gnu-cross-build gnu-build))
(arguments (strip-keyword-arguments private-keywords arguments))))
+(define %license-file-regexp
+ ;; Regexp matching license files.
+ "^(COPYING.*|LICEN[CS]E.*|[Ll]icen[cs]e.*|Copy[Rr]ight(\\.(txt|md))?)$")
+
(define* (gnu-build store name input-drvs
#:key (guile #f)
(outputs '("out"))
@@ -291,6 +295,7 @@ standard packages used as implicit inputs of the GNU build system."
(strip-directories ''("lib" "lib64" "libexec"
"bin" "sbin"))
(validate-runpath? #t)
+ (license-file-regexp %license-file-regexp)
(phases '%standard-phases)
(locale "en_US.utf8")
(system (%current-system))
@@ -358,6 +363,7 @@ packages that must not be referenced."
#:patch-shebangs? ,patch-shebangs?
#:strip-binaries? ,strip-binaries?
#:validate-runpath? ,validate-runpath?
+ #:license-file-regexp ,license-file-regexp
#:strip-flags ,strip-flags
#:strip-directories ,strip-directories)))
@@ -432,6 +438,7 @@ is one of `host' or `target'."
(strip-directories ''("lib" "lib64" "libexec"
"bin" "sbin"))
(validate-runpath? #t)
+ (license-file-regexp %license-file-regexp)
(phases '%standard-phases)
(locale "en_US.utf8")
(system (%current-system))
@@ -509,6 +516,7 @@ platform."
#:patch-shebangs? ,patch-shebangs?
#:strip-binaries? ,strip-binaries?
#:validate-runpath? ,validate-runpath?
+ #:license-file-regexp ,license-file-regexp
#:strip-flags ,strip-flags
#:strip-directories ,strip-directories))))