diff options
author | Ludovic Courtès <ludo@gnu.org> | 2014-03-26 16:31:57 +0100 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2014-03-26 16:31:57 +0100 |
commit | 4979ee04f07defb55dc448a5682913dc41935760 (patch) | |
tree | 03d0a1ed2bd7c7d141d2af09ea01b66fa62e3d88 /guix/build/gnu-build-system.scm | |
parent | 07fb21b231b8d86cc17beff64111759b972ffcac (diff) | |
parent | eafee15b3ce3638058c43974244964dbd48ec15d (diff) |
Merge branch 'core-updates'
Diffstat (limited to 'guix/build/gnu-build-system.scm')
-rw-r--r-- | guix/build/gnu-build-system.scm | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/guix/build/gnu-build-system.scm b/guix/build/gnu-build-system.scm index 65c9fcd1bd..da6b31c326 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 Ludovic Courtès <ludo@gnu.org> +;;; Copyright © 2012, 2013, 2014 Ludovic Courtès <ludo@gnu.org> ;;; ;;; This file is part of GNU Guix. ;;; @@ -90,8 +90,17 @@ #t) (define* (unpack #:key source #:allow-other-keys) - (and (zero? (system* "tar" "xvf" source)) - (chdir (first-subdirectory ".")))) + "Unpack SOURCE in the working directory, and change directory within the +source. When SOURCE is a directory, copy it in a sub-directory of the current +working directory." + (if (file-is-directory? source) + (begin + (mkdir "source") + (chdir "source") + (copy-recursively source ".") + #t) + (and (zero? (system* "tar" "xvf" source)) + (chdir (first-subdirectory "."))))) (define* (patch-source-shebangs #:key source #:allow-other-keys) "Patch shebangs in all source files; this includes non-executable @@ -136,7 +145,10 @@ makefiles." (bash (or (and=> (assoc-ref (or native-inputs inputs) "bash") (cut string-append <> "/bin/bash")) "/bin/sh")) - (flags `(,(string-append "CONFIG_SHELL=" bash) + (flags `(,@(if target ; cross building + '("CC_FOR_BUILD=gcc") + '()) + ,(string-append "CONFIG_SHELL=" bash) ,(string-append "SHELL=" bash) ,(string-append "--prefix=" prefix) "--enable-fast-install" ; when using Libtool @@ -160,7 +172,7 @@ makefiles." '()) ,@(if docdir (list (string-append "--docdir=" docdir - "/doc/" (package-name))) + "/share/doc/" (package-name))) '()) ,@(if target ; cross building (list (string-append "--host=" target)) |