aboutsummaryrefslogtreecommitdiff
path: root/guix/build/gnu-build-system.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2012-09-06 22:58:43 +0200
committerLudovic Courtès <ludo@gnu.org>2012-09-06 22:58:43 +0200
commit2d14ef0f2ce486fceeeff69cc838c652bb5de9be (patch)
treec4dffd5fb2f0722b600956affbb9cb477c5473b7 /guix/build/gnu-build-system.scm
parent9d9ef458e8bad9fddcee071038d18d6c27f448c2 (diff)
downloadgnu-guix-2d14ef0f2ce486fceeeff69cc838c652bb5de9be.tar
gnu-guix-2d14ef0f2ce486fceeeff69cc838c652bb5de9be.tar.gz
build-system/gnu: Fix `#:path-exclusions' handling.
* guix/build/gnu-build-system.scm (set-paths)[relevant-input-directories]: New procedure. Use it. This fixes #:path-exclusions handling.
Diffstat (limited to 'guix/build/gnu-build-system.scm')
-rw-r--r--guix/build/gnu-build-system.scm60
1 files changed, 28 insertions, 32 deletions
diff --git a/guix/build/gnu-build-system.scm b/guix/build/gnu-build-system.scm
index c57bc60d24..112b34cd4d 100644
--- a/guix/build/gnu-build-system.scm
+++ b/guix/build/gnu-build-system.scm
@@ -49,38 +49,34 @@
(define* (set-paths #:key inputs (path-exclusions '())
#:allow-other-keys)
- (let ((inputs (map cdr inputs)))
- (set-path-environment-variable "PATH" '("bin")
- (remove (cute member <>
- (or (assoc-ref path-exclusions
- "PATH")
- '()))
- inputs))
- (set-path-environment-variable "CPATH" '("include")
- (remove (cute member <>
- (or (assoc-ref path-exclusions
- "CPATH")
- '()))
- inputs))
- (set-path-environment-variable "LIBRARY_PATH" '("lib" "lib64")
- (remove (cute member <>
- (or (assoc-ref path-exclusions
- "LIBRARY_PATH")
- '()))
- inputs))
-
- ;; FIXME: Eventually move this to the `search-paths' field of the
- ;; `pkg-config' package.
- (set-path-environment-variable "PKG_CONFIG_PATH"
- '("lib/pkgconfig" "lib64/pkgconfig")
- (remove (cute member <>
- (or (assoc-ref path-exclusions
- "PKG_CONFIG_PATH")
- '()))
- inputs))
-
- ;; Dump the environment variables as a shell script, for handy debugging.
- (system "export > environment-variables")))
+ (define (relevant-input-directories env-var)
+ ;; Return the subset of INPUTS that should be considered when setting
+ ;; ENV-VAR.
+ (match (assoc-ref path-exclusions env-var)
+ (#f
+ (map cdr inputs))
+ ((excluded ...)
+ (filter-map (match-lambda
+ ((name . dir)
+ (and (not (member name excluded))
+ dir)))
+ inputs))))
+
+ (set-path-environment-variable "PATH" '("bin")
+ (relevant-input-directories "PATH"))
+ (set-path-environment-variable "CPATH" '("include")
+ (relevant-input-directories "CPATH"))
+ (set-path-environment-variable "LIBRARY_PATH" '("lib" "lib64")
+ (relevant-input-directories "LIBRARY_PATH"))
+
+ ;; FIXME: Eventually move this to the `search-paths' field of the
+ ;; `pkg-config' package.
+ (set-path-environment-variable "PKG_CONFIG_PATH"
+ '("lib/pkgconfig" "lib64/pkgconfig")
+ (relevant-input-directories "PKG_CONFIG_PATH"))
+
+ ;; Dump the environment variables as a shell script, for handy debugging.
+ (system "export > environment-variables"))
(define* (unpack #:key source #:allow-other-keys)
(and (zero? (system* "tar" "xvf" source))