guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

01/03: build-system/gnu: Use executables from the target inputs in 'patc


From: Ludovic Courtès
Subject: 01/03: build-system/gnu: Use executables from the target inputs in 'patch-shebangs'.
Date: Sun, 04 Jan 2015 21:24:17 +0000

civodul pushed a commit to branch core-updates
in repository guix.

commit ac70048be287bf4e1624051e74b3ecc3a295fa51
Author: Ludovic Courtès <address@hidden>
Date:   Sun Jan 4 18:16:16 2015 +0100

    build-system/gnu: Use executables from the target inputs in 
'patch-shebangs'.
    
    Fixes <http://bugs.gnu.org/18895>.
    
    * guix/build/gnu-build-system.scm (patch-shebangs): Add #:inputs
      parameter.  Remove 'bindirs'.  Add 'bin-directories',
      'output-bindirs', and 'input-bindirs'.  Use them instead of (getenv
      "PATH") to as the argument to 'patch-shebang'.
---
 guix/build/gnu-build-system.scm |   28 +++++++++++++++++-----------
 1 files changed, 17 insertions(+), 11 deletions(-)

diff --git a/guix/build/gnu-build-system.scm b/guix/build/gnu-build-system.scm
index 1311cdc..cdfba2f 100644
--- a/guix/build/gnu-build-system.scm
+++ b/guix/build/gnu-build-system.scm
@@ -1,5 +1,5 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2012, 2013, 2014 Ludovic Courtès <address@hidden>
+;;; Copyright © 2012, 2013, 2014, 2015 Ludovic Courtès <address@hidden>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -265,7 +265,7 @@ makefiles."
 (define* (install #:key (make-flags '()) #:allow-other-keys)
   (zero? (apply system* "make" "install" make-flags)))
 
-(define* (patch-shebangs #:key outputs (patch-shebangs? #t)
+(define* (patch-shebangs #:key inputs outputs (patch-shebangs? #t)
                          #:allow-other-keys)
   (define (list-of-files dir)
     (map (cut string-append dir "/" <>)
@@ -274,20 +274,26 @@ makefiles."
                               (eq? 'regular (stat:type s)))))
              '())))
 
-  (define bindirs
-    (append-map (match-lambda
-                 ((_ . dir)
-                  (list (string-append dir "/bin")
-                        (string-append dir "/sbin"))))
-                outputs))
+  (define bin-directories
+    (match-lambda
+     ((_ . dir)
+      (list (string-append dir "/bin")
+            (string-append dir "/sbin")))))
+
+  (define output-bindirs
+    (append-map bin-directories outputs))
+
+  (define input-bindirs
+    ;; Shebangs should refer to binaries of the target system---i.e., from
+    ;; "inputs", not from "native-inputs".
+    (append-map bin-directories inputs))
 
   (when patch-shebangs?
-    (let ((path (append bindirs
-                        (search-path-as-string->list (getenv "PATH")))))
+    (let ((path (append output-bindirs input-bindirs)))
       (for-each (lambda (dir)
                   (let ((files (list-of-files dir)))
                     (for-each (cut patch-shebang <> path) files)))
-                bindirs)))
+                output-bindirs)))
   #t)
 
 (define* (strip #:key target outputs (strip-binaries? #t)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]