me
/
guix
Archived
1
0
Fork 0

packages: Mark the `arguments' field of <package> as thunked.

* guix/packages.scm (<package>): Mark `arguments' as thunked.
  (package-derivation): Adjust accordingly.  Parameterize
  %CURRENT-SYSTEM to SYSTEM, so that arguments can refer to it.

* guix/build-system/gnu.scm (package-with-explicit-inputs): Expect
  `package-arguments' to always return a list, and return a list.
  (package-with-extra-configure-variable): Likewise.
  (static-package): Likewise.
* gnu/packages/base.scm (patch, findutils, gcc-4.7, binutils-boot0,
  gcc-boot0, glibc-final-with-bootstrap-bash, cross-gcc-wrapper,
  static-bash-for-glibc, binutils-final, gcc-final): Change `arguments'
  from a lambda to a list, and use (%current-system) as needed.
  (nix-system->gnu-triplet, boot-triplet): Have the first argument
  default to (%current-system).
* gnu/packages/bootstrap.scm (glibc-dynamic-linker): Have `system'
  default to (%current-system).
  (%bootstrap-gcc): Change `arguments' to a list.
* gnu/packages/gawk.scm (gawk): Likewise.
* gnu/packages/m4.scm (m4): Likewise.
* gnu/packages/make-bootstrap.scm (%glibc-for-bootstrap): Likewise, and
  expect `package-arguments' to return a list.
  (%static-inputs, %gcc-static, tarball-package): Likewise.
* gnu/packages/ncurses.scm (ncurses): Likewise.
master
Ludovic Courtès 2013-01-23 23:21:59 +01:00
parent 9c9da07f4c
commit 21c203a53a
8 changed files with 414 additions and 456 deletions

View File

@ -162,10 +162,10 @@ files (as archives).")
(build-system gnu-build-system) (build-system gnu-build-system)
(native-inputs '()) ; FIXME: needs `ed' for the tests (native-inputs '()) ; FIXME: needs `ed' for the tests
(arguments (arguments
(case-lambda '(#:tests? #f)
((system) '(#:tests? #f)) ;; TODO: When cross-compiling, add this:
((system cross-system) ;; '(#:configure-flags '("ac_cv_func_strnlen_working=yes"))
'(#:configure-flags '("ac_cv_func_strnlen_working=yes"))))) )
(synopsis "GNU Patch, a program to apply differences to files") (synopsis "GNU Patch, a program to apply differences to files")
(description (description
"GNU Patch takes a patch file containing a difference listing produced by "GNU Patch takes a patch file containing a difference listing produced by
@ -235,14 +235,13 @@ You can use the sdiff command to merge two files interactively.")
`(("patch/absolute-paths" `(("patch/absolute-paths"
,(search-patch "findutils-absolute-paths.patch")))) ,(search-patch "findutils-absolute-paths.patch"))))
(arguments (arguments
(case-lambda `(#:patches (list (assoc-ref %build-inputs "patch/absolute-paths")))
((system)
`(#:patches (list (assoc-ref %build-inputs "patch/absolute-paths")))) ;; TODO: Work around cross-compilation failure.
((system cross-system)
;; Work around cross-compilation failure.
;; See <http://savannah.gnu.org/bugs/?27299#comment1>. ;; See <http://savannah.gnu.org/bugs/?27299#comment1>.
`(#:configure-flags '("gl_cv_func_wcwidth_works=yes") ;; `(#:configure-flags '("gl_cv_func_wcwidth_works=yes")
,@(arguments cross-system))))) ;; ,@(arguments cross-system))
)
(synopsis "Basic directory searching utilities of the GNU operating (synopsis "Basic directory searching utilities of the GNU operating
system") system")
(description (description
@ -396,7 +395,6 @@ BFD (Binary File Descriptor) library, `gprof', `nm', `strip', etc.")
("mpfr" ,mpfr) ("mpfr" ,mpfr)
("mpc" ,mpc))) ; TODO: libelf, ppl, cloog, zlib, etc. ("mpc" ,mpc))) ; TODO: libelf, ppl, cloog, zlib, etc.
(arguments (arguments
(lambda (system)
`(#:out-of-source? #t `(#:out-of-source? #t
#:strip-binaries? ,stripped? #:strip-binaries? ,stripped?
#:configure-flags #:configure-flags
@ -418,7 +416,7 @@ BFD (Binary File Descriptor) library, `gprof', `nm', `strip', etc.")
"-L" libc "/lib " "-L" libc "/lib "
"-Wl,-dynamic-linker " "-Wl,-dynamic-linker "
"-Wl," libc "-Wl," libc
,(glibc-dynamic-linker system))) ,(glibc-dynamic-linker)))
'()) '())
,(string-append "BOOT_CFLAGS=-O2 " ,(string-append "BOOT_CFLAGS=-O2 "
,(if stripped? "-g0" "-g")))) ,(if stripped? "-g0" "-g"))))
@ -440,7 +438,7 @@ BFD (Binary File Descriptor) library, `gprof', `nm', `strip', etc.")
(("#define GLIBC_DYNAMIC_LINKER([^ ]*).*$" _ suffix) (("#define GLIBC_DYNAMIC_LINKER([^ ]*).*$" _ suffix)
(format #f "#define GLIBC_DYNAMIC_LINKER~a \"~a\"~%" (format #f "#define GLIBC_DYNAMIC_LINKER~a \"~a\"~%"
suffix suffix
(string-append libc ,(glibc-dynamic-linker system))))) (string-append libc ,(glibc-dynamic-linker)))))
;; Tell where to find libstdc++, libc, and `?crt*.o', except ;; Tell where to find libstdc++, libc, and `?crt*.o', except
;; `crt{begin,end}.o', which come with GCC. ;; `crt{begin,end}.o', which come with GCC.
@ -479,7 +477,7 @@ BFD (Binary File Descriptor) library, `gprof', `nm', `strip', etc.")
,(if stripped? ,(if stripped?
"install-strip" "install-strip"
"install")))) "install"))))
%standard-phases)))))) %standard-phases)))))
(properties `((gcc-libc . ,(assoc-ref inputs "libc")))) (properties `((gcc-libc . ,(assoc-ref inputs "libc"))))
(synopsis "The GNU Compiler Collection") (synopsis "The GNU Compiler Collection")
@ -653,7 +651,8 @@ with the Linux kernel.")
("findutils" ,findutils-boot0) ("findutils" ,findutils-boot0)
,@%bootstrap-inputs)) ,@%bootstrap-inputs))
(define* (nix-system->gnu-triplet system #:optional (vendor "unknown")) (define* (nix-system->gnu-triplet
#:optional (system (%current-system)) (vendor "unknown"))
"Return an a guess of the GNU triplet corresponding to Nix system "Return an a guess of the GNU triplet corresponding to Nix system
identifier SYSTEM." identifier SYSTEM."
(let* ((dash (string-index system #\-)) (let* ((dash (string-index system #\-))
@ -665,10 +664,10 @@ identifier SYSTEM."
"linux-gnu" "linux-gnu"
os)))) os))))
(define boot-triplet (define* (boot-triplet #:optional (system (%current-system)))
;; Return the triplet used to create the cross toolchain needed in the ;; Return the triplet used to create the cross toolchain needed in the
;; first bootstrapping stage. ;; first bootstrapping stage.
(cut nix-system->gnu-triplet <> "guix")) (nix-system->gnu-triplet system "guix"))
;; Following Linux From Scratch, build a cross-toolchain in stage 0. That ;; Following Linux From Scratch, build a cross-toolchain in stage 0. That
;; toolchain actually targets the same OS and arch, but it has the advantage ;; toolchain actually targets the same OS and arch, but it has the advantage
@ -680,12 +679,11 @@ identifier SYSTEM."
(package (inherit binutils) (package (inherit binutils)
(name "binutils-cross-boot0") (name "binutils-cross-boot0")
(arguments (arguments
(lambda (system)
`(#:guile ,%bootstrap-guile `(#:guile ,%bootstrap-guile
#:implicit-inputs? #f #:implicit-inputs? #f
,@(substitute-keyword-arguments (package-arguments binutils) ,@(substitute-keyword-arguments (package-arguments binutils)
((#:configure-flags cf) ((#:configure-flags cf)
`(list ,(string-append "--target=" (boot-triplet system)))))))) `(list ,(string-append "--target=" (boot-triplet)))))))
(inputs %boot0-inputs)))) (inputs %boot0-inputs))))
(define gcc-boot0 (define gcc-boot0
@ -693,7 +691,6 @@ identifier SYSTEM."
(package (inherit gcc-4.7) (package (inherit gcc-4.7)
(name "gcc-cross-boot0") (name "gcc-cross-boot0")
(arguments (arguments
(lambda (system)
`(#:guile ,%bootstrap-guile `(#:guile ,%bootstrap-guile
#:implicit-inputs? #f #:implicit-inputs? #f
#:modules ((guix build gnu-build-system) #:modules ((guix build gnu-build-system)
@ -701,10 +698,9 @@ identifier SYSTEM."
(ice-9 regex) (ice-9 regex)
(srfi srfi-1) (srfi srfi-1)
(srfi srfi-26)) (srfi srfi-26))
,@(substitute-keyword-arguments ((package-arguments gcc-4.7) system) ,@(substitute-keyword-arguments (package-arguments gcc-4.7)
((#:configure-flags flags) ((#:configure-flags flags)
`(append (list ,(string-append "--target=" `(append (list ,(string-append "--target=" (boot-triplet))
(boot-triplet system))
;; No libc yet. ;; No libc yet.
"--without-headers" "--without-headers"
@ -765,10 +761,10 @@ identifier SYSTEM."
;; it. ;; it.
(with-directory-excursion (with-directory-excursion
(string-append out "/lib/gcc/" (string-append out "/lib/gcc/"
,(boot-triplet system) ,(boot-triplet)
"/" ,(package-version gcc-4.7)) "/" ,(package-version gcc-4.7))
(symlink "libgcc.a" "libgcc_eh.a")))) (symlink "libgcc.a" "libgcc_eh.a"))))
,phases))))))) ,phases))))))
(inputs `(("gmp-source" ,(package-source gmp)) (inputs `(("gmp-source" ,(package-source gmp))
("mpfr-source" ,(package-source mpfr)) ("mpfr-source" ,(package-source mpfr))
@ -812,20 +808,19 @@ identifier SYSTEM."
(package (inherit glibc) (package (inherit glibc)
(name "glibc-intermediate") (name "glibc-intermediate")
(arguments (arguments
(lambda (system)
`(#:guile ,%bootstrap-guile `(#:guile ,%bootstrap-guile
#:implicit-inputs? #f #:implicit-inputs? #f
,@(substitute-keyword-arguments (package-arguments glibc) ,@(substitute-keyword-arguments (package-arguments glibc)
((#:configure-flags flags) ((#:configure-flags flags)
`(append (list ,(string-append "--host=" (boot-triplet system)) `(append (list ,(string-append "--host=" (boot-triplet))
,(string-append "--build=" ,(string-append "--build="
(nix-system->gnu-triplet system)) (nix-system->gnu-triplet))
;; Build Sun/ONC RPC support. In particular, ;; Build Sun/ONC RPC support. In particular,
;; install rpc/*.h. ;; install rpc/*.h.
"--enable-obsolete-rpc") "--enable-obsolete-rpc")
,flags)))))) ,flags)))))
(propagated-inputs `(("linux-headers" ,linux-libre-headers-boot0))) (propagated-inputs `(("linux-headers" ,linux-libre-headers-boot0)))
(inputs (inputs
`( ;; A native GCC is needed to build `cross-rpcgen'. `( ;; A native GCC is needed to build `cross-rpcgen'.
@ -847,7 +842,6 @@ that makes it available under the native tool names."
(source #f) (source #f)
(build-system trivial-build-system) (build-system trivial-build-system)
(arguments (arguments
(lambda (system)
`(#:guile ,%bootstrap-guile `(#:guile ,%bootstrap-guile
#:modules ((guix build utils)) #:modules ((guix build utils))
#:builder (begin #:builder (begin
@ -859,7 +853,7 @@ that makes it available under the native tool names."
(bash (assoc-ref %build-inputs "bash")) (bash (assoc-ref %build-inputs "bash"))
(out (assoc-ref %outputs "out")) (out (assoc-ref %outputs "out"))
(bindir (string-append out "/bin")) (bindir (string-append out "/bin"))
(triplet ,(boot-triplet system))) (triplet ,(boot-triplet)))
(mkdir-p bindir) (mkdir-p bindir)
(with-directory-excursion bindir (with-directory-excursion bindir
(for-each (lambda (tool) (for-each (lambda (tool)
@ -878,9 +872,9 @@ exec ~a/bin/~a-gcc -B~a/lib -Wl,-dynamic-linker -Wl,~a/~a \"$@\"~%"
bash bash
gcc triplet gcc triplet
libc libc libc libc
,(glibc-dynamic-linker system)))) ,(glibc-dynamic-linker))))
(chmod "gcc" #o555))))))) (chmod "gcc" #o555))))))
(native-inputs (native-inputs
`(("binutils" ,binutils) `(("binutils" ,binutils)
("gcc" ,gcc) ("gcc" ,gcc)
@ -896,9 +890,8 @@ exec ~a/bin/~a-gcc -B~a/lib -Wl,-dynamic-linker -Wl,~a/~a \"$@\"~%"
(car (assoc-ref %boot1-inputs "bash")))) (car (assoc-ref %boot1-inputs "bash"))))
(bash (package (inherit bash-light) (bash (package (inherit bash-light)
(arguments (arguments
(lambda (system)
`(#:guile ,%bootstrap-guile `(#:guile ,%bootstrap-guile
,@(package-arguments bash-light))))))) ,@(package-arguments bash-light))))))
(package-with-bootstrap-guile (package-with-bootstrap-guile
(package-with-explicit-inputs (static-package bash) (package-with-explicit-inputs (static-package bash)
`(("gcc" ,gcc) `(("gcc" ,gcc)
@ -932,10 +925,9 @@ exec ~a/bin/~a-gcc -B~a/lib -Wl,-dynamic-linker -Wl,~a/~a \"$@\"~%"
(package-with-bootstrap-guile (package-with-bootstrap-guile
(package (inherit binutils) (package (inherit binutils)
(arguments (arguments
(lambda (system)
`(#:guile ,%bootstrap-guile `(#:guile ,%bootstrap-guile
#:implicit-inputs? #f #:implicit-inputs? #f
,@(package-arguments binutils)))) ,@(package-arguments binutils)))
(inputs %boot2-inputs)))) (inputs %boot2-inputs))))
(define-public gcc-final (define-public gcc-final
@ -943,23 +935,22 @@ exec ~a/bin/~a-gcc -B~a/lib -Wl,-dynamic-linker -Wl,~a/~a \"$@\"~%"
(package (inherit gcc-boot0) (package (inherit gcc-boot0)
(name "gcc") (name "gcc")
(arguments (arguments
(lambda (system)
`(#:guile ,%bootstrap-guile `(#:guile ,%bootstrap-guile
#:implicit-inputs? #f #:implicit-inputs? #f
;; Build again GMP & co. within GCC's build process, because it's hard ;; Build again GMP & co. within GCC's build process, because it's hard
;; to do outside (because GCC-BOOT0 is a cross-compiler, and thus ;; to do outside (because GCC-BOOT0 is a cross-compiler, and thus
;; doesn't honor $LIBRARY_PATH, which breaks `gnu-build-system'.) ;; doesn't honor $LIBRARY_PATH, which breaks `gnu-build-system'.)
,@(substitute-keyword-arguments ((package-arguments gcc-boot0) system) ,@(substitute-keyword-arguments (package-arguments gcc-boot0)
((#:configure-flags boot-flags) ((#:configure-flags boot-flags)
(let loop ((args ((package-arguments gcc-4.7) system))) (let loop ((args (package-arguments gcc-4.7)))
(match args (match args
((#:configure-flags normal-flags _ ...) ((#:configure-flags normal-flags _ ...)
normal-flags) normal-flags)
((_ rest ...) ((_ rest ...)
(loop rest))))) (loop rest)))))
((#:phases phases) ((#:phases phases)
`(alist-delete 'symlink-libgcc_eh ,phases)))))) `(alist-delete 'symlink-libgcc_eh ,phases)))))
(inputs `(("gmp-source" ,(package-source gmp)) (inputs `(("gmp-source" ,(package-source gmp))
("mpfr-source" ,(package-source mpfr)) ("mpfr-source" ,(package-source mpfr))

View File

@ -133,7 +133,7 @@ check whether everything is alright."
(propagated-inputs (map rewritten-input (propagated-inputs (map rewritten-input
(package-propagated-inputs p))))))) (package-propagated-inputs p)))))))
(define (glibc-dynamic-linker system) (define* (glibc-dynamic-linker #:optional (system (%current-system)))
"Return the name of Glibc's dynamic linker for SYSTEM." "Return the name of Glibc's dynamic linker for SYSTEM."
(cond ((string=? system "x86_64-linux") "/lib/ld-linux-x86-64.so.2") (cond ((string=? system "x86_64-linux") "/lib/ld-linux-x86-64.so.2")
((string=? system "i686-linux") "/lib/ld-linux.so.2") ((string=? system "i686-linux") "/lib/ld-linux.so.2")
@ -301,7 +301,6 @@ $out/bin/guile --version~%"
(source #f) (source #f)
(build-system trivial-build-system) (build-system trivial-build-system)
(arguments (arguments
(lambda (system)
`(#:guile ,%bootstrap-guile `(#:guile ,%bootstrap-guile
#:modules ((guix build utils)) #:modules ((guix build utils))
#:builder #:builder
@ -334,9 +333,9 @@ exec ~a/bin/.gcc-wrapped -B~a/lib \
-Wl,-dynamic-linker -Wl,~a/~a \"$@\"~%" -Wl,-dynamic-linker -Wl,~a/~a \"$@\"~%"
bash bash
out libc libc libc out libc libc libc
,(glibc-dynamic-linker system)))) ,(glibc-dynamic-linker))))
(chmod "gcc" #o555))))))) (chmod "gcc" #o555))))))
(inputs (inputs
`(("tar" ,(lambda (system) `(("tar" ,(lambda (system)
(search-bootstrap-binary "tar" system))) (search-bootstrap-binary "tar" system)))

View File

@ -36,12 +36,10 @@
(base32 "0sss7rhpvizi2a88h6giv0i7w5h07s2fxkw3s6n1hqvcnhrfgbb0")))) (base32 "0sss7rhpvizi2a88h6giv0i7w5h07s2fxkw3s6n1hqvcnhrfgbb0"))))
(build-system gnu-build-system) (build-system gnu-build-system)
(arguments (arguments
(case-lambda
((system)
`(#:parallel-tests? #f ; test suite fails in parallel `(#:parallel-tests? #f ; test suite fails in parallel
;; Work around test failure on Cygwin. ;; Work around test failure on Cygwin.
#:tests? ,(not (string=? system "i686-cygwin")) #:tests? ,(not (string=? (%current-system) "i686-cygwin"))
#:phases (alist-cons-before #:phases (alist-cons-before
'configure 'set-shell-file-name 'configure 'set-shell-file-name
@ -52,8 +50,6 @@
(("/bin/sh") (("/bin/sh")
(string-append bash "/bin/bash"))))) (string-append bash "/bin/bash")))))
%standard-phases))) %standard-phases)))
((system cross-system)
'(#:parallel-tests? #f))))
(inputs `(("libsigsegv" ,libsigsegv))) (inputs `(("libsigsegv" ,libsigsegv)))
(home-page "http://www.gnu.org/software/gawk/") (home-page "http://www.gnu.org/software/gawk/")
(synopsis "GNU implementation of the Awk programming language") (synopsis "GNU implementation of the Awk programming language")

View File

@ -1,5 +1,5 @@
;;; GNU Guix --- Functional package management for GNU ;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2012 Ludovic Courtès <ludo@gnu.org> ;;; Copyright © 2012, 2013 Ludovic Courtès <ludo@gnu.org>
;;; ;;;
;;; This file is part of GNU Guix. ;;; This file is part of GNU Guix.
;;; ;;;
@ -36,10 +36,9 @@
(base32 (base32
"035r7ma272j2cwni2961jp22k6bn3n9xwn3b3qbcn2yrvlghql22")))) "035r7ma272j2cwni2961jp22k6bn3n9xwn3b3qbcn2yrvlghql22"))))
(build-system gnu-build-system) (build-system gnu-build-system)
(arguments (case-lambda (arguments
((system)
;; XXX: Disable tests on those platforms with know issues. ;; XXX: Disable tests on those platforms with know issues.
`(#:tests? ,(not (member system `(#:tests? ,(not (member (%current-system)
'("x86_64-darwin" '("x86_64-darwin"
"i686-cygwin" "i686-cygwin"
"i686-sunos"))) "i686-sunos")))
@ -59,11 +58,6 @@
(("/bin/sh") (("/bin/sh")
(format #f "~a/bin/bash" bash))))) (format #f "~a/bin/bash" bash)))))
%standard-phases))) %standard-phases)))
((system cross-system)
`(#:patches (list (assoc-ref %build-inputs "patch/s_isdir")
(assoc-ref %build-inputs
"patch/readlink-EINVAL")
(assoc-ref %build-inputs "patch/gets"))))))
(inputs `(("patch/s_isdir" ,(search-patch "m4-s_isdir.patch")) (inputs `(("patch/s_isdir" ,(search-patch "m4-s_isdir.patch"))
("patch/readlink-EINVAL" ("patch/readlink-EINVAL"
,(search-patch "m4-readlink-EINVAL.patch")) ,(search-patch "m4-readlink-EINVAL.patch"))

View File

@ -52,17 +52,15 @@
;; without nscd, and with static NSS modules. ;; without nscd, and with static NSS modules.
(package (inherit glibc-final) (package (inherit glibc-final)
(arguments (arguments
(lambda (system) (substitute-keyword-arguments (package-arguments glibc-final)
(substitute-keyword-arguments ((package-arguments glibc-final) system)
((#:patches patches) ((#:patches patches)
`(cons (assoc-ref %build-inputs "patch/system") `(cons (assoc-ref %build-inputs "patch/system") ,patches))
,patches))
((#:configure-flags flags) ((#:configure-flags flags)
;; Arrange so that getaddrinfo & co. do not contact the nscd, ;; Arrange so that getaddrinfo & co. do not contact the nscd,
;; and can use statically-linked NSS modules. ;; and can use statically-linked NSS modules.
`(cons* "--disable-nscd" "--disable-build-nscd" `(cons* "--disable-nscd" "--disable-build-nscd"
"--enable-static-nss" "--enable-static-nss"
,flags))))) ,flags))))
(inputs (inputs
`(("patch/system" ,(search-patch "glibc-bootstrap-system.patch")) `(("patch/system" ,(search-patch "glibc-bootstrap-system.patch"))
,@(package-inputs glibc-final))))) ,@(package-inputs glibc-final)))))
@ -119,10 +117,8 @@
%standard-phases))))) %standard-phases)))))
(gawk (package (inherit gawk) (gawk (package (inherit gawk)
(arguments (arguments
(lambda (system)
`(#:patches (list (assoc-ref %build-inputs "patch/sh")) `(#:patches (list (assoc-ref %build-inputs "patch/sh"))
,@(substitute-keyword-arguments ,@(substitute-keyword-arguments (package-arguments gawk)
((package-arguments gawk) system)
((#:phases phases) ((#:phases phases)
`(alist-cons-before `(alist-cons-before
'configure 'no-export-dynamic 'configure 'no-export-dynamic
@ -131,7 +127,7 @@
;; `-export-dynamic'. ;; `-export-dynamic'.
(substitute* "configure" (substitute* "configure"
(("-export-dynamic") ""))) (("-export-dynamic") "")))
,phases)))))) ,phases)))))
(inputs `(("patch/sh" ,(search-patch "gawk-shell.patch")))))) (inputs `(("patch/sh" ,(search-patch "gawk-shell.patch"))))))
(finalize (lambda (p) (finalize (lambda (p)
(static-package (package-with-explicit-inputs (static-package (package-with-explicit-inputs
@ -332,13 +328,12 @@
(package (inherit gcc-final) (package (inherit gcc-final)
(name "gcc-static") (name "gcc-static")
(arguments (arguments
(lambda (system)
`(#:modules ((guix build utils) `(#:modules ((guix build utils)
(guix build gnu-build-system) (guix build gnu-build-system)
(srfi srfi-1) (srfi srfi-1)
(srfi srfi-26) (srfi srfi-26)
(ice-9 regex)) (ice-9 regex))
,@(substitute-keyword-arguments ((package-arguments gcc-final) system) ,@(substitute-keyword-arguments (package-arguments gcc-final)
((#:guile _) #f) ((#:guile _) #f)
((#:implicit-inputs? _) #t) ((#:implicit-inputs? _) #t)
((#:configure-flags flags) ((#:configure-flags flags)
@ -354,7 +349,7 @@
(remove (cut string-match "--(.*plugin|enable-languages)" <>) (remove (cut string-match "--(.*plugin|enable-languages)" <>)
,flags))) ,flags)))
((#:make-flags flags) ((#:make-flags flags)
`(cons "BOOT_LDFLAGS=-static" ,flags)))))) `(cons "BOOT_LDFLAGS=-static" ,flags)))))
(inputs `(("gmp-source" ,(package-source gmp)) (inputs `(("gmp-source" ,(package-source gmp))
("mpfr-source" ,(package-source mpfr)) ("mpfr-source" ,(package-source mpfr))
("mpc-source" ,(package-source mpc)) ("mpc-source" ,(package-source mpc))
@ -482,7 +477,6 @@
("xz" ,xz) ("xz" ,xz)
("input" ,pkg))) ("input" ,pkg)))
(arguments (arguments
(lambda (system)
(let ((name (package-name pkg)) (let ((name (package-name pkg))
(version (package-version pkg))) (version (package-version pkg)))
`(#:modules ((guix build utils)) `(#:modules ((guix build utils))
@ -499,8 +493,9 @@
(zero? (system* "tar" "cJvf" (zero? (system* "tar" "cJvf"
(string-append out "/" (string-append out "/"
,name "-" ,version ,name "-" ,version
"-" ,system ".tar.xz") "-" ,(%current-system)
"."))))))))))) ".tar.xz")
"."))))))))))
(define %bootstrap-binaries-tarball (define %bootstrap-binaries-tarball
;; A tarball with the statically-linked bootstrap binaries. ;; A tarball with the statically-linked bootstrap binaries.

View File

@ -83,8 +83,6 @@
"0fsn7xis81za62afan0vvm38bvgzg5wfmv1m86flqcj0nj7jjilh")))) "0fsn7xis81za62afan0vvm38bvgzg5wfmv1m86flqcj0nj7jjilh"))))
(build-system gnu-build-system) (build-system gnu-build-system)
(arguments (arguments
(case-lambda
((system)
`(#:configure-flags `(#:configure-flags
`("--with-shared" "--without-debug" "--enable-widec" `("--with-shared" "--without-debug" "--enable-widec"
@ -96,7 +94,7 @@
;; C++ bindings fail to build on ;; C++ bindings fail to build on
;; `i386-pc-solaris2.11' with GCC 3.4.3: ;; `i386-pc-solaris2.11' with GCC 3.4.3:
;; <http://bugs.opensolaris.org/bugdatabase/view_bug.do?bug_id=6395191>. ;; <http://bugs.opensolaris.org/bugdatabase/view_bug.do?bug_id=6395191>.
,,@(if (string=? system "i686-solaris") ,,@(if (string=? (%current-system) "i686-solaris")
'("--without-cxx-binding") '("--without-cxx-binding")
'())) '()))
#:tests? #f ; no "check" target #:tests? #f ; no "check" target
@ -109,8 +107,6 @@
'configure 'configure
,configure-phase ,configure-phase
%standard-phases))))) %standard-phases)))))
((system cross-system)
(arguments cross-system))))
(self-native-input? #t) (self-native-input? #t)
(synopsis (synopsis
"GNU Ncurses, a free software emulation of curses in SVR4 and more") "GNU Ncurses, a free software emulation of curses in SVR4 and more")

View File

@ -1,5 +1,5 @@
;;; GNU Guix --- Functional package management for GNU ;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2012 Ludovic Courtès <ludo@gnu.org> ;;; Copyright © 2012, 2013 Ludovic Courtès <ludo@gnu.org>
;;; ;;;
;;; This file is part of GNU Guix. ;;; This file is part of GNU Guix.
;;; ;;;
@ -66,12 +66,8 @@ when GUILE is #f."
(location (if (pair? loc) (source-properties->location loc) loc)) (location (if (pair? loc) (source-properties->location loc) loc))
(arguments (arguments
(let ((args (package-arguments p))) (let ((args (package-arguments p)))
(if (procedure? args)
(lambda (system)
`(#:guile ,guile `(#:guile ,guile
#:implicit-inputs? #f ,@(args system))) #:implicit-inputs? #f ,@args)))
`(#:guile ,guile
#:implicit-inputs? #f ,@args))))
(native-inputs (map rewritten-input (native-inputs (map rewritten-input
(filtered-inputs (package-native-inputs p)))) (filtered-inputs (package-native-inputs p))))
(propagated-inputs (map rewritten-input (propagated-inputs (map rewritten-input
@ -95,11 +91,7 @@ configure flags for VARIABLE, the associated value is augmented."
(package (inherit p) (package (inherit p)
(arguments (arguments
(lambda (system) (let ((args (package-arguments p)))
(let ((args (match (package-arguments p)
((? procedure? proc)
(proc system))
(x x))))
(substitute-keyword-arguments args (substitute-keyword-arguments args
((#:configure-flags flags) ((#:configure-flags flags)
(let* ((var= (string-append variable "=")) (let* ((var= (string-append variable "="))
@ -111,7 +103,7 @@ configure flags for VARIABLE, the associated value is augmented."
,(string-append var= value " ") ,(string-append var= value " ")
(substring flag ,len)) (substring flag ,len))
flag)) flag))
,flags)))))))) ,flags)))))))
(inputs (rewritten-inputs (package-inputs p))) (inputs (rewritten-inputs (package-inputs p)))
(propagated-inputs (rewritten-inputs (package-propagated-inputs p)))))) (propagated-inputs (rewritten-inputs (package-propagated-inputs p))))))
@ -125,21 +117,14 @@ configure flags for VARIABLE, the associated value is augmented."
(package (inherit p) (package (inherit p)
(location (source-properties->location loc)) (location (source-properties->location loc))
(arguments (arguments
(let ((augment (lambda (args)
(let ((a (default-keyword-arguments args (let ((a (default-keyword-arguments args
'(#:configure-flags '() '(#:configure-flags '()
#:strip-flags #f)))) #:strip-flags #f))))
(substitute-keyword-arguments a (substitute-keyword-arguments a
((#:configure-flags flags) ((#:configure-flags flags)
`(cons* "--disable-shared" `(cons* "--disable-shared" "LDFLAGS=-static" ,flags))
"LDFLAGS=-static"
,flags))
((#:strip-flags _) ((#:strip-flags _)
''("--strip-all"))))))) ''("--strip-all"))))))))
(if (procedure? args)
(lambda x
(augment (apply args x)))
(augment args)))))))
(define %store (define %store

View File

@ -110,7 +110,7 @@ representation."
(source package-source) ; <origin> instance (source package-source) ; <origin> instance
(build-system package-build-system) ; build system (build-system package-build-system) ; build system
(arguments package-arguments ; arguments for the build method (arguments package-arguments ; arguments for the build method
(default '())) (default '()) (thunked))
(inputs package-inputs ; input packages or derivations (inputs package-inputs ; input packages or derivations
(default '())) (default '()))
@ -290,6 +290,10 @@ PACKAGE for SYSTEM."
;; because some derivations, such as the implicit inputs of the GNU build ;; because some derivations, such as the implicit inputs of the GNU build
;; system, will be queried many, many times in a row. ;; system, will be queried many, many times in a row.
(cached package system (cached package system
;; Bind %CURRENT-SYSTEM so that thunked field values can refer
;; to it.
(parameterize ((%current-system system))
(match package (match package
(($ <package> name version source (= build-system-builder builder) (($ <package> name version source (= build-system-builder builder)
args inputs propagated-inputs native-inputs self-native-input? args inputs propagated-inputs native-inputs self-native-input?
@ -305,9 +309,7 @@ PACKAGE for SYSTEM."
(package-source-derivation store source system)) (package-source-derivation store source system))
inputs inputs
#:outputs outputs #:system system #:outputs outputs #:system system
(if (procedure? args) (args))))))))
(args system)
args)))))))
(define* (package-cross-derivation store package) (define* (package-cross-derivation store package)
;; TODO ;; TODO