diff options
author | Mark H Weaver <mhw@netris.org> | 2015-07-19 20:28:56 -0400 |
---|---|---|
committer | Mark H Weaver <mhw@netris.org> | 2015-07-19 20:28:56 -0400 |
commit | e170571887dc072edae8b197527921c47743c62c (patch) | |
tree | c77e6d7ff744c50cd2741fd92a0c73503daa83c2 /guix | |
parent | dcd9c2505c0230c13556e233dbe4d81604a4abbd (diff) | |
parent | 1b4e48d498a96d478baa1aae7d9c7ecdbd817d6f (diff) |
Merge branch 'core-updates'
Diffstat (limited to 'guix')
-rw-r--r-- | guix/build-system/gnu.scm | 4 | ||||
-rw-r--r-- | guix/build/gnu-build-system.scm | 5 | ||||
-rw-r--r-- | guix/build/python-build-system.scm | 15 | ||||
-rw-r--r-- | guix/packages.scm | 48 |
4 files changed, 57 insertions, 15 deletions
diff --git a/guix/build-system/gnu.scm b/guix/build-system/gnu.scm index 8702c6c915..1f302447c2 100644 --- a/guix/build-system/gnu.scm +++ b/guix/build-system/gnu.scm @@ -289,6 +289,7 @@ standard packages used as implicit inputs of the GNU build system." (phases '%standard-phases) (locale "en_US.UTF-8") (system (%current-system)) + (build (nix-system->gnu-triplet system)) (imported-modules %gnu-build-system-modules) (modules %default-modules) (substitutable? #t) @@ -333,6 +334,7 @@ are allowed to refer to." (source source)) #:system ,system + #:build ,build #:outputs %outputs #:inputs %build-inputs #:search-paths ',(map search-path-specification->sexp @@ -422,6 +424,7 @@ is one of `host' or `target'." (phases '%standard-phases) (locale "en_US.UTF-8") (system (%current-system)) + (build (nix-system->gnu-triplet system)) (imported-modules %gnu-build-system-modules) (modules %default-modules) (substitutable? #t) @@ -472,6 +475,7 @@ platform." (source source)) #:system ,system + #:build ,build #:target ,target #:outputs %outputs #:inputs %build-target-inputs diff --git a/guix/build/gnu-build-system.scm b/guix/build/gnu-build-system.scm index 5062479360..102207b022 100644 --- a/guix/build/gnu-build-system.scm +++ b/guix/build/gnu-build-system.scm @@ -184,7 +184,7 @@ makefiles." ;; Patch `SHELL' in generated makefiles. (for-each patch-makefile-SHELL (find-files "." "^(GNU)?[mM]akefile$"))) -(define* (configure #:key target native-inputs inputs outputs +(define* (configure #:key build target native-inputs inputs outputs (configure-flags '()) out-of-source? #:allow-other-keys) (define (package-name) @@ -234,6 +234,9 @@ makefiles." (list (string-append "--docdir=" docdir "/share/doc/" (package-name))) '()) + ,@(if build + (list (string-append "--build=" build)) + '()) ,@(if target ; cross building (list (string-append "--host=" target)) '()) diff --git a/guix/build/python-build-system.scm b/guix/build/python-build-system.scm index 26a7254db9..d008ac2c69 100644 --- a/guix/build/python-build-system.scm +++ b/guix/build/python-build-system.scm @@ -2,6 +2,7 @@ ;;; Copyright © 2013, 2015 Ludovic Courtès <ludo@gnu.org> ;;; Copyright © 2013 Andreas Enge <andreas@enge.fr> ;;; Copyright © 2013 Nikita Karetnikov <nikita@karetnikov.org> +;;; Copyright © 2015 Mark H Weaver <mhw@netris.org> ;;; ;;; This file is part of GNU Guix. ;;; @@ -119,10 +120,24 @@ installed with setuptools." (rename-file easy-install-pth new-pth)) #t)) +(define* (ensure-no-mtimes-pre-1980 #:rest _) + "Ensure that there are no mtimes before 1980-01-02 in the source tree." + ;; Rationale: patch-and-repack creates tarballs with timestamps at the POSIX + ;; epoch, 1970-01-01 UTC. This causes problems with Python packages, + ;; because Python eggs are ZIP files, and the ZIP format does not support + ;; timestamps before 1980. + (let ((early-1980 315619200)) ; 1980-01-02 UTC + (ftw "." (lambda (file stat flag) + (unless (<= early-1980 (stat:mtime stat)) + (utime file early-1980 early-1980)) + #t)) + #t)) + (define %standard-phases ;; 'configure' and 'build' phases are not needed. Everything is done during ;; 'install'. (modify-phases gnu:%standard-phases + (add-after 'unpack 'ensure-no-mtimes-pre-1980 ensure-no-mtimes-pre-1980) (delete 'configure) (replace 'install install) (replace 'check check) diff --git a/guix/packages.scm b/guix/packages.scm index 5a280857ea..3983d1409a 100644 --- a/guix/packages.scm +++ b/guix/packages.scm @@ -1,6 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2012, 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org> -;;; Copyright © 2014 Mark H Weaver <mhw@netris.org> +;;; Copyright © 2014, 2015 Mark H Weaver <mhw@netris.org> ;;; ;;; This file is part of GNU Guix. ;;; @@ -480,7 +480,11 @@ IMPORTED-MODULES specify modules to use/import for use by SNIPPET." (begin (chdir "..") #t) (zero? (system* (string-append #+tar "/bin/tar") - "cvfa" #$output directory))))))) + "cvfa" #$output directory + ;; avoid non-determinism in the archive + "--mtime=@0" + "--owner=root:0" + "--group=root:0"))))))) (let ((name (tarxz-name original-file-name)) (modules (delete-duplicates (cons '(guix build utils) modules)))) @@ -491,21 +495,37 @@ IMPORTED-MODULES specify modules to use/import for use by SNIPPET." #:guile-for-build guile-for-build)))) (define (transitive-inputs inputs) - (let loop ((inputs inputs) - (result '())) + "Return the closure of INPUTS when considering the 'propagated-inputs' +edges. Omit duplicate inputs, except for those already present in INPUTS +itself. + +This is implemented as a breadth-first traversal such that INPUTS is +preserved, and only duplicate propagated inputs are removed." + (define (seen? seen item outputs) + (match (vhash-assq item seen) + ((_ . o) (equal? o outputs)) + (_ #f))) + + (let loop ((inputs inputs) + (result '()) + (propagated '()) + (first? #t) + (seen vlist-null)) (match inputs (() - (delete-duplicates (reverse result))) ; XXX: efficiency - (((and i (name (? package? p) sub ...)) rest ...) - (let ((t (map (match-lambda - ((dep-name derivation ...) - (cons (string-append name "/" dep-name) - derivation))) - (package-propagated-inputs p)))) - (loop (append t rest) - (append t (cons i result))))) + (if (null? propagated) + (reverse result) + (loop (reverse (concatenate propagated)) result '() #f seen))) + (((and input (label (? package? package) outputs ...)) rest ...) + (if (and (not first?) (seen? seen package outputs)) + (loop rest result propagated first? seen) + (loop rest + (cons input result) + (cons (package-propagated-inputs package) propagated) + first? + (vhash-consq package outputs seen)))) ((input rest ...) - (loop rest (cons input result)))))) + (loop rest (cons input result) propagated first? seen))))) (define (package-direct-sources package) "Return all source origins associated with PACKAGE; including origins in |