From cfbf7877a673400881db20521a9d6a44261ed62b Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Wed, 12 Jun 2013 09:39:31 +0200 Subject: ld-wrapper: Unless in a build env., allow files that symlink to the store. * gnu/packages/ld-wrapper.scm (pure-file-name?): As a last resort, when %BUILD-DIRECTORY is false, check whether FILE is a symlink, and loop over it to check whether its target is in the store. --- gnu/packages/ld-wrapper.scm | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) (limited to 'gnu') diff --git a/gnu/packages/ld-wrapper.scm b/gnu/packages/ld-wrapper.scm index fd5a4cbd0c..41ff3df986 100644 --- a/gnu/packages/ld-wrapper.scm +++ b/gnu/packages/ld-wrapper.scm @@ -11,7 +11,7 @@ main="(@ (gnu build-support ld-wrapper) ld-wrapper)" exec @GUILE@ -c "(load-compiled \"$0.go\") (apply $main (cdr (command-line)))" "$@" !# ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2012 Ludovic Courtès +;;; Copyright © 2012, 2013 Ludovic Courtès ;;; ;;; This file is part of GNU Guix. ;;; @@ -82,13 +82,26 @@ exec @GUILE@ -c "(load-compiled \"$0.go\") (apply $main (cdr (command-line)))" " (getenv "GUIX_LD_WRAPPER_DEBUG")) (define (pure-file-name? file) - ;; Return #t when FILE is the name of a file either within the store or - ;; within the build directory. - (or (not (string-prefix? "/" file)) - (string-prefix? %store-directory file) - (string-prefix? %temporary-directory file) - (and %build-directory - (string-prefix? %build-directory file)))) + ;; Return #t when FILE is the name of a file either within the store + ;; (possibly via a symlink) or within the build directory. + (define %max-symlink-depth 50) + + (let loop ((file file) + (depth 0)) + (or (not (string-prefix? "/" file)) + (string-prefix? %store-directory file) + (string-prefix? %temporary-directory file) + (if %build-directory + (string-prefix? %build-directory file) + + ;; When used from a user environment, FILE may refer to + ;; ~/.guix-profile/lib/libfoo.so, which is itself a symlink to the + ;; store. Check whether this is the case. + (let ((s (false-if-exception (lstat file)))) + (and s + (eq? 'symlink (stat:type s)) + (< depth %max-symlink-depth) + (loop (readlink file) (+ 1 depth)))))))) (define (switch-arguments switch args) ;; Return the arguments passed for the occurrences of SWITCH--e.g., -- cgit 1.4.1 From fba96c4885aa5b95c42120387db0450d9794508a Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Thu, 20 Jun 2013 23:45:41 +0200 Subject: gnu: libgc: Switch to 7.2d. * gnu/packages/bdw-gc.scm (libgc): Upgrade to 7.2d. (libgc-7.2): Remove. --- gnu/packages/bdw-gc.scm | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) (limited to 'gnu') diff --git a/gnu/packages/bdw-gc.scm b/gnu/packages/bdw-gc.scm index e119fc0bb9..ad0577b1ea 100644 --- a/gnu/packages/bdw-gc.scm +++ b/gnu/packages/bdw-gc.scm @@ -25,7 +25,7 @@ (define-public libgc (package (name "libgc") - (version "7.2alpha6") + (version "7.2d") (source (origin (method url-fetch) (uri (string-append @@ -33,7 +33,7 @@ version ".tar.gz")) (sha256 (base32 - "05jwadjbrv8pr7z9cb4miskicxqpxm0pca4h2rg5cgbpajr2bx7b")))) + "0phwa5driahnpn79zqff14w9yc8sn3599cxz91m78hqdcpl0mznr")))) (build-system gnu-build-system) ;; TODO: Build with -DUSE_LIBC_PRIVATES (see make-bootstrap.scm). (synopsis "The Boehm-Demers-Weiser conservative garbage collector @@ -58,17 +58,3 @@ C or C++ programs, though that is not its primary goal.") ;; permissive X11-style license: ;; http://www.hpl.hp.com/personal/Hans_Boehm/gc/license.txt (license x11))) - -(define-public libgc-7.2 - ;; This is the latest final release of the 7.2 series. - ;; TODO: Use it as the default when doing a core-updates. - (package (inherit libgc) - (version "7.2d") - (source (origin - (method url-fetch) - (uri (string-append - "http://www.hpl.hp.com/personal/Hans_Boehm/gc/gc_source/gc-" - version ".tar.gz")) - (sha256 - (base32 - "0phwa5driahnpn79zqff14w9yc8sn3599cxz91m78hqdcpl0mznr")))))) -- cgit 1.4.1 From 4db00e42109b6f8229259859deac35499eec9004 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Thu, 20 Jun 2013 23:47:22 +0200 Subject: gnu: libgc: Always build with -DUSE_LIBC_PRIVATES. * gnu/packages/bdw-gc.scm (libgc): Add `arguments' field. * gnu/packages/make-bootstrap.scm (%guile-static): Remove local `libgc'. --- gnu/packages/bdw-gc.scm | 5 ++++- gnu/packages/make-bootstrap.scm | 8 +------- 2 files changed, 5 insertions(+), 8 deletions(-) (limited to 'gnu') diff --git a/gnu/packages/bdw-gc.scm b/gnu/packages/bdw-gc.scm index ad0577b1ea..bebb0862e3 100644 --- a/gnu/packages/bdw-gc.scm +++ b/gnu/packages/bdw-gc.scm @@ -35,7 +35,10 @@ (base32 "0phwa5driahnpn79zqff14w9yc8sn3599cxz91m78hqdcpl0mznr")))) (build-system gnu-build-system) - ;; TODO: Build with -DUSE_LIBC_PRIVATES (see make-bootstrap.scm). + (arguments + ;; Make it so that we don't rely on /proc. This is especially useful in + ;; an initrd run before /proc is mounted. + '(#:configure-flags '("CPPFLAGS=-DUSE_LIBC_PRIVATES"))) (synopsis "The Boehm-Demers-Weiser conservative garbage collector for C and C++") (description diff --git a/gnu/packages/make-bootstrap.scm b/gnu/packages/make-bootstrap.scm index de4e0dcbeb..b927d5db25 100644 --- a/gnu/packages/make-bootstrap.scm +++ b/gnu/packages/make-bootstrap.scm @@ -404,13 +404,7 @@ ;; A statically-linked Guile that is relocatable--i.e., it can search ;; .scm and .go files relative to its installation directory, rather ;; than in hard-coded configure-time paths. - (let* ((libgc (package (inherit libgc) - (arguments - ;; Make it so that we don't rely on /proc. This is - ;; especially useful in an initrd run before /proc is - ;; mounted. - '(#:configure-flags '("CPPFLAGS=-DUSE_LIBC_PRIVATES"))))) - (guile (package (inherit guile-2.0) + (let* ((guile (package (inherit guile-2.0) (name (string-append (package-name guile-2.0) "-static")) (inputs `(("patch/relocatable" -- cgit 1.4.1 From 56c092ce94cee893898f71ce61e443dd121cccdb Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Fri, 21 Jun 2013 00:25:54 +0200 Subject: build-system/gnu: Unify with (guix build-system gnu-cross-build). * guix/build/gnu-build-system.scm (set-paths): Add `native-inputs' and `native-search-paths' keyword parameters. Honor them. (configure): Add `target' and `native-inputs' keyword parameters. Look for Bash in NATIVE-INPUTS or INPUTS. Pass `--host' when TARGET is true. (strip): Add `strip-command' keyword parameter. Use it. * guix/build/gnu-cross-build.scm: Remove. * Makefile.am (MODULES): Adjust accordingly. * gnu/packages/acl.scm, gnu/packages/attr.scm, gnu/packages/base.scm, gnu/packages/bash.scm, gnu/packages/gawk.scm, gnu/packages/gettext.scm, gnu/packages/guile.scm, gnu/packages/libffi.scm, gnu/packages/libsigsegv.scm, gnu/packages/linux.scm, gnu/packages/ncurses.scm, gnu/packages/readline.scm, guix/build-system/gnu.scm: Replace `%standard-cross-phases' by `%standard-phases'. Remove references to (guix build gnu-cross-build). --- Makefile.am | 1 - gnu/packages/acl.scm | 2 +- gnu/packages/attr.scm | 2 +- gnu/packages/base.scm | 4 +- gnu/packages/bash.scm | 9 +-- gnu/packages/gawk.scm | 4 +- gnu/packages/gettext.scm | 2 +- gnu/packages/guile.scm | 4 +- gnu/packages/libffi.scm | 9 +-- gnu/packages/libsigsegv.scm | 4 +- gnu/packages/linux.scm | 10 +-- gnu/packages/ncurses.scm | 2 +- gnu/packages/readline.scm | 4 +- guix/build-system/gnu.scm | 6 +- guix/build/gnu-build-system.scm | 45 ++++++++++--- guix/build/gnu-cross-build.scm | 138 ---------------------------------------- 16 files changed, 54 insertions(+), 192 deletions(-) delete mode 100644 guix/build/gnu-cross-build.scm (limited to 'gnu') diff --git a/Makefile.am b/Makefile.am index 418b63a377..9faa6544ea 100644 --- a/Makefile.am +++ b/Makefile.am @@ -59,7 +59,6 @@ MODULES = \ guix/build/download.scm \ guix/build/cmake-build-system.scm \ guix/build/gnu-build-system.scm \ - guix/build/gnu-cross-build.scm \ guix/build/perl-build-system.scm \ guix/build/python-build-system.scm \ guix/build/utils.scm \ diff --git a/gnu/packages/acl.scm b/gnu/packages/acl.scm index 54c9116baf..b7604dcea6 100644 --- a/gnu/packages/acl.scm +++ b/gnu/packages/acl.scm @@ -46,7 +46,7 @@ (lambda _ (patch-makefile-SHELL "include/buildmacros")) ,(if (%current-target-system) - '%standard-cross-phases + '%standard-phases '(alist-replace 'check (lambda _ (system* "make" "tests" "-C" "test") diff --git a/gnu/packages/attr.scm b/gnu/packages/attr.scm index 3fb15d235f..2ce50296ac 100644 --- a/gnu/packages/attr.scm +++ b/gnu/packages/attr.scm @@ -55,7 +55,7 @@ ;; When building natively, adjust the test cases. ,(if (%current-target-system) - '%standard-cross-phases + '%standard-phases '(alist-replace 'check (lambda _ ;; Use the right shell. diff --git a/gnu/packages/base.scm b/gnu/packages/base.scm index 85380549ff..95052775c5 100644 --- a/gnu/packages/base.scm +++ b/gnu/packages/base.scm @@ -293,9 +293,7 @@ The tools supplied with this package are: (substitute* (find-files "tests" "\\.sh$") (("#!/bin/sh") (format #f "#!~a/bin/bash" bash))))) - ,(if (%current-target-system) - '%standard-cross-phases - '%standard-phases)))) + %standard-phases))) (synopsis "Core GNU utilities (file, text, shell)") (description "The GNU Core Utilities are the basic file, shell and text manipulation diff --git a/gnu/packages/bash.scm b/gnu/packages/bash.scm index bf51403f1a..aa3f397a52 100644 --- a/gnu/packages/bash.scm +++ b/gnu/packages/bash.scm @@ -82,9 +82,7 @@ #:phases (alist-cons-after 'install 'post-install ,post-install-phase - ,(if (%current-target-system) - '%standard-cross-phases - '%standard-phases)))) + %standard-phases))) (synopsis "The GNU Bourne-Again SHell") (description "Bash is the shell, or command language interpreter, that will appear in @@ -106,10 +104,7 @@ modification.") (let ((args `(#:modules ((guix build gnu-build-system) (guix build utils) (srfi srfi-1) - (srfi srfi-26) - ,@(if (%current-target-system) - '((guix build gnu-cross-build)) - '())) + (srfi srfi-26)) ,@(package-arguments bash)))) (substitute-keyword-arguments args ((#:configure-flags flags) diff --git a/gnu/packages/gawk.scm b/gnu/packages/gawk.scm index 444fa5e556..1b19f7bfd2 100644 --- a/gnu/packages/gawk.scm +++ b/gnu/packages/gawk.scm @@ -50,9 +50,7 @@ (substitute* "io.c" (("/bin/sh") (string-append bash "/bin/bash"))))) - ,(if (%current-target-system) - '%standard-cross-phases - '%standard-phases)))) + %standard-phases))) (inputs `(("libsigsegv" ,libsigsegv) ;; TODO: On next core-updates, make Bash input unconditional. diff --git a/gnu/packages/gettext.scm b/gnu/packages/gettext.scm index e22b1ba6ff..c838f9c0a6 100644 --- a/gnu/packages/gettext.scm +++ b/gnu/packages/gettext.scm @@ -39,7 +39,7 @@ (arguments `(#:patches (list (assoc-ref %build-inputs "patch/gets")) #:phases ,(if (%current-target-system) - '%standard-cross-phases + '%standard-phases '(alist-cons-before 'check 'patch-tests (lambda* (#:key inputs #:allow-other-keys) diff --git a/gnu/packages/guile.scm b/gnu/packages/guile.scm index b53f3eb770..c4eca3e350 100644 --- a/gnu/packages/guile.scm +++ b/gnu/packages/guile.scm @@ -158,9 +158,7 @@ extensible. It supports many SRFIs.") (substitute* "module/ice-9/popen.scm" (("/bin/sh") (string-append bash "/bin/bash"))))) - ,(if (%current-target-system) - '%standard-cross-phases - '%standard-phases)) + %standard-phases) ,@(if (%current-target-system) '(#:configure-flags '("CC_FOR_BUILD=gcc")) diff --git a/gnu/packages/libffi.scm b/gnu/packages/libffi.scm index f7d4a8c908..fdebab7433 100644 --- a/gnu/packages/libffi.scm +++ b/gnu/packages/libffi.scm @@ -49,15 +49,10 @@ "0ln4jbpb6clcsdpb9niqk0frgx4k0xki96wiv067ig0q4cajb7aq")))) (build-system gnu-build-system) (arguments `(#:modules ((guix build utils) (guix build gnu-build-system) - (ice-9 ftw) (srfi srfi-26) - ,@(if (%current-target-system) - '((guix build gnu-cross-build)) - '())) + (ice-9 ftw) (srfi srfi-26)) #:phases (alist-cons-after 'install 'post-install ,post-install-phase - ,(if (%current-target-system) - '%standard-cross-phases - '%standard-phases)))) + %standard-phases))) (synopsis "Foreign function call interface library") (description "The libffi library provides a portable, high level programming interface diff --git a/gnu/packages/libsigsegv.scm b/gnu/packages/libsigsegv.scm index 4689b3d8b5..62fb40737a 100644 --- a/gnu/packages/libsigsegv.scm +++ b/gnu/packages/libsigsegv.scm @@ -49,9 +49,7 @@ (lambda _ (substitute* "src/fault-linux-mips-old.h" (("#include ") ""))) - ,(if (%current-target-system) - '%standard-cross-phases - '%standard-phases))) + %standard-phases)) '())) (description "GNU libsigsegv is a library for handling page faults in user mode. A page diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm index 0bc9fbcb5e..dde53e9f5d 100644 --- a/gnu/packages/linux.scm +++ b/gnu/packages/linux.scm @@ -80,18 +80,12 @@ (arguments `(#:modules ((guix build gnu-build-system) (guix build utils) - (srfi srfi-1) - ,@(if (%current-target-system) - '((guix build gnu-cross-build)) - '())) + (srfi srfi-1)) #:phases (alist-replace 'build ,(build-phase (%current-system)) (alist-replace 'install ,install-phase - (alist-delete 'configure - ,(if (%current-target-system) - '%standard-cross-phases - '%standard-phases)))) + (alist-delete 'configure %standard-phases))) #:tests? #f)) (synopsis "GNU Linux-Libre kernel headers") (description "Headers of the Linux-Libre kernel.") diff --git a/gnu/packages/ncurses.scm b/gnu/packages/ncurses.scm index c1badae8a3..e5a9bce0f1 100644 --- a/gnu/packages/ncurses.scm +++ b/gnu/packages/ncurses.scm @@ -116,7 +116,7 @@ ,cross-pre-install-phase (alist-cons-after 'install 'post-install ,post-install-phase - %standard-cross-phases))) + %standard-phases))) `(alist-cons-after ; native build 'install 'post-install ,post-install-phase diff --git a/gnu/packages/readline.scm b/gnu/packages/readline.scm index 1fb4376971..8857666fcc 100644 --- a/gnu/packages/readline.scm +++ b/gnu/packages/readline.scm @@ -61,9 +61,7 @@ #:phases (alist-cons-after 'install 'post-install ,post-install-phase - ,(if (%current-target-system) - '%standard-cross-phases - '%standard-phases)))) + %standard-phases))) (synopsis "Edit command lines while typing, with history support") (description "The GNU Readline library provides a set of functions for use by diff --git a/guix/build-system/gnu.scm b/guix/build-system/gnu.scm index 35590aa3da..b72239d13e 100644 --- a/guix/build-system/gnu.scm +++ b/guix/build-system/gnu.scm @@ -340,14 +340,12 @@ inputs." (strip-flags ''("--strip-debug")) (strip-directories ''("lib" "lib64" "libexec" "bin" "sbin")) - (phases '%standard-cross-phases) + (phases '%standard-phases) (system (%current-system)) - (implicit-inputs? #t) ; useful when bootstrapping + (implicit-inputs? #t) (imported-modules '((guix build gnu-build-system) - (guix build gnu-cross-build) (guix build utils))) (modules '((guix build gnu-build-system) - (guix build gnu-cross-build) (guix build utils)))) "Cross-build NAME for TARGET, where TARGET is a GNU triplet. INPUTS are cross-built inputs, and NATIVE-INPUTS are inputs that run on the build diff --git a/guix/build/gnu-build-system.scm b/guix/build/gnu-build-system.scm index 47820aa02e..4245f2aefd 100644 --- a/guix/build/gnu-build-system.scm +++ b/guix/build/gnu-build-system.scm @@ -48,15 +48,28 @@ #f dir)) -(define* (set-paths #:key inputs (search-paths '()) +(define* (set-paths #:key target inputs native-inputs + (search-paths '()) (native-search-paths '()) #:allow-other-keys) (define input-directories (match inputs (((_ . dir) ...) dir))) + (define native-input-directories + (match native-inputs + (((_ . dir) ...) + dir) + (#f ; not cross compiling + '()))) + + ;; When cross building, $PATH must refer only to native (host) inputs since + ;; target inputs are not executable. (set-path-environment-variable "PATH" '("bin" "sbin") - input-directories) + (append native-input-directories + (if target + '() + input-directories))) (for-each (match-lambda ((env-var (directories ...) separator) @@ -65,6 +78,15 @@ #:separator separator))) search-paths) + (when native-search-paths + ;; Search paths for native inputs, when cross building. + (for-each (match-lambda + ((env-var (directories ...) separator) + (set-path-environment-variable env-var directories + native-input-directories + #:separator separator))) + native-search-paths)) + ;; Dump the environment variables as a shell script, for handy debugging. (system "export > environment-variables")) @@ -102,7 +124,8 @@ makefiles." (append patch-flags (list "--input" p))))) patches)) -(define* (configure #:key inputs outputs (configure-flags '()) out-of-source? +(define* (configure #:key target native-inputs inputs outputs + (configure-flags '()) out-of-source? #:allow-other-keys) (define (package-name) (let* ((out (assoc-ref outputs "out")) @@ -119,7 +142,7 @@ makefiles." (libdir (assoc-ref outputs "lib")) (includedir (assoc-ref outputs "include")) (docdir (assoc-ref outputs "doc")) - (bash (or (and=> (assoc-ref inputs "bash") + (bash (or (and=> (assoc-ref (or native-inputs inputs) "bash") (cut string-append <> "/bin/bash")) "/bin/sh")) (flags `(,(string-append "CONFIG_SHELL=" bash) @@ -148,6 +171,9 @@ makefiles." (list (string-append "--docdir=" docdir "/doc/" (package-name))) '()) + ,@(if target ; cross building + (list (string-append "--host=" target)) + '()) ,@configure-flags)) (abs-srcdir (getcwd)) (srcdir (if out-of-source? @@ -230,17 +256,20 @@ makefiles." bindirs))) #t) -(define* (strip #:key outputs (strip-binaries? #t) +(define* (strip #:key target outputs (strip-binaries? #t) + (strip-command (if target + (string-append target "-strip") + "strip")) (strip-flags '("--strip-debug")) (strip-directories '("lib" "lib64" "libexec" "bin" "sbin")) #:allow-other-keys) (define (strip-dir dir) - (format #t "stripping binaries in ~s with flags ~s~%" - dir strip-flags) + (format #t "stripping binaries in ~s with ~s and flags ~s~%" + dir strip-command strip-flags) (file-system-fold (const #t) (lambda (path stat result) ; leaf - (zero? (apply system* "strip" + (zero? (apply system* strip-command (append strip-flags (list path))))) (const #t) ; down (const #t) ; up diff --git a/guix/build/gnu-cross-build.scm b/guix/build/gnu-cross-build.scm deleted file mode 100644 index dab60684ac..0000000000 --- a/guix/build/gnu-cross-build.scm +++ /dev/null @@ -1,138 +0,0 @@ -;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2013 Ludovic Courtès -;;; -;;; This file is part of GNU Guix. -;;; -;;; GNU Guix is free software; you can redistribute it and/or modify it -;;; under the terms of the GNU General Public License as published by -;;; the Free Software Foundation; either version 3 of the License, or (at -;;; your option) any later version. -;;; -;;; GNU Guix is distributed in the hope that it will be useful, but -;;; WITHOUT ANY WARRANTY; without even the implied warranty of -;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;;; GNU General Public License for more details. -;;; -;;; You should have received a copy of the GNU General Public License -;;; along with GNU Guix. If not, see . - -(define-module (guix build gnu-cross-build) - #:use-module (guix build utils) - #:use-module ((guix build gnu-build-system) - #:renamer (symbol-prefix-proc 'build:)) - #:use-module (ice-9 ftw) - #:use-module (ice-9 match) - #:use-module (srfi srfi-1) - #:export (%standard-cross-phases - gnu-cross-build)) - -;;; Commentary: -;;; -;;; Extension of `gnu-build-system.scm' to support cross-compilation. -;;; -;;; Code: - -(define* (set-paths #:key inputs native-inputs - (search-paths '()) (native-search-paths '()) - #:allow-other-keys) - (define input-directories - (match inputs - (((_ . dir) ...) - dir))) - - (define native-input-directories - (match native-inputs - (((_ . dir) ...) - dir))) - - ;; $PATH must refer only to native (host) inputs since target inputs are not - ;; executable. - (set-path-environment-variable "PATH" '("bin" "sbin") - native-input-directories) - - ;; Search paths for target inputs. - (for-each (match-lambda - ((env-var (directories ...) separator) - (set-path-environment-variable env-var directories - input-directories - #:separator separator))) - search-paths) - - ;; Search paths for native inputs. - (for-each (match-lambda - ((env-var (directories ...) separator) - (set-path-environment-variable env-var directories - native-input-directories - #:separator separator))) - native-search-paths) - - ;; Dump the environment variables as a shell script, for handy debugging. - (system "export > environment-variables")) - -(define* (configure #:key - inputs outputs (configure-flags '()) out-of-source? - target native-inputs - #:allow-other-keys) - (format #t "configuring for cross-compilation to `~a'~%" target) - (apply (assoc-ref build:%standard-phases 'configure) - #:configure-flags (cons (string-append "--host=" target) - configure-flags) - - ;; XXX: The underlying `configure' phase looks for Bash among - ;; #:inputs, so fool it this way. - #:inputs native-inputs - - #:outputs outputs - #:out-of-source? out-of-source? - '())) - -(define* (strip #:key target outputs (strip-binaries? #t) - (strip-flags '("--strip-debug")) - (strip-directories '("lib" "lib64" "libexec" - "bin" "sbin")) - #:allow-other-keys) - ;; TODO: The only difference with `strip' in gnu-build-system.scm is the - ;; name of the strip command; factorize it. - - (define (strip-dir dir) - (format #t "stripping binaries in ~s with flags ~s~%" - dir strip-flags) - (file-system-fold (const #t) - (lambda (path stat result) ; leaf - (zero? (apply system* - (string-append target "-strip") - (append strip-flags (list path))))) - (const #t) ; down - (const #t) ; up - (const #t) ; skip - (lambda (path stat errno result) - (format (current-error-port) - "strip: failed to access `~a': ~a~%" - path (strerror errno)) - #f) - #t - dir)) - - (or (not strip-binaries?) - (every strip-dir - (append-map (match-lambda - ((_ . dir) - (filter-map (lambda (d) - (let ((sub (string-append dir "/" d))) - (and (directory-exists? sub) sub))) - strip-directories))) - outputs)))) - -(define %standard-cross-phases - ;; The standard phases when cross-building. - (let ((replacements `((set-paths ,set-paths) - (configure ,configure) - (strip ,strip)))) - (fold (lambda (replacement phases) - (match replacement - ((name proc) - (alist-replace name proc phases)))) - (alist-delete 'check build:%standard-phases) - replacements))) - -;;; gnu-cross-build.scm ends here -- cgit 1.4.1 From 2a511f7a1a114eeba49273a1c32d80dfff5dee10 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sat, 22 Jun 2013 16:27:13 +0200 Subject: gnu: gzip: Upgrade to 1.6. * gnu/packages/compression.scm (gzip): Upgrade. --- gnu/packages/compression.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gnu') diff --git a/gnu/packages/compression.scm b/gnu/packages/compression.scm index b39119f611..8196d695b3 100644 --- a/gnu/packages/compression.scm +++ b/gnu/packages/compression.scm @@ -66,14 +66,14 @@ in compression.") (define-public gzip (package (name "gzip") - (version "1.5") + (version "1.6") (source (origin (method url-fetch) (uri (string-append "mirror://gnu/gzip/gzip-" version ".tar.gz")) (sha256 (base32 - "18rm80kar7n016g8bsyy1a3zk50i2826xdgs874yh64rzj7nxmdm")))) + "0zlgdm4v3dndrbiz7b67mbbj25dpwqbmbzjiycssvrfrcfvq7swp")))) (build-system gnu-build-system) (synopsis "General file (de)compression (using lzw)") (arguments -- cgit 1.4.1 From d16368cf41f1b685c523de04f86ded11914c218b Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sat, 22 Jun 2013 16:29:19 +0200 Subject: gnu: gawk: Upgrade to 4.1.0. * gnu/packages/gawk.scm (gawk): Update to 4.1.0. Remove wrong-headed comments. --- gnu/packages/gawk.scm | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'gnu') diff --git a/gnu/packages/gawk.scm b/gnu/packages/gawk.scm index 1b19f7bfd2..da570e6617 100644 --- a/gnu/packages/gawk.scm +++ b/gnu/packages/gawk.scm @@ -27,13 +27,13 @@ (define-public gawk (package (name "gawk") - (version "4.0.2") + (version "4.1.0") (source (origin (method url-fetch) (uri (string-append "mirror://gnu/gawk/gawk-" version ".tar.xz")) (sha256 - (base32 "04vd0axif762mf781pj3days6ilv2333b9zi9c50y5mma66g5q91")))) + (base32 "0hin2hswbbd6kd6i4zzvgciwpl5fba8d2s524z8y5qagyz3x010q")))) (build-system gnu-build-system) (arguments `(#:parallel-tests? #f ; test suite fails in parallel @@ -45,7 +45,6 @@ 'configure 'set-shell-file-name (lambda* (#:key inputs #:allow-other-keys) ;; Refer to the right shell. - ;; FIXME: Remove `else' arm upon core-updates. (let ((bash (assoc-ref inputs "bash"))) (substitute* "io.c" (("/bin/sh") @@ -53,7 +52,6 @@ %standard-phases))) (inputs `(("libsigsegv" ,libsigsegv) - ;; TODO: On next core-updates, make Bash input unconditional. ,@(if (%current-target-system) `(("bash" ,bash)) '()))) -- cgit 1.4.1 From 8572bf5e0c921dfcd860a220e7646d1b3f4a90da Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sat, 22 Jun 2013 16:29:40 +0200 Subject: gnu: gmp: Upgrade to 5.1.2. * gnu/packages/multiprecision.scm (gmp): Update to 5.1.2. --- gnu/packages/multiprecision.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gnu') diff --git a/gnu/packages/multiprecision.scm b/gnu/packages/multiprecision.scm index 19c32352b3..46acba3065 100644 --- a/gnu/packages/multiprecision.scm +++ b/gnu/packages/multiprecision.scm @@ -27,7 +27,7 @@ (define-public gmp (package (name "gmp") - (version "5.1.1") + (version "5.1.2") (source (origin (method url-fetch) (uri @@ -35,7 +35,7 @@ version ".tar.xz")) (sha256 (base32 - "1hili06lcf0clg5qfvz7knm6pmj6ab54yhsvskp1mdny5xw4vmjb")))) + "1hnbxz7a6jrli8ph27i8zb6k2f456zn6l5xi78yhskzbxjk47nf7")))) (build-system gnu-build-system) (native-inputs `(("m4" ,m4))) (arguments `(#:configure-flags -- cgit 1.4.1 From ee26820636c2521bb0a15bd960814bafa780635e Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sat, 22 Jun 2013 16:32:30 +0200 Subject: gnu: acl, attr: Make `gettext' a native input. * gnu/packages/acl.scm (acl): Make `gettext' a native input, always. * gnu/packages/attr.scm (attr): Likewise. --- gnu/packages/acl.scm | 9 ++------- gnu/packages/attr.scm | 16 ++++++---------- 2 files changed, 8 insertions(+), 17 deletions(-) (limited to 'gnu') diff --git a/gnu/packages/acl.scm b/gnu/packages/acl.scm index b7604dcea6..dde9ac4f34 100644 --- a/gnu/packages/acl.scm +++ b/gnu/packages/acl.scm @@ -60,14 +60,9 @@ ;; Perl is needed to run tests; remove it from cross builds. ,@(if (%current-target-system) '() - `(("gettext" ,guix:gettext) - ("perl" ,perl))))) + `(("perl" ,perl))))) (native-inputs - ;; FIXME: Upon next core-updates, make gettext a native input - ;; unconditionally. - (if (%current-target-system) - `(("gettext" ,guix:gettext)) - '())) + `(("gettext" ,guix:gettext))) (home-page "http://savannah.nongnu.org/projects/acl") diff --git a/gnu/packages/attr.scm b/gnu/packages/attr.scm index 2ce50296ac..3108a9072a 100644 --- a/gnu/packages/attr.scm +++ b/gnu/packages/attr.scm @@ -69,17 +69,13 @@ ;; dependent on the underlying file system. #t) %standard-phases)))))) - (inputs `(;; Perl is needed to run tests; remove it from cross builds. - ,@(if (%current-target-system) - '() - `(("perl" ,perl) - ("gettext" ,guix:gettext))))) - (native-inputs - ;; FIXME: Upon next core-updates, make gettext a native input - ;; unconditionally. + (inputs + ;; Perl is needed to run tests; remove it from cross builds. (if (%current-target-system) - `(("gettext" ,guix:gettext)) - '())) + '() + `(("perl" ,perl)))) + (native-inputs + `(("gettext" ,guix:gettext))) (home-page "http://savannah.nongnu.org/projects/attr/") (synopsis "Library and tools for manipulating extended attributes") -- cgit 1.4.1 From b15669f37daecd9d06e0d4b3c864ecdbb81c9b9c Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sat, 22 Jun 2013 16:42:46 +0200 Subject: utils: `set-path-environment-variable' calls `unsetenv' for empty values. * guix/build/utils.scm (set-path-environment-variable): When VALUE is the empty string, call `unsetenv' instead of `setenv'. * gnu/packages/guile.scm (guile-2.0)[arguments]: Remove `unsetenv' trick. --- gnu/packages/guile.scm | 11 ----------- guix/build/utils.scm | 14 +++++++++++--- 2 files changed, 11 insertions(+), 14 deletions(-) (limited to 'gnu') diff --git a/gnu/packages/guile.scm b/gnu/packages/guile.scm index c4eca3e350..c78ab57915 100644 --- a/gnu/packages/guile.scm +++ b/gnu/packages/guile.scm @@ -142,17 +142,6 @@ extensible. It supports many SRFIs.") `(#:phases (alist-cons-before 'configure 'pre-configure (lambda* (#:key inputs #:allow-other-keys) - ;; By default we end up with GUILE_LOAD_PATH="" and - ;; GUILE_LOAD_COMPILED_PATH="". But that is equivalent to - ;; ".", and breaks the build system when cross-compiling. - ;; Thus, make sure they are unset. - ;; TODO: Eventually fix `set-path-environment-variable' - ;; for that case. - ,@(if (%current-target-system) - '((unsetenv "GUILE_LOAD_PATH") - (unsetenv "GUILE_LOAD_COMPILED_PATH")) - '()) - ;; Tell (ice-9 popen) the file name of Bash. (let ((bash (assoc-ref inputs "bash"))) (substitute* "module/ice-9/popen.scm" diff --git a/guix/build/utils.scm b/guix/build/utils.scm index a4a82a5f8c..c0b150e016 100644 --- a/guix/build/utils.scm +++ b/guix/build/utils.scm @@ -248,9 +248,17 @@ SEPARATOR-separated path accordingly. Example: " (let* ((path (search-path-as-list sub-directories input-dirs)) (value (list->search-path-as-string path separator))) - (setenv env-var value) - (format #t "environment variable `~a' set to `~a'~%" - env-var value))) + (if (string-null? value) + (begin + ;; Never set ENV-VAR to an empty string because often, the empty + ;; string is equivalent to ".". This is the case for + ;; GUILE_LOAD_PATH in Guile 2.0, for instance. + (unsetenv env-var) + (format #t "environment variable `~a' unset~%" env-var)) + (begin + (setenv env-var value) + (format #t "environment variable `~a' set to `~a'~%" + env-var value))))) (define (which program) "Return the complete file name for PROGRAM as found in $PATH, or #f if -- cgit 1.4.1 From a62b83d52fb154e6d1073ab3620daa48e101f933 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sat, 22 Jun 2013 16:47:09 +0200 Subject: gnu: libffi: Upgrade to 3.0.13. * gnu/packages/libffi.scm (libffi): Upgrade to 3.0.13. --- gnu/packages/libffi.scm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'gnu') diff --git a/gnu/packages/libffi.scm b/gnu/packages/libffi.scm index fdebab7433..0707bf8a7e 100644 --- a/gnu/packages/libffi.scm +++ b/gnu/packages/libffi.scm @@ -29,7 +29,7 @@ (define out (assoc-ref outputs "out")) (mkdir (string-append out "/include")) (with-directory-excursion - (string-append out "/lib/libffi-3.0.9/include") + (string-append out "/lib/libffi-3.0.13/include") (for-each (lambda (h) (format #t "moving `~a' to includedir~%" h) (rename-file h (string-append out "/include/" h))) @@ -38,7 +38,7 @@ (not (member x '("." "..")))))))))) (package (name "libffi") - (version "3.0.9") + (version "3.0.13") (source (origin (method url-fetch) (uri @@ -46,7 +46,7 @@ name "-" version ".tar.gz")) (sha256 (base32 - "0ln4jbpb6clcsdpb9niqk0frgx4k0xki96wiv067ig0q4cajb7aq")))) + "077ibkf84bvcd6rw1m6jb107br63i2pp301rkmsbgg6300adxp8x")))) (build-system gnu-build-system) (arguments `(#:modules ((guix build utils) (guix build gnu-build-system) (ice-9 ftw) (srfi srfi-26)) -- cgit 1.4.1 From 1e4310f1f269d26f7129e1bae167c8d8b096ea10 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Tue, 25 Jun 2013 00:00:09 +0200 Subject: gnu: gawk: Allow cross-compilation. * gnu/packages/gawk.scm (gawk)[arguments]: Annihilate the `check-for-shared-lib-support' target when cross-compiling. --- gnu/packages/gawk.scm | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'gnu') diff --git a/gnu/packages/gawk.scm b/gnu/packages/gawk.scm index da570e6617..aff856d9f3 100644 --- a/gnu/packages/gawk.scm +++ b/gnu/packages/gawk.scm @@ -38,9 +38,6 @@ (arguments `(#:parallel-tests? #f ; test suite fails in parallel - ;; Work around test failure on Cygwin. - #:tests? ,(not (string=? (%current-system) "i686-cygwin")) - #:phases (alist-cons-before 'configure 'set-shell-file-name (lambda* (#:key inputs #:allow-other-keys) @@ -48,7 +45,16 @@ (let ((bash (assoc-ref inputs "bash"))) (substitute* "io.c" (("/bin/sh") - (string-append bash "/bin/bash"))))) + (string-append bash "/bin/bash"))) + + ;; When cross-compiling, remove dependencies on the + ;; `check-for-shared-lib-support' target, which tries to + ;; run the cross-built `gawk'. + ,@(if (%current-target-system) + '((substitute* "extension/Makefile.in" + (("^.*: check-for-shared-lib-support" match) + (string-append "### " match)))) + '()))) %standard-phases))) (inputs `(("libsigsegv" ,libsigsegv) -- cgit 1.4.1 From 0de71c233cb1d4fdea1d41bfe8a39be778502d81 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Tue, 25 Jun 2013 20:57:14 +0200 Subject: gnu: cross-base: Make the cross tools native inputs. * gnu/packages/cross-base.scm (cross-gcc): Change `inputs' to `native-inputs', and set `inputs' to the empty list. (cross-libc): Likewise. --- gnu/packages/cross-base.scm | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'gnu') diff --git a/gnu/packages/cross-base.scm b/gnu/packages/cross-base.scm index 5c46d00b20..4cfbbba234 100644 --- a/gnu/packages/cross-base.scm +++ b/gnu/packages/cross-base.scm @@ -175,7 +175,8 @@ GCC that does not target a libc; otherwise, target that libc." ;; ;; for instance. #f)))) - (inputs + + (native-inputs `(("patch/cross-env-vars" ,(search-patch "gcc-cross-environment-variables.patch")) @@ -193,6 +194,8 @@ GCC that does not target a libc; otherwise, target that libc." ,@inputs) inputs)))) + (inputs '()) + ;; Only search target inputs, not host inputs. (search-paths (list (search-path-specification @@ -225,9 +228,9 @@ XBINUTILS and the cross tool chain." (and (zero? (system* "make" "defconfig")) (zero? (system* "make" "mrproper" "headers_check")))) ,phases)))) - (inputs `(("cross-gcc" ,xgcc) - ("cross-binutils" ,xbinutils) - ,@(package-inputs linux-libre-headers))))) + (native-inputs `(("cross-gcc" ,xgcc) + ("cross-binutils" ,xbinutils) + ,@(package-native-inputs linux-libre-headers))))) (package (inherit glibc) (name (string-append "glibc-cross-" target)) @@ -248,9 +251,9 @@ XBINUTILS and the cross tool chain." #t)) ,phases)))) (propagated-inputs `(("cross-linux-headers" ,xlinux-headers))) - (inputs `(("cross-gcc" ,xgcc) - ("cross-binutils" ,xbinutils) - ,@(package-inputs glibc))))) + (native-inputs `(("cross-gcc" ,xgcc) + ("cross-binutils" ,xbinutils) + ,@(package-native-inputs glibc))))) ;;; -- cgit 1.4.1 From a410a0105d9517ccc0982b396588835899f6fc3f Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Tue, 25 Jun 2013 23:39:14 +0200 Subject: gnu: make-bootstrap: Allow cross-compilation of the bootstrap tarballs. * gnu/packages/make-bootstrap.scm (package-with-relocatable-glibc): Turn `inputs' into a thunk. Add `native-inputs', and pass it to `package-with-explicit-inputs'. (%static-inputs): Add %BASH-STATIC as an input to gawk when cross building. (%glibc-stripped): When cross compiling, use (glibc-for-bootstrap (cross-libc)) as the basis. (%gcc-static): Base on GCC-4.7, not GCC-FINAL. (tarball-package): TAR and XZ are native inputs. Choose the tarball file name based on (%current-target-system) too. --- gnu/packages/make-bootstrap.scm | 193 +++++++++++++++++++++++----------------- 1 file changed, 112 insertions(+), 81 deletions(-) (limited to 'gnu') diff --git a/gnu/packages/make-bootstrap.scm b/gnu/packages/make-bootstrap.scm index c8de969b1a..13f858adc6 100644 --- a/gnu/packages/make-bootstrap.scm +++ b/gnu/packages/make-bootstrap.scm @@ -24,6 +24,7 @@ #:use-module (guix build-system gnu) #:use-module ((gnu packages) #:select (search-patch)) #:use-module (gnu packages base) + #:use-module (gnu packages cross-base) #:use-module (gnu packages bash) #:use-module (gnu packages compression) #:use-module (gnu packages gawk) @@ -49,20 +50,20 @@ ;;; ;;; Code: -(define* (glibc-for-bootstrap #:optional (base glibc-final)) +(define* (glibc-for-bootstrap #:optional (base glibc)) "Return a libc deriving from BASE whose `system' and `popen' functions looks for `sh' in $PATH, and without nscd, and with static NSS modules." (package (inherit base) (arguments (substitute-keyword-arguments (package-arguments base) ((#:patches patches) - `(cons (assoc-ref %build-inputs "patch/system") ,patches)) + `(cons (assoc-ref %build-inputs "patch/system") ,patches)) ((#:configure-flags flags) - ;; Arrange so that getaddrinfo & co. do not contact the nscd, - ;; and can use statically-linked NSS modules. - `(cons* "--disable-nscd" "--disable-build-nscd" - "--enable-static-nss" - ,flags)))) + ;; Arrange so that getaddrinfo & co. do not contact the nscd, + ;; and can use statically-linked NSS modules. + `(cons* "--disable-nscd" "--disable-build-nscd" + "--enable-static-nss" + ,flags)))) (inputs `(("patch/system" ,(search-patch "glibc-bootstrap-system.patch")) ,@(package-inputs base))))) @@ -71,17 +72,39 @@ for `sh' in $PATH, and without nscd, and with static NSS modules." "Return a variant of P that uses the libc as defined by `glibc-for-bootstrap'." - (define inputs - `(("libc", (glibc-for-bootstrap)) - ("gcc" ,(package-with-explicit-inputs - gcc-4.7 - `(("libc",(glibc-for-bootstrap)) - ,@(alist-delete "libc" %final-inputs)) - (current-source-location))) - ,@(fold alist-delete %final-inputs '("libc" "gcc")))) + (define (cross-bootstrap-libc) + (let ((target (%current-target-system))) + (glibc-for-bootstrap + ;; `cross-libc' already returns a cross libc, so clear + ;; %CURRENT-TARGET-SYSTEM. + (parameterize ((%current-target-system #f)) + (cross-libc target))))) + + ;; Standard inputs with the above libc and corresponding GCC. + + (define (inputs) + (if (%current-target-system) ; is this package cross built? + `(("cross-libc" ,(cross-bootstrap-libc))) + '())) + + (define (native-inputs) + (if (%current-target-system) + (let ((target (%current-target-system))) + `(("cross-gcc" ,(cross-gcc target + (cross-binutils target) + (cross-bootstrap-libc))) + ("cross-binutils" ,(cross-binutils target)) + ,@%final-inputs)) + `(("libc" ,(glibc-for-bootstrap)) + ("gcc" ,(package (inherit gcc-4.7) + (inputs + `(("libc",(glibc-for-bootstrap)) + ,@(package-inputs gcc-4.7))))) + ,@(fold alist-delete %final-inputs '("libc" "gcc"))))) (package-with-explicit-inputs p inputs - (current-source-location))) + (current-source-location) + #:native-inputs native-inputs)) (define %bash-static (static-package bash-light)) @@ -140,9 +163,12 @@ for `sh' in $PATH, and without nscd, and with static NSS modules." (substitute* "configure" (("-export-dynamic") ""))) ,phases))))) - (inputs `(("patch/sh" ,(search-patch "gawk-shell.patch")))))) - (finalize (compose static-package - package-with-relocatable-glibc))) + (inputs `(("patch/sh" ,(search-patch "gawk-shell.patch")) + ,@(if (%current-target-system) + `(("bash" ,%bash-static)) + '()))))) + (finalize (compose static-package + package-with-relocatable-glibc))) `(,@(map (match-lambda ((name package) (list name (finalize package)))) @@ -155,12 +181,7 @@ for `sh' in $PATH, and without nscd, and with static NSS modules." ("sed" ,sed) ("grep" ,grep) ("gawk" ,gawk))) - ("bash" ,%bash-static) - ;; ("ld-wrapper" ,ld-wrapper) - ;; ("binutils" ,binutils-final) - ;; ("gcc" ,gcc-final) - ;; ("libc" ,glibc-final) - ))) + ("bash" ,%bash-static)))) (define %static-binaries (package @@ -330,7 +351,12 @@ for `sh' in $PATH, and without nscd, and with static NSS modules." (copy-recursively (string-append linux "/include/asm-generic") (string-append incdir "/asm-generic")) #t)))) - (inputs `(("libc" ,glibc) + (inputs `(("libc" ,(let ((target (%current-target-system))) + (if target + (glibc-for-bootstrap + (parameterize ((%current-target-system #f)) + (cross-libc target))) + glibc))) ("linux-headers" ,linux-libre-headers))) ;; Only one output. @@ -339,7 +365,7 @@ for `sh' in $PATH, and without nscd, and with static NSS modules." (define %gcc-static ;; A statically-linked GCC, with stripped-down functionality. (package-with-relocatable-glibc - (package (inherit gcc-final) + (package (inherit gcc-4.7) (name "gcc-static") (arguments `(#:modules ((guix build utils) @@ -347,7 +373,7 @@ for `sh' in $PATH, and without nscd, and with static NSS modules." (srfi srfi-1) (srfi srfi-26) (ice-9 regex)) - ,@(substitute-keyword-arguments (package-arguments gcc-final) + ,@(substitute-keyword-arguments (package-arguments gcc-4.7) ((#:guile _) #f) ((#:implicit-inputs? _) #t) ((#:configure-flags flags) @@ -365,10 +391,10 @@ for `sh' in $PATH, and without nscd, and with static NSS modules." ((#:make-flags flags) `(cons "BOOT_LDFLAGS=-static" ,flags))))) (inputs `(("gmp-source" ,(package-source gmp)) - ("mpfr-source" ,(package-source mpfr)) - ("mpc-source" ,(package-source mpc)) - ("binutils" ,binutils-final) - ,@(package-inputs gcc-4.7)))))) + ("mpfr-source" ,(package-source mpfr)) + ("mpc-source" ,(package-source mpc)) + ("binutils" ,binutils) + ,@(package-inputs gcc-4.7)))))) (define %gcc-stripped ;; The subset of GCC files needed for bootstrap. @@ -411,51 +437,54 @@ for `sh' in $PATH, and without nscd, and with static NSS modules." ;; .scm and .go files relative to its installation directory, rather ;; than in hard-coded configure-time paths. (let* ((guile (package (inherit guile-2.0) - (name (string-append (package-name guile-2.0) "-static")) - (inputs - `(("patch/relocatable" - ,(search-patch "guile-relocatable.patch")) - ("patch/utf8" - ,(search-patch "guile-default-utf8.patch")) - ("patch/syscalls" - ,(search-patch "guile-linux-syscalls.patch")) - ,@(package-inputs guile-2.0))) - (propagated-inputs - `(("bdw-gc" ,libgc) - ,@(alist-delete "bdw-gc" - (package-propagated-inputs guile-2.0)))) - (arguments - `(;; When `configure' checks for ltdl availability, it - ;; doesn't try to link using libtool, and thus fails - ;; because of a missing -ldl. Work around that. - #:configure-flags '("LDFLAGS=-ldl") - - #:phases (alist-cons-before - 'configure 'static-guile - (lambda _ - (substitute* "libguile/Makefile.in" - ;; Create a statically-linked `guile' - ;; executable. - (("^guile_LDFLAGS =") - "guile_LDFLAGS = -all-static") - - ;; Add `-ldl' *after* libguile-2.0.la. - (("^guile_LDADD =(.*)$" _ ldadd) - (string-append "guile_LDADD = " - (string-trim-right ldadd) - " -ldl\n")))) - %standard-phases) - - ;; Allow Guile to be relocated, as is needed during - ;; bootstrap. - #:patches - (list (assoc-ref %build-inputs "patch/relocatable") - (assoc-ref %build-inputs "patch/utf8") - (assoc-ref %build-inputs "patch/syscalls")) - - ;; There are uses of `dynamic-link' in - ;; {foreign,coverage}.test that don't fly here. - #:tests? #f))))) + (name (string-append (package-name guile-2.0) "-static")) + (inputs + `(("patch/relocatable" + ,(search-patch "guile-relocatable.patch")) + ("patch/utf8" + ,(search-patch "guile-default-utf8.patch")) + ("patch/syscalls" + ,(search-patch "guile-linux-syscalls.patch")) + ,@(package-inputs guile-2.0))) + (propagated-inputs + `(("bdw-gc" ,libgc) + ,@(alist-delete "bdw-gc" + (package-propagated-inputs guile-2.0)))) + (arguments + `(;; When `configure' checks for ltdl availability, it + ;; doesn't try to link using libtool, and thus fails + ;; because of a missing -ldl. Work around that. + #:configure-flags '("LDFLAGS=-ldl" + ,@(if (%current-target-system) + '("CC_FOR_BUILD=gcc") + '())) + + #:phases (alist-cons-before + 'configure 'static-guile + (lambda _ + (substitute* "libguile/Makefile.in" + ;; Create a statically-linked `guile' + ;; executable. + (("^guile_LDFLAGS =") + "guile_LDFLAGS = -all-static") + + ;; Add `-ldl' *after* libguile-2.0.la. + (("^guile_LDADD =(.*)$" _ ldadd) + (string-append "guile_LDADD = " + (string-trim-right ldadd) + " -ldl\n")))) + %standard-phases) + + ;; Allow Guile to be relocated, as is needed during + ;; bootstrap. + #:patches + (list (assoc-ref %build-inputs "patch/relocatable") + (assoc-ref %build-inputs "patch/utf8") + (assoc-ref %build-inputs "patch/syscalls")) + + ;; There are uses of `dynamic-link' in + ;; {foreign,coverage}.test that don't fly here. + #:tests? #f))))) (package-with-relocatable-glibc (static-package guile)))) (define %guile-static-stripped @@ -492,9 +521,9 @@ for `sh' in $PATH, and without nscd, and with static NSS modules." (location (source-properties->location (current-source-location))) (name (string-append (package-name pkg) "-tarball")) (build-system trivial-build-system) - (inputs `(("tar" ,tar) - ("xz" ,xz) - ("input" ,pkg))) + (native-inputs `(("tar" ,tar) + ("xz" ,xz))) + (inputs `(("input" ,pkg))) (arguments (let ((name (package-name pkg)) (version (package-version pkg))) @@ -512,7 +541,9 @@ for `sh' in $PATH, and without nscd, and with static NSS modules." (zero? (system* "tar" "cJvf" (string-append out "/" ,name "-" ,version - "-" ,(%current-system) + "-" + ,(or (%current-target-system) + (%current-system)) ".tar.xz") ".")))))))))) -- cgit 1.4.1 From c8fa51f2d6dd8ab9157f8c87b909f73b956371d1 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Wed, 26 Jun 2013 14:31:24 +0200 Subject: gnu: cross-base: Build Binutils with `--with-sysroot=/'. * gnu/packages/cross-base.scm (cross-binutils): Use `--with-sysroot=/'. --- gnu/packages/cross-base.scm | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'gnu') diff --git a/gnu/packages/cross-base.scm b/gnu/packages/cross-base.scm index 4cfbbba234..e6a8a1b550 100644 --- a/gnu/packages/cross-base.scm +++ b/gnu/packages/cross-base.scm @@ -56,8 +56,13 @@ ;; library. This works because as a side effect ;; `genscripts.sh' sets `USE_LIBPATH=yes', which tells ;; elf32.em to use DT_RUNPATH in its search list. - `(cons "--with-sysroot=/no-such-path" - ,flags))))))) + ;; See . + ;; + ;; In theory choosing / as the sysroot could lead ld + ;; to pick up native libs instead of target ones. In + ;; practice the RUNPATH of target libs only refers to + ;; target libs, not native libs, so this is safe. + `(cons "--with-sysroot=/" ,flags))))))) (cross binutils target))) (define* (cross-gcc target -- cgit 1.4.1 From e7133c76802991f8da2afd87eed598f5ca00a082 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Wed, 26 Jun 2013 16:27:51 +0200 Subject: gnu: cross-base: Make `glibc-dynamic-linker' do the right thing. * gnu/packages/bootstrap.scm (glibc-dynamic-linker): Determine SYSTEM based on (%current-target-system) when it's true. * gnu/packages/cross-base.scm (cross-gcc): Directly call (package-arguments gcc-4.7) from the body of `arguments'. --- gnu/packages/bootstrap.scm | 5 ++++- gnu/packages/cross-base.scm | 8 +------- 2 files changed, 5 insertions(+), 8 deletions(-) (limited to 'gnu') diff --git a/gnu/packages/bootstrap.scm b/gnu/packages/bootstrap.scm index eaad45a741..86723a9591 100644 --- a/gnu/packages/bootstrap.scm +++ b/gnu/packages/bootstrap.scm @@ -131,7 +131,10 @@ check whether everything is alright." (propagated-inputs (map rewritten-input (package-propagated-inputs p))))))) -(define* (glibc-dynamic-linker #:optional (system (%current-system))) +(define* (glibc-dynamic-linker + #:optional (system (or (and=> (%current-target-system) + gnu-triplet->nix-system) + (%current-system)))) "Return the name of Glibc's dynamic linker for SYSTEM." (cond ((string=? system "x86_64-linux") "/lib/ld-linux-x86-64.so.2") ((string=? system "i686-linux") "/lib/ld-linux.so.2") diff --git a/gnu/packages/cross-base.scm b/gnu/packages/cross-base.scm index e6a8a1b550..68c321ee89 100644 --- a/gnu/packages/cross-base.scm +++ b/gnu/packages/cross-base.scm @@ -70,12 +70,6 @@ "Return a cross-compiler for TARGET, where TARGET is a GNU triplet. Use XBINUTILS as the associated cross-Binutils. If LIBC is false, then build a GCC that does not target a libc; otherwise, target that libc." - (define args - ;; Get the arguments as if we were building for TARGET. In particular, we - ;; want `glibc-dynamic-linker' to return the right thing. - (parameterize ((%current-system (gnu-triplet->nix-system target))) - (package-arguments gcc-4.7))) - (package (inherit gcc-4.7) (name (string-append "gcc-cross-" (if libc "" "sans-libc-") @@ -89,7 +83,7 @@ GCC that does not target a libc; otherwise, target that libc." (srfi srfi-26)) #:patches (list (assoc-ref %build-inputs "patch/cross-env-vars")) - ,@(substitute-keyword-arguments args + ,@(substitute-keyword-arguments (package-arguments gcc-4.7) ((#:configure-flags flags) `(append (list ,(string-append "--target=" target) ,@(if libc -- cgit 1.4.1 From de1d41f9807dec9cc8a151af60e4949aa62b25d6 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Wed, 26 Jun 2013 16:51:39 +0200 Subject: gnu: gcc: Allow cross-compilation of GCC itself. * gnu/packages/gcc.scm (gcc-4.7): Define `CC_FOR_TARGET', `AR_FOR_TARGET', etc. when cross-compiling. --- gnu/packages/gcc.scm | 233 ++++++++++++++++++++++++++++----------------------- 1 file changed, 127 insertions(+), 106 deletions(-) (limited to 'gnu') diff --git a/gnu/packages/gcc.scm b/gnu/packages/gcc.scm index d239b5a9ab..b297ef1fb1 100644 --- a/gnu/packages/gcc.scm +++ b/gnu/packages/gcc.scm @@ -32,129 +32,150 @@ "ftp://gcc.gnu.org/pub/gcc/infrastructure/") (define-public gcc-4.7 - (let ((stripped? #t)) ; TODO: make this a parameter - (package - (name "gcc") - (version "4.7.3") - (source (origin - (method url-fetch) - (uri (string-append "mirror://gnu/gcc/gcc-" - version "/gcc-" version ".tar.bz2")) - (sha256 - (base32 - "1hx9h64ivarlzi4hxvq42as5m9vlr5cyzaaq4gzj4i619zmkfz1g")))) - (build-system gnu-build-system) - (inputs `(("gmp" ,gmp) - ("mpfr" ,mpfr) - ("mpc" ,mpc) - ("isl" ,isl) - ("cloog" ,cloog) - ("libelf" ,libelf) - ("zlib" ,zlib))) - (arguments - `(#:out-of-source? #t - #:strip-binaries? ,stripped? - #:configure-flags - `("--enable-plugin" - "--enable-languages=c,c++" - "--disable-multilib" + (let* ((stripped? #t) ; TODO: make this a parameter + (maybe-target-tools + (lambda () + ;; Return the `_FOR_TARGET' variables that are needed when + ;; cross-compiling GCC. + (let ((target (%current-target-system))) + (if target + (map (lambda (var tool) + (string-append (string-append var "_FOR_TARGET") + "=" target "-" tool)) + '("CC" "CXX" "LD" "AR" "NM" "RANLIB" "STRIP") + '("gcc" "g++" "ld" "ar" "nm" "ranlib" "strip")) + '())))) + (configure-flags + (lambda () + ;; This is terrible. Since we have two levels of quasiquotation, + ;; we have to do this convoluted thing just so we can insert the + ;; contents of (maybe-target-tools). + (list 'quasiquote + (append + '("--enable-plugin" + "--enable-languages=c,c++" + "--disable-multilib" - "--with-local-prefix=/no-gcc-local-prefix" + "--with-local-prefix=/no-gcc-local-prefix" - ,(let ((libc (assoc-ref %build-inputs "libc"))) - (if libc - (string-append "--with-native-system-header-dir=" libc - "/include") - "--without-headers"))) - #:make-flags - (let ((libc (assoc-ref %build-inputs "libc"))) - `(,@(if libc - (list (string-append "LDFLAGS_FOR_TARGET=" - "-B" libc "/lib " - "-Wl,-dynamic-linker " - "-Wl," libc - ,(glibc-dynamic-linker))) - '()) - ,(string-append "BOOT_CFLAGS=-O2 " - ,(if stripped? "-g0" "-g")))) + ,(let ((libc (assoc-ref %build-inputs "libc"))) + (if libc + (string-append "--with-native-system-header-dir=" libc + "/include") + "--without-headers"))) + + (maybe-target-tools)))))) + (package + (name "gcc") + (version "4.7.3") + (source (origin + (method url-fetch) + (uri (string-append "mirror://gnu/gcc/gcc-" + version "/gcc-" version ".tar.bz2")) + (sha256 + (base32 + "1hx9h64ivarlzi4hxvq42as5m9vlr5cyzaaq4gzj4i619zmkfz1g")))) + (build-system gnu-build-system) + (inputs `(("gmp" ,gmp) + ("mpfr" ,mpfr) + ("mpc" ,mpc) + ("isl" ,isl) + ("cloog" ,cloog) + ("libelf" ,libelf) + ("zlib" ,zlib))) + (arguments + `(#:out-of-source? #t + #:strip-binaries? ,stripped? + #:configure-flags ,(configure-flags) + #:make-flags + (let ((libc (assoc-ref %build-inputs "libc"))) + `(,@(if libc + (list (string-append "LDFLAGS_FOR_TARGET=" + "-B" libc "/lib " + "-Wl,-dynamic-linker " + "-Wl," libc + ,(glibc-dynamic-linker))) + '()) + ,(string-append "BOOT_CFLAGS=-O2 " + ,(if stripped? "-g0" "-g")))) - #:tests? #f - #:phases - (alist-cons-before - 'configure 'pre-configure - (lambda* (#:key inputs outputs #:allow-other-keys) - (let ((out (assoc-ref outputs "out")) - (libc (assoc-ref inputs "libc"))) - (when libc - ;; The following is not performed for `--without-headers' - ;; cross-compiler builds. + #:tests? #f + #:phases + (alist-cons-before + 'configure 'pre-configure + (lambda* (#:key inputs outputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out")) + (libc (assoc-ref inputs "libc"))) + (when libc + ;; The following is not performed for `--without-headers' + ;; cross-compiler builds. - ;; Fix the dynamic linker's file name. - (substitute* (find-files "gcc/config" - "^linux(64|-elf)?\\.h$") - (("#define GLIBC_DYNAMIC_LINKER([^ ]*).*$" _ suffix) - (format #f "#define GLIBC_DYNAMIC_LINKER~a \"~a\"~%" - suffix - (string-append libc ,(glibc-dynamic-linker))))) + ;; Fix the dynamic linker's file name. + (substitute* (find-files "gcc/config" + "^linux(64|-elf)?\\.h$") + (("#define GLIBC_DYNAMIC_LINKER([^ ]*).*$" _ suffix) + (format #f "#define GLIBC_DYNAMIC_LINKER~a \"~a\"~%" + suffix + (string-append libc ,(glibc-dynamic-linker))))) - ;; Tell where to find libstdc++, libc, and `?crt*.o', except - ;; `crt{begin,end}.o', which come with GCC. - (substitute* (find-files "gcc/config" - "^(gnu-user(64)?|linux-elf)\\.h$") - (("#define LIB_SPEC (.*)$" _ suffix) - ;; Note that with this "lib" spec, we may still add a - ;; RUNPATH to GCC even when `libgcc_s' is not NEEDED. - ;; There's not much that can be done to avoid it, though. - (format #f "#define LIB_SPEC \"-L~a/lib %{!static:-rpath=~a/lib \ + ;; Tell where to find libstdc++, libc, and `?crt*.o', except + ;; `crt{begin,end}.o', which come with GCC. + (substitute* (find-files "gcc/config" + "^(gnu-user(64)?|linux-elf)\\.h$") + (("#define LIB_SPEC (.*)$" _ suffix) + ;; Note that with this "lib" spec, we may still add a + ;; RUNPATH to GCC even when `libgcc_s' is not NEEDED. + ;; There's not much that can be done to avoid it, though. + (format #f "#define LIB_SPEC \"-L~a/lib %{!static:-rpath=~a/lib \ %{!static-libgcc:-rpath=~a/lib64 -rpath=~a/lib}} \" ~a" - libc libc out out suffix)) - (("#define STARTFILE_SPEC.*$" line) - (format #f "#define STANDARD_STARTFILE_PREFIX_1 \"~a/lib\" + libc libc out out suffix)) + (("#define STARTFILE_SPEC.*$" line) + (format #f "#define STANDARD_STARTFILE_PREFIX_1 \"~a/lib\" #define STANDARD_STARTFILE_PREFIX_2 \"\" ~a~%" - libc line)))) + libc line)))) - ;; Don't retain a dependency on the build-time sed. - (substitute* "fixincludes/fixincl.x" - (("static char const sed_cmd_z\\[\\] =.*;") - "static char const sed_cmd_z[] = \"sed\";")))) + ;; Don't retain a dependency on the build-time sed. + (substitute* "fixincludes/fixincl.x" + (("static char const sed_cmd_z\\[\\] =.*;") + "static char const sed_cmd_z[] = \"sed\";")))) - (alist-cons-after - 'configure 'post-configure - (lambda _ - ;; Don't store configure flags, to avoid retaining references to - ;; build-time dependencies---e.g., `--with-ppl=/nix/store/xxx'. - (substitute* "Makefile" - (("^TOPLEVEL_CONFIGURE_ARGUMENTS=(.*)$" _ rest) - "TOPLEVEL_CONFIGURE_ARGUMENTS=\n"))) - (alist-replace 'install - (lambda* (#:key outputs #:allow-other-keys) - (zero? - (system* "make" - ,(if stripped? - "install-strip" - "install")))) - %standard-phases))))) + (alist-cons-after + 'configure 'post-configure + (lambda _ + ;; Don't store configure flags, to avoid retaining references to + ;; build-time dependencies---e.g., `--with-ppl=/nix/store/xxx'. + (substitute* "Makefile" + (("^TOPLEVEL_CONFIGURE_ARGUMENTS=(.*)$" _ rest) + "TOPLEVEL_CONFIGURE_ARGUMENTS=\n"))) + (alist-replace 'install + (lambda* (#:key outputs #:allow-other-keys) + (zero? + (system* "make" + ,(if stripped? + "install-strip" + "install")))) + %standard-phases))))) - (native-search-paths - (list (search-path-specification - (variable "CPATH") - (directories '("include"))) - (search-path-specification - (variable "LIBRARY_PATH") - (directories '("lib" "lib64"))))) + (native-search-paths + (list (search-path-specification + (variable "CPATH") + (directories '("include"))) + (search-path-specification + (variable "LIBRARY_PATH") + (directories '("lib" "lib64"))))) - (properties `((gcc-libc . ,(assoc-ref inputs "libc")))) - (synopsis "GNU Compiler Collection") - (description - "The GNU Compiler Collection includes compiler front ends for C, C++, + (properties `((gcc-libc . ,(assoc-ref inputs "libc")))) + (synopsis "GNU Compiler Collection") + (description + "The GNU Compiler Collection includes compiler front ends for C, C++, Objective-C, Fortran, OpenMP for C/C++/Fortran, Java, and Ada, as well as libraries for these languages (libstdc++, libgcj, libgomp,...). GCC development is a part of the GNU Project, aiming to improve the compiler used in the GNU system including the GNU/Linux variant.") - (license gpl3+) - (home-page "http://gcc.gnu.org/")))) + (license gpl3+) + (home-page "http://gcc.gnu.org/")))) (define-public gcc-4.8 ;; FIXME: Move to gcc.scm when Binutils is updated. -- cgit 1.4.1 From 11acdf1747a18fe11ccbabb78b5b14884164ee39 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Wed, 26 Jun 2013 17:01:10 +0200 Subject: gnu: make-bootstrap: Have %gcc-static actually static when cross building. * gnu/packages/make-bootstrap.scm (%gcc-static): Pass `-static' through `LDFLAGS' when cross-compiling. --- gnu/packages/make-bootstrap.scm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'gnu') diff --git a/gnu/packages/make-bootstrap.scm b/gnu/packages/make-bootstrap.scm index 13f858adc6..853dc8e59d 100644 --- a/gnu/packages/make-bootstrap.scm +++ b/gnu/packages/make-bootstrap.scm @@ -389,7 +389,9 @@ for `sh' in $PATH, and without nscd, and with static NSS modules." (remove (cut string-match "--(.*plugin|enable-languages)" <>) ,flags))) ((#:make-flags flags) - `(cons "BOOT_LDFLAGS=-static" ,flags))))) + (if (%current-target-system) + `(cons "LDFLAGS=-static" ,flags) + `(cons "BOOT_LDFLAGS=-static" ,flags)))))) (inputs `(("gmp-source" ,(package-source gmp)) ("mpfr-source" ,(package-source mpfr)) ("mpc-source" ,(package-source mpc)) -- cgit 1.4.1 From 5708485357ef0e55f5148347958c4fe9a860453e Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Wed, 26 Jun 2013 17:23:56 +0200 Subject: gnu: make-bootstrap: Fix cross compilation of binutils-static. * gnu/packages/make-bootstrap.scm (%binutils-static): Inherit configure flags from BINUTILS. --- gnu/packages/make-bootstrap.scm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'gnu') diff --git a/gnu/packages/make-bootstrap.scm b/gnu/packages/make-bootstrap.scm index 853dc8e59d..f4d29bdf96 100644 --- a/gnu/packages/make-bootstrap.scm +++ b/gnu/packages/make-bootstrap.scm @@ -260,7 +260,11 @@ for `sh' in $PATH, and without nscd, and with static NSS modules." (package (inherit binutils) (name "binutils-static") (arguments - `(#:configure-flags '("--disable-gold" "--with-lib-path=/no-ld-lib-path") + `(#:configure-flags (cons "--disable-gold" + ,(match (memq #:configure-flags + (package-arguments binutils)) + ((#:configure-flags flags _ ...) + flags))) #:strip-flags '("--strip-all") #:phases (alist-cons-before 'configure 'all-static -- cgit 1.4.1 From beda99e882e6049f4bf426551d0fd8a2cc7127e0 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Wed, 26 Jun 2013 22:37:38 +0200 Subject: gnu: cross-base: Add support for `mips64el-linux-gnu-gnuabi64' (N64 ABI). * gnu/packages/cross-base.scm (gcc-configure-flags-for-triplet): New procedure. (cross-gcc): Use it. (xgcc-mips64el): Use *-gnuabi64 instead of the N32 ABI. --- gnu/packages/cross-base.scm | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'gnu') diff --git a/gnu/packages/cross-base.scm b/gnu/packages/cross-base.scm index 68c321ee89..5edc1b52e3 100644 --- a/gnu/packages/cross-base.scm +++ b/gnu/packages/cross-base.scm @@ -30,6 +30,7 @@ #:use-module (srfi srfi-1) #:use-module (srfi srfi-26) #:use-module (ice-9 match) + #:use-module (ice-9 regex) #:export (cross-binutils cross-libc cross-gcc)) @@ -65,6 +66,20 @@ `(cons "--with-sysroot=/" ,flags))))))) (cross binutils target))) +(define (gcc-configure-flags-for-triplet target) + "Return a list of additional GCC `configure' flags for TARGET, a GNU triplet. + +The purpose of this procedure is to translate extended GNU triplets---e.g., +where the OS part is overloaded to denote a specific ABI---into GCC +`configure' options. We take extended GNU triplets that glibc recognizes." + (cond ((string-match "^mips64el.*gnuabin?64$" target) + ;; Triplets recognized by glibc as denoting the N64 ABI; see + ;; ports/sysdeps/mips/preconfigure. + '("--with-abi=64")) + (else + ;; TODO: Add `armel.*gnueabi', `hf', etc. + '()))) + (define* (cross-gcc target #:optional (xbinutils (cross-binutils target)) libc) "Return a cross-compiler for TARGET, where TARGET is a GNU triplet. Use @@ -86,6 +101,7 @@ GCC that does not target a libc; otherwise, target that libc." ,@(substitute-keyword-arguments (package-arguments gcc-4.7) ((#:configure-flags flags) `(append (list ,(string-append "--target=" target) + ,@(gcc-configure-flags-for-triplet target) ,@(if libc '() `( ;; Disable features not needed at this stage. @@ -260,7 +276,7 @@ XBINUTILS and the cross tool chain." ;;; (define-public xgcc-mips64el - (let ((triplet "mips64el-linux-gnu")) + (let ((triplet "mips64el-linux-gnuabi64")) ; N64 ABI (cross-gcc triplet (cross-binutils triplet) (cross-libc triplet)))) -- cgit 1.4.1 From ca16cb96066e29b32df924df9e1446efcc58c87f Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Wed, 26 Jun 2013 23:02:49 +0200 Subject: gnu: gcc: Use `gcc-configure-flags-for-triplet' when cross-compiling GCC. * gnu/packages/cross-base.scm (gcc-configure-flags-for-triplet): Move to... * gnu/packages/gcc.scm (gcc-configure-flags-for-triplet): ... here. New procedure. (gcc-4.7): Use it when (%current-target-system) is true. --- gnu/packages/cross-base.scm | 15 --------------- gnu/packages/gcc.scm | 23 ++++++++++++++++++++++- 2 files changed, 22 insertions(+), 16 deletions(-) (limited to 'gnu') diff --git a/gnu/packages/cross-base.scm b/gnu/packages/cross-base.scm index 5edc1b52e3..29a81f1fa7 100644 --- a/gnu/packages/cross-base.scm +++ b/gnu/packages/cross-base.scm @@ -30,7 +30,6 @@ #:use-module (srfi srfi-1) #:use-module (srfi srfi-26) #:use-module (ice-9 match) - #:use-module (ice-9 regex) #:export (cross-binutils cross-libc cross-gcc)) @@ -66,20 +65,6 @@ `(cons "--with-sysroot=/" ,flags))))))) (cross binutils target))) -(define (gcc-configure-flags-for-triplet target) - "Return a list of additional GCC `configure' flags for TARGET, a GNU triplet. - -The purpose of this procedure is to translate extended GNU triplets---e.g., -where the OS part is overloaded to denote a specific ABI---into GCC -`configure' options. We take extended GNU triplets that glibc recognizes." - (cond ((string-match "^mips64el.*gnuabin?64$" target) - ;; Triplets recognized by glibc as denoting the N64 ABI; see - ;; ports/sysdeps/mips/preconfigure. - '("--with-abi=64")) - (else - ;; TODO: Add `armel.*gnueabi', `hf', etc. - '()))) - (define* (cross-gcc target #:optional (xbinutils (cross-binutils target)) libc) "Return a cross-compiler for TARGET, where TARGET is a GNU triplet. Use diff --git a/gnu/packages/gcc.scm b/gnu/packages/gcc.scm index b297ef1fb1..bba35901a2 100644 --- a/gnu/packages/gcc.scm +++ b/gnu/packages/gcc.scm @@ -25,12 +25,27 @@ #:use-module (gnu packages multiprecision) #:use-module (guix packages) #:use-module (guix download) - #:use-module (guix build-system gnu)) + #:use-module (guix build-system gnu) + #:use-module (ice-9 regex)) (define %gcc-infrastructure ;; Base URL for GCC's infrastructure. "ftp://gcc.gnu.org/pub/gcc/infrastructure/") +(define-public (gcc-configure-flags-for-triplet target) + "Return a list of additional GCC `configure' flags for TARGET, a GNU triplet. + +The purpose of this procedure is to translate extended GNU triplets---e.g., +where the OS part is overloaded to denote a specific ABI---into GCC +`configure' options. We take extended GNU triplets that glibc recognizes." + (cond ((string-match "^mips64el.*gnuabin?64$" target) + ;; Triplets recognized by glibc as denoting the N64 ABI; see + ;; ports/sysdeps/mips/preconfigure. + '("--with-abi=64")) + (else + ;; TODO: Add `armel.*gnueabi', `hf', etc. + '()))) + (define-public gcc-4.7 (let* ((stripped? #t) ; TODO: make this a parameter (maybe-target-tools @@ -64,6 +79,12 @@ "/include") "--without-headers"))) + ;; When cross-compiling GCC, pass the right options for the + ;; target triplet. + (or (and=> (%current-target-system) + gcc-configure-flags-for-triplet) + '()) + (maybe-target-tools)))))) (package (name "gcc") -- cgit 1.4.1 From 9bf62d9b1d8058b7c428932d40ac91dd48e988dc Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Wed, 3 Jul 2013 23:55:04 +0200 Subject: gnu: Add a "debug" output for some packages. * gnu/packages/base.scm (coreutils, gnu-make, glibc): Add a "debug" output. * gnu/packages/bdw-gc.scm (libgc): Likewise. * gnu/packages/guile.scm (guile-2.0): Likewise. * gnu/packages/libffi.scm (libffi): Likewise. * gnu/packages/multiprecision.scm (gmp, mpfr, mpc): Likewise. --- gnu/packages/base.scm | 4 +++- gnu/packages/bdw-gc.scm | 1 + gnu/packages/guile.scm | 2 ++ gnu/packages/libffi.scm | 1 + gnu/packages/multiprecision.scm | 3 +++ 5 files changed, 10 insertions(+), 1 deletion(-) (limited to 'gnu') diff --git a/gnu/packages/base.scm b/gnu/packages/base.scm index 95052775c5..7ca7ec74c6 100644 --- a/gnu/packages/base.scm +++ b/gnu/packages/base.scm @@ -279,6 +279,7 @@ The tools supplied with this package are: ,@(if (%current-target-system) '() `(("perl" ,perl))))) + (outputs '("out" "debug")) (arguments `(#:parallel-build? #f ; help2man may be called too early #:phases (alist-cons-before @@ -316,6 +317,7 @@ are expected to exist on every operating system.") (build-system gnu-build-system) (native-inputs `(("patch/impure-dirs" ,(search-patch "make-impure-dirs.patch")))) + (outputs '("out" "debug")) (arguments '(#:patches (list (assoc-ref %build-inputs "patch/impure-dirs")) #:phases (alist-cons-before @@ -403,7 +405,7 @@ BFD (Binary File Descriptor) library, `gprof', `nm', `strip', etc.") ;; reference to them anyway, so there's no space savings here. ;; TODO: Eventually we may want to add a $LOCALE_ARCHIVE search path like ;; Nixpkgs does. - (outputs '("out" "locales")) + (outputs '("out" "locales" "debug")) (arguments `(#:out-of-source? #t diff --git a/gnu/packages/bdw-gc.scm b/gnu/packages/bdw-gc.scm index bebb0862e3..7cce9671d1 100644 --- a/gnu/packages/bdw-gc.scm +++ b/gnu/packages/bdw-gc.scm @@ -39,6 +39,7 @@ ;; Make it so that we don't rely on /proc. This is especially useful in ;; an initrd run before /proc is mounted. '(#:configure-flags '("CPPFLAGS=-DUSE_LIBC_PRIVATES"))) + (outputs '("out" "debug")) (synopsis "The Boehm-Demers-Weiser conservative garbage collector for C and C++") (description diff --git a/gnu/packages/guile.scm b/gnu/packages/guile.scm index c78ab57915..772776349e 100644 --- a/gnu/packages/guile.scm +++ b/gnu/packages/guile.scm @@ -138,6 +138,8 @@ extensible. It supports many SRFIs.") (self-native-input? #t) + (outputs '("out" "debug")) + (arguments `(#:phases (alist-cons-before 'configure 'pre-configure diff --git a/gnu/packages/libffi.scm b/gnu/packages/libffi.scm index 0707bf8a7e..e4a2761273 100644 --- a/gnu/packages/libffi.scm +++ b/gnu/packages/libffi.scm @@ -53,6 +53,7 @@ #:phases (alist-cons-after 'install 'post-install ,post-install-phase %standard-phases))) + (outputs '("out" "debug")) (synopsis "Foreign function call interface library") (description "The libffi library provides a portable, high level programming interface diff --git a/gnu/packages/multiprecision.scm b/gnu/packages/multiprecision.scm index 46acba3065..16383d1ec1 100644 --- a/gnu/packages/multiprecision.scm +++ b/gnu/packages/multiprecision.scm @@ -38,6 +38,7 @@ "1hnbxz7a6jrli8ph27i8zb6k2f456zn6l5xi78yhskzbxjk47nf7")))) (build-system gnu-build-system) (native-inputs `(("m4" ,m4))) + (outputs '("out" "debug")) (arguments `(#:configure-flags '(;; Build a "fat binary", with routines for several ;; sub-architectures. @@ -78,6 +79,7 @@ faster algorithms.") (sha256 (base32 "0fs501qi8l523gs3cpy4jjcnvwxggyfbklcys80wq236xx3hz79r")))) (build-system gnu-build-system) + (outputs '("out" "debug")) (propagated-inputs `(("gmp" ,gmp))) ; refers to (synopsis "C library for arbitrary precision floating-point arithmetic") (description @@ -103,6 +105,7 @@ double-precision floating-point arithmetic (53-bit mantissa).") (sha256 (base32 "1zq0fidp1jii2j5k5n9hmx55a6wwid33gjzhimvxq9d5zrf82npd")))) (build-system gnu-build-system) + (outputs '("out" "debug")) (propagated-inputs `(("gmp" ,gmp) ; refers to both ("mpfr" ,mpfr))) (synopsis "C library for arbitrary precision complex arithmetic") -- cgit 1.4.1 From a4627d498a9d8021141df27a1cac4c61da8a7a59 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Thu, 4 Jul 2013 11:08:28 +0200 Subject: gnu: cross-libc: Remove the "debug" output. * gnu/packages/cross-base.scm (cross-libc): Remove "debug" from the `outputs' field. --- gnu/packages/cross-base.scm | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'gnu') diff --git a/gnu/packages/cross-base.scm b/gnu/packages/cross-base.scm index 29a81f1fa7..ca8d432d96 100644 --- a/gnu/packages/cross-base.scm +++ b/gnu/packages/cross-base.scm @@ -250,6 +250,10 @@ XBINUTILS and the cross tool chain." (string-append linux "/include")) #t)) ,phases)))) + + ;; Remove the "debug" output since stripping is disabled. + (outputs (delete "debug" (package-outputs glibc))) + (propagated-inputs `(("cross-linux-headers" ,xlinux-headers))) (native-inputs `(("cross-gcc" ,xgcc) ("cross-binutils" ,xbinutils) -- cgit 1.4.1 From 82f9b17687073d9d2d1c9a9a70e338e56fb9a7b7 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Thu, 4 Jul 2013 13:26:35 +0200 Subject: build-system/gnu: Remove the "debug" output when `strip-binaries?' is #f. * guix/build-system/gnu.scm (gnu-build, gnu-cross-build): Delete "debug" from OUTPUTS when STRIP-BINARIES? is false. * gnu/packages/cross-base.scm (cross-libc): Leave `outputs' unchanged. This reverts commit a4627d4. --- gnu/packages/cross-base.scm | 3 --- guix/build-system/gnu.scm | 8 ++++++-- 2 files changed, 6 insertions(+), 5 deletions(-) (limited to 'gnu') diff --git a/gnu/packages/cross-base.scm b/gnu/packages/cross-base.scm index ca8d432d96..28224a1c40 100644 --- a/gnu/packages/cross-base.scm +++ b/gnu/packages/cross-base.scm @@ -251,9 +251,6 @@ XBINUTILS and the cross tool chain." #t)) ,phases)))) - ;; Remove the "debug" output since stripping is disabled. - (outputs (delete "debug" (package-outputs glibc))) - (propagated-inputs `(("cross-linux-headers" ,xlinux-headers))) (native-inputs `(("cross-gcc" ,xgcc) ("cross-binutils" ,xbinutils) diff --git a/guix/build-system/gnu.scm b/guix/build-system/gnu.scm index d074294b4c..c12a871fd8 100644 --- a/guix/build-system/gnu.scm +++ b/guix/build-system/gnu.scm @@ -299,7 +299,9 @@ which could lead to gratuitous input divergence." ,@(if implicit-inputs? implicit-inputs '())) - #:outputs outputs + #:outputs (if strip-binaries? + outputs + (delete "debug" outputs)) #:modules imported-modules #:guile-for-build guile-for-build)) @@ -470,7 +472,9 @@ platform." ,@(if implicit-inputs? implicit-host-inputs '())) - #:outputs outputs + #:outputs (if strip-binaries? + outputs + (delete "debug" outputs)) #:modules imported-modules #:guile-for-build guile-for-build)) -- cgit 1.4.1 From 3a4ebc11240761901de75da3ffebbace5a70cf6c Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Fri, 5 Jul 2013 14:39:47 +0200 Subject: gnu: make-bootstrap: guile-static-stripped has no "debug" output. * gnu/packages/make-bootstrap.scm (%guile-static-stripped): Add `outputs' field. --- gnu/packages/make-bootstrap.scm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'gnu') diff --git a/gnu/packages/make-bootstrap.scm b/gnu/packages/make-bootstrap.scm index f4d29bdf96..97362baff2 100644 --- a/gnu/packages/make-bootstrap.scm +++ b/gnu/packages/make-bootstrap.scm @@ -519,7 +519,8 @@ for `sh' in $PATH, and without nscd, and with static NSS modules." (string-append out "/bin/guile")) (remove-store-references (string-append out "/bin/guile")) #t)))) - (inputs `(("guile" ,%guile-static))))) + (inputs `(("guile" ,%guile-static))) + (outputs '("out")))) (define (tarball-package pkg) "Return a package containing a tarball of PKG." -- cgit 1.4.1 From c8ebc82187d83e845a201bbe45d837c97f9c64b1 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sat, 6 Jul 2013 18:08:29 +0200 Subject: gnu: gcc: Add Texinfo to the native inputs. * gnu/packages/gcc.scm (gcc-4.7): Add `native-inputs' field. (gcc-4.8): Remove outdated comment. * gnu/packages/base.scm (gcc-boot0): Add `native-inputs' field. --- gnu/packages/base.scm | 6 +++++- gnu/packages/gcc.scm | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) (limited to 'gnu') diff --git a/gnu/packages/base.scm b/gnu/packages/base.scm index 7ca7ec74c6..a5c6a70603 100644 --- a/gnu/packages/base.scm +++ b/gnu/packages/base.scm @@ -756,7 +756,11 @@ identifier SYSTEM." ;; Call it differently so that the builder can check whether ;; the "libc" input is #f. ("libc-native" ,@(assoc-ref %boot0-inputs "libc")) - ,@(alist-delete "libc" %boot0-inputs)))))) + ,@(alist-delete "libc" %boot0-inputs))) + + ;; No need for Texinfo at this stage. + (native-inputs (alist-delete "texinfo" + (package-native-inputs gcc-4.7)))))) (define linux-libre-headers-boot0 (package-with-bootstrap-guile diff --git a/gnu/packages/gcc.scm b/gnu/packages/gcc.scm index bba35901a2..f8caf4c7f6 100644 --- a/gnu/packages/gcc.scm +++ b/gnu/packages/gcc.scm @@ -23,6 +23,7 @@ #:use-module (gnu packages bootstrap) #:use-module (gnu packages compression) #:use-module (gnu packages multiprecision) + #:use-module (gnu packages texinfo) #:use-module (guix packages) #:use-module (guix download) #:use-module (guix build-system gnu) @@ -104,6 +105,10 @@ where the OS part is overloaded to denote a specific ABI---into GCC ("cloog" ,cloog) ("libelf" ,libelf) ("zlib" ,zlib))) + + ;; GCC is one of the few packages that doesn't ship .info files. + (native-inputs `(("texinfo" ,texinfo))) + (arguments `(#:out-of-source? #t #:strip-binaries? ,stripped? @@ -199,7 +204,6 @@ used in the GNU system including the GNU/Linux variant.") (home-page "http://gcc.gnu.org/")))) (define-public gcc-4.8 - ;; FIXME: Move to gcc.scm when Binutils is updated. (package (inherit gcc-4.7) (version "4.8.0") (source (origin -- cgit 1.4.1 From acf428dd0bbf590f01c32dd9c63f2dfc3d474eee Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sun, 7 Jul 2013 23:40:36 +0200 Subject: gnu: tzdata: Upgrade to 2013d. * gnu/packages/base.scm (tzdata): Upgrade to 2013d. --- gnu/packages/base.scm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'gnu') diff --git a/gnu/packages/base.scm b/gnu/packages/base.scm index a5c6a70603..9e453522ec 100644 --- a/gnu/packages/base.scm +++ b/gnu/packages/base.scm @@ -511,7 +511,7 @@ with the Linux kernel.") (define-public tzdata (package (name "tzdata") - (version "2013c") + (version "2013d") (source (origin (method url-fetch) (uri (string-append @@ -519,7 +519,7 @@ with the Linux kernel.") version ".tar.gz")) (sha256 (base32 - "11swq6fg20m2dh520qcr8vb23gqhzbvqhizx8wifnmci4gmsg5z5")))) + "08jzd8y2xkgd89wqrv3835pqr48yjabaczxr2rmg42zaykr11an0")))) (build-system gnu-build-system) (arguments '(#:tests? #f @@ -566,7 +566,7 @@ with the Linux kernel.") version ".tar.gz")) (sha256 (base32 - "1w6nkdwhi6k9llshp4baac1yj43jqf3apdf6n66i0wvjj8qyjvp4")))))) + "13xd30ngwhqmj7w216ghd5knvg047hzpc0xca5l297g5cwb62hza")))))) (home-page "http://www.iana.org/time-zones") (synopsis "Database of current and historical time zones") (description "The Time Zone Database (often called tz or zoneinfo) -- cgit 1.4.1 From 2c9143a1f37ee9fdc2fc03c42f07d4b1eb9eada7 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Mon, 8 Jul 2013 00:13:15 +0200 Subject: gnu: gettext: Upgrade to 0.18.3. * gnu/packages/gettext.scm (gettext): Upgrade to 0.18.3. Remove patch. Change `patch-tests' phase to use (which "sh'); keep it regardless of whether we're cross compiling. --- gnu-system.am | 1 - gnu/packages/gettext.scm | 53 +++++++-------- gnu/packages/patches/gettext-gets-undeclared.patch | 77 ---------------------- 3 files changed, 22 insertions(+), 109 deletions(-) delete mode 100644 gnu/packages/patches/gettext-gets-undeclared.patch (limited to 'gnu') diff --git a/gnu-system.am b/gnu-system.am index 96b87e6a72..3b86b63a6d 100644 --- a/gnu-system.am +++ b/gnu-system.am @@ -182,7 +182,6 @@ dist_patch_DATA = \ gnu/packages/patches/flex-bison-tests.patch \ gnu/packages/patches/gawk-shell.patch \ gnu/packages/patches/gcc-cross-environment-variables.patch \ - gnu/packages/patches/gettext-gets-undeclared.patch \ gnu/packages/patches/glib-tests-desktop.patch \ gnu/packages/patches/glib-tests-homedir.patch \ gnu/packages/patches/glib-tests-prlimit.patch \ diff --git a/gnu/packages/gettext.scm b/gnu/packages/gettext.scm index c838f9c0a6..399d96784c 100644 --- a/gnu/packages/gettext.scm +++ b/gnu/packages/gettext.scm @@ -26,39 +26,30 @@ (define-public gettext (package (name "gettext") - (version "0.18.1.1") - (source - (origin - (method url-fetch) - (uri (string-append "mirror://gnu/gettext/gettext-" - version ".tar.gz")) - (sha256 - (base32 - "1sa3ch12qxa4h3ya6hkz119yclcccmincl9j20dhrdx5mykp3b4k")))) + (version "0.18.3") + (source (origin + (method url-fetch) + (uri (string-append "mirror://gnu/gettext/gettext-" + version ".tar.gz")) + (sha256 + (base32 + "0j7rp56c61j4k1bz1xdc041hzv7186yyzhbp95fmc0zq7l2c3wrn")))) (build-system gnu-build-system) (arguments - `(#:patches (list (assoc-ref %build-inputs "patch/gets")) - #:phases ,(if (%current-target-system) - '%standard-phases - '(alist-cons-before - 'check 'patch-tests - (lambda* (#:key inputs #:allow-other-keys) - ;; TODO: Use (which "sh"). - (let ((bash (assoc-ref inputs "bash"))) - (substitute* (find-files "gettext-tools/tests" - "^msgexec-[0-9]") - (("#![[:blank:]]/bin/sh") - (format #f "#!~a/bin/sh" bash))) - (substitute* (find-files "gettext-tools/gnulib-tests" - "posix_spawn") - (("/bin/sh") - (format #f "~a/bin/bash" bash))))) - %standard-phases)))) - (inputs - `(("patch/gets" - ,(search-patch "gettext-gets-undeclared.patch")))) - (home-page - "http://www.gnu.org/software/gettext/") + `(#:phases (alist-cons-before + 'check 'patch-tests + (lambda* (#:key inputs #:allow-other-keys) + (let ((bash (which "sh"))) + (substitute* (find-files "gettext-tools/tests" + "^msgexec-[0-9]") + (("#![[:blank:]]/bin/sh") + (format #f "#!~a" bash))) + (substitute* (find-files "gettext-tools/gnulib-tests" + "posix_spawn") + (("/bin/sh") + bash)))) + %standard-phases))) + (home-page "http://www.gnu.org/software/gettext/") (synopsis "Tools and documentation for translation") (description "Usually, programs are written and documented in English, and use diff --git a/gnu/packages/patches/gettext-gets-undeclared.patch b/gnu/packages/patches/gettext-gets-undeclared.patch deleted file mode 100644 index 072a8d94ab..0000000000 --- a/gnu/packages/patches/gettext-gets-undeclared.patch +++ /dev/null @@ -1,77 +0,0 @@ -This patch is needed to allow builds with newer versions of -the GNU libc (2.16+). - -The upstream fix was: - - commit 66712c23388e93e5c518ebc8515140fa0c807348 - Author: Eric Blake - Date: Thu Mar 29 13:30:41 2012 -0600 - - stdio: don't assume gets any more - - Gnulib intentionally does not have a gets module, and now that C11 - and glibc have dropped it, we should be more proactive about warning - any user on a platform that still has a declaration of this dangerous - interface. - - * m4/stdio_h.m4 (gl_STDIO_H, gl_STDIO_H_DEFAULTS): Drop gets - support. - * modules/stdio (Makefile.am): Likewise. - * lib/stdio-read.c (gets): Likewise. - * tests/test-stdio-c++.cc: Likewise. - * m4/warn-on-use.m4 (gl_WARN_ON_USE_PREPARE): Fix comment. - * lib/stdio.in.h (gets): Make warning occur in more places. - * doc/posix-functions/gets.texi (gets): Update documentation. - Reported by Christer Solskogen. - - Signed-off-by: Eric Blake - -This patch just gets rid of the offending part. - ---- gettext-0.18.1.1/gettext-tools/libgettextpo/stdio.in.h-orig 2012-11-24 01:13:14.000000000 +0400 -+++ gettext-0.18.1.1/gettext-tools/libgettextpo/stdio.in.h 2012-11-24 01:13:46.000000000 +0400 -@@ -137,12 +137,6 @@ - "use gnulib module fflush for portable POSIX compliance"); - #endif - --/* It is very rare that the developer ever has full control of stdin, -- so any use of gets warrants an unconditional warning. Assume it is -- always declared, since it is required by C89. */ --#undef gets --_GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead"); -- - #if @GNULIB_FOPEN@ - # if @REPLACE_FOPEN@ - # if !(defined __cplusplus && defined GNULIB_NAMESPACE) - ---- gettext-0.18.1.1/gettext-runtime/gnulib-lib/stdio.in.h-orig 2012-11-24 00:26:49.000000000 +0400 -+++ gettext-0.18.1.1/gettext-runtime/gnulib-lib/stdio.in.h 2012-11-24 00:45:54.000000000 +0400 -@@ -137,12 +137,6 @@ - "use gnulib module fflush for portable POSIX compliance"); - #endif - --/* It is very rare that the developer ever has full control of stdin, -- so any use of gets warrants an unconditional warning. Assume it is -- always declared, since it is required by C89. */ --#undef gets --_GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead"); -- - #if @GNULIB_FOPEN@ - # if @REPLACE_FOPEN@ - # if !(defined __cplusplus && defined GNULIB_NAMESPACE) - ---- gettext-0.18.1.1/gettext-tools/gnulib-lib/stdio.in.h-orig 2012-11-24 01:00:26.000000000 +0400 -+++ gettext-0.18.1.1/gettext-tools/gnulib-lib/stdio.in.h 2012-11-24 01:00:53.000000000 +0400 -@@ -137,12 +137,6 @@ - "use gnulib module fflush for portable POSIX compliance"); - #endif - --/* It is very rare that the developer ever has full control of stdin, -- so any use of gets warrants an unconditional warning. Assume it is -- always declared, since it is required by C89. */ --#undef gets --_GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead"); -- - #if @GNULIB_FOPEN@ - # if @REPLACE_FOPEN@ - # if !(defined __cplusplus && defined GNULIB_NAMESPACE) -- cgit 1.4.1