summaryrefslogtreecommitdiff
path: root/guix/build
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2014-03-26 16:31:57 +0100
committerLudovic Courtès <ludo@gnu.org>2014-03-26 16:31:57 +0100
commit4979ee04f07defb55dc448a5682913dc41935760 (patch)
tree03d0a1ed2bd7c7d141d2af09ea01b66fa62e3d88 /guix/build
parent07fb21b231b8d86cc17beff64111759b972ffcac (diff)
parenteafee15b3ce3638058c43974244964dbd48ec15d (diff)
Merge branch 'core-updates'
Diffstat (limited to 'guix/build')
-rw-r--r--guix/build/gnu-build-system.scm22
-rw-r--r--guix/build/utils.scm15
2 files changed, 27 insertions, 10 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))
diff --git a/guix/build/utils.scm b/guix/build/utils.scm
index a37ace31af..40af785b88 100644
--- a/guix/build/utils.scm
+++ b/guix/build/utils.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>
;;; Copyright © 2013 Andreas Enge <andreas@enge.fr>
;;; Copyright © 2013 Nikita Karetnikov <nikita@karetnikov.org>
;;;
@@ -29,7 +29,8 @@
#:use-module (rnrs io ports)
#:re-export (alist-cons
alist-delete)
- #:export (directory-exists?
+ #:export (%store-directory
+ directory-exists?
executable-file?
call-with-ascii-input-file
with-directory-excursion
@@ -62,6 +63,11 @@
;;; Directories.
;;;
+(define (%store-directory)
+ "Return the directory name of the store."
+ (or (getenv "NIX_STORE")
+ "/gnu/store"))
+
(define (directory-exists? dir)
"Return #t if DIR exists and is a directory."
(let ((s (stat dir #f)))
@@ -443,7 +449,7 @@ all subject to the substitutions."
;;;
-;;; Patching shebangs---e.g., /bin/sh -> /nix/store/xyz...-bash/bin/sh.
+;;; Patching shebangs---e.g., /bin/sh -> /gnu/store/xyz...-bash/bin/sh.
;;;
(define* (dump-port in out
@@ -630,8 +636,7 @@ for each unmatched character."
(unmatched (car matched) result)))))))
(define* (remove-store-references file
- #:optional (store (or (getenv "NIX_STORE")
- "/nix/store")))
+ #:optional (store (%store-directory)))
"Remove from FILE occurrences of file names in STORE; return #t when
store paths were encountered in FILE, #f otherwise. This procedure is
known as `nuke-refs' in Nixpkgs."