summary refs log tree commit diff
path: root/gnu/packages/cross-base.scm
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/packages/cross-base.scm')
-rw-r--r--gnu/packages/cross-base.scm86
1 files changed, 44 insertions, 42 deletions
diff --git a/gnu/packages/cross-base.scm b/gnu/packages/cross-base.scm
index 0f5997951c..bbd779ae4e 100644
--- a/gnu/packages/cross-base.scm
+++ b/gnu/packages/cross-base.scm
@@ -1,8 +1,9 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2013, 2014, 2015, 2016, 2017 Ludovic Courtès <ludo@gnu.org>
-;;; Copyright © 2014, 2015 Mark H Weaver <mhw@netris.org>
+;;; Copyright © 2014, 2015, 2018 Mark H Weaver <mhw@netris.org>
 ;;; Copyright © 2016 Jan Nieuwenhuizen <janneke@gnu.org>
 ;;; Copyright © 2016 Manolis Fragkiskos Ragkousis <manolis837@gmail.com>
+;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -181,8 +182,10 @@ base compiler and using LIBC (which may be either a libc package or #f.)"
 (define (cross-gcc-snippet target)
   "Return GCC snippet needed for TARGET."
   (cond ((target-mingw? target)
-         '(copy-recursively "libstdc++-v3/config/os/mingw32-w64"
-                            "libstdc++-v3/config/os/newlib"))
+         '(begin
+            (copy-recursively "libstdc++-v3/config/os/mingw32-w64"
+                              "libstdc++-v3/config/os/newlib")
+            #t))
         (else #f)))
 
 (define* (cross-gcc target
@@ -291,8 +294,8 @@ target that libc."
               (setenv "ARCH" ,(system->linux-architecture target))
               (format #t "`ARCH' set to `~a' (cross compiling)~%" (getenv "ARCH"))
 
-              (and (zero? (system* "make" ,(system->defconfig target)))
-                   (zero? (system* "make" "mrproper" "headers_check"))))
+              (invoke "make" ,(system->defconfig target))
+              (invoke "make" "mrproper" "headers_check"))
             ,phases))))
       (native-inputs `(("cross-gcc" ,xgcc)
                        ("cross-binutils" ,xbinutils)
@@ -314,14 +317,14 @@ target that libc."
        `(#:modules ((guix build gnu-build-system)
                     (guix build utils)
                     (srfi srfi-26))
-         #:phases (alist-cons-before
-                   'configure 'set-cross-headers-path
-                   (lambda* (#:key inputs #:allow-other-keys)
-                     (let* ((mach (assoc-ref inputs "cross-gnumach-headers"))
-                            (cpath (string-append mach "/include")))
-                       (for-each (cut setenv <> cpath)
-                                 ',%gcc-cross-include-paths)))
-                   %standard-phases)
+         #:phases (modify-phases %standard-phases
+                    (add-before 'configure 'set-cross-headers-path
+                      (lambda* (#:key inputs #:allow-other-keys)
+                        (let* ((mach (assoc-ref inputs "cross-gnumach-headers"))
+                               (cpath (string-append mach "/include")))
+                          (for-each (cut setenv <> cpath)
+                                    ',%gcc-cross-include-paths)
+                          #t))))
          #:configure-flags (list ,(string-append "--target=" target))
          ,@(package-arguments mig)))
 
@@ -352,16 +355,16 @@ target that libc."
                         (srfi srfi-26))
              ,@(package-arguments glibc/hurd-headers))
          ((#:phases phases)
-          `(alist-cons-before
-            'pre-configure 'set-cross-headers-path
-            (lambda* (#:key inputs #:allow-other-keys)
-              (let* ((mach (assoc-ref inputs "gnumach-headers"))
-                     (hurd (assoc-ref inputs "hurd-headers"))
-                     (cpath (string-append mach "/include:"
-                                           hurd "/include")))
-                (for-each (cut setenv <> cpath)
-                          ',%gcc-cross-include-paths)))
-            ,phases))))
+          `(modify-phases ,phases
+             (add-before 'pre-configure 'set-cross-headers-path
+               (lambda* (#:key inputs #:allow-other-keys)
+                 (let* ((mach (assoc-ref inputs "gnumach-headers"))
+                        (hurd (assoc-ref inputs "hurd-headers"))
+                        (cpath (string-append mach "/include:"
+                                              hurd "/include")))
+                   (for-each (cut setenv <> cpath)
+                             ',%gcc-cross-include-paths)
+                   #t)))))))
 
       (propagated-inputs `(("gnumach-headers" ,xgnumach-headers)
                            ("hurd-headers" ,xhurd-headers)))
@@ -382,14 +385,14 @@ target that libc."
                       (srfi srfi-26))
            ,@(package-arguments hurd-minimal))
          ((#:phases phases)
-          `(alist-cons-before
-            'configure 'set-cross-headers-path
-            (lambda* (#:key inputs #:allow-other-keys)
-              (let* ((glibc-headers (assoc-ref inputs "cross-glibc-hurd-headers"))
-                    (cpath (string-append glibc-headers "/include")))
-                (for-each (cut setenv <> cpath)
-                          ',%gcc-cross-include-paths)))
-            ,phases))))
+          `(modify-phases ,phases
+             (add-before 'configure 'set-cross-headers-path
+               (lambda* (#:key inputs #:allow-other-keys)
+                 (let* ((glibc-headers (assoc-ref inputs "cross-glibc-hurd-headers"))
+                        (cpath (string-append glibc-headers "/include")))
+                   (for-each (cut setenv <> cpath)
+                             ',%gcc-cross-include-paths)
+                   #t)))))))
 
       (inputs `(("cross-glibc-hurd-headers" ,xglibc/hurd-headers)))
 
@@ -456,17 +459,16 @@ XBINUTILS and the cross tool chain."
               `(cons ,(string-append "--host=" target)
                    ,flags))
              ((#:phases phases)
-              `(alist-cons-before
-                'configure 'set-cross-kernel-headers-path
-                (lambda* (#:key inputs #:allow-other-keys)
-                  (let* ((kernel (assoc-ref inputs "kernel-headers"))
-                         (cpath (string-append kernel "/include")))
-                    (for-each (cut setenv <> cpath)
-                              ',%gcc-cross-include-paths)
-                    (setenv "CROSS_LIBRARY_PATH"
-                            (string-append kernel "/lib")) ;for Hurd's libihash
-                    #t))
-                ,phases))))
+              `(modify-phases ,phases
+                 (add-before 'configure 'set-cross-kernel-headers-path
+                   (lambda* (#:key inputs #:allow-other-keys)
+                     (let* ((kernel (assoc-ref inputs "kernel-headers"))
+                            (cpath (string-append kernel "/include")))
+                       (for-each (cut setenv <> cpath)
+                                 ',%gcc-cross-include-paths)
+                       (setenv "CROSS_LIBRARY_PATH"
+                               (string-append kernel "/lib")) ; for Hurd's libihash
+                       #t)))))))
 
           ;; Shadow the native "kernel-headers" because glibc's recipe expects the
           ;; "kernel-headers" input to point to the right thing.