summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2015-01-16 13:27:03 +0100
committerLudovic Courtès <ludo@gnu.org>2015-01-16 13:27:03 +0100
commit57b7e1a62d2269bfd9d37f88bae92c829222f8fc (patch)
tree5e6395e08025eb80de2040d77ac6febb558d2a72
parent72b703cdcaec260733a4e30800cef5eab3f071a6 (diff)
parentb01a0ba86e93012044f42c41ba5cbc7d7936c356 (diff)
Merge branch 'core-updates'
Conflicts: gnu/packages/bootstrap.scm
-rw-r--r--.gitignore1
-rw-r--r--build-aux/check-available-binaries.scm53
-rw-r--r--build-aux/check-final-inputs-self-contained.scm5
-rw-r--r--build-aux/download.scm8
-rw-r--r--doc/guix.texi4
-rw-r--r--gnu-system.am29
-rw-r--r--gnu/packages/apr.scm2
-rw-r--r--gnu/packages/autotools.scm123
-rw-r--r--gnu/packages/base.scm41
-rw-r--r--gnu/packages/bash.scm8
-rw-r--r--gnu/packages/boost.scm4
-rw-r--r--gnu/packages/bootstrap.scm67
-rwxr-xr-xgnu/packages/bootstrap/armhf-linux/bashbin0 -> 802224 bytes
-rwxr-xr-xgnu/packages/bootstrap/armhf-linux/mkdirbin0 -> 401544 bytes
-rwxr-xr-xgnu/packages/bootstrap/armhf-linux/tarbin0 -> 755356 bytes
-rwxr-xr-xgnu/packages/bootstrap/armhf-linux/xzbin0 -> 502884 bytes
-rw-r--r--gnu/packages/commencement.scm15
-rw-r--r--gnu/packages/compression.scm24
-rw-r--r--gnu/packages/cross-base.scm30
-rw-r--r--gnu/packages/curl.scm6
-rw-r--r--gnu/packages/databases.scm8
-rw-r--r--gnu/packages/elf.scm26
-rw-r--r--gnu/packages/file.scm28
-rw-r--r--gnu/packages/fontutils.scm3
-rw-r--r--gnu/packages/games.scm2
-rw-r--r--gnu/packages/gawk.scm24
-rw-r--r--gnu/packages/gcc.scm74
-rw-r--r--gnu/packages/gd.scm22
-rw-r--r--gnu/packages/gettext.scm4
-rw-r--r--gnu/packages/glib.scm4
-rw-r--r--gnu/packages/global.scm4
-rw-r--r--gnu/packages/gnome.scm11
-rw-r--r--gnu/packages/gnunet.scm4
-rw-r--r--gnu/packages/gnutls.scm6
-rw-r--r--gnu/packages/gps.scm12
-rw-r--r--gnu/packages/graphviz.scm4
-rw-r--r--gnu/packages/gtk.scm15
-rw-r--r--gnu/packages/guile.scm29
-rw-r--r--gnu/packages/icu4c.scm31
-rw-r--r--gnu/packages/image.scm6
-rw-r--r--gnu/packages/ld-wrapper.scm95
-rw-r--r--gnu/packages/libcanberra.scm4
-rw-r--r--gnu/packages/libevent.scm4
-rw-r--r--gnu/packages/linux.scm90
-rw-r--r--gnu/packages/m4.scm3
-rw-r--r--gnu/packages/mail.scm6
-rw-r--r--gnu/packages/make-bootstrap.scm14
-rw-r--r--gnu/packages/man.scm2
-rw-r--r--gnu/packages/mit-krb5.scm8
-rw-r--r--gnu/packages/mp3.scm4
-rw-r--r--gnu/packages/multiprecision.scm15
-rw-r--r--gnu/packages/ncurses.scm7
-rw-r--r--gnu/packages/openldap.scm4
-rw-r--r--gnu/packages/openssl.scm6
-rw-r--r--gnu/packages/patches/curl-gss-api-fix.patch38
-rw-r--r--gnu/packages/patches/file-CVE-2014-3587.patch16
-rw-r--r--gnu/packages/patches/gcc-fix-pr61801.patch25
-rw-r--r--gnu/packages/patches/gd-mips64-deplibs-fix.patch17
-rw-r--r--gnu/packages/patches/glibc-CVE-2012-3406.patch282
-rw-r--r--gnu/packages/patches/glibc-CVE-2014-7817.patch171
-rw-r--r--gnu/packages/patches/glibc-mips-dangling-vfork-ref.patch45
-rw-r--r--gnu/packages/patches/gmp-arm-asm-nothumb.patch21
-rw-r--r--gnu/packages/patches/guile-arm-fixes.patch203
-rw-r--r--gnu/packages/patches/libtool-2.4-skip-tests.patch24
-rw-r--r--gnu/packages/patches/libtool-skip-tests-for-mips.patch12
-rw-r--r--gnu/packages/patches/libtool-skip-tests.patch82
-rw-r--r--gnu/packages/patches/m4-readlink-EINVAL.patch18
-rw-r--r--gnu/packages/patches/patchelf-page-size.patch33
-rw-r--r--gnu/packages/patches/patchelf-rework-for-arm.patch473
-rw-r--r--gnu/packages/patches/sqlite-large-page-size-fix.patch180
-rw-r--r--gnu/packages/patchutils.scm2
-rw-r--r--gnu/packages/perl.scm2
-rw-r--r--gnu/packages/photo.scm4
-rw-r--r--gnu/packages/pkg-config.scm7
-rw-r--r--gnu/packages/pth.scm9
-rw-r--r--gnu/packages/pulseaudio.scm6
-rw-r--r--gnu/packages/python.scm4
-rw-r--r--gnu/packages/ruby.scm7
-rw-r--r--gnu/packages/ssh.scm2
-rw-r--r--gnu/packages/swig.scm13
-rw-r--r--gnu/packages/tcl.scm10
-rw-r--r--gnu/packages/texlive.scm3
-rw-r--r--gnu/packages/tre.scm14
-rw-r--r--gnu/packages/version-control.scm2
-rw-r--r--gnu/packages/web.scm16
-rw-r--r--gnu/packages/weechat.scm6
-rw-r--r--gnu/packages/xfce.scm2
-rw-r--r--gnu/packages/xiph.scm7
-rw-r--r--gnu/packages/xml.scm14
-rw-r--r--gnu/packages/xorg.scm4
-rw-r--r--guix/build/gnu-build-system.scm173
-rw-r--r--guix/build/utils.scm164
-rw-r--r--guix/packages.scm20
-rw-r--r--guix/scripts/environment.scm8
-rw-r--r--guix/scripts/package.scm28
-rw-r--r--guix/utils.scm24
-rw-r--r--m4/guix.m413
-rw-r--r--tests/packages.scm55
98 files changed, 2274 insertions, 984 deletions
diff --git a/.gitignore b/.gitignore
index bcb82aa26da..3ec36366e3f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -67,6 +67,7 @@ config.cache
67/doc/version.texi 67/doc/version.texi
68/gnu/packages/bootstrap/x86_64-linux/guile-2.0.9.tar.xz 68/gnu/packages/bootstrap/x86_64-linux/guile-2.0.9.tar.xz
69/gnu/packages/bootstrap/i686-linux/guile-2.0.9.tar.xz 69/gnu/packages/bootstrap/i686-linux/guile-2.0.9.tar.xz
70/gnu/packages/bootstrap/armhf-linux/guile-2.0.11.tar.xz
70/gnu/packages/bootstrap/mips64el-linux/guile-2.0.9.tar.xz 71/gnu/packages/bootstrap/mips64el-linux/guile-2.0.9.tar.xz
71/guix/config.scm 72/guix/config.scm
72/nix/nix-daemon/nix-daemon.cc 73/nix/nix-daemon/nix-daemon.cc
diff --git a/build-aux/check-available-binaries.scm b/build-aux/check-available-binaries.scm
index d5163a9503a..7ac43528394 100644
--- a/build-aux/check-available-binaries.scm
+++ b/build-aux/check-available-binaries.scm
@@ -1,5 +1,5 @@
1;;; GNU Guix --- Functional package management for GNU 1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2013, 2014 Ludovic Courtès <ludo@gnu.org> 2;;; Copyright © 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org>
3;;; 3;;;
4;;; This file is part of GNU Guix. 4;;; This file is part of GNU Guix.
5;;; 5;;;
@@ -28,31 +28,28 @@
28 (srfi srfi-1) 28 (srfi srfi-1)
29 (srfi srfi-26)) 29 (srfi srfi-26))
30 30
31(define %supported-systems 31(with-store store
32 '("x86_64-linux" "i686-linux")) 32 (let* ((native (append-map (lambda (system)
33 (map (cut package-derivation store <> system)
34 (list %bootstrap-tarballs emacs)))
35 %supported-systems))
36 (cross (map (cut package-cross-derivation store
37 %bootstrap-tarballs <>)
38 '("mips64el-linux-gnuabi64")))
39 (total (append native cross)))
40 (define (warn item system)
41 (format (current-error-port) "~a (~a) is not substitutable~%"
42 item system)
43 #f)
33 44
34(let* ((store (open-connection)) 45 (set-build-options store #:use-substitutes? #t)
35 (native (append-map (lambda (system) 46 (let* ((substitutable? (substitution-oracle store total))
36 (map (cut package-derivation store <> system) 47 (result (every (lambda (drv)
37 (list %bootstrap-tarballs emacs))) 48 (let ((out (derivation->output-path drv)))
38 %supported-systems)) 49 (or (substitutable? out)
39 (cross (map (cut package-cross-derivation store 50 (warn out (derivation-system drv)))))
40 %bootstrap-tarballs <>) 51 total)))
41 '("mips64el-linux-gnuabi64"))) 52 (when result
42 (total (append native cross))) 53 (format (current-error-port) "~a packages found substitutable~%"
43 (define (warn proc) 54 (length total)))
44 (lambda (drv) 55 (exit result))))
45 (or (proc drv)
46 (begin
47 (format (current-error-port) "~a is not substitutable~%"
48 drv)
49 #f))))
50
51 (set-build-options store #:use-substitutes? #t)
52 (let ((result (every (compose (warn (cut has-substitutes? store <>))
53 derivation->output-path)
54 total)))
55 (when result
56 (format (current-error-port) "~a packages found substitutable~%"
57 (length total)))
58 (exit result)))
diff --git a/build-aux/check-final-inputs-self-contained.scm b/build-aux/check-final-inputs-self-contained.scm
index ade4e98001a..ca7e8030b46 100644
--- a/build-aux/check-final-inputs-self-contained.scm
+++ b/build-aux/check-final-inputs-self-contained.scm
@@ -1,5 +1,5 @@
1;;; GNU Guix --- Functional package management for GNU 1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2014 Ludovic Courtès <ludo@gnu.org> 2;;; Copyright © 2014, 2015 Ludovic Courtès <ludo@gnu.org>
3;;; 3;;;
4;;; This file is part of GNU Guix. 4;;; This file is part of GNU Guix.
5;;; 5;;;
@@ -29,9 +29,6 @@
29 (srfi srfi-1) 29 (srfi srfi-1)
30 (srfi srfi-26)) 30 (srfi srfi-26))
31 31
32(define %supported-systems
33 '("x86_64-linux" "i686-linux"))
34
35(define (final-inputs store system) 32(define (final-inputs store system)
36 "Return the list of outputs directories of the final inputs for SYSTEM." 33 "Return the list of outputs directories of the final inputs for SYSTEM."
37 (append-map (match-lambda 34 (append-map (match-lambda
diff --git a/build-aux/download.scm b/build-aux/download.scm
index 50123f59d2a..a107a887dc3 100644
--- a/build-aux/download.scm
+++ b/build-aux/download.scm
@@ -1,5 +1,6 @@
1;;; GNU Guix --- Functional package management for GNU 1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2012, 2013 Ludovic Courtès <ludo@gnu.org> 2;;; Copyright © 2012, 2013 Ludovic Courtès <ludo@gnu.org>
3;;; Copyright © 2014, 2015 Mark H Weaver <mhw@netris.org>
3;;; 4;;;
4;;; This file is part of GNU Guix. 5;;; This file is part of GNU Guix.
5;;; 6;;;
@@ -45,7 +46,12 @@
45 (match (string-tokenize file (char-set-complement (char-set #\/))) 46 (match (string-tokenize file (char-set-complement (char-set #\/)))
46 ((_ ... system basename) 47 ((_ ... system basename)
47 (string->uri (string-append %url-base "/" system 48 (string->uri (string-append %url-base "/" system
48 "/20131110/" basename))))) 49 (match system
50 ("armhf-linux"
51 "/20150101/")
52 (_
53 "/20131110/"))
54 basename)))))
49 55
50(match (command-line) 56(match (command-line)
51 ((_ file expected-hash) 57 ((_ file expected-hash)
diff --git a/doc/guix.texi b/doc/guix.texi
index c052804a451..7febee48ac7 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -3275,6 +3275,10 @@ Intel/AMD @code{x86_64} architecture, Linux-Libre kernel;
3275@item i686-linux 3275@item i686-linux
3276Intel 32-bit architecture (IA32), Linux-Libre kernel; 3276Intel 32-bit architecture (IA32), Linux-Libre kernel;
3277 3277
3278@item armhf-linux
3279ARMv7-A architecture with hard float, Thumb-2 and VFP3D16 coprocessor,
3280using the EABI hard-float ABI, and Linux-Libre kernel.
3281
3278@item mips64el-linux 3282@item mips64el-linux
3279little-endian 64-bit MIPS processors, specifically the Loongson series, 3283little-endian 64-bit MIPS processors, specifically the Loongson series,
3280n32 application binary interface (ABI), and Linux-Libre kernel. 3284n32 application binary interface (ABI), and Linux-Libre kernel.
diff --git a/gnu-system.am b/gnu-system.am
index 8e331e136bf..58baec73136 100644
--- a/gnu-system.am
+++ b/gnu-system.am
@@ -1,7 +1,7 @@
1# GNU Guix --- Functional package management for GNU 1# GNU Guix --- Functional package management for GNU
2# Copyright © 2012, 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org> 2# Copyright © 2012, 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org>
3# Copyright © 2013, 2014 Andreas Enge <andreas@enge.fr> 3# Copyright © 2013, 2014 Andreas Enge <andreas@enge.fr>
4# Copyright © 2013, 2014 Mark H Weaver <mhw@netris.org> 4# Copyright © 2013, 2014, 2015 Mark H Weaver <mhw@netris.org>
5# 5#
6# This file is part of GNU Guix. 6# This file is part of GNU Guix.
7# 7#
@@ -347,6 +347,7 @@ dist_patch_DATA = \
347 gnu/packages/patches/cpio-gets-undeclared.patch \ 347 gnu/packages/patches/cpio-gets-undeclared.patch \
348 gnu/packages/patches/cssc-gets-undeclared.patch \ 348 gnu/packages/patches/cssc-gets-undeclared.patch \
349 gnu/packages/patches/cssc-missing-include.patch \ 349 gnu/packages/patches/cssc-missing-include.patch \
350 gnu/packages/patches/curl-gss-api-fix.patch \
350 gnu/packages/patches/cursynth-wave-rand.patch \ 351 gnu/packages/patches/cursynth-wave-rand.patch \
351 gnu/packages/patches/dbus-localstatedir.patch \ 352 gnu/packages/patches/dbus-localstatedir.patch \
352 gnu/packages/patches/diffutils-gets-undeclared.patch \ 353 gnu/packages/patches/diffutils-gets-undeclared.patch \
@@ -356,21 +357,22 @@ dist_patch_DATA = \
356 gnu/packages/patches/duplicity-piped-password.patch \ 357 gnu/packages/patches/duplicity-piped-password.patch \
357 gnu/packages/patches/duplicity-test_selection-tmp.patch \ 358 gnu/packages/patches/duplicity-test_selection-tmp.patch \
358 gnu/packages/patches/eudev-rules-directory.patch \ 359 gnu/packages/patches/eudev-rules-directory.patch \
359 gnu/packages/patches/file-CVE-2014-3587.patch \
360 gnu/packages/patches/findutils-absolute-paths.patch \ 360 gnu/packages/patches/findutils-absolute-paths.patch \
361 gnu/packages/patches/flashrom-use-libftdi1.patch \ 361 gnu/packages/patches/flashrom-use-libftdi1.patch \
362 gnu/packages/patches/flex-bison-tests.patch \ 362 gnu/packages/patches/flex-bison-tests.patch \
363 gnu/packages/patches/gawk-shell.patch \ 363 gnu/packages/patches/gawk-shell.patch \
364 gnu/packages/patches/gcc-cross-environment-variables.patch \ 364 gnu/packages/patches/gcc-cross-environment-variables.patch \
365 gnu/packages/patches/gcc-fix-pr61801.patch \
366 gnu/packages/patches/gd-mips64-deplibs-fix.patch \
367 gnu/packages/patches/glib-tests-desktop.patch \ 365 gnu/packages/patches/glib-tests-desktop.patch \
368 gnu/packages/patches/glib-tests-homedir.patch \ 366 gnu/packages/patches/glib-tests-homedir.patch \
369 gnu/packages/patches/glib-tests-prlimit.patch \ 367 gnu/packages/patches/glib-tests-prlimit.patch \
370 gnu/packages/patches/glib-tests-timer.patch \ 368 gnu/packages/patches/glib-tests-timer.patch \
371 gnu/packages/patches/glib-tests-gapplication.patch \ 369 gnu/packages/patches/glib-tests-gapplication.patch \
370 gnu/packages/patches/glibc-CVE-2012-3406.patch \
371 gnu/packages/patches/glibc-CVE-2014-7817.patch \
372 gnu/packages/patches/glibc-bootstrap-system.patch \ 372 gnu/packages/patches/glibc-bootstrap-system.patch \
373 gnu/packages/patches/glibc-ldd-x86_64.patch \ 373 gnu/packages/patches/glibc-ldd-x86_64.patch \
374 gnu/packages/patches/glibc-mips-dangling-vfork-ref.patch \
375 gnu/packages/patches/gmp-arm-asm-nothumb.patch \
374 gnu/packages/patches/gnunet-fix-scheduler.patch \ 376 gnu/packages/patches/gnunet-fix-scheduler.patch \
375 gnu/packages/patches/gnunet-fix-tests.patch \ 377 gnu/packages/patches/gnunet-fix-tests.patch \
376 gnu/packages/patches/gobject-introspection-cc.patch \ 378 gnu/packages/patches/gobject-introspection-cc.patch \
@@ -378,6 +380,7 @@ dist_patch_DATA = \
378 gnu/packages/patches/gstreamer-0.10-bison3.patch \ 380 gnu/packages/patches/gstreamer-0.10-bison3.patch \
379 gnu/packages/patches/gstreamer-0.10-silly-test.patch \ 381 gnu/packages/patches/gstreamer-0.10-silly-test.patch \
380 gnu/packages/patches/guile-1.8-cpp-4.5.patch \ 382 gnu/packages/patches/guile-1.8-cpp-4.5.patch \
383 gnu/packages/patches/guile-arm-fixes.patch \
381 gnu/packages/patches/guile-default-utf8.patch \ 384 gnu/packages/patches/guile-default-utf8.patch \
382 gnu/packages/patches/guile-linux-syscalls.patch \ 385 gnu/packages/patches/guile-linux-syscalls.patch \
383 gnu/packages/patches/guile-relocatable.patch \ 386 gnu/packages/patches/guile-relocatable.patch \
@@ -405,13 +408,10 @@ dist_patch_DATA = \
405 gnu/packages/patches/libmad-mips-newgcc.patch \ 408 gnu/packages/patches/libmad-mips-newgcc.patch \
406 gnu/packages/patches/libtheora-config-guess.patch \ 409 gnu/packages/patches/libtheora-config-guess.patch \
407 gnu/packages/patches/libtool-skip-tests.patch \ 410 gnu/packages/patches/libtool-skip-tests.patch \
408 gnu/packages/patches/libtool-skip-tests-for-mips.patch \
409 gnu/packages/patches/libtool-2.4-skip-tests.patch \
410 gnu/packages/patches/libssh-CVE-2014-0017.patch \ 411 gnu/packages/patches/libssh-CVE-2014-0017.patch \
411 gnu/packages/patches/lm-sensors-hwmon-attrs.patch \ 412 gnu/packages/patches/lm-sensors-hwmon-attrs.patch \
412 gnu/packages/patches/luit-posix.patch \ 413 gnu/packages/patches/luit-posix.patch \
413 gnu/packages/patches/m4-gets-undeclared.patch \ 414 gnu/packages/patches/m4-gets-undeclared.patch \
414 gnu/packages/patches/m4-readlink-EINVAL.patch \
415 gnu/packages/patches/make-impure-dirs.patch \ 415 gnu/packages/patches/make-impure-dirs.patch \
416 gnu/packages/patches/mc-fix-ncurses-build.patch \ 416 gnu/packages/patches/mc-fix-ncurses-build.patch \
417 gnu/packages/patches/mcron-install.patch \ 417 gnu/packages/patches/mcron-install.patch \
@@ -428,6 +428,7 @@ dist_patch_DATA = \
428 gnu/packages/patches/orpheus-cast-errors-and-includes.patch \ 428 gnu/packages/patches/orpheus-cast-errors-and-includes.patch \
429 gnu/packages/patches/ots-no-include-missing-file.patch \ 429 gnu/packages/patches/ots-no-include-missing-file.patch \
430 gnu/packages/patches/patchelf-page-size.patch \ 430 gnu/packages/patches/patchelf-page-size.patch \
431 gnu/packages/patches/patchelf-rework-for-arm.patch \
431 gnu/packages/patches/patchutils-xfail-gendiff-tests.patch \ 432 gnu/packages/patches/patchutils-xfail-gendiff-tests.patch \
432 gnu/packages/patches/perl-no-sys-dirs.patch \ 433 gnu/packages/patches/perl-no-sys-dirs.patch \
433 gnu/packages/patches/perl-tk-x11-discover.patch \ 434 gnu/packages/patches/perl-tk-x11-discover.patch \
@@ -457,7 +458,6 @@ dist_patch_DATA = \
457 gnu/packages/patches/slim-sigusr1.patch \ 458 gnu/packages/patches/slim-sigusr1.patch \
458 gnu/packages/patches/soprano-find-clucene.patch \ 459 gnu/packages/patches/soprano-find-clucene.patch \
459 gnu/packages/patches/source-highlight-regexrange-test.patch \ 460 gnu/packages/patches/source-highlight-regexrange-test.patch \
460 gnu/packages/patches/sqlite-large-page-size-fix.patch \
461 gnu/packages/patches/superlu-dist-scotchmetis.patch \ 461 gnu/packages/patches/superlu-dist-scotchmetis.patch \
462 gnu/packages/patches/tcsh-fix-autotest.patch \ 462 gnu/packages/patches/tcsh-fix-autotest.patch \
463 gnu/packages/patches/teckit-cstdio.patch \ 463 gnu/packages/patches/teckit-cstdio.patch \
@@ -496,6 +496,7 @@ dist_patch_DATA = \
496bootstrapdir = $(guilemoduledir)/gnu/packages/bootstrap 496bootstrapdir = $(guilemoduledir)/gnu/packages/bootstrap
497bootstrap_x86_64_linuxdir = $(bootstrapdir)/x86_64-linux 497bootstrap_x86_64_linuxdir = $(bootstrapdir)/x86_64-linux
498bootstrap_i686_linuxdir = $(bootstrapdir)/i686-linux 498bootstrap_i686_linuxdir = $(bootstrapdir)/i686-linux
499bootstrap_armhf_linuxdir = $(bootstrapdir)/armhf-linux
499bootstrap_mips64el_linuxdir = $(bootstrapdir)/mips64el-linux 500bootstrap_mips64el_linuxdir = $(bootstrapdir)/mips64el-linux
500 501
501dist_bootstrap_x86_64_linux_DATA = \ 502dist_bootstrap_x86_64_linux_DATA = \
@@ -510,6 +511,12 @@ dist_bootstrap_i686_linux_DATA = \
510 gnu/packages/bootstrap/i686-linux/tar \ 511 gnu/packages/bootstrap/i686-linux/tar \
511 gnu/packages/bootstrap/i686-linux/xz 512 gnu/packages/bootstrap/i686-linux/xz
512 513
514dist_bootstrap_armhf_linux_DATA = \
515 gnu/packages/bootstrap/armhf-linux/bash \
516 gnu/packages/bootstrap/armhf-linux/mkdir \
517 gnu/packages/bootstrap/armhf-linux/tar \
518 gnu/packages/bootstrap/armhf-linux/xz
519
513dist_bootstrap_mips64el_linux_DATA = \ 520dist_bootstrap_mips64el_linux_DATA = \
514 gnu/packages/bootstrap/mips64el-linux/bash \ 521 gnu/packages/bootstrap/mips64el-linux/bash \
515 gnu/packages/bootstrap/mips64el-linux/mkdir \ 522 gnu/packages/bootstrap/mips64el-linux/mkdir \
@@ -522,6 +529,8 @@ nodist_bootstrap_x86_64_linux_DATA = \
522 gnu/packages/bootstrap/x86_64-linux/guile-2.0.9.tar.xz 529 gnu/packages/bootstrap/x86_64-linux/guile-2.0.9.tar.xz
523nodist_bootstrap_i686_linux_DATA = \ 530nodist_bootstrap_i686_linux_DATA = \
524 gnu/packages/bootstrap/i686-linux/guile-2.0.9.tar.xz 531 gnu/packages/bootstrap/i686-linux/guile-2.0.9.tar.xz
532nodist_bootstrap_armhf_linux_DATA = \
533 gnu/packages/bootstrap/armhf-linux/guile-2.0.11.tar.xz
525nodist_bootstrap_mips64el_linux_DATA = \ 534nodist_bootstrap_mips64el_linux_DATA = \
526 gnu/packages/bootstrap/mips64el-linux/guile-2.0.9.tar.xz 535 gnu/packages/bootstrap/mips64el-linux/guile-2.0.9.tar.xz
527 536
@@ -533,6 +542,7 @@ set-bootstrap-executable-permissions:
533DISTCLEANFILES = \ 542DISTCLEANFILES = \
534 $(nodist_bootstrap_x86_64_linux_DATA) \ 543 $(nodist_bootstrap_x86_64_linux_DATA) \
535 $(nodist_bootstrap_i686_linux_DATA) \ 544 $(nodist_bootstrap_i686_linux_DATA) \
545 $(nodist_bootstrap_armhf_linux_DATA) \
536 $(nodist_bootstrap_mips64el_linux_DATA) 546 $(nodist_bootstrap_mips64el_linux_DATA)
537 547
538# Method to download a file from an external source. 548# Method to download a file from an external source.
@@ -547,6 +557,9 @@ gnu/packages/bootstrap/x86_64-linux/guile-2.0.9.tar.xz:
547gnu/packages/bootstrap/i686-linux/guile-2.0.9.tar.xz: 557gnu/packages/bootstrap/i686-linux/guile-2.0.9.tar.xz:
548 $(MKDIR_P) `dirname "$@"` 558 $(MKDIR_P) `dirname "$@"`
549 $(DOWNLOAD_FILE) "$@" "b757cd46bf13ecac83fb8e955fb50096ac2d17bb610ca8eb816f29302a00a846" 559 $(DOWNLOAD_FILE) "$@" "b757cd46bf13ecac83fb8e955fb50096ac2d17bb610ca8eb816f29302a00a846"
560gnu/packages/bootstrap/armhf-linux/guile-2.0.11.tar.xz:
561 $(MKDIR_P) `dirname "$@"`
562 $(DOWNLOAD_FILE) "$@" "e551d05d4d385d6706ab8d574856a087758294dc90ab4c06e70a157a685e23d6"
550gnu/packages/bootstrap/mips64el-linux/guile-2.0.9.tar.xz: 563gnu/packages/bootstrap/mips64el-linux/guile-2.0.9.tar.xz:
551 $(MKDIR_P) `dirname "$@"` 564 $(MKDIR_P) `dirname "$@"`
552 $(DOWNLOAD_FILE) "$@" "994680f0001346864aa2c2cc5110f380ee7518dcd701c614291682b8e948f73b" 565 $(DOWNLOAD_FILE) "$@" "994680f0001346864aa2c2cc5110f380ee7518dcd701c614291682b8e948f73b"
diff --git a/gnu/packages/apr.scm b/gnu/packages/apr.scm
index cedeea8a14d..3e53a614fc3 100644
--- a/gnu/packages/apr.scm
+++ b/gnu/packages/apr.scm
@@ -48,7 +48,7 @@
48 '(#:parallel-build? #f 48 '(#:parallel-build? #f
49 #:parallel-tests? #f)) 49 #:parallel-tests? #f))
50 (inputs `(("perl" ,perl) 50 (inputs `(("perl" ,perl)
51 ("libtool" ,libtool))) 51 ("libltdl" ,libltdl)))
52 (home-page "http://apr.apache.org/") 52 (home-page "http://apr.apache.org/")
53 (synopsis "The Apache Portable Runtime Library") 53 (synopsis "The Apache Portable Runtime Library")
54 (description 54 (description
diff --git a/gnu/packages/autotools.scm b/gnu/packages/autotools.scm
index 3db3f45949e..8e72562444a 100644
--- a/gnu/packages/autotools.scm
+++ b/gnu/packages/autotools.scm
@@ -178,7 +178,7 @@ exec ~a --no-auto-compile \"$0\" \"$@\"
178 (native-search-paths 178 (native-search-paths
179 (list (search-path-specification 179 (list (search-path-specification
180 (variable "ACLOCAL_PATH") 180 (variable "ACLOCAL_PATH")
181 (directories '("share/aclocal"))))) 181 (files '("share/aclocal")))))
182 (arguments 182 (arguments
183 '(#:modules ((guix build gnu-build-system) 183 '(#:modules ((guix build gnu-build-system)
184 (guix build utils) 184 (guix build utils)
@@ -238,52 +238,48 @@ Makefile, simplifying the entire process for the developer.")
238(define-public libtool 238(define-public libtool
239 (package 239 (package
240 (name "libtool") 240 (name "libtool")
241 (version "2.4.2") 241 (version "2.4.4")
242 (source (origin 242 (source (origin
243 (method url-fetch) 243 (method url-fetch)
244 (uri (string-append "mirror://gnu/libtool/libtool-" 244 (uri (string-append "mirror://gnu/libtool/libtool-"
245 version ".tar.gz")) 245 version ".tar.xz"))
246 (sha256 246 (sha256
247 (base32 247 (base32
248 "0649qfpzkswgcj9vqkkr9rn4nlcx80faxpyqscy2k1x9c94f93dk")) 248 "0v3zq08qxv7k5067mpqrkjkjl3wphhg06i696mka90mzadc5nad8"))
249 (patches 249 (patches
250 (list (search-patch "libtool-skip-tests.patch") 250 (list (search-patch "libtool-skip-tests.patch")))))
251 (search-patch "libtool-skip-tests-for-mips.patch")))))
252 (build-system gnu-build-system) 251 (build-system gnu-build-system)
252 (propagated-inputs `(("m4" ,m4)))
253 (native-inputs `(("m4" ,m4) 253 (native-inputs `(("m4" ,m4)
254 ("perl" ,perl))) 254 ("perl" ,perl)
255 255 ("automake" ,automake) ;some tests rely on 'aclocal'
256 ;; Separate binaries from the rest. During bootstrap, only ltdl is 256 ("autoconf" ,(autoconf-wrapper)))) ;others on 'autom4te'
257 ;; used; not depending on the binaries allows us to avoid retaining
258 ;; a reference to the bootstrap bash.
259 (outputs '("bin" ; libtoolize, libtool, etc.
260 "out")) ; libltdl.so, ltdl.h, etc.
261 257
262 (arguments 258 (arguments
263 (if (%current-target-system) 259 `(;; Libltdl is provided as a separate package, so don't install it here.
264 '() ; no `check' phase when cross-building 260 #:configure-flags '("--disable-ltdl-install")
265 '(#:phases (alist-cons-before 261
266 'check 'pre-check 262 ;; XXX: There are test failures on mips64el-linux starting from 2.4.4:
267 (lambda* (#:key inputs #:allow-other-keys) 263 ;; <http://hydra.gnu.org/build/181662>.
268 ;; Run the test suite in parallel, if possible. 264 #:tests? ,(not (string-prefix? "mips64"
269 (let ((ncores 265 (or (%current-target-system)
270 (cond 266 (%current-system))))
271 ((getenv "NIX_BUILD_CORES") 267
272 => 268 #:phases (alist-cons-before
273 (lambda (n) 269 'check 'pre-check
274 (if (zero? (string->number n)) 270 (lambda* (#:key inputs #:allow-other-keys)
275 (number->string (current-processor-count)) 271 ;; Run the test suite in parallel, if possible.
276 n))) 272 (setenv "TESTSUITEFLAGS"
277 (else "1")))) 273 (string-append
278 (setenv "TESTSUITEFLAGS" 274 "-j"
279 (string-append "-j" ncores))) 275 (number->string (parallel-job-count))))
280 276
281 ;; Path references to /bin/sh. 277 ;; Path references to /bin/sh.
282 (let ((bash (assoc-ref inputs "bash"))) 278 (let ((bash (assoc-ref inputs "bash")))
283 (substitute* "tests/testsuite" 279 (substitute* "tests/testsuite"
284 (("/bin/sh") 280 (("/bin/sh")
285 (string-append bash "/bin/bash"))))) 281 (string-append bash "/bin/bash")))))
286 %standard-phases)))) 282 %standard-phases)))
287 (synopsis "Generic shared library support tools") 283 (synopsis "Generic shared library support tools")
288 (description 284 (description
289 "GNU Libtool helps in the creation and use of shared libraries, by 285 "GNU Libtool helps in the creation and use of shared libraries, by
@@ -292,28 +288,25 @@ complexity of working with shared libraries across platforms.")
292 (license gpl3+) 288 (license gpl3+)
293 (home-page "http://www.gnu.org/software/libtool/"))) 289 (home-page "http://www.gnu.org/software/libtool/")))
294 290
295(define-public libtool-2.4.4 291(define-public libltdl
296 (package (inherit libtool) 292 ;; This is a libltdl package separate from the libtool package. This is
297 (version "2.4.4") 293 ;; useful because, unlike libtool, it has zero extra dependencies (making it
298 (source (origin 294 ;; readily usable during bootstrap), and it builds very quickly since
299 (method url-fetch) 295 ;; Libtool's extensive test suite isn't run.
300 (uri (string-append "mirror://gnu/libtool/libtool-" 296 (package
301 version ".tar.xz")) 297 (name "libltdl")
302 (sha256 298 (version (package-version libtool))
303 (base32 299 (source (package-source libtool))
304 "0v3zq08qxv7k5067mpqrkjkjl3wphhg06i696mka90mzadc5nad8")) 300 (build-system gnu-build-system)
305 (patches
306 (list (search-patch "libtool-2.4-skip-tests.patch")))))
307
308 (native-inputs `(("automake" ,automake) ;some tests rely on 'aclocal'
309 ("autoconf" ,(autoconf-wrapper)) ;others on 'autom4te'
310 ,@(package-native-inputs libtool)))
311
312 (arguments 301 (arguments
313 ;; XXX: There are test failures on mips64el-linux starting from 2.4.4: 302 '(#:configure-flags '("--enable-ltdl-install") ;really install it
314 ;; <http://hydra.gnu.org/build/181662>. 303 #:phases (alist-cons-before
315 (if (string-prefix? "mips64el" 304 'configure 'change-directory
316 (or (%current-target-system) (%current-system))) 305 (lambda _
317 `(#:tests? #f 306 (chdir "libltdl"))
318 ,@(package-arguments libtool)) 307 %standard-phases)))
319 (package-arguments libtool))))) 308
309 (synopsis "System-independent dlopen wrapper of GNU libtool")
310 (description (package-description libtool))
311 (home-page (package-home-page libtool))
312 (license lgpl2.1+)))
diff --git a/gnu/packages/base.scm b/gnu/packages/base.scm
index 85e92aad3b2..1f479ccbbec 100644
--- a/gnu/packages/base.scm
+++ b/gnu/packages/base.scm
@@ -65,14 +65,14 @@ command-line arguments, multiple languages, and so on.")
65(define-public grep 65(define-public grep
66 (package 66 (package
67 (name "grep") 67 (name "grep")
68 (version "2.20") 68 (version "2.21")
69 (source (origin 69 (source (origin
70 (method url-fetch) 70 (method url-fetch)
71 (uri (string-append "mirror://gnu/grep/grep-" 71 (uri (string-append "mirror://gnu/grep/grep-"
72 version ".tar.xz")) 72 version ".tar.xz"))
73 (sha256 73 (sha256
74 (base32 74 (base32
75 "0rcs0spsxdmh6yz8y4frkqp6f5iw19mdbdl9s2v6956hq0mlbbzh")))) 75 "1pp5n15qwxrw1pibwjhhgsibyv5cafhamf8lwzjygs6y00fa2i2j"))))
76 (build-system gnu-build-system) 76 (build-system gnu-build-system)
77 (synopsis "Print lines matching a pattern") 77 (synopsis "Print lines matching a pattern")
78 (description 78 (description
@@ -312,14 +312,14 @@ change. GNU make offers many powerful extensions over the standard utility.")
312(define-public binutils 312(define-public binutils
313 (package 313 (package
314 (name "binutils") 314 (name "binutils")
315 (version "2.24") 315 (version "2.25")
316 (source (origin 316 (source (origin
317 (method url-fetch) 317 (method url-fetch)
318 (uri (string-append "mirror://gnu/binutils/binutils-" 318 (uri (string-append "mirror://gnu/binutils/binutils-"
319 version ".tar.bz2")) 319 version ".tar.bz2"))
320 (sha256 320 (sha256
321 (base32 321 (base32
322 "0ds1y7qa0xqihw4ihnsgg6bxanmb228r228ddvwzgrv4jszcbs75")) 322 "08r9i26b05zcwb9zxb6zllpfdiiicdfsgbpsjlrjmvx3rxjzrpi2"))
323 (patches (list (search-patch "binutils-ld-new-dtags.patch") 323 (patches (list (search-patch "binutils-ld-new-dtags.patch")
324 (search-patch "binutils-loongson-workaround.patch"))))) 324 (search-patch "binutils-loongson-workaround.patch")))))
325 (build-system gnu-build-system) 325 (build-system gnu-build-system)
@@ -375,32 +375,37 @@ included.")
375 (("use_ldconfig=yes") 375 (("use_ldconfig=yes")
376 "use_ldconfig=no"))) 376 "use_ldconfig=no")))
377 (modules '((guix build utils))) 377 (modules '((guix build utils)))
378 (patches (list (search-patch "glibc-ldd-x86_64.patch"))))) 378 (patches (list (search-patch "glibc-CVE-2014-7817.patch")
379 (search-patch "glibc-CVE-2012-3406.patch")
380 (search-patch "glibc-mips-dangling-vfork-ref.patch")
381 (search-patch "glibc-ldd-x86_64.patch")))))
379 (build-system gnu-build-system) 382 (build-system gnu-build-system)
380 383
381 ;; Glibc's <limits.h> refers to <linux/limit.h>, for instance, so glibc 384 ;; Glibc's <limits.h> refers to <linux/limit.h>, for instance, so glibc
382 ;; users should automatically pull Linux headers as well. 385 ;; users should automatically pull Linux headers as well.
383 (propagated-inputs `(("linux-headers" ,linux-libre-headers))) 386 (propagated-inputs `(("linux-headers" ,linux-libre-headers)))
384 387
385 ;; Store the locales separately (~100 MiB). Note that "out" retains a 388 (outputs '("out" "debug"))
386 ;; reference to them anyway, so there's no space savings here.
387 ;; TODO: Eventually we may want to add a $LOCALE_ARCHIVE search path like
388 ;; Nixpkgs does.
389 (outputs '("out" "locales" "debug"))
390 389
391 (arguments 390 (arguments
392 `(#:out-of-source? #t 391 `(#:out-of-source? #t
393 #:configure-flags 392 #:configure-flags
394 (list "--enable-add-ons" 393 (list "--enable-add-ons"
395 "--sysconfdir=/etc" 394 "--sysconfdir=/etc"
396 (string-append "--localedir=" (assoc-ref %outputs "locales")
397 "/share/locale")
398 395
396 ;; Installing a locale archive with all the locales is to
397 ;; expensive (~100 MiB), so we rely on users to install the
398 ;; locales they really want.
399 ;;
400 ;; Set the default locale path. In practice, $LOCPATH may be
401 ;; defined to point whatever locales users want. However, setuid
402 ;; binaries don't honor $LOCPATH, so they'll instead look into
403 ;; $libc_cv_localedir; we choose /run/current-system/locale, with
404 ;; the idea that it is going to be populated by the sysadmin.
405 ;;
399 ;; `--localedir' is not honored, so work around it. 406 ;; `--localedir' is not honored, so work around it.
400 ;; See <http://sourceware.org/ml/libc-alpha/2013-03/msg00093.html>. 407 ;; See <http://sourceware.org/ml/libc-alpha/2013-03/msg00093.html>.
401 (string-append "libc_cv_localedir=" 408 (string-append "libc_cv_localedir=/run/current-system/locale")
402 (assoc-ref %outputs "locales")
403 "/share/locale")
404 409
405 (string-append "--with-headers=" 410 (string-append "--with-headers="
406 (assoc-ref %build-inputs "linux-headers") 411 (assoc-ref %build-inputs "linux-headers")
@@ -477,11 +482,7 @@ included.")
477 "") 482 "")
478 (("exec @PERL@") 483 (("exec @PERL@")
479 "exec perl")))) 484 "exec perl"))))
480 (alist-cons-after 485 %standard-phases)))
481 'install 'install-locales
482 (lambda _
483 (zero? (system* "make" "localedata/install-locales")))
484 %standard-phases))))
485 486
486 (inputs `(("static-bash" ,(static-package bash-light)))) 487 (inputs `(("static-bash" ,(static-package bash-light))))
487 488
diff --git a/gnu/packages/bash.scm b/gnu/packages/bash.scm
index 8a589395f30..f565c1a876c 100644
--- a/gnu/packages/bash.scm
+++ b/gnu/packages/bash.scm
@@ -1,6 +1,6 @@
1;;; GNU Guix --- Functional package management for GNU 1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2012, 2013, 2014 Ludovic Courtès <ludo@gnu.org> 2;;; Copyright © 2012, 2013, 2014 Ludovic Courtès <ludo@gnu.org>
3;;; Copyright © 2014 Mark H Weaver <mhw@netris.org> 3;;; Copyright © 2014, 2015 Mark H Weaver <mhw@netris.org>
4;;; 4;;;
5;;; This file is part of GNU Guix. 5;;; This file is part of GNU Guix.
6;;; 6;;;
@@ -81,8 +81,10 @@
81 (27 "1gnsfvq6bhb3srlbh0cannj2hackdsipcg7z0ds7zlk1hp96mdqy") 81 (27 "1gnsfvq6bhb3srlbh0cannj2hackdsipcg7z0ds7zlk1hp96mdqy")
82 (28 "17a65c4fn4c5rgsiw9gqqnzhznh3gwnd2xzzv2dppyi48znxpc78") ;CVE-2014-7186 82 (28 "17a65c4fn4c5rgsiw9gqqnzhznh3gwnd2xzzv2dppyi48znxpc78") ;CVE-2014-7186
83 (29 "14k27p28r5l2fz3r03kd0x72vvsq8bja8c6hjz5kxikbzsbs7i2c") ;CVE-2014-6277 83 (29 "14k27p28r5l2fz3r03kd0x72vvsq8bja8c6hjz5kxikbzsbs7i2c") ;CVE-2014-6277
84 (30 "0nrqb0m7s89qsrbfaffpilc5gcf82bx9yvgzld4hr79p5y54yhw5"))) ;CVE-2014-6278 84 (30 "0nrqb0m7s89qsrbfaffpilc5gcf82bx9yvgzld4hr79p5y54yhw5") ;CVE-2014-6278
85 85 (31 "07d62bl3z7qa8v6kgk47vzzazw563mlk9zhrsr4xsbqgvmcrylnd")
86 (32 "0jjgapfq4qhmndfrw8c3q3lva8xjdhlbd9cc631v41b0kb95g4w8")
87 (33 "05ma5rlxiadnfh925p4y7s0vvk917kmsdb1mfdx05gizl63pfapv")))
86(define (download-patches store count) 88(define (download-patches store count)
87 "Download COUNT Bash patches into store. Return a list of 89 "Download COUNT Bash patches into store. Return a list of
88number/base32-hash tuples, directly usable in the 'patch-series' form." 90number/base32-hash tuples, directly usable in the 'patch-series' form."
diff --git a/gnu/packages/boost.scm b/gnu/packages/boost.scm
index 3e8d2b8a020..17676819556 100644
--- a/gnu/packages/boost.scm
+++ b/gnu/packages/boost.scm
@@ -1,6 +1,6 @@
1;;; GNU Guix --- Functional package management for GNU 1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2014 John Darrington <jmd@gnu.org> 2;;; Copyright © 2014 John Darrington <jmd@gnu.org>
3;;; Copyright © 2014 Mark H Weaver <mhw@netris.org> 3;;; Copyright © 2014, 2015 Mark H Weaver <mhw@netris.org>
4;;; 4;;;
5;;; This file is part of GNU Guix. 5;;; This file is part of GNU Guix.
6;;; 6;;;
@@ -53,7 +53,7 @@
53 ;; Boost's 'context' library is not yet supported on mips64, so 53 ;; Boost's 'context' library is not yet supported on mips64, so
54 ;; we disable it. The 'coroutine' library depends on 'context', 54 ;; we disable it. The 'coroutine' library depends on 'context',
55 ;; so we disable that too. 55 ;; so we disable that too.
56 ,@(if (equal? "mips64el-linux" (or (%current-target-system) 56 ,@(if (string-prefix? "mips64" (or (%current-target-system)
57 (%current-system))) 57 (%current-system)))
58 '("--without-context" "--without-coroutine") 58 '("--without-context" "--without-coroutine")
59 '())))) 59 '()))))
diff --git a/gnu/packages/bootstrap.scm b/gnu/packages/bootstrap.scm
index 56c26eef184..1f0fe166880 100644
--- a/gnu/packages/bootstrap.scm
+++ b/gnu/packages/bootstrap.scm
@@ -1,5 +1,6 @@
1;;; GNU Guix --- Functional package management for GNU 1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2012, 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org> 2;;; Copyright © 2012, 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org>
3;;; Copyright © 2014, 2015 Mark H Weaver <mhw@netris.org>
3;;; 4;;;
4;;; This file is part of GNU Guix. 5;;; This file is part of GNU Guix.
5;;; 6;;;
@@ -87,10 +88,13 @@
87 (patch patch)) 88 (patch patch))
88 (origin-patches source)))))) 89 (origin-patches source))))))
89 90
90(define (package-from-tarball name source program-to-test description) 91(define* (package-from-tarball name source program-to-test description
92 #:key snippet)
91 "Return a package that correspond to the extraction of SOURCE. 93 "Return a package that correspond to the extraction of SOURCE.
92PROGRAM-TO-TEST is a program to run after extraction of SOURCE, to 94PROGRAM-TO-TEST is a program to run after extraction of SOURCE, to
93check whether everything is alright." 95check whether everything is alright. If SNIPPET is provided, it is
96evaluated after extracting SOURCE. SNIPPET should return true if
97successful, or false to signal an error."
94 (package 98 (package
95 (name name) 99 (name name)
96 (version "0") 100 (version "0")
@@ -112,6 +116,7 @@ check whether everything is alright."
112 (with-directory-excursion out 116 (with-directory-excursion out
113 (and (zero? (system* tar "xvf" 117 (and (zero? (system* tar "xvf"
114 (string-append builddir "/binaries.tar"))) 118 (string-append builddir "/binaries.tar")))
119 ,@(if snippet (list snippet) '())
115 (zero? (system* (string-append "bin/" ,program-to-test) 120 (zero? (system* (string-append "bin/" ,program-to-test)
116 "--version")))))))) 121 "--version"))))))))
117 (inputs 122 (inputs
@@ -157,6 +162,7 @@ check whether everything is alright."
157 "Return the name of Glibc's dynamic linker for SYSTEM." 162 "Return the name of Glibc's dynamic linker for SYSTEM."
158 (cond ((string=? system "x86_64-linux") "/lib/ld-linux-x86-64.so.2") 163 (cond ((string=? system "x86_64-linux") "/lib/ld-linux-x86-64.so.2")
159 ((string=? system "i686-linux") "/lib/ld-linux.so.2") 164 ((string=? system "i686-linux") "/lib/ld-linux.so.2")
165 ((string=? system "armhf-linux") "/lib/ld-linux-armhf.so.3")
160 ((string=? system "mips64el-linux") "/lib/ld.so.1") 166 ((string=? system "mips64el-linux") "/lib/ld.so.1")
161 167
162 ;; XXX: This one is used bare-bones, without a libc, so add a case 168 ;; XXX: This one is used bare-bones, without a libc, so add a case
@@ -186,7 +192,11 @@ check whether everything is alright."
186 (xz (->store "xz")) 192 (xz (->store "xz"))
187 (mkdir (->store "mkdir")) 193 (mkdir (->store "mkdir"))
188 (bash (->store "bash")) 194 (bash (->store "bash"))
189 (guile (->store "guile-2.0.9.tar.xz")) 195 (guile (->store (match system
196 ("armhf-linux"
197 "guile-2.0.11.tar.xz")
198 (_
199 "guile-2.0.9.tar.xz"))))
190 (builder 200 (builder
191 (add-text-to-store store 201 (add-text-to-store store
192 "build-bootstrap-guile.sh" 202 "build-bootstrap-guile.sh"
@@ -246,7 +256,11 @@ $out/bin/guile --version~%"
246 (origin 256 (origin
247 (method url-fetch) 257 (method url-fetch)
248 (uri (map (cut string-append <> "/" system 258 (uri (map (cut string-append <> "/" system
249 "/20131110/static-binaries.tar.xz") 259 (match system
260 ("armhf-linux"
261 "/20150101/static-binaries.tar.xz")
262 (_
263 "/20131110/static-binaries.tar.xz")))
250 %bootstrap-base-urls)) 264 %bootstrap-base-urls))
251 (sha256 265 (sha256
252 (match system 266 (match system
@@ -256,11 +270,21 @@ $out/bin/guile --version~%"
256 ("i686-linux" 270 ("i686-linux"
257 (base32 271 (base32
258 "0s5b3jb315n13m1k8095l0a5hfrsz8g0fv1b6riyc5hnxqyphlak")) 272 "0s5b3jb315n13m1k8095l0a5hfrsz8g0fv1b6riyc5hnxqyphlak"))
273 ("armhf-linux"
274 (base32
275 "0gf0fn2kbpxkjixkmx5f4z6hv6qpmgixl69zgg74dbsfdfj8jdv5"))
259 ("mips64el-linux" 276 ("mips64el-linux"
260 (base32 277 (base32
261 "072y4wyfsj1bs80r6vbybbafy8ya4vfy7qj25dklwk97m6g71753")))))) 278 "072y4wyfsj1bs80r6vbybbafy8ya4vfy7qj25dklwk97m6g71753"))))))
262 "true" ; the program to test 279 "fgrep" ; the program to test
263 "Bootstrap binaries of Coreutils, Awk, etc.")) 280 "Bootstrap binaries of Coreutils, Awk, etc."
281 #:snippet
282 '(let ((path (list (string-append (getcwd) "/bin"))))
283 (chmod "bin" #o755)
284 (patch-shebang "bin/egrep" path)
285 (patch-shebang "bin/fgrep" path)
286 (chmod "bin" #o555)
287 #t)))
264 288
265(define %bootstrap-binutils 289(define %bootstrap-binutils
266 (package-from-tarball "binutils-bootstrap" 290 (package-from-tarball "binutils-bootstrap"
@@ -268,7 +292,11 @@ $out/bin/guile --version~%"
268 (origin 292 (origin
269 (method url-fetch) 293 (method url-fetch)
270 (uri (map (cut string-append <> "/" system 294 (uri (map (cut string-append <> "/" system
271 "/20131110/binutils-2.23.2.tar.xz") 295 (match system
296 ("armhf-linux"
297 "/20150101/binutils-2.25.tar.xz")
298 (_
299 "/20131110/binutils-2.23.2.tar.xz")))
272 %bootstrap-base-urls)) 300 %bootstrap-base-urls))
273 (sha256 301 (sha256
274 (match system 302 (match system
@@ -278,6 +306,9 @@ $out/bin/guile --version~%"
278 ("i686-linux" 306 ("i686-linux"
279 (base32 307 (base32
280 "14jgwf9gscd7l2pnz610b1zia06dvcm2qyzvni31b8zpgmcai2v9")) 308 "14jgwf9gscd7l2pnz610b1zia06dvcm2qyzvni31b8zpgmcai2v9"))
309 ("armhf-linux"
310 (base32
311 "1v7dj6bzn6m36f20gw31l99xaabq4xrhrx3gwqkhhig0mdlmr69q"))
281 ("mips64el-linux" 312 ("mips64el-linux"
282 (base32 313 (base32
283 "1x8kkhcxmfyzg1ddpz2pxs6fbdl6412r7x0nzbmi5n7mj8zw2gy7")))))) 314 "1x8kkhcxmfyzg1ddpz2pxs6fbdl6412r7x0nzbmi5n7mj8zw2gy7"))))))
@@ -322,7 +353,11 @@ $out/bin/guile --version~%"
322 (origin 353 (origin
323 (method url-fetch) 354 (method url-fetch)
324 (uri (map (cut string-append <> "/" (%current-system) 355 (uri (map (cut string-append <> "/" (%current-system)
325 "/20131110/glibc-2.18.tar.xz") 356 (match (%current-system)
357 ("armhf-linux"
358 "/20150101/glibc-2.20.tar.xz")
359 (_
360 "/20131110/glibc-2.18.tar.xz")))
326 %bootstrap-base-urls)) 361 %bootstrap-base-urls))
327 (sha256 362 (sha256
328 (match (%current-system) 363 (match (%current-system)
@@ -332,6 +367,9 @@ $out/bin/guile --version~%"
332 ("i686-linux" 367 ("i686-linux"
333 (base32 368 (base32
334 "1hgrccw1zqdc7lvgivwa54d9l3zsim5pqm0dykxg0z522h6gr05w")) 369 "1hgrccw1zqdc7lvgivwa54d9l3zsim5pqm0dykxg0z522h6gr05w"))
370 ("armhf-linux"
371 (base32
372 "18cmgvpllqfpn6khsmivqib7ys8ymnq0hdzi3qp24prik0ykz8gn"))
335 ("mips64el-linux" 373 ("mips64el-linux"
336 (base32 374 (base32
337 "0k97a3whzx3apsi9n2cbsrr79ad6lh00klxph9hw4fqyp1abkdsg"))))))))) 375 "0k97a3whzx3apsi9n2cbsrr79ad6lh00klxph9hw4fqyp1abkdsg")))))))))
@@ -393,7 +431,11 @@ exec ~a/bin/.gcc-wrapped -B~a/lib \
393 (origin 431 (origin
394 (method url-fetch) 432 (method url-fetch)
395 (uri (map (cut string-append <> "/" (%current-system) 433 (uri (map (cut string-append <> "/" (%current-system)
396 "/20131110/gcc-4.8.2.tar.xz") 434 (match (%current-system)
435 ("armhf-linux"
436 "/20150101/gcc-4.8.4.tar.xz")
437 (_
438 "/20131110/gcc-4.8.2.tar.xz")))
397 %bootstrap-base-urls)) 439 %bootstrap-base-urls))
398 (sha256 440 (sha256
399 (match (%current-system) 441 (match (%current-system)
@@ -403,16 +445,19 @@ exec ~a/bin/.gcc-wrapped -B~a/lib \
403 ("i686-linux" 445 ("i686-linux"
404 (base32 446 (base32
405 "150c1arrf2k8vfy6dpxh59vcgs4p1bgiz2av5m19dynpks7rjnyw")) 447 "150c1arrf2k8vfy6dpxh59vcgs4p1bgiz2av5m19dynpks7rjnyw"))
448 ("armhf-linux"
449 (base32
450 "0ghz825yzp43fxw53kd6afm8nkz16f7dxi9xi40bfwc8x3nbbr8v"))
406 ("mips64el-linux" 451 ("mips64el-linux"
407 (base32 452 (base32
408 "1m5miqkyng45l745n0sfafdpjkqv9225xf44jqkygwsipj2cv9ks"))))))))) 453 "1m5miqkyng45l745n0sfafdpjkqv9225xf44jqkygwsipj2cv9ks")))))))))
409 (native-search-paths 454 (native-search-paths
410 (list (search-path-specification 455 (list (search-path-specification
411 (variable "CPATH") 456 (variable "CPATH")
412 (directories '("include"))) 457 (files '("include")))
413 (search-path-specification 458 (search-path-specification
414 (variable "LIBRARY_PATH") 459 (variable "LIBRARY_PATH")
415 (directories '("lib" "lib64"))))) 460 (files '("lib" "lib64")))))
416 (synopsis "Bootstrap binaries of the GNU Compiler Collection") 461 (synopsis "Bootstrap binaries of the GNU Compiler Collection")
417 (description #f) 462 (description #f)
418 (home-page #f) 463 (home-page #f)
diff --git a/gnu/packages/bootstrap/armhf-linux/bash b/gnu/packages/bootstrap/armhf-linux/bash
new file mode 100755
index 00000000000..212a22c8ce2
--- /dev/null
+++ b/gnu/packages/bootstrap/armhf-linux/bash
Binary files differ
diff --git a/gnu/packages/bootstrap/armhf-linux/mkdir b/gnu/packages/bootstrap/armhf-linux/mkdir
new file mode 100755
index 00000000000..c3e5246e92c
--- /dev/null
+++ b/gnu/packages/bootstrap/armhf-linux/mkdir
Binary files differ
diff --git a/gnu/packages/bootstrap/armhf-linux/tar b/gnu/packages/bootstrap/armhf-linux/tar
new file mode 100755
index 00000000000..5a6aac8a585
--- /dev/null
+++ b/gnu/packages/bootstrap/armhf-linux/tar
Binary files differ
diff --git a/gnu/packages/bootstrap/armhf-linux/xz b/gnu/packages/bootstrap/armhf-linux/xz
new file mode 100755
index 00000000000..a77aebc2680
--- /dev/null
+++ b/gnu/packages/bootstrap/armhf-linux/xz
Binary files differ
diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm
index 20831de9977..8fa90fed3fb 100644
--- a/gnu/packages/commencement.scm
+++ b/gnu/packages/commencement.scm
@@ -122,19 +122,6 @@
122 ("file" ,file-boot0) 122 ("file" ,file-boot0)
123 ,@%bootstrap-inputs)) 123 ,@%bootstrap-inputs))
124 124
125(define* (nix-system->gnu-triplet
126 #:optional (system (%current-system)) (vendor "unknown"))
127 "Return an a guess of the GNU triplet corresponding to Nix system
128identifier SYSTEM."
129 (let* ((dash (string-index system #\-))
130 (arch (substring system 0 dash))
131 (os (substring system (+ 1 dash))))
132 (string-append arch
133 "-" vendor "-"
134 (if (string=? os "linux")
135 "linux-gnu"
136 os))))
137
138(define* (boot-triplet #:optional (system (%current-system))) 125(define* (boot-triplet #:optional (system (%current-system)))
139 ;; Return the triplet used to create the cross toolchain needed in the 126 ;; Return the triplet used to create the cross toolchain needed in the
140 ;; first bootstrapping stage. 127 ;; first bootstrapping stage.
@@ -544,7 +531,7 @@ exec ~a/bin/~a-~a -B~a/lib -Wl,-dynamic-linker -Wl,~a/~a \"$@\"~%"
544 (native-inputs `(("texinfo" ,texinfo-boot0) 531 (native-inputs `(("texinfo" ,texinfo-boot0)
545 ,@(package-native-inputs gcc-boot0))) 532 ,@(package-native-inputs gcc-boot0)))
546 533
547 (inputs `(("gmp-source" ,(package-source gmp)) 534 (inputs `(("gmp-source" ,(bootstrap-origin (package-source gmp)))
548 ("mpfr-source" ,(package-source mpfr)) 535 ("mpfr-source" ,(package-source mpfr))
549 ("mpc-source" ,(package-source mpc)) 536 ("mpc-source" ,(package-source mpc))
550 ("binutils" ,binutils-final) 537 ("binutils" ,binutils-final)
diff --git a/gnu/packages/compression.scm b/gnu/packages/compression.scm
index f2736b9eb38..cda1984f6ad 100644
--- a/gnu/packages/compression.scm
+++ b/gnu/packages/compression.scm
@@ -1,5 +1,5 @@
1;;; GNU Guix --- Functional package management for GNU 1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2012, 2013, 2014 Ludovic Courtès <ludo@gnu.org> 2;;; Copyright © 2012, 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org>
3;;; Copyright © 2013 Andreas Enge <andreas@enge.fr> 3;;; Copyright © 2013 Andreas Enge <andreas@enge.fr>
4;;; Copyright © 2014 Mark H Weaver <mhw@netris.org> 4;;; Copyright © 2014 Mark H Weaver <mhw@netris.org>
5;;; 5;;;
@@ -115,13 +115,7 @@ file; as a result, it is often used in conjunction with \"tar\", resulting in
115 (home-page "http://www.gnu.org/software/gzip/"))) 115 (home-page "http://www.gnu.org/software/gzip/")))
116 116
117(define-public bzip2 117(define-public bzip2
118 (let ((fix-man-dir 118 (let ((build-shared-lib
119 ;; Move man pages to $out/share/.
120 '(lambda* (#:key outputs #:allow-other-keys)
121 (with-directory-excursion (assoc-ref outputs "out")
122 (mkdir "share")
123 (rename-file "man" "share/man"))))
124 (build-shared-lib
125 ;; Build a shared library. 119 ;; Build a shared library.
126 '(lambda* (#:key inputs #:allow-other-keys) 120 '(lambda* (#:key inputs #:allow-other-keys)
127 (patch-makefile-SHELL "Makefile-libbz2_so") 121 (patch-makefile-SHELL "Makefile-libbz2_so")
@@ -171,20 +165,16 @@ file; as a result, it is often used in conjunction with \"tar\", resulting in
171 `(alist-cons-before 165 `(alist-cons-before
172 'build 'build-shared-lib ,build-shared-lib 166 'build 'build-shared-lib ,build-shared-lib
173 (alist-cons-after 167 (alist-cons-after
174 'install 'fix-man-dir ,fix-man-dir 168 'install 'install-shared-lib ,install-shared-lib
175 (alist-cons-after 169 (alist-replace 'configure ,set-cross-environment
176 'install 'install-shared-lib ,install-shared-lib 170 %standard-phases)))
177 (alist-replace 'configure ,set-cross-environment
178 %standard-phases))))
179 171
180 ;; Native compilation: build the shared library. 172 ;; Native compilation: build the shared library.
181 `(alist-cons-before 173 `(alist-cons-before
182 'build 'build-shared-lib ,build-shared-lib 174 'build 'build-shared-lib ,build-shared-lib
183 (alist-cons-after 175 (alist-cons-after
184 'install 'fix-man-dir ,fix-man-dir 176 'install 'install-shared-lib ,install-shared-lib
185 (alist-cons-after 177 (alist-delete 'configure %standard-phases))))
186 'install 'install-shared-lib ,install-shared-lib
187 (alist-delete 'configure %standard-phases)))))
188 178
189 #:make-flags (list (string-append "PREFIX=" 179 #:make-flags (list (string-append "PREFIX="
190 (assoc-ref %outputs "out"))) 180 (assoc-ref %outputs "out")))
diff --git a/gnu/packages/cross-base.scm b/gnu/packages/cross-base.scm
index 74809d08f99..5a67d4b6ace 100644
--- a/gnu/packages/cross-base.scm
+++ b/gnu/packages/cross-base.scm
@@ -1,5 +1,6 @@
1;;; GNU Guix --- Functional package management for GNU 1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2013, 2014 Ludovic Courtès <ludo@gnu.org> 2;;; Copyright © 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org>
3;;; Copyright © 2014, 2015 Mark H Weaver <mhw@netris.org>
3;;; 4;;;
4;;; This file is part of GNU Guix. 5;;; This file is part of GNU Guix.
5;;; 6;;;
@@ -88,7 +89,6 @@ may be either a libc package or #f.)"
88 (substitute-keyword-arguments (package-arguments gcc-4.8) 89 (substitute-keyword-arguments (package-arguments gcc-4.8)
89 ((#:configure-flags flags) 90 ((#:configure-flags flags)
90 `(append (list ,(string-append "--target=" target) 91 `(append (list ,(string-append "--target=" target)
91 ,@(gcc-configure-flags-for-triplet target)
92 ,@(if libc 92 ,@(if libc
93 '() 93 '()
94 `( ;; Disable features not needed at this stage. 94 `( ;; Disable features not needed at this stage.
@@ -234,10 +234,10 @@ GCC that does not target a libc; otherwise, target that libc."
234 (search-paths 234 (search-paths
235 (list (search-path-specification 235 (list (search-path-specification
236 (variable "CROSS_CPATH") 236 (variable "CROSS_CPATH")
237 (directories '("include"))) 237 (files '("include")))
238 (search-path-specification 238 (search-path-specification
239 (variable "CROSS_LIBRARY_PATH") 239 (variable "CROSS_LIBRARY_PATH")
240 (directories '("lib" "lib64"))))) 240 (files '("lib" "lib64")))))
241 (native-search-paths '()))) 241 (native-search-paths '())))
242 242
243(define* (cross-libc target 243(define* (cross-libc target
@@ -308,10 +308,16 @@ XBINUTILS and the cross tool chain."
308;;; 308;;;
309 309
310(define-public xgcc-mips64el 310(define-public xgcc-mips64el
311 (let ((triplet "mips64el-linux-gnuabi64")) ; N64 ABI 311 (let* ((triplet "mips64el-linux-gnuabi64") ;N64 ABI
312 (cross-gcc triplet 312 (xgcc (cross-gcc triplet
313 (cross-binutils triplet) 313 (cross-binutils triplet)
314 (cross-libc triplet)))) 314 (cross-libc triplet))))
315 ;; Don't attempt to build this cross-compiler on i686;
316 ;; see <http://bugs.gnu.org/19598>.
317 (package (inherit xgcc)
318 (supported-systems (fold delete
319 (package-supported-systems xgcc)
320 '("mips64el-linux" "i686-linux"))))))
315 321
316(define-public xgcc-avr 322(define-public xgcc-avr
317 ;; AVR cross-compiler, used to build AVR-Libc. 323 ;; AVR cross-compiler, used to build AVR-Libc.
@@ -323,6 +329,14 @@ XBINUTILS and the cross tool chain."
323 ;; Bare-bones Xtensa cross-compiler, used to build the Atheros firmware. 329 ;; Bare-bones Xtensa cross-compiler, used to build the Atheros firmware.
324 (cross-gcc "xtensa-elf")) 330 (cross-gcc "xtensa-elf"))
325 331
332(define-public xgcc-armhf
333 (let* ((triplet "arm-linux-gnueabihf")
334 (xgcc (cross-gcc triplet
335 (cross-binutils triplet)
336 (cross-libc triplet))))
337 (package (inherit xgcc)
338 (supported-systems (delete "armhf-linux" %supported-systems)))))
339
326;; (define-public xgcc-armel 340;; (define-public xgcc-armel
327;; (let ((triplet "armel-linux-gnueabi")) 341;; (let ((triplet "armel-linux-gnueabi"))
328;; (cross-gcc triplet 342;; (cross-gcc triplet
diff --git a/gnu/packages/curl.scm b/gnu/packages/curl.scm
index f595e7259c2..8792ddceaf6 100644
--- a/gnu/packages/curl.scm
+++ b/gnu/packages/curl.scm
@@ -1,5 +1,6 @@
1;;; GNU Guix --- Functional package management for GNU 1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2013, 2014 Andreas Enge <andreas@enge.fr> 2;;; Copyright © 2013, 2014 Andreas Enge <andreas@enge.fr>
3;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
3;;; 4;;;
4;;; This file is part of GNU Guix. 5;;; This file is part of GNU Guix.
5;;; 6;;;
@@ -36,14 +37,15 @@
36(define-public curl 37(define-public curl
37 (package 38 (package
38 (name "curl") 39 (name "curl")
39 (version "7.37.1") 40 (version "7.40.0")
40 (source (origin 41 (source (origin
41 (method url-fetch) 42 (method url-fetch)
42 (uri (string-append "http://curl.haxx.se/download/curl-" 43 (uri (string-append "http://curl.haxx.se/download/curl-"
43 version ".tar.lzma")) 44 version ".tar.lzma"))
44 (sha256 45 (sha256
45 (base32 46 (base32
46 "10yfh4hy8wbkj43la238hg6h8i9wyp1cvvk8kl0giac1020imn5d")))) 47 "1a15fdc26b3vwwmchzzpd3l1hfyhx06dn7b6lkikqd7kgwvg5ps7"))
48 (patches (list (search-patch "curl-gss-api-fix.patch")))))
47 (build-system gnu-build-system) 49 (build-system gnu-build-system)
48 (inputs `(("gnutls" ,gnutls) 50 (inputs `(("gnutls" ,gnutls)
49 ("gss" ,gss) 51 ("gss" ,gss)
diff --git a/gnu/packages/databases.scm b/gnu/packages/databases.scm
index 5a7b9950a12..8d21248fe58 100644
--- a/gnu/packages/databases.scm
+++ b/gnu/packages/databases.scm
@@ -3,7 +3,7 @@
3;;; Copyright © 2012, 2014 Andreas Enge <andreas@enge.fr> 3;;; Copyright © 2012, 2014 Andreas Enge <andreas@enge.fr>
4;;; Copyright © 2013 Cyril Roelandt <tipecaml@gmail.com> 4;;; Copyright © 2013 Cyril Roelandt <tipecaml@gmail.com>
5;;; Copyright © 2014 David Thompson <davet@gnu.org> 5;;; Copyright © 2014 David Thompson <davet@gnu.org>
6;;; Copyright © 2014 Mark H Weaver <mhw@netris.org> 6;;; Copyright © 2014, 2015 Mark H Weaver <mhw@netris.org>
7;;; 7;;;
8;;; This file is part of GNU Guix. 8;;; This file is part of GNU Guix.
9;;; 9;;;
@@ -213,7 +213,7 @@ types are supported, as is encryption.")
213(define-public sqlite 213(define-public sqlite
214 (package 214 (package
215 (name "sqlite") 215 (name "sqlite")
216 (version "3.8.4.3") 216 (version "3.8.7.4")
217 (source (origin 217 (source (origin
218 (method url-fetch) 218 (method url-fetch)
219 ;; TODO: Download from sqlite.org once this bug : 219 ;; TODO: Download from sqlite.org once this bug :
@@ -233,9 +233,7 @@ types are supported, as is encryption.")
233 "/sqlite-autoconf-" numeric-version ".tar.gz"))) 233 "/sqlite-autoconf-" numeric-version ".tar.gz")))
234 (sha256 234 (sha256
235 (base32 235 (base32
236 "0rcdsk5sz34w8vy0g5yhfms4saiq81i872jxx5m5sjij7bi9bsg0")) 236 "1v2rhgsx27in6dcvxk0pkxc0zrbl38biimjg6c1zxz85jh9hydw6"))))
237 (patches
238 (list (search-patch "sqlite-large-page-size-fix.patch")))))
239 (build-system gnu-build-system) 237 (build-system gnu-build-system)
240 (inputs 238 (inputs
241 `(("readline" ,readline))) 239 `(("readline" ,readline)))
diff --git a/gnu/packages/elf.scm b/gnu/packages/elf.scm
index 248297bbbb9..46c59c3a3bd 100644
--- a/gnu/packages/elf.scm
+++ b/gnu/packages/elf.scm
@@ -1,5 +1,6 @@
1;;; GNU Guix --- Functional package management for GNU 1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2013, 2014 Ludovic Courtès <ludo@gnu.org> 2;;; Copyright © 2013, 2014 Ludovic Courtès <ludo@gnu.org>
3;;; Copyright © 2014, 2015 Mark H Weaver <mhw@netris.org>
3;;; 4;;;
4;;; This file is part of GNU Guix. 5;;; This file is part of GNU Guix.
5;;; 6;;;
@@ -87,7 +88,7 @@ addr2line, and more.")
87(define-public patchelf 88(define-public patchelf
88 (package 89 (package
89 (name "patchelf") 90 (name "patchelf")
90 (version "0.6") 91 (version "0.8")
91 (source (origin 92 (source (origin
92 (method url-fetch) 93 (method url-fetch)
93 (uri (string-append 94 (uri (string-append
@@ -96,9 +97,30 @@ addr2line, and more.")
96 "/patchelf-" version ".tar.bz2")) 97 "/patchelf-" version ".tar.bz2"))
97 (sha256 98 (sha256
98 (base32 99 (base32
99 "00bw29vdsscsili65wcb5ay0gvg1w0ljd00sb5xc6br8bylpyzpw")) 100 "1rqpg84wrd3fa16wa9vqdvasnc05yz49w207cz1l0wrl4k8q97y9"))
100 (patches (list (search-patch "patchelf-page-size.patch"))))) 101 (patches (list (search-patch "patchelf-page-size.patch")))))
101 (build-system gnu-build-system) 102 (build-system gnu-build-system)
103
104 ;; XXX: The upstream 'patchelf' doesn't support ARM. The only available
105 ;; patch makes significant changes to the algorithm, possibly
106 ;; introducing bugs. So, we apply the patch only on ARM systems.
107 (inputs
108 (if (string-prefix? "arm" (or (%current-target-system) (%current-system)))
109 `(("patch/rework-for-arm" ,(search-patch
110 "patchelf-rework-for-arm.patch")))
111 '()))
112 (arguments
113 (if (string-prefix? "arm" (or (%current-target-system) (%current-system)))
114 `(#:phases (alist-cons-after
115 'unpack 'patch/rework-for-arm
116 (lambda* (#:key inputs #:allow-other-keys)
117 (let ((patch-file
118 (assoc-ref inputs "patch/rework-for-arm")))
119 (zero? (system* "patch" "--force" "-p1"
120 "--input" patch-file))))
121 %standard-phases))
122 '()))
123
102 (home-page "http://nixos.org/patchelf.html") 124 (home-page "http://nixos.org/patchelf.html")
103 (synopsis "Modify the dynamic linker and RPATH of ELF executables") 125 (synopsis "Modify the dynamic linker and RPATH of ELF executables")
104 (description 126 (description
diff --git a/gnu/packages/file.scm b/gnu/packages/file.scm
index 070695ec2ce..161df544de9 100644
--- a/gnu/packages/file.scm
+++ b/gnu/packages/file.scm
@@ -1,6 +1,6 @@
1;;; GNU Guix --- Functional package management for GNU 1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2013 Andreas Enge <andreas@enge.fr> 2;;; Copyright © 2013 Andreas Enge <andreas@enge.fr>
3;;; Copyright © 2014 Mark H Weaver <mhw@netris.org> 3;;; Copyright © 2014, 2015 Mark H Weaver <mhw@netris.org>
4;;; 4;;;
5;;; This file is part of GNU Guix. 5;;; This file is part of GNU Guix.
6;;; 6;;;
@@ -27,14 +27,14 @@
27(define-public file 27(define-public file
28 (package 28 (package
29 (name "file") 29 (name "file")
30 (version "5.19") 30 (version "5.22")
31 (source (origin 31 (source (origin
32 (method url-fetch) 32 (method url-fetch)
33 (uri (string-append "ftp://ftp.astron.com/pub/file/file-" 33 (uri (string-append "ftp://ftp.astron.com/pub/file/file-"
34 version ".tar.gz")) 34 version ".tar.gz"))
35 (sha256 (base32 35 (sha256
36 "0z1sgrcfy6d285kj5izy1yypf371bjl3247plh9ppk0svaxv714l")) 36 (base32
37 (patches (list (search-patch "file-CVE-2014-3587.patch"))))) 37 "02zw14hw3gqlw91w2f2snbirvyrp7r83irvnnkjcb25q9kjaiqy4"))))
38 (build-system gnu-build-system) 38 (build-system gnu-build-system)
39 39
40 ;; When cross-compiling, this package depends upon a native install of 40 ;; When cross-compiling, this package depends upon a native install of
@@ -50,13 +50,3 @@ of the file.")
50 (license bsd-2) 50 (license bsd-2)
51 (home-page "http://www.darwinsys.com/file/"))) 51 (home-page "http://www.darwinsys.com/file/")))
52 52
53(define-public file-5.20 ;fix for CVE-2014-3710
54 (package (inherit file)
55 (version "5.20")
56 (source (origin
57 (method url-fetch)
58 (uri (string-append "ftp://ftp.astron.com/pub/file/file-"
59 version ".tar.gz"))
60 (sha256
61 (base32
62 "0iyjs9z8kp43gz7gva4j67h4p0n53f7q8x3ibai9s01sp3xnphsv"))))))
diff --git a/gnu/packages/fontutils.scm b/gnu/packages/fontutils.scm
index 0f4f1090468..646e12c806f 100644
--- a/gnu/packages/fontutils.scm
+++ b/gnu/packages/fontutils.scm
@@ -281,8 +281,7 @@ smooth contours with constant curvature at the spline joins.")
281 (build-system gnu-build-system) 281 (build-system gnu-build-system)
282 (native-inputs `(("autoconf" ,autoconf) 282 (native-inputs `(("autoconf" ,autoconf)
283 ("automake" ,automake) 283 ("automake" ,automake)
284 ("libtool" ,libtool) 284 ("libtool" ,libtool)))
285 ("libtool-bin" ,libtool "bin")))
286 (arguments 285 (arguments
287 `(#:phases (alist-cons-before 286 `(#:phases (alist-cons-before
288 'configure 'bootstrap 287 'configure 'bootstrap
diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm
index c7630fc349c..f206d3cacae 100644
--- a/gnu/packages/games.scm
+++ b/gnu/packages/games.scm
@@ -717,7 +717,7 @@ for common mesh file formats, and collision detection.")
717 (native-search-paths 717 (native-search-paths
718 (list (search-path-specification 718 (list (search-path-specification
719 (variable "MINETEST_SUBGAME_PATH") 719 (variable "MINETEST_SUBGAME_PATH")
720 (directories '("share/minetest/games"))))) 720 (files '("share/minetest/games")))))
721 (native-inputs 721 (native-inputs
722 `(("pkg-config" ,pkg-config))) 722 `(("pkg-config" ,pkg-config)))
723 (inputs 723 (inputs
diff --git a/gnu/packages/gawk.scm b/gnu/packages/gawk.scm
index 10506197f3a..e0d3f41ac23 100644
--- a/gnu/packages/gawk.scm
+++ b/gnu/packages/gawk.scm
@@ -1,6 +1,6 @@
1;;; GNU Guix --- Functional package management for GNU 1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2012, 2013, 2014 Ludovic Courtès <ludo@gnu.org> 2;;; Copyright © 2012, 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org>
3;;; Copyright © 2014 Mark H Weaver <mhw@netris.org> 3;;; Copyright © 2014, 2015 Mark H Weaver <mhw@netris.org>
4;;; 4;;;
5;;; This file is part of GNU Guix. 5;;; This file is part of GNU Guix.
6;;; 6;;;
@@ -55,16 +55,18 @@
55 '((substitute* "extension/Makefile.in" 55 '((substitute* "extension/Makefile.in"
56 (("^.*: check-for-shared-lib-support" match) 56 (("^.*: check-for-shared-lib-support" match)
57 (string-append "### " match)))) 57 (string-append "### " match))))
58 '())
59
60 ;; XXX FIXME prerelease libtool fails on MIPS in the
61 ;; absence of /usr/bin/file.
62 ,@(if (equal? "mips64el-linux" (or (%current-target-system)
63 (%current-system)))
64 '((substitute* "extension/configure"
65 (("/usr/bin/file") (which "file"))))
66 '()))) 58 '())))
67 %standard-phases))) 59
60 (alist-cons-before
61 'check 'install-locales
62 (lambda _
63 ;; A bunch of tests require the availability of a UTF-8
64 ;; locale and otherwise fail. Give them what they want.
65 (setenv "LOCPATH" (getcwd))
66 (zero? (system* "localedef" "--no-archive"
67 "--prefix" (getcwd) "-i" "en_US"
68 "-f" "UTF-8" "./en_US.UTF-8")))
69 %standard-phases))))
68 (inputs `(("libsigsegv" ,libsigsegv) 70 (inputs `(("libsigsegv" ,libsigsegv)
69 71
70 ,@(if (%current-target-system) 72 ,@(if (%current-target-system)
diff --git a/gnu/packages/gcc.scm b/gnu/packages/gcc.scm
index b28b3e05882..276b986331f 100644
--- a/gnu/packages/gcc.scm
+++ b/gnu/packages/gcc.scm
@@ -1,5 +1,6 @@
1;;; GNU Guix --- Functional package management for GNU 1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2012, 2013, 2014 Ludovic Courtès <ludo@gnu.org> 2;;; Copyright © 2012, 2013, 2014 Ludovic Courtès <ludo@gnu.org>
3;;; Copyright © 2014, 2015 Mark H Weaver <mhw@netris.org>
3;;; 4;;;
4;;; This file is part of GNU Guix. 5;;; This file is part of GNU Guix.
5;;; 6;;;
@@ -35,7 +36,7 @@
35 ;; Base URL for GCC's infrastructure. 36 ;; Base URL for GCC's infrastructure.
36 "ftp://gcc.gnu.org/pub/gcc/infrastructure/") 37 "ftp://gcc.gnu.org/pub/gcc/infrastructure/")
37 38
38(define-public (gcc-configure-flags-for-triplet target) 39(define (gcc-configure-flags-for-triplet target)
39 "Return a list of additional GCC `configure' flags for TARGET, a GNU triplet. 40 "Return a list of additional GCC `configure' flags for TARGET, a GNU triplet.
40 41
41The purpose of this procedure is to translate extended GNU triplets---e.g., 42The purpose of this procedure is to translate extended GNU triplets---e.g.,
@@ -45,8 +46,17 @@ where the OS part is overloaded to denote a specific ABI---into GCC
45 ;; Triplets recognized by glibc as denoting the N64 ABI; see 46 ;; Triplets recognized by glibc as denoting the N64 ABI; see
46 ;; ports/sysdeps/mips/preconfigure. 47 ;; ports/sysdeps/mips/preconfigure.
47 '("--with-abi=64")) 48 '("--with-abi=64"))
49
50 ((string-match "^arm.*-gnueabihf$" target)
51 '("--with-arch=armv7-a"
52 "--with-float=hard"
53 "--with-mode=thumb"
54
55 ;; See <https://wiki.debian.org/ArmHardFloatPort/VfpComparison#FPU>
56 "--with-fpu=vfpv3-d16"))
57
48 (else 58 (else
49 ;; TODO: Add `armel.*gnueabi', `hf', etc. 59 ;; TODO: Add `arm.*-gnueabi', etc.
50 '()))) 60 '())))
51 61
52(define-public gcc-4.7 62(define-public gcc-4.7
@@ -101,11 +111,11 @@ where the OS part is overloaded to denote a specific ABI---into GCC
101 "/include") 111 "/include")
102 "--without-headers"))) 112 "--without-headers")))
103 113
104 ;; When cross-compiling GCC, pass the right options for the 114 ;; Pass the right options for the target triplet.
105 ;; target triplet. 115 (let ((triplet
106 (or (and=> (%current-target-system) 116 (or (%current-target-system)
107 gcc-configure-flags-for-triplet) 117 (nix-system->gnu-triplet (%current-system)))))
108 '()) 118 (gcc-configure-flags-for-triplet triplet))
109 119
110 (maybe-target-tools)))))) 120 (maybe-target-tools))))))
111 (package 121 (package
@@ -178,9 +188,19 @@ where the OS part is overloaded to denote a specific ABI---into GCC
178 ;; The following is not performed for `--without-headers' 188 ;; The following is not performed for `--without-headers'
179 ;; cross-compiler builds. 189 ;; cross-compiler builds.
180 190
191 ;; Join multi-line definitions of GLIBC_DYNAMIC_LINKER* into a
192 ;; single line, to allow the next step to work properly.
193 (for-each
194 (lambda (x)
195 (substitute* (find-files "gcc/config"
196 "^linux(64|-elf|-eabi)?\\.h$")
197 (("(#define GLIBC_DYNAMIC_LINKER.*)\\\\\n$" _ line)
198 line)))
199 '(1 2 3))
200
181 ;; Fix the dynamic linker's file name. 201 ;; Fix the dynamic linker's file name.
182 (substitute* (find-files "gcc/config" 202 (substitute* (find-files "gcc/config"
183 "^linux(64|-elf)?\\.h$") 203 "^linux(64|-elf|-eabi)?\\.h$")
184 (("#define GLIBC_DYNAMIC_LINKER([^ ]*).*$" _ suffix) 204 (("#define GLIBC_DYNAMIC_LINKER([^ ]*).*$" _ suffix)
185 (format #f "#define GLIBC_DYNAMIC_LINKER~a \"~a\"~%" 205 (format #f "#define GLIBC_DYNAMIC_LINKER~a \"~a\"~%"
186 suffix 206 suffix
@@ -197,6 +217,11 @@ where the OS part is overloaded to denote a specific ABI---into GCC
197 ;; libgcc_s.so when pthread_cancel support is needed, but 217 ;; libgcc_s.so when pthread_cancel support is needed, but
198 ;; having it in the application's RUNPATH isn't enough; see 218 ;; having it in the application's RUNPATH isn't enough; see
199 ;; <http://sourceware.org/ml/libc-help/2013-11/msg00023.html>.) 219 ;; <http://sourceware.org/ml/libc-help/2013-11/msg00023.html>.)
220 ;;
221 ;; NOTE: The '-lgcc_s' added below needs to be removed in a
222 ;; later phase of %gcc-static. If you change the string
223 ;; below, make sure to update the relevant code in
224 ;; %gcc-static package as needed.
200 (format #f "#define GNU_USER_TARGET_LIB_SPEC \ 225 (format #f "#define GNU_USER_TARGET_LIB_SPEC \
201\"-L~a/lib %{!static:-rpath=~a/lib %{!static-libgcc:-rpath=~a/lib64 -rpath=~a/lib -lgcc_s}} \" ~a" 226\"-L~a/lib %{!static:-rpath=~a/lib %{!static-libgcc:-rpath=~a/lib64 -rpath=~a/lib -lgcc_s}} \" ~a"
202 libc libc libdir libdir suffix)) 227 libc libc libdir libdir suffix))
@@ -245,10 +270,10 @@ where the OS part is overloaded to denote a specific ABI---into GCC
245 (native-search-paths 270 (native-search-paths
246 (list (search-path-specification 271 (list (search-path-specification
247 (variable "CPATH") 272 (variable "CPATH")
248 (directories '("include"))) 273 (files '("include")))
249 (search-path-specification 274 (search-path-specification
250 (variable "LIBRARY_PATH") 275 (variable "LIBRARY_PATH")
251 (directories '("lib" "lib64"))))) 276 (files '("lib" "lib64")))))
252 277
253 (properties `((gcc-libc . ,(assoc-ref inputs "libc")))) 278 (properties `((gcc-libc . ,(assoc-ref inputs "libc"))))
254 (synopsis "GNU Compiler Collection") 279 (synopsis "GNU Compiler Collection")
@@ -261,15 +286,14 @@ Go. It also includes runtime support libraries for these languages.")
261 286
262(define-public gcc-4.8 287(define-public gcc-4.8
263 (package (inherit gcc-4.7) 288 (package (inherit gcc-4.7)
264 (version "4.8.3") 289 (version "4.8.4")
265 (source (origin 290 (source (origin
266 (method url-fetch) 291 (method url-fetch)
267 (uri (string-append "mirror://gnu/gcc/gcc-" 292 (uri (string-append "mirror://gnu/gcc/gcc-"
268 version "/gcc-" version ".tar.bz2")) 293 version "/gcc-" version ".tar.bz2"))
269 (sha256 294 (sha256
270 (base32 295 (base32
271 "07hg10zs7gnqz58my10ch0zygizqh0z0bz6pv4pgxx45n48lz3ka")) 296 "15c6gwm6dzsaagamxkak5smdkf1rdfbqqjs9jdbrp3lbg4ism02a"))))))
272 (patches (list (search-patch "gcc-fix-pr61801.patch")))))))
273 297
274(define-public gcc-4.9 298(define-public gcc-4.9
275 (package (inherit gcc-4.7) 299 (package (inherit gcc-4.7)
@@ -280,29 +304,7 @@ Go. It also includes runtime support libraries for these languages.")
280 version "/gcc-" version ".tar.bz2")) 304 version "/gcc-" version ".tar.bz2"))
281 (sha256 305 (sha256
282 (base32 306 (base32
283 "1pbjp4blk2ycaa6r3jmw4ky5f1s9ji3klbqgv8zs2sl5jn1cj810")))) 307 "1pbjp4blk2ycaa6r3jmw4ky5f1s9ji3klbqgv8zs2sl5jn1cj810"))))))
284
285 ;; TODO: In core-updates, improve the 'pre-configure phase of the main
286 ;; 'gcc' package so that the 'join-two-line-dynamic-linker-defns phase is
287 ;; no longer needed here. Then the entire 'arguments' override below can
288 ;; be removed.
289 (arguments
290 (substitute-keyword-arguments (package-arguments gcc-4.7)
291 ((#:phases phases)
292 `(alist-cons-before
293 'pre-configure 'join-two-line-dynamic-linker-defns
294 (lambda* (#:key inputs outputs #:allow-other-keys)
295 (let ((libc (assoc-ref inputs "libc")))
296 (when libc
297 ;; Join two-line definitions of GLIBC_DYNAMIC_LINKER* into a
298 ;; single line, to allow the 'pre-configure phase to work
299 ;; properly.
300 (substitute* (find-files "gcc/config"
301 "^linux(64|-elf)?\\.h$")
302 (("(#define GLIBC_DYNAMIC_LINKER[^ ]*.*)\\\\\n$" _ line)
303 line)))
304 #t))
305 ,phases))))))
306 308
307(define* (custom-gcc gcc name languages #:key (separate-lib-output? #t)) 309(define* (custom-gcc gcc name languages #:key (separate-lib-output? #t))
308 "Return a custom version of GCC that supports LANGUAGES." 310 "Return a custom version of GCC that supports LANGUAGES."
diff --git a/gnu/packages/gd.scm b/gnu/packages/gd.scm
index caeaeae36b3..2d6ccb8d7d9 100644
--- a/gnu/packages/gd.scm
+++ b/gnu/packages/gd.scm
@@ -1,5 +1,6 @@
1;;; GNU Guix --- Functional package management for GNU 1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2013 Ludovic Courtès <ludo@gnu.org> 2;;; Copyright © 2013 Ludovic Courtès <ludo@gnu.org>
3;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
3;;; 4;;;
4;;; This file is part of GNU Guix. 5;;; This file is part of GNU Guix.
5;;; 6;;;
@@ -24,6 +25,7 @@
24 #:use-module (gnu packages image) 25 #:use-module (gnu packages image)
25 #:use-module (gnu packages fontutils) 26 #:use-module (gnu packages fontutils)
26 #:use-module (gnu packages compression) 27 #:use-module (gnu packages compression)
28 #:use-module (gnu packages pkg-config)
27 #:use-module ((guix licenses) #:select (bsd-style))) 29 #:use-module ((guix licenses) #:select (bsd-style)))
28 30
29(define-public gd 31(define-public gd
@@ -31,25 +33,21 @@
31 (name "gd") 33 (name "gd")
32 34
33 ;; Note: With libgd.org now pointing to bitbucket.org, genuine old 35 ;; Note: With libgd.org now pointing to bitbucket.org, genuine old
34 ;; tarballs are no longer available. Notably, versions 2.0.34 and .35 are 36 ;; tarballs are no longer available. Notably, versions 2.0.x are
35 ;; missing. 37 ;; missing.
36 (version "2.0.33") 38 (version "2.1.1")
37 39
38 (source (origin 40 (source (origin
39 (method url-fetch) 41 (method url-fetch)
40 (uri "https://bitbucket.org/libgd/gd-libgd/get/GD_2_0_33.tar.gz") 42 (uri (string-append
43 "https://bitbucket.org/libgd/gd-libgd/downloads/"
44 "libgd-" version ".tar.xz"))
41 (sha256 45 (sha256
42 (base32 46 (base32
43 "0yrbx8mj9pykyzm0zl1q86xlkdvkajcsf5jmg688vhw9yc5wmbbw")) 47 "11djy9flzxczphigqgp7fbbblbq35gqwwhn9xfcckawlapa1xnls"))))
44 (patches
45 (list (search-patch "gd-mips64-deplibs-fix.patch")))))
46 (build-system gnu-build-system) 48 (build-system gnu-build-system)
47 (arguments 49 (native-inputs
48 '(#:phases (alist-cons-after 50 `(("pkg-config" ,pkg-config)))
49 'unpack 'chdir
50 (lambda _
51 (chdir "src"))
52 %standard-phases)))
53 (inputs 51 (inputs
54 `(("freetype" ,freetype) 52 `(("freetype" ,freetype)
55 ("libpng" ,libpng) 53 ("libpng" ,libpng)
diff --git a/gnu/packages/gettext.scm b/gnu/packages/gettext.scm
index bbdf0c5862a..dd86fe4c5b4 100644
--- a/gnu/packages/gettext.scm
+++ b/gnu/packages/gettext.scm
@@ -35,14 +35,14 @@
35(define-public gnu-gettext 35(define-public gnu-gettext
36 (package 36 (package
37 (name "gettext") 37 (name "gettext")
38 (version "0.19.3") 38 (version "0.19.4")
39 (source (origin 39 (source (origin
40 (method url-fetch) 40 (method url-fetch)
41 (uri (string-append "mirror://gnu/gettext/gettext-" 41 (uri (string-append "mirror://gnu/gettext/gettext-"
42 version ".tar.gz")) 42 version ".tar.gz"))
43 (sha256 43 (sha256
44 (base32 44 (base32
45 "1xmkxviqnq60h4wmh3bi6b1zkc9qsk3l1lv91k0iwfrxb982v5ck")))) 45 "0gvz86m4cs8bdf3mwmwsyx6lrq4ydfxgadrgd9jlx32z3bnz3jca"))))
46 (build-system gnu-build-system) 46 (build-system gnu-build-system)
47 (inputs 47 (inputs
48 `(("expat" ,expat))) 48 `(("expat" ,expat)))
diff --git a/gnu/packages/glib.scm b/gnu/packages/glib.scm
index 83d55d64ff4..5a5b4dfd0aa 100644
--- a/gnu/packages/glib.scm
+++ b/gnu/packages/glib.scm
@@ -189,7 +189,7 @@ shared NFS home directories.")
189 ;; by 'glib-compile-schemas'. 189 ;; by 'glib-compile-schemas'.
190 (list (search-path-specification 190 (list (search-path-specification
191 (variable "XDG_DATA_DIRS") 191 (variable "XDG_DATA_DIRS")
192 (directories '("share"))))) 192 (files '("share")))))
193 (search-paths native-search-paths) 193 (search-paths native-search-paths)
194 194
195 (synopsis "Thread-safe general utility library; basis of GTK+ and GNOME") 195 (synopsis "Thread-safe general utility library; basis of GTK+ and GNOME")
@@ -231,7 +231,7 @@ dynamic loading, and an object system.")
231 (native-search-paths 231 (native-search-paths
232 (list (search-path-specification 232 (list (search-path-specification
233 (variable "GI_TYPELIB_PATH") 233 (variable "GI_TYPELIB_PATH")
234 (directories '("lib/girepository-1.0"))))) 234 (files '("lib/girepository-1.0")))))
235 (search-paths native-search-paths) 235 (search-paths native-search-paths)
236 (arguments 236 (arguments
237 `(#:phases 237 `(#:phases
diff --git a/gnu/packages/global.scm b/gnu/packages/global.scm
index f7377def0a7..72a53ad4a88 100644
--- a/gnu/packages/global.scm
+++ b/gnu/packages/global.scm
@@ -1,5 +1,5 @@
1;;; GNU Guix --- Functional package management for GNU 1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2013 Ludovic Courtès <ludo@gnu.org> 2;;; Copyright © 2013, 2015 Ludovic Courtès <ludo@gnu.org>
3;;; 3;;;
4;;; This file is part of GNU Guix. 4;;; This file is part of GNU Guix.
5;;; 5;;;
@@ -38,7 +38,7 @@
38 "0j828dg2cjf77rx71cw68jpk7jl119v6nyb0kyvirr5i1860j1fx")))) 38 "0j828dg2cjf77rx71cw68jpk7jl119v6nyb0kyvirr5i1860j1fx"))))
39 (build-system gnu-build-system) 39 (build-system gnu-build-system)
40 (inputs `(("ncurses" ,ncurses) 40 (inputs `(("ncurses" ,ncurses)
41 ("libtool" ,libtool))) 41 ("libltdl" ,libltdl)))
42 (arguments 42 (arguments
43 `(#:configure-flags 43 `(#:configure-flags
44 (list (string-append "--with-ncurses=" 44 (list (string-append "--with-ncurses="
diff --git a/gnu/packages/gnome.scm b/gnu/packages/gnome.scm
index 4fea27a865f..408ba4e8168 100644
--- a/gnu/packages/gnome.scm
+++ b/gnu/packages/gnome.scm
@@ -143,17 +143,6 @@ The gnome-about program helps find which version of GNOME is installed.")
143 (base32 143 (base32
144 "19n4x25ndzngaciiyd8dd6s2mf9gv6nv3wv27ggns2smm7zkj1nb")))) 144 "19n4x25ndzngaciiyd8dd6s2mf9gv6nv3wv27ggns2smm7zkj1nb"))))
145 (build-system gnu-build-system) 145 (build-system gnu-build-system)
146 (arguments
147 `(#:phases
148 (alist-cons-before
149 'check 'pre-check
150 (lambda* (#:key inputs #:allow-other-keys #:rest args)
151 ;; This is needed, because without it, xmlint etc tries
152 ;; to download docbookx.dtd from the net
153 (setenv "XML_CATALOG_FILES"
154 (string-append (assoc-ref inputs "docbook-xml")
155 "/xml/dtd/docbook/catalog.xml")))
156 %standard-phases)))
157 (native-inputs 146 (native-inputs
158 `(("intltool" ,intltool) 147 `(("intltool" ,intltool)
159 ("docbook-xml" ,docbook-xml-4.4) 148 ("docbook-xml" ,docbook-xml-4.4)
diff --git a/gnu/packages/gnunet.scm b/gnu/packages/gnunet.scm
index 249971becda..f7063ead110 100644
--- a/gnu/packages/gnunet.scm
+++ b/gnu/packages/gnunet.scm
@@ -85,7 +85,7 @@
85 ("libjpeg" ,libjpeg) 85 ("libjpeg" ,libjpeg)
86 ("libogg" ,libogg) 86 ("libogg" ,libogg)
87 ("libtiff" ,libtiff) 87 ("libtiff" ,libtiff)
88 ("libtool" ,libtool) 88 ("libltdl" ,libltdl)
89 ("libvorbis" ,libvorbis) 89 ("libvorbis" ,libvorbis)
90 ("zlib" ,zlib))) 90 ("zlib" ,zlib)))
91 (native-inputs 91 (native-inputs
@@ -213,7 +213,7 @@ supports HTTPS, HTTPS and GnuTLS.")
213 ("libgcrypt" ,libgcrypt) 213 ("libgcrypt" ,libgcrypt)
214 ("libidn" ,libidn) 214 ("libidn" ,libidn)
215 ("libmicrohttpd" ,libmicrohttpd) 215 ("libmicrohttpd" ,libmicrohttpd)
216 ("libtool" ,libtool) 216 ("libltdl" ,libltdl)
217 ("libunistring" ,libunistring) 217 ("libunistring" ,libunistring)
218 ("openssl" ,openssl) 218 ("openssl" ,openssl)
219 ("opus" ,opus) 219 ("opus" ,opus)
diff --git a/gnu/packages/gnutls.scm b/gnu/packages/gnutls.scm
index 7ac7a9e304f..4f6bd22977c 100644
--- a/gnu/packages/gnutls.scm
+++ b/gnu/packages/gnutls.scm
@@ -1,6 +1,6 @@
1;;; GNU Guix --- Functional package management for GNU 1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2012, 2013, 2014 Ludovic Courtès <ludo@gnu.org> 2;;; Copyright © 2012, 2013, 2014 Ludovic Courtès <ludo@gnu.org>
3;;; Copyright © 2014 Mark H Weaver <mhw@netris.org> 3;;; Copyright © 2014, 2015 Mark H Weaver <mhw@netris.org>
4;;; Copyright © 2014 Ian Denhardt <ian@zenhack.net> 4;;; Copyright © 2014 Ian Denhardt <ian@zenhack.net>
5;;; 5;;;
6;;; This file is part of GNU Guix. 6;;; This file is part of GNU Guix.
@@ -63,7 +63,7 @@ specifications.")
63(define-public gnutls 63(define-public gnutls
64 (package 64 (package
65 (name "gnutls") 65 (name "gnutls")
66 (version "3.2.20") 66 (version "3.2.21")
67 (source (origin 67 (source (origin
68 (method url-fetch) 68 (method url-fetch)
69 (uri 69 (uri
@@ -74,7 +74,7 @@ specifications.")
74 "/gnutls-" version ".tar.xz")) 74 "/gnutls-" version ".tar.xz"))
75 (sha256 75 (sha256
76 (base32 76 (base32
77 "165mpmm506jgpiffgf0s01rrn8c14qkan1saaa79dvf3g1z0arvr")))) 77 "0zq8syiq51ls5g0f32nglvps330h5llpyrs1z2gjn5pr9hjrchc2"))))
78 (build-system gnu-build-system) 78 (build-system gnu-build-system)
79 (arguments 79 (arguments
80 '(#:configure-flags 80 '(#:configure-flags
diff --git a/gnu/packages/gps.scm b/gnu/packages/gps.scm
index 1fbf38f1250..231b1d1b048 100644
--- a/gnu/packages/gps.scm
+++ b/gnu/packages/gps.scm
@@ -100,17 +100,7 @@ manipulate maps.")
100 (substitute* "Makefile" 100 (substitute* "Makefile"
101 (("prefix[[:blank:]]*=.*$") 101 (("prefix[[:blank:]]*=.*$")
102 (string-append "prefix = " (assoc-ref outputs "out") 102 (string-append "prefix = " (assoc-ref outputs "out")
103 "\n"))) 103 "\n"))))
104
105 ;; Make sure the DocBook XML and XSL files are found.
106 ;; Note: this is a space-separated list.
107 (setenv "XML_CATALOG_FILES"
108 (string-append (assoc-ref inputs "docbook-xml")
109 "/xml/dtd/docbook/catalog.xml "
110 (assoc-ref inputs "docbook-xsl")
111 "/xml/xsl/"
112 ,(package-full-name docbook-xsl)
113 "/catalog.xml")))
114 %standard-phases) 104 %standard-phases)
115 #:tests? #f)) 105 #:tests? #f))
116 (inputs 106 (inputs
diff --git a/gnu/packages/graphviz.scm b/gnu/packages/graphviz.scm
index dc477f30b3b..52522af4461 100644
--- a/gnu/packages/graphviz.scm
+++ b/gnu/packages/graphviz.scm
@@ -1,5 +1,5 @@
1;;; GNU Guix --- Functional package management for GNU 1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2013 Ludovic Courtès <ludo@gnu.org> 2;;; Copyright © 2013, 2015 Ludovic Courtès <ludo@gnu.org>
3;;; 3;;;
4;;; This file is part of GNU Guix. 4;;; This file is part of GNU Guix.
5;;; 5;;;
@@ -69,7 +69,7 @@
69 ("pango" ,pango) 69 ("pango" ,pango)
70 ("fontconfig" ,fontconfig) 70 ("fontconfig" ,fontconfig)
71 ("freetype" ,freetype) 71 ("freetype" ,freetype)
72 ("libltdl" ,libtool) 72 ("libltdl" ,libltdl)
73 ("libXaw" ,libxaw) 73 ("libXaw" ,libxaw)
74 ("expat" ,expat) 74 ("expat" ,expat)
75 ("libjpeg" ,libjpeg) 75 ("libjpeg" ,libjpeg)
diff --git a/gnu/packages/gtk.scm b/gnu/packages/gtk.scm
index ce1c533df86..dae3bac5679 100644
--- a/gnu/packages/gtk.scm
+++ b/gnu/packages/gtk.scm
@@ -1,7 +1,7 @@
1;;; GNU Guix --- Functional package management for GNU 1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2013 Andreas Enge <andreas@enge.fr> 2;;; Copyright © 2013 Andreas Enge <andreas@enge.fr>
3;;; Copyright © 2013, 2014 Ludovic Courtès <ludo@gnu.org> 3;;; Copyright © 2013, 2014 Ludovic Courtès <ludo@gnu.org>
4;;; Copyright © 2014 Mark H Weaver <mhw@netris.org> 4;;; Copyright © 2014, 2015 Mark H Weaver <mhw@netris.org>
5;;; Copyright © 2014 Eric Bavier <bavier@member.fsf.org> 5;;; Copyright © 2014 Eric Bavier <bavier@member.fsf.org>
6;;; 6;;;
7;;; This file is part of GNU Guix. 7;;; This file is part of GNU Guix.
@@ -418,18 +418,9 @@ application suites.")
418 ("pkg-config" ,pkg-config) 418 ("pkg-config" ,pkg-config)
419 ("gobject-introspection" ,gobject-introspection) 419 ("gobject-introspection" ,gobject-introspection)
420 ("python-wrapper" ,python-wrapper) 420 ("python-wrapper" ,python-wrapper)
421 421 ("xorg-server" ,xorg-server)))
422 ;; FIXME: The Xorg server is needed to run the tests, but it currently
423 ;; fails to build on mips64el, so remove it in the meantime.
424 ,@(if (string=? (or (%current-target-system) (%current-system))
425 "mips64el-linux")
426 '()
427 `(("xorg-server" ,xorg-server)))))
428 (arguments 422 (arguments
429 `(;; FIXME: See above. 423 `(#:phases
430 #:tests? ,(not (string=? (or (%current-target-system) (%current-system))
431 "mips64el-linux"))
432 #:phases
433 (alist-replace 424 (alist-replace
434 'configure 425 'configure
435 (lambda* (#:key inputs #:allow-other-keys #:rest args) 426 (lambda* (#:key inputs #:allow-other-keys #:rest args)
diff --git a/gnu/packages/guile.scm b/gnu/packages/guile.scm
index 6a76bafe84e..c0c5ced0f3a 100644
--- a/gnu/packages/guile.scm
+++ b/gnu/packages/guile.scm
@@ -1,6 +1,6 @@
1;;; GNU Guix --- Functional package management for GNU 1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2012, 2013, 2014 Ludovic Courtès <ludo@gnu.org> 2;;; Copyright © 2012, 2013, 2014 Ludovic Courtès <ludo@gnu.org>
3;;; Copyright © 2014 Mark H Weaver <mhw@netris.org> 3;;; Copyright © 2014, 2015 Mark H Weaver <mhw@netris.org>
4;;; 4;;;
5;;; This file is part of GNU Guix. 5;;; This file is part of GNU Guix.
6;;; 6;;;
@@ -87,7 +87,7 @@
87 ;; Since `guile-1.8.pc' has "Libs: ... -lgmp -lltdl", these must be 87 ;; Since `guile-1.8.pc' has "Libs: ... -lgmp -lltdl", these must be
88 ;; propagated. 88 ;; propagated.
89 (propagated-inputs `(("gmp" ,gmp) 89 (propagated-inputs `(("gmp" ,gmp)
90 ("libtool" ,libtool))) 90 ("libltdl" ,libltdl)))
91 91
92 ;; When cross-compiling, a native version of Guile itself is needed. 92 ;; When cross-compiling, a native version of Guile itself is needed.
93 (self-native-input? #t) 93 (self-native-input? #t)
@@ -95,7 +95,7 @@
95 (native-search-paths 95 (native-search-paths
96 (list (search-path-specification 96 (list (search-path-specification
97 (variable "GUILE_LOAD_PATH") 97 (variable "GUILE_LOAD_PATH")
98 (directories '("share/guile/site"))))) 98 (files '("share/guile/site")))))
99 99
100 (synopsis "Scheme implementation intended especially for extensions") 100 (synopsis "Scheme implementation intended especially for extensions")
101 (description 101 (description
@@ -117,7 +117,8 @@ without requiring the source code to be rewritten.")
117 ".tar.xz")) 117 ".tar.xz"))
118 (sha256 118 (sha256
119 (base32 119 (base32
120 "1qh3j7308qvsjgwf7h94yqgckpbgz2k3yqdkzsyhqcafvfka9l5f")))) 120 "1qh3j7308qvsjgwf7h94yqgckpbgz2k3yqdkzsyhqcafvfka9l5f"))
121 (patches (list (search-patch "guile-arm-fixes.patch")))))
121 (build-system gnu-build-system) 122 (build-system gnu-build-system)
122 (native-inputs `(("pkgconfig" ,pkg-config))) 123 (native-inputs `(("pkgconfig" ,pkg-config)))
123 (inputs `(("libffi" ,libffi) 124 (inputs `(("libffi" ,libffi)
@@ -130,7 +131,10 @@ without requiring the source code to be rewritten.")
130 ;; `-L' flags. As for why the `.la' file lacks the `-L' flags, see 131 ;; `-L' flags. As for why the `.la' file lacks the `-L' flags, see
131 ;; <http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/18903>. 132 ;; <http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/18903>.
132 ("libunistring" ,libunistring) 133 ("libunistring" ,libunistring)
133 ("libtool" ,libtool) 134
135 ;; Depend on LIBLTDL, not LIBTOOL. That way, we avoid some the extra
136 ;; dependencies that LIBTOOL has, which is helpful during bootstrap.
137 ("libltdl" ,libltdl)
134 138
135 ;; The headers and/or `guile-2.0.pc' refer to these packages, so they 139 ;; The headers and/or `guile-2.0.pc' refer to these packages, so they
136 ;; must be propagated. 140 ;; must be propagated.
@@ -155,10 +159,10 @@ without requiring the source code to be rewritten.")
155 (native-search-paths 159 (native-search-paths
156 (list (search-path-specification 160 (list (search-path-specification
157 (variable "GUILE_LOAD_PATH") 161 (variable "GUILE_LOAD_PATH")
158 (directories '("share/guile/site/2.0"))) 162 (files '("share/guile/site/2.0")))
159 (search-path-specification 163 (search-path-specification
160 (variable "GUILE_LOAD_COMPILED_PATH") 164 (variable "GUILE_LOAD_COMPILED_PATH")
161 (directories '("share/guile/site/2.0"))))) 165 (files '("share/guile/site/2.0")))))
162 166
163 (synopsis "Scheme implementation intended especially for extensions") 167 (synopsis "Scheme implementation intended especially for extensions")
164 (description 168 (description
@@ -258,7 +262,16 @@ many readers as needed).")
258 (("\"libguile-ncurses\"") 262 (("\"libguile-ncurses\"")
259 (format #f "\"~a/lib/libguile-ncurses\"" 263 (format #f "\"~a/lib/libguile-ncurses\""
260 out))))) 264 out)))))
261 %standard-phases))) 265 (alist-cons-before
266 'check 'install-locales
267 (lambda _
268 ;; One of the tests requires the availability of a UTF-8
269 ;; locale and otherwise fails.
270 (setenv "LOCPATH" (getcwd))
271 (zero? (system* "localedef" "--no-archive"
272 "--prefix" (getcwd) "-i" "en_US"
273 "-f" "UTF-8" "./en_US.utf8")))
274 %standard-phases))))
262 (home-page "http://www.gnu.org/software/guile-ncurses/") 275 (home-page "http://www.gnu.org/software/guile-ncurses/")
263 (synopsis "Guile bindings to ncurses") 276 (synopsis "Guile bindings to ncurses")
264 (description 277 (description
diff --git a/gnu/packages/icu4c.scm b/gnu/packages/icu4c.scm
index ea5aecc21f8..a575e91c8cf 100644
--- a/gnu/packages/icu4c.scm
+++ b/gnu/packages/icu4c.scm
@@ -1,5 +1,6 @@
1;;; GNU Guix --- Functional package management for GNU 1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2013 Andreas Enge <andreas@enge.fr> 2;;; Copyright © 2013 Andreas Enge <andreas@enge.fr>
3;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
3;;; 4;;;
4;;; This file is part of GNU Guix. 5;;; This file is part of GNU Guix.
5;;; 6;;;
@@ -18,7 +19,6 @@
18 19
19(define-module (gnu packages icu4c) 20(define-module (gnu packages icu4c)
20 #:use-module (gnu packages) 21 #:use-module (gnu packages)
21 #:use-module (gnu packages elf)
22 #:use-module (gnu packages perl) 22 #:use-module (gnu packages perl)
23 #:use-module (guix licenses) 23 #:use-module (guix licenses)
24 #:use-module (guix packages) 24 #:use-module (guix packages)
@@ -40,16 +40,14 @@
40 (base32 "1cwapgjmvrcv1n2wjspj3vahidg596gjfp4jn1gcb4baralcjayl")))) 40 (base32 "1cwapgjmvrcv1n2wjspj3vahidg596gjfp4jn1gcb4baralcjayl"))))
41 (build-system gnu-build-system) 41 (build-system gnu-build-system)
42 (inputs 42 (inputs
43 `(("patchelf" ,patchelf) 43 `(("perl" ,perl)))
44 ("perl" ,perl)))
45 (arguments 44 (arguments
46 `(#:modules ((guix build gnu-build-system) 45 `(#:configure-flags
47 (guix build utils) 46 '("--enable-rpath"
48 (guix build rpath) 47 ,@(if (string-prefix? "arm" (or (%current-target-system)
49 (srfi srfi-26)) 48 (%current-system)))
50 #:imported-modules ((guix build gnu-build-system) 49 '("--with-data-packaging=archive")
51 (guix build utils) 50 '()))
52 (guix build rpath))
53 #:phases 51 #:phases
54 (alist-cons-after 52 (alist-cons-after
55 'unpack 'chdir-to-source 53 'unpack 'chdir-to-source
@@ -62,18 +60,7 @@
62 (substitute* "configure" 60 (substitute* "configure"
63 (("`/bin/sh") 61 (("`/bin/sh")
64 (string-append "`" (which "bash"))))) 62 (string-append "`" (which "bash")))))
65 (alist-cons-after 63 %standard-phases))))
66 'strip 'add-lib-to-runpath
67 (lambda* (#:key outputs #:allow-other-keys)
68 (let* ((out (assoc-ref outputs "out"))
69 (lib (string-append out "/lib")))
70 ;; Add LIB to the RUNPATH of all the libraries and binaries.
71 (with-directory-excursion out
72 (for-each (cut augment-rpath <> lib)
73 (append (find-files "lib" ".*")
74 (find-files "bin" ".*")
75 (find-files "sbin" ".*"))))))
76 %standard-phases)))))
77 (synopsis "International Components for Unicode") 64 (synopsis "International Components for Unicode")
78 (description 65 (description
79 "ICU is a set of C/C++ and Java libraries providing Unicode and 66 "ICU is a set of C/C++ and Java libraries providing Unicode and
diff --git a/gnu/packages/image.scm b/gnu/packages/image.scm
index cdb9c1cfb23..07669a18032 100644
--- a/gnu/packages/image.scm
+++ b/gnu/packages/image.scm
@@ -1,6 +1,6 @@
1;;; GNU Guix --- Functional package management for GNU 1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2013 Andreas Enge <andreas@enge.fr> 2;;; Copyright © 2013 Andreas Enge <andreas@enge.fr>
3;;; Copyright © 2014 Mark H Weaver <mhw@netris.org> 3;;; Copyright © 2014, 2015 Mark H Weaver <mhw@netris.org>
4;;; Copyright © 2014 Alex Kost <alezost@gmail.com> 4;;; Copyright © 2014 Alex Kost <alezost@gmail.com>
5;;; Copyright © 2014 Ricardo Wurmus <rekado@elephly.net> 5;;; Copyright © 2014 Ricardo Wurmus <rekado@elephly.net>
6;;; 6;;;
@@ -39,7 +39,7 @@
39(define-public libpng 39(define-public libpng
40 (package 40 (package
41 (name "libpng") 41 (name "libpng")
42 (version "1.5.17") 42 (version "1.5.21")
43 (source (origin 43 (source (origin
44 (method url-fetch) 44 (method url-fetch)
45 45
@@ -50,7 +50,7 @@
50 "ftp://ftp.simplesystems.org/pub/libpng/png/src" 50 "ftp://ftp.simplesystems.org/pub/libpng/png/src"
51 "/libpng15/libpng-" version ".tar.xz"))) 51 "/libpng15/libpng-" version ".tar.xz")))
52 (sha256 52 (sha256
53 (base32 "19wj293r4plbfgb43yhrc2qx8bsch9gbazazfqrj9haa7lsk29jp")))) 53 (base32 "19yvzw6sf9gf7v25ha9bla8bw1nijh82wj8ag6brjj3hpij1q5dm"))))
54 (build-system gnu-build-system) 54 (build-system gnu-build-system)
55 55
56 ;; libpng.la says "-lz", so propagate it. 56 ;; libpng.la says "-lz", so propagate it.
diff --git a/gnu/packages/ld-wrapper.scm b/gnu/packages/ld-wrapper.scm
index d3eb083f2fe..19856176b32 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)"
11exec @GUILE@ -c "(load-compiled \"$0.go\") (apply $main (cdr (command-line)))" "$@" 11exec @GUILE@ -c "(load-compiled \"$0.go\") (apply $main (cdr (command-line)))" "$@"
12!# 12!#
13;;; GNU Guix --- Functional package management for GNU 13;;; GNU Guix --- Functional package management for GNU
14;;; Copyright © 2012, 2013, 2014 Ludovic Courtès <ludo@gnu.org> 14;;; Copyright © 2012, 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org>
15;;; 15;;;
16;;; This file is part of GNU Guix. 16;;; This file is part of GNU Guix.
17;;; 17;;;
@@ -30,6 +30,7 @@ exec @GUILE@ -c "(load-compiled \"$0.go\") (apply $main (cdr (command-line)))" "
30 30
31(define-module (gnu build-support ld-wrapper) 31(define-module (gnu build-support ld-wrapper)
32 #:use-module (srfi srfi-1) 32 #:use-module (srfi srfi-1)
33 #:use-module (ice-9 match)
33 #:export (ld-wrapper)) 34 #:export (ld-wrapper))
34 35
35;;; Commentary: 36;;; Commentary:
@@ -103,58 +104,62 @@ exec @GUILE@ -c "(load-compiled \"$0.go\") (apply $main (cdr (command-line)))" "
103 (< depth %max-symlink-depth) 104 (< depth %max-symlink-depth)
104 (loop (readlink file) (+ 1 depth)))))))) 105 (loop (readlink file) (+ 1 depth))))))))
105 106
106(define (switch-arguments switch args)
107 ;; Return the arguments passed for the occurrences of SWITCH--e.g.,
108 ;; "-L"--in ARGS.
109 (let ((prefix-len (string-length switch)))
110 (fold-right (lambda (arg path)
111 (if (string-prefix? switch arg)
112 (cons (substring arg prefix-len) path)
113 path))
114 '()
115 args)))
116
117(define (library-path args)
118 ;; Return the library search path extracted from `-L' switches in ARGS.
119 ;; Note: allow references to out-of-store directories. When this leads to
120 ;; actual impurities, this is caught later.
121 (switch-arguments "-L" args))
122
123(define (library-files-linked args) 107(define (library-files-linked args)
124 ;; Return the file names of shared libraries explicitly linked against via 108 ;; Return the file names of shared libraries explicitly linked against via
125 ;; `-l' in ARGS. 109 ;; `-l' or with an absolute file name in ARGS.
126 (map (lambda (lib) 110 (define path+files
127 (string-append "lib" lib ".so")) 111 (fold (lambda (argument result)
128 (switch-arguments "-l" args))) 112 (match result
129 113 ((library-path . library-files)
130(define (rpath-arguments lib-path library-files) 114 (cond ((string-prefix? "-L" argument) ;augment the search path
131 ;; Return the `-rpath' argument list for each of LIBRARY-FILES found in 115 (cons (append library-path
132 ;; LIB-PATH. 116 (list (string-drop argument 2)))
117 library-files))
118 ((string-prefix? "-l" argument) ;add library
119 (let* ((lib (string-append "lib"
120 (string-drop argument 2)
121 ".so"))
122 (full (search-path library-path lib)))
123 (if full
124 (cons library-path
125 (cons full library-files))
126 result)))
127 ((and (string-prefix? %store-directory argument)
128 (string-suffix? ".so" argument)) ;add library
129 (cons library-path
130 (cons argument library-files)))
131 (else
132 result)))))
133 (cons '() '())
134 args))
135
136 (match path+files
137 ((path . files)
138 (reverse files))))
139
140(define (rpath-arguments library-files)
141 ;; Return the `-rpath' argument list for each of LIBRARY-FILES, a list of
142 ;; absolute file names.
133 (fold-right (lambda (file args) 143 (fold-right (lambda (file args)
134 (let ((absolute (search-path lib-path file))) 144 (if (or %allow-impurities?
135 (if absolute 145 (pure-file-name? file))
136 (if (or %allow-impurities? 146 (cons* "-rpath" (dirname file) args)
137 (pure-file-name? absolute)) 147 (begin
138 (cons* "-rpath" (dirname absolute) 148 (format (current-error-port)
139 args) 149 "ld-wrapper: error: attempt to use impure library ~s~%"
140 (begin 150 file)
141 (format (current-error-port) 151 (exit 1))))
142 "ld-wrapper: error: attempt to use impure library ~s~%"
143 absolute)
144 (exit 1)))
145 args)))
146 '() 152 '()
147 library-files)) 153 library-files))
148 154
149(define (ld-wrapper . args) 155(define (ld-wrapper . args)
150 ;; Invoke the real `ld' with ARGS, augmented with `-rpath' switches. 156 ;; Invoke the real `ld' with ARGS, augmented with `-rpath' switches.
151 (let* ((lib-path (library-path args)) 157 (let* ((libs (library-files-linked args))
152 (libs (library-files-linked args)) 158 (args (append args (rpath-arguments libs))))
153 (args (append args (rpath-arguments lib-path libs)))) 159 (when %debug?
154 (if %debug? 160 (format (current-error-port)
155 (format (current-error-port) 161 "ld-wrapper: invoking `~a' with ~s~%"
156 "ld-wrapper: invoking `~a' with ~s~%" 162 %real-ld args))
157 %real-ld args))
158 (apply execl %real-ld (basename %real-ld) args))) 163 (apply execl %real-ld (basename %real-ld) args)))
159 164
160;;; ld-wrapper.scm ends here 165;;; ld-wrapper.scm ends here
diff --git a/gnu/packages/libcanberra.scm b/gnu/packages/libcanberra.scm
index 3d43c4f98e4..0ffae1f6747 100644
--- a/gnu/packages/libcanberra.scm
+++ b/gnu/packages/libcanberra.scm
@@ -1,6 +1,6 @@
1;;; GNU Guix --- Functional package management for GNU 1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2013 Andreas Enge <andreas@enge.fr> 2;;; Copyright © 2013 Andreas Enge <andreas@enge.fr>
3;;; Copyright © 2014 Ludovic Courtès <ludo@gnu.org> 3;;; Copyright © 2014, 2015 Ludovic Courtès <ludo@gnu.org>
4;;; 4;;;
5;;; This file is part of GNU Guix. 5;;; This file is part of GNU Guix.
6;;; 6;;;
@@ -67,7 +67,7 @@
67 `(("alsa-lib" ,alsa-lib) 67 `(("alsa-lib" ,alsa-lib)
68 ("gstreamer" ,gstreamer) 68 ("gstreamer" ,gstreamer)
69 ("gtk+" ,gtk+) 69 ("gtk+" ,gtk+)
70 ("libtool" ,libtool) 70 ("libltdl" ,libltdl)
71 ("libvorbis" ,libvorbis) 71 ("libvorbis" ,libvorbis)
72 ("pulseaudio" ,pulseaudio) 72 ("pulseaudio" ,pulseaudio)
73 ("udev" ,eudev) 73 ("udev" ,eudev)
diff --git a/gnu/packages/libevent.scm b/gnu/packages/libevent.scm
index 27416a0e599..64892bf8785 100644
--- a/gnu/packages/libevent.scm
+++ b/gnu/packages/libevent.scm
@@ -1,5 +1,5 @@
1;;; GNU Guix --- Functional package management for GNU 1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2013, 2014 Ludovic Courtès <ludo@gnu.org> 2;;; Copyright © 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org>
3;;; 3;;;
4;;; This file is part of GNU Guix. 4;;; This file is part of GNU Guix.
5;;; 5;;;
@@ -85,7 +85,7 @@ loop.")
85 #:tests? #f)) 85 #:tests? #f))
86 (native-inputs `(("autoconf" ,(autoconf-wrapper)) 86 (native-inputs `(("autoconf" ,(autoconf-wrapper))
87 ("automake" ,automake) 87 ("automake" ,automake)
88 ("libtool" ,libtool "bin") 88 ("libtool" ,libtool)
89 89
90 ;; libuv.pc is installed only when pkg-config is found. 90 ;; libuv.pc is installed only when pkg-config is found.
91 ("pkg-config" ,pkg-config))) 91 ("pkg-config" ,pkg-config)))
diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index eab6c54a658..f8bb6e2c1f0 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -196,7 +196,7 @@ for SYSTEM, or #f if there is no configuration for SYSTEM."
196 (build-phase 196 (build-phase
197 '(lambda* (#:key system inputs #:allow-other-keys #:rest args) 197 '(lambda* (#:key system inputs #:allow-other-keys #:rest args)
198 ;; Apply the neat patch. 198 ;; Apply the neat patch.
199 (system* "patch" "-p1" "--batch" 199 (system* "patch" "-p1" "--force"
200 "-i" (assoc-ref inputs "patch/freedo+gnu")) 200 "-i" (assoc-ref inputs "patch/freedo+gnu"))
201 201
202 (let ((arch (car (string-split system #\-)))) 202 (let ((arch (car (string-split system #\-))))
@@ -825,7 +825,7 @@ manpages.")
825 'unpack 'patch 825 'unpack 'patch
826 (lambda* (#:key inputs #:allow-other-keys) 826 (lambda* (#:key inputs #:allow-other-keys)
827 (define (apply-patch file) 827 (define (apply-patch file)
828 (zero? (system* "patch" "-p1" "--batch" 828 (zero? (system* "patch" "-p1" "--force"
829 "--input" file))) 829 "--input" file)))
830 830
831 (let ((patch.gz (assoc-ref inputs "patch"))) 831 (let ((patch.gz (assoc-ref inputs "patch")))
@@ -1414,55 +1414,9 @@ kmod. The aim is to be compatible with tools, configurations and indices
1414from the module-init-tools project.") 1414from the module-init-tools project.")
1415 (license gpl2+))) ; library under lgpl2.1+ 1415 (license gpl2+))) ; library under lgpl2.1+
1416 1416
1417(define-public udev
1418 ;; The last pre-systemd version.
1419 (package
1420 (name "udev")
1421 (version "182")
1422 (source (origin
1423 (method url-fetch)
1424 (uri (string-append
1425 "mirror://kernel.org/linux/utils/kernel/hotplug/udev-"
1426 version ".tar.xz"))
1427 (sha256
1428 (base32
1429 "1awp7p07gi083w0dwqhhbbas68a7fx2sbm1yf1ip2jwf7cpqkf5d"))
1430 (patches (list (search-patch "udev-gir-libtool.patch")))))
1431 (build-system gnu-build-system)
1432 (arguments
1433 `(#:configure-flags (list (string-append
1434 "--with-pci-ids-path="
1435 (assoc-ref %build-inputs "pciutils")
1436 "/share/pci.ids.gz")
1437
1438 "--with-firmware-path=/no/firmware"
1439
1440 ;; Work around undefined reference to
1441 ;; 'mq_getattr' in sc-daemon.c.
1442 "LDFLAGS=-lrt")))
1443 (native-inputs
1444 `(("pkg-config" ,pkg-config)
1445 ("gperf" ,gperf)
1446 ("glib" ,glib "bin") ; glib-genmarshal, etc.
1447 ("perl" ,perl) ; for the tests
1448 ("python" ,python-2))) ; ditto
1449 (inputs
1450 `(("kmod" ,kmod)
1451 ("pciutils" ,pciutils)
1452 ("usbutils" ,usbutils)
1453 ("util-linux" ,util-linux)
1454 ("glib" ,glib)
1455 ("gobject-introspection" ,gobject-introspection)))
1456 (home-page "http://www.freedesktop.org/software/systemd/libudev/")
1457 (synopsis "Userspace device management")
1458 (description "Udev is a daemon which dynamically creates and removes
1459device nodes from /dev/, handles hotplug events and loads drivers at boot
1460time.")
1461 (license gpl2+))) ; libudev is under lgpl2.1+
1462
1463(define-public eudev 1417(define-public eudev
1464 ;; The post-systemd fork, maintained by Gentoo. 1418 ;; The post-systemd fork, maintained by Gentoo.
1465 (package (inherit udev) 1419 (package
1466 (name "eudev") 1420 (name "eudev")
1467 (version "1.10") 1421 (version "1.10")
1468 (source (origin 1422 (source (origin
@@ -1483,11 +1437,39 @@ time.")
1483 '(substitute* "configure" 1437 '(substitute* "configure"
1484 (("linux/btrfs\\.h") 1438 (("linux/btrfs\\.h")
1485 ""))))) 1439 "")))))
1440 (build-system gnu-build-system)
1441 (native-inputs
1442 `(("pkg-config" ,pkg-config)
1443 ("gperf" ,gperf)
1444 ("glib" ,glib "bin") ; glib-genmarshal, etc.
1445 ("perl" ,perl) ; for the tests
1446 ("python" ,python-2))) ; ditto
1447 (inputs
1448 `(("kmod" ,kmod)
1449 ("pciutils" ,pciutils)
1450 ("usbutils" ,usbutils)
1451 ("util-linux" ,util-linux)
1452 ("glib" ,glib)
1453 ("gobject-introspection" ,gobject-introspection)))
1486 (arguments 1454 (arguments
1487 (substitute-keyword-arguments (package-arguments udev) 1455 `(#:configure-flags (list "--enable-libkmod"
1488 ((#:configure-flags flags) 1456
1489 `(cons "--enable-libkmod" ,flags)))) 1457 (string-append
1490 (home-page "http://www.gentoo.org/proj/en/eudev/"))) 1458 "--with-pci-ids-path="
1459 (assoc-ref %build-inputs "pciutils")
1460 "/share/pci.ids.gz")
1461
1462 "--with-firmware-path=/no/firmware"
1463
1464 ;; Work around undefined reference to
1465 ;; 'mq_getattr' in sc-daemon.c.
1466 "LDFLAGS=-lrt")))
1467 (home-page "http://www.gentoo.org/proj/en/eudev/")
1468 (synopsis "Userspace device management")
1469 (description "Udev is a daemon which dynamically creates and removes
1470device nodes from /dev/, handles hotplug events and loads drivers at boot
1471time.")
1472 (license gpl2+)))
1491 1473
1492(define-public lvm2 1474(define-public lvm2
1493 (package 1475 (package
@@ -1516,7 +1498,7 @@ time.")
1516 `(("pkg-config" ,pkg-config) 1498 `(("pkg-config" ,pkg-config)
1517 ("procps" ,procps))) ;tests use 'pgrep' 1499 ("procps" ,procps))) ;tests use 'pgrep'
1518 (inputs 1500 (inputs
1519 `(("udev" ,udev))) 1501 `(("udev" ,eudev)))
1520 (arguments 1502 (arguments
1521 '(#:phases (alist-cons-after 1503 '(#:phases (alist-cons-after
1522 'configure 'set-makefile-shell 1504 'configure 'set-makefile-shell
diff --git a/gnu/packages/m4.scm b/gnu/packages/m4.scm
index 0915fde4f2b..b3b3a00fdeb 100644
--- a/gnu/packages/m4.scm
+++ b/gnu/packages/m4.scm
@@ -33,8 +33,7 @@
33 version ".tar.bz2")) 33 version ".tar.bz2"))
34 (sha256 34 (sha256
35 (base32 35 (base32
36 "0w0da1chh12mczxa5lnwzjk9czi3dq6gnnndbpa6w4rj76b1yklf")) 36 "0w0da1chh12mczxa5lnwzjk9czi3dq6gnnndbpa6w4rj76b1yklf"))))
37 (patches (list (search-patch "m4-readlink-EINVAL.patch")))))
38 (build-system gnu-build-system) 37 (build-system gnu-build-system)
39 (arguments 38 (arguments
40 ;; XXX: Disable tests on those platforms with know issues. 39 ;; XXX: Disable tests on those platforms with know issues.
diff --git a/gnu/packages/mail.scm b/gnu/packages/mail.scm
index 8424d8ccbe7..62f86ef8398 100644
--- a/gnu/packages/mail.scm
+++ b/gnu/packages/mail.scm
@@ -1,5 +1,5 @@
1;;; GNU Guix --- Functional package management for GNU 1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2013, 2014 Ludovic Courtès <ludo@gnu.org> 2;;; Copyright © 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org>
3;;; Copyright © 2014 Mark H Weaver <mhw@netris.org> 3;;; Copyright © 2014 Mark H Weaver <mhw@netris.org>
4;;; Copyright © 2014 Ian Denhardt <ian@zenhack.net> 4;;; Copyright © 2014 Ian Denhardt <ian@zenhack.net>
5;;; Copyright © 2014 Sou Bunnbu <iyzsong@gmail.com> 5;;; Copyright © 2014 Sou Bunnbu <iyzsong@gmail.com>
@@ -113,7 +113,7 @@
113 ("readline" ,readline-6.2) 113 ("readline" ,readline-6.2)
114 114
115 ("linux-pam" ,linux-pam) 115 ("linux-pam" ,linux-pam)
116 ("libtool" ,libtool) 116 ("libltdl" ,libltdl)
117 ("gdbm" ,gdbm))) 117 ("gdbm" ,gdbm)))
118 (home-page "http://www.gnu.org/software/mailutils/") 118 (home-page "http://www.gnu.org/software/mailutils/")
119 (synopsis "Utilities and library for reading and serving mail") 119 (synopsis "Utilities and library for reading and serving mail")
@@ -419,7 +419,7 @@ useful features.")
419 (build-system gnu-build-system) 419 (build-system gnu-build-system)
420 (native-inputs `(("autoconf" ,(autoconf-wrapper)) 420 (native-inputs `(("autoconf" ,(autoconf-wrapper))
421 ("automake" ,automake) 421 ("automake" ,automake)
422 ("libtool" ,libtool "bin") 422 ("libtool" ,libtool)
423 ("pkg-config" ,pkg-config))) 423 ("pkg-config" ,pkg-config)))
424 (propagated-inputs 424 (propagated-inputs
425 ;; 'libetpan-config --libs' returns '-lssl -lcrypto -lsasl2', so these 425 ;; 'libetpan-config --libs' returns '-lssl -lcrypto -lsasl2', so these
diff --git a/gnu/packages/make-bootstrap.scm b/gnu/packages/make-bootstrap.scm
index f6ef2e326a0..88fad0e6046 100644
--- a/gnu/packages/make-bootstrap.scm
+++ b/gnu/packages/make-bootstrap.scm
@@ -430,7 +430,19 @@ for `sh' in $PATH, and without nscd, and with static NSS modules."
430 "--disable-libquadmath" 430 "--disable-libquadmath"
431 "--disable-decimal-float") 431 "--disable-decimal-float")
432 (remove (cut string-match "--(.*plugin|enable-languages)" <>) 432 (remove (cut string-match "--(.*plugin|enable-languages)" <>)
433 ,flags)))))) 433 ,flags)))
434 ((#:phases phases)
435 `(alist-cons-after
436 'pre-configure 'remove-lgcc_s
437 (lambda _
438 ;; Remove the '-lgcc_s' added to GNU_USER_TARGET_LIB_SPEC in
439 ;; the 'pre-configure phase of our main gcc package, because
440 ;; that shared library is not present in this static gcc. See
441 ;; <https://lists.gnu.org/archive/html/guix-devel/2015-01/msg00008.html>.
442 (substitute* (find-files "gcc/config"
443 "^gnu-user.*\\.h$")
444 ((" -lgcc_s}}") "}}")))
445 ,phases)))))
434 (native-inputs 446 (native-inputs
435 (if (%current-target-system) 447 (if (%current-target-system)
436 `(;; When doing a Canadian cross, we need GMP/MPFR/MPC both 448 `(;; When doing a Canadian cross, we need GMP/MPFR/MPC both
diff --git a/gnu/packages/man.scm b/gnu/packages/man.scm
index 028403ce746..712622aee8c 100644
--- a/gnu/packages/man.scm
+++ b/gnu/packages/man.scm
@@ -105,7 +105,7 @@ a flexible and convenient way.")
105 (native-search-paths 105 (native-search-paths
106 (list (search-path-specification 106 (list (search-path-specification
107 (variable "MANPATH") 107 (variable "MANPATH")
108 (directories '("share/man"))))) 108 (files '("share/man")))))
109 (home-page "http://man-db.nongnu.org/") 109 (home-page "http://man-db.nongnu.org/")
110 (synopsis "Standard Unix documentation system") 110 (synopsis "Standard Unix documentation system")
111 (description 111 (description
diff --git a/gnu/packages/mit-krb5.scm b/gnu/packages/mit-krb5.scm
index 2528f461575..0a107a8bec6 100644
--- a/gnu/packages/mit-krb5.scm
+++ b/gnu/packages/mit-krb5.scm
@@ -41,11 +41,7 @@
41 (native-inputs 41 (native-inputs
42 `(("patch/init-fix" ,(search-patch "mit-krb5-init-fix.patch")) 42 `(("patch/init-fix" ,(search-patch "mit-krb5-init-fix.patch"))
43 ("bison" ,bison) 43 ("bison" ,bison)
44 ("perl" ,perl) 44 ("perl" ,perl)))
45
46 ;; XXX: When built with GCC 4.8, the 'db_test' test program enters an
47 ;; infinite loop. As a stopgap measure, build with GCC 4.7.
48 ("gcc" ,gcc-4.7)))
49 (arguments 45 (arguments
50 '(#:phases 46 '(#:phases
51 (alist-replace 47 (alist-replace
@@ -62,7 +58,7 @@
62 ;; XXX The current patch system does not support unusual 58 ;; XXX The current patch system does not support unusual
63 ;; source unpack methods, so we have to apply this patch in a 59 ;; source unpack methods, so we have to apply this patch in a
64 ;; non-standard way. 60 ;; non-standard way.
65 (zero? (system* "patch" "-p1" "--batch" "-i" 61 (zero? (system* "patch" "-p1" "--force" "-i"
66 (assoc-ref %build-inputs "patch/init-fix")))))) 62 (assoc-ref %build-inputs "patch/init-fix"))))))
67 (alist-replace 63 (alist-replace
68 'check 64 'check
diff --git a/gnu/packages/mp3.scm b/gnu/packages/mp3.scm
index 1731cd59afd..55ab4b497c9 100644
--- a/gnu/packages/mp3.scm
+++ b/gnu/packages/mp3.scm
@@ -1,6 +1,6 @@
1;;; GNU Guix --- Functional package management for GNU 1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2013 Andreas Enge <andreas@enge.fr> 2;;; Copyright © 2013 Andreas Enge <andreas@enge.fr>
3;;; Copyright © 2014 Ludovic Courtès <ludo@gnu.org> 3;;; Copyright © 2014, 2015 Ludovic Courtès <ludo@gnu.org>
4;;; 4;;;
5;;; This file is part of GNU Guix. 5;;; This file is part of GNU Guix.
6;;; 6;;;
@@ -231,7 +231,7 @@ pre-defined or user-specifiable output format.")
231 (inputs `(("libid3tag" ,libid3tag) 231 (inputs `(("libid3tag" ,libid3tag)
232 ("libmad" ,libmad) 232 ("libmad" ,libmad)
233 ("libogg" ,libogg) 233 ("libogg" ,libogg)
234 ("libtool" ,libtool) 234 ("libltdl" ,libltdl)
235 ("libvorbid" ,libvorbis) 235 ("libvorbid" ,libvorbis)
236 ("pcre" ,pcre))) 236 ("pcre" ,pcre)))
237 (native-inputs 237 (native-inputs
diff --git a/gnu/packages/multiprecision.scm b/gnu/packages/multiprecision.scm
index 377d922a090..ddbfc79965c 100644
--- a/gnu/packages/multiprecision.scm
+++ b/gnu/packages/multiprecision.scm
@@ -1,5 +1,6 @@
1;;; GNU Guix --- Functional package management for GNU 1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2012, 2013 Ludovic Courtès <ludo@gnu.org> 2;;; Copyright © 2012, 2013 Ludovic Courtès <ludo@gnu.org>
3;;; Copyright © 2014 Mark H Weaver <mhw@netris.org>
3;;; 4;;;
4;;; This file is part of GNU Guix. 5;;; This file is part of GNU Guix.
5;;; 6;;;
@@ -22,6 +23,7 @@
22 #:use-module (gnu packages m4) 23 #:use-module (gnu packages m4)
23 #:use-module (guix packages) 24 #:use-module (guix packages)
24 #:use-module (guix download) 25 #:use-module (guix download)
26 #:use-module (guix utils)
25 #:use-module (guix build-system gnu)) 27 #:use-module (guix build-system gnu))
26 28
27(define-public gmp 29(define-public gmp
@@ -35,7 +37,8 @@
35 version ".tar.xz")) 37 version ".tar.xz"))
36 (sha256 38 (sha256
37 (base32 39 (base32
38 "0r5pp27cy7ch3dg5v0rsny8bib1zfvrza6027g2mp5f6v8pd6mli")))) 40 "0r5pp27cy7ch3dg5v0rsny8bib1zfvrza6027g2mp5f6v8pd6mli"))
41 (patches (list (search-patch "gmp-arm-asm-nothumb.patch")))))
39 (build-system gnu-build-system) 42 (build-system gnu-build-system)
40 (native-inputs `(("m4" ,m4))) 43 (native-inputs `(("m4" ,m4)))
41 (outputs '("out" "debug")) 44 (outputs '("out" "debug"))
@@ -43,7 +46,15 @@
43 '(;; Build a "fat binary", with routines for several 46 '(;; Build a "fat binary", with routines for several
44 ;; sub-architectures. 47 ;; sub-architectures.
45 "--enable-fat" 48 "--enable-fat"
46 "--enable-cxx"))) 49 "--enable-cxx"
50
51 ;; FIXME: gmp-6.0.0a's config.guess fails on
52 ;; multi-core armhf systems.
53 ,@(if (%current-target-system)
54 '()
55 (let ((triplet
56 (nix-system->gnu-triplet (%current-system))))
57 (list (string-append "--build=" triplet)))))))
47 (synopsis "Multiple-precision arithmetic library") 58 (synopsis "Multiple-precision arithmetic library")
48 (description 59 (description
49 "GMP is a library for arbitrary precision arithmetic, operating on 60 "GMP is a library for arbitrary precision arithmetic, operating on
diff --git a/gnu/packages/ncurses.scm b/gnu/packages/ncurses.scm
index de7e6f67212..0dbc583f793 100644
--- a/gnu/packages/ncurses.scm
+++ b/gnu/packages/ncurses.scm
@@ -1,5 +1,5 @@
1;;; GNU Guix --- Functional package management for GNU 1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2012, 2013, 2014 Ludovic Courtès <ludo@gnu.org> 2;;; Copyright © 2012, 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org>
3;;; Copyright © 2014 Mark H Weaver <mhw@netris.org> 3;;; Copyright © 2014 Mark H Weaver <mhw@netris.org>
4;;; 4;;;
5;;; This file is part of GNU Guix. 5;;; This file is part of GNU Guix.
@@ -99,11 +99,6 @@
99 ,(string-append "--includedir=" (assoc-ref %outputs "out") 99 ,(string-append "--includedir=" (assoc-ref %outputs "out")
100 "/include") 100 "/include")
101 101
102 ;; By default man pages land in PREFIX/man, but we want them
103 ;; in PREFIX/share/man.
104 ,(string-append "--mandir=" (assoc-ref %outputs "out")
105 "/share/man")
106
107 ;; Make sure programs like 'tic', 'reset', and 'clear' have a 102 ;; Make sure programs like 'tic', 'reset', and 'clear' have a
108 ;; correct RUNPATH. 103 ;; correct RUNPATH.
109 ,(string-append "LDFLAGS=-Wl,-rpath=" (assoc-ref %outputs "out") 104 ,(string-append "LDFLAGS=-Wl,-rpath=" (assoc-ref %outputs "out")
diff --git a/gnu/packages/openldap.scm b/gnu/packages/openldap.scm
index 23c32488e96..a6c4cb0d931 100644
--- a/gnu/packages/openldap.scm
+++ b/gnu/packages/openldap.scm
@@ -1,5 +1,5 @@
1;;; GNU Guix --- Functional package management for GNU 1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2013, 2014 Ludovic Courtès <ludo@gnu.org> 2;;; Copyright © 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org>
3;;; Copyright © 2013 Andreas Enge <andreas@enge.fr> 3;;; Copyright © 2013 Andreas Enge <andreas@enge.fr>
4;;; 4;;;
5;;; This file is part of GNU Guix. 5;;; This file is part of GNU Guix.
@@ -52,8 +52,8 @@
52 ;; FIXME: currently, openldap requires openssl or gnutls<3, see 52 ;; FIXME: currently, openldap requires openssl or gnutls<3, see
53 ;; http://www.openldap.org/its/index.cgi/Incoming?id=7430;page=17 53 ;; http://www.openldap.org/its/index.cgi/Incoming?id=7430;page=17
54 ;; Once this is fixed, switch to gnutls. 54 ;; Once this is fixed, switch to gnutls.
55 ("libtool" ,libtool "bin")
56 ("zlib" ,zlib))) 55 ("zlib" ,zlib)))
56 (native-inputs `(("libtool" ,libtool)))
57 (arguments 57 (arguments
58 `(#:tests? #f 58 `(#:tests? #f
59 #:phases 59 #:phases
diff --git a/gnu/packages/openssl.scm b/gnu/packages/openssl.scm
index 141e105a2d3..7764fc462b8 100644
--- a/gnu/packages/openssl.scm
+++ b/gnu/packages/openssl.scm
@@ -1,6 +1,6 @@
1;;; GNU Guix --- Functional package management for GNU 1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2013 Andreas Enge <andreas@enge.fr> 2;;; Copyright © 2013 Andreas Enge <andreas@enge.fr>
3;;; Copyright © 2014 Mark H Weaver <mhw@netris.org> 3;;; Copyright © 2014, 2015 Mark H Weaver <mhw@netris.org>
4;;; 4;;;
5;;; This file is part of GNU Guix. 5;;; This file is part of GNU Guix.
6;;; 6;;;
@@ -29,14 +29,14 @@
29(define-public openssl 29(define-public openssl
30 (package 30 (package
31 (name "openssl") 31 (name "openssl")
32 (version "1.0.1j") 32 (version "1.0.1k")
33 (source (origin 33 (source (origin
34 (method url-fetch) 34 (method url-fetch)
35 (uri (string-append "ftp://ftp.openssl.org/source/openssl-" version 35 (uri (string-append "ftp://ftp.openssl.org/source/openssl-" version
36 ".tar.gz")) 36 ".tar.gz"))
37 (sha256 37 (sha256
38 (base32 38 (base32
39 "1wzdaiix40lz0rsyf51qv0wiq4ywp29j5ni0xzl06vxsi63wlq0v")))) 39 "0754wzmzr90hiiqs5cy6g3cf8as75ljkhppgyirfg26hpapax7wg"))))
40 (build-system gnu-build-system) 40 (build-system gnu-build-system)
41 (native-inputs `(("perl" ,perl))) 41 (native-inputs `(("perl" ,perl)))
42 (arguments 42 (arguments
diff --git a/gnu/packages/patches/curl-gss-api-fix.patch b/gnu/packages/patches/curl-gss-api-fix.patch
new file mode 100644
index 00000000000..ea838ae8c71
--- /dev/null
+++ b/gnu/packages/patches/curl-gss-api-fix.patch
@@ -0,0 +1,38 @@
1Copied from upstream:
2https://github.com/bagder/curl/commit/5c0e66d63214e0306197c5a3f162441e074f3401.patch
3
4From 5c0e66d63214e0306197c5a3f162441e074f3401 Mon Sep 17 00:00:00 2001
5From: Steve Holme <steve_holme@hotmail.com>
6Date: Thu, 8 Jan 2015 19:23:53 +0000
7Subject: [PATCH] sasl_gssapi: Fixed build on NetBSD with built-in GSS-API
8
9Bug: http://curl.haxx.se/bug/view.cgi?id=1469
10Reported-by: Thomas Klausner
11---
12 lib/curl_sasl_gssapi.c | 3 ++-
13 1 file changed, 2 insertions(+), 1 deletion(-)
14
15diff --git a/lib/curl_sasl_gssapi.c b/lib/curl_sasl_gssapi.c
16index 6dda0e9..a50646a 100644
17--- a/lib/curl_sasl_gssapi.c
18+++ b/lib/curl_sasl_gssapi.c
19@@ -6,6 +6,7 @@
20 * \___|\___/|_| \_\_____|
21 *
22 * Copyright (C) 2014, Steve Holme, <steve_holme@hotmail.com>.
23+ * Copyright (C) 2015, Daniel Stenberg, <daniel@haxx.se>, et al.
24 *
25 * This software is licensed as described in the file COPYING, which
26 * you should have received as part of this distribution. The terms
27@@ -126,7 +127,7 @@ CURLcode Curl_sasl_create_gssapi_user_message(struct SessionHandle *data,
28
29 /* Import the SPN */
30 gss_major_status = gss_import_name(&gss_minor_status, &spn_token,
31- gss_nt_service_name, &krb5->spn);
32+ GSS_C_NT_HOSTBASED_SERVICE, &krb5->spn);
33 if(GSS_ERROR(gss_major_status)) {
34 Curl_gss_log_error(data, gss_minor_status, "gss_import_name() failed: ");
35
36--
372.2.1
38
diff --git a/gnu/packages/patches/file-CVE-2014-3587.patch b/gnu/packages/patches/file-CVE-2014-3587.patch
deleted file mode 100644
index cf88bf5f3ec..00000000000
--- a/gnu/packages/patches/file-CVE-2014-3587.patch
+++ /dev/null
@@ -1,16 +0,0 @@
1Fixes CVE-2014-3587. Copied from upstream commit
20641e56be1af003aa02c7c6b0184466540637233.
3
4--- file-5.19/src/cdf.c.orig 2014-06-09 09:04:37.000000000 -0400
5+++ file-5.19/src/cdf.c 2014-08-26 11:55:23.887118898 -0400
6@@ -824,6 +824,10 @@
7 q = (const uint8_t *)(const void *)
8 ((const char *)(const void *)p + ofs
9 - 2 * sizeof(uint32_t));
10+ if (q < p) {
11+ DPRINTF(("Wrapped around %p < %p\n", q, p));
12+ goto out;
13+ }
14 if (q > e) {
15 DPRINTF(("Ran of the end %p > %p\n", q, e));
16 goto out;
diff --git a/gnu/packages/patches/gcc-fix-pr61801.patch b/gnu/packages/patches/gcc-fix-pr61801.patch
deleted file mode 100644
index e9cd92aa1ca..00000000000
--- a/gnu/packages/patches/gcc-fix-pr61801.patch
+++ /dev/null
@@ -1,25 +0,0 @@
1GCC bug fix for <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61801>.
2Initially discussed at
3 <http://lists.gnu.org/archive/html/guix-devel/2014-09/msg00283.html>.
4Patch from <https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=212740>.
5
62014-07-17 Richard Biener <rguenther@suse.de>
7
8 PR rtl-optimization/61801
9
10 * sched-deps.c (sched_analyze_2): For ASM_OPERANDS and
11 ASM_INPUT don't set reg_pending_barrier if it appears in a
12 debug-insn.
13
14--- gcc-4_8-branch/gcc/sched-deps.c 2014/07/17 07:48:49 212739
15+++ gcc-4_8-branch/gcc/sched-deps.c 2014/07/17 07:49:44 212740
16@@ -2744,7 +2744,8 @@
17 Consider for instance a volatile asm that changes the fpu rounding
18 mode. An insn should not be moved across this even if it only uses
19 pseudo-regs because it might give an incorrectly rounded result. */
20- if (code != ASM_OPERANDS || MEM_VOLATILE_P (x))
21+ if ((code != ASM_OPERANDS || MEM_VOLATILE_P (x))
22+ && !DEBUG_INSN_P (insn))
23 reg_pending_barrier = TRUE_BARRIER;
24
25 /* For all ASM_OPERANDS, we must traverse the vector of input operands.
diff --git a/gnu/packages/patches/gd-mips64-deplibs-fix.patch b/gnu/packages/patches/gd-mips64-deplibs-fix.patch
deleted file mode 100644
index 6231310cdbe..00000000000
--- a/gnu/packages/patches/gd-mips64-deplibs-fix.patch
+++ /dev/null
@@ -1,17 +0,0 @@
1Patch configure script to choose pass_all deplibs check method for
2linux-gnu* systems on mips64. This is a temporary hack until libgd
3bootstraps their build system with a newer libtool.
4
5Patch by Mark H Weaver <mhw@netris.org>.
6
7--- libgd-gd/src/configure.orig 2006-04-05 11:56:57.000000000 -0400
8+++ libgd-gd/src/configure 2013-11-02 17:56:19.123995838 -0400
9@@ -4457,7 +4457,7 @@
10 # This must be Linux ELF.
11 linux-gnu*)
12 case $host_cpu in
13- alpha* | hppa* | i*86 | mips | mipsel | powerpc* | sparc* | ia64* | s390* | x86_64*)
14+ alpha* | hppa* | i*86 | mips | mipsel | mips64 | mips64el | powerpc* | sparc* | ia64* | s390* | x86_64*)
15 lt_cv_deplibs_check_method=pass_all ;;
16 *)
17 # glibc up to 2.1.1 does not perform some relocations on ARM
diff --git a/gnu/packages/patches/glibc-CVE-2012-3406.patch b/gnu/packages/patches/glibc-CVE-2012-3406.patch
new file mode 100644
index 00000000000..9147a2aeeef
--- /dev/null
+++ b/gnu/packages/patches/glibc-CVE-2012-3406.patch
@@ -0,0 +1,282 @@
1Fix CVE-2012-3406: Stack overflow in vfprintf [BZ #16617]
2
3Note: Here the ChangeLog and NEWS updates are removed from Jeff's
4 patch, since they depend on other earlier commits.
5
6From: Jeff Law <law@redhat.com>
7Date: Mon, 15 Dec 2014 09:09:32 +0000 (+0100)
8Subject: CVE-2012-3406: Stack overflow in vfprintf [BZ #16617]
9X-Git-Url: https://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff_plain;h=a3a1f4163c4d0f9a36056c8640661a88674ae8a2
10
11CVE-2012-3406: Stack overflow in vfprintf [BZ #16617]
12
13A larger number of format specifiers coudld cause a stack overflow,
14potentially allowing to bypass _FORTIFY_SOURCE format string
15protection.
16
17(cherry picked from commit a5357b7ce2a2982c5778435704bcdb55ce3667a0)
18(cherry picked from commit ae61fc7b33d9d99d2763c16de8275227dc9748ba)
19
20Conflicts:
21 NEWS
22---
23
24diff --git a/stdio-common/Makefile b/stdio-common/Makefile
25index 5f8e534..e5e45b6 100644
26--- a/stdio-common/Makefile
27+++ b/stdio-common/Makefile
28@@ -57,7 +57,7 @@ tests := tstscanf test_rdwr test-popen tstgetln test-fseek \
29 bug19 bug19a tst-popen2 scanf13 scanf14 scanf15 bug20 bug21 bug22 \
30 scanf16 scanf17 tst-setvbuf1 tst-grouping bug23 bug24 \
31 bug-vfprintf-nargs tst-long-dbl-fphex tst-fphex-wide tst-sprintf3 \
32- bug25 tst-printf-round bug26
33+ bug25 tst-printf-round bug23-2 bug23-3 bug23-4 bug26
34
35 test-srcs = tst-unbputc tst-printf
36
37diff --git a/stdio-common/bug23-2.c b/stdio-common/bug23-2.c
38new file mode 100644
39index 0000000..9e0cfe6
40--- /dev/null
41+++ b/stdio-common/bug23-2.c
42@@ -0,0 +1,70 @@
43+#include <stdio.h>
44+#include <string.h>
45+#include <stdlib.h>
46+
47+static const char expected[] = "\
48+\n\
49+a\n\
50+abbcd55\
51+\n\
52+a\n\
53+abbcd55\
54+\n\
55+a\n\
56+abbcd55\
57+\n\
58+a\n\
59+abbcd55\
60+\n\
61+a\n\
62+abbcd55\
63+\n\
64+a\n\
65+abbcd55\
66+\n\
67+a\n\
68+abbcd55\
69+\n\
70+a\n\
71+abbcd55\
72+\n\
73+a\n\
74+abbcd55\
75+\n\
76+a\n\
77+abbcd55\
78+\n\
79+a\n\
80+abbcd55\
81+\n\
82+a\n\
83+abbcd55\
84+\n\
85+a\n\
86+abbcd55%%%%%%%%%%%%%%%%%%%%%%%%%%\n";
87+
88+static int
89+do_test (void)
90+{
91+ char *buf = malloc (strlen (expected) + 1);
92+ snprintf (buf, strlen (expected) + 1,
93+ "\n%1$s\n" "%1$s" "%2$s" "%2$s" "%3$s" "%4$s" "%5$d" "%5$d"
94+ "\n%1$s\n" "%1$s" "%2$s" "%2$s" "%3$s" "%4$s" "%5$d" "%5$d"
95+ "\n%1$s\n" "%1$s" "%2$s" "%2$s" "%3$s" "%4$s" "%5$d" "%5$d"
96+ "\n%1$s\n" "%1$s" "%2$s" "%2$s" "%3$s" "%4$s" "%5$d" "%5$d"
97+ "\n%1$s\n" "%1$s" "%2$s" "%2$s" "%3$s" "%4$s" "%5$d" "%5$d"
98+ "\n%1$s\n" "%1$s" "%2$s" "%2$s" "%3$s" "%4$s" "%5$d" "%5$d"
99+ "\n%1$s\n" "%1$s" "%2$s" "%2$s" "%3$s" "%4$s" "%5$d" "%5$d"
100+ "\n%1$s\n" "%1$s" "%2$s" "%2$s" "%3$s" "%4$s" "%5$d" "%5$d"
101+ "\n%1$s\n" "%1$s" "%2$s" "%2$s" "%3$s" "%4$s" "%5$d" "%5$d"
102+ "\n%1$s\n" "%1$s" "%2$s" "%2$s" "%3$s" "%4$s" "%5$d" "%5$d"
103+ "\n%1$s\n" "%1$s" "%2$s" "%2$s" "%3$s" "%4$s" "%5$d" "%5$d"
104+ "\n%1$s\n" "%1$s" "%2$s" "%2$s" "%3$s" "%4$s" "%5$d" "%5$d"
105+ "\n%1$s\n" "%1$s" "%2$s" "%2$s" "%3$s" "%4$s" "%5$d" "%5$d"
106+ "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n",
107+ "a", "b", "c", "d", 5);
108+ return strcmp (buf, expected) != 0;
109+}
110+
111+#define TEST_FUNCTION do_test ()
112+#include "../test-skeleton.c"
113diff --git a/stdio-common/bug23-3.c b/stdio-common/bug23-3.c
114new file mode 100644
115index 0000000..57c8cef
116--- /dev/null
117+++ b/stdio-common/bug23-3.c
118@@ -0,0 +1,50 @@
119+#include <stdio.h>
120+#include <string.h>
121+#include <stdlib.h>
122+
123+int
124+do_test (void)
125+{
126+ size_t instances = 16384;
127+#define X0 "\n%1$s\n" "%1$s" "%2$s" "%2$s" "%3$s" "%4$s" "%5$d" "%5$d"
128+ const char *item = "\na\nabbcd55";
129+#define X3 X0 X0 X0 X0 X0 X0 X0 X0
130+#define X6 X3 X3 X3 X3 X3 X3 X3 X3
131+#define X9 X6 X6 X6 X6 X6 X6 X6 X6
132+#define X12 X9 X9 X9 X9 X9 X9 X9 X9
133+#define X14 X12 X12 X12 X12
134+#define TRAILER "%%%%%%%%%%%%%%%%%%%%%%%%%%"
135+#define TRAILER2 TRAILER TRAILER
136+ size_t length = instances * strlen (item) + strlen (TRAILER) + 1;
137+
138+ char *buf = malloc (length + 1);
139+ snprintf (buf, length + 1,
140+ X14 TRAILER2 "\n",
141+ "a", "b", "c", "d", 5);
142+
143+ const char *p = buf;
144+ size_t i;
145+ for (i = 0; i < instances; ++i)
146+ {
147+ const char *expected;
148+ for (expected = item; *expected; ++expected)
149+ {
150+ if (*p != *expected)
151+ {
152+ printf ("mismatch at offset %zu (%zu): expected %d, got %d\n",
153+ (size_t) (p - buf), i, *expected & 0xFF, *p & 0xFF);
154+ return 1;
155+ }
156+ ++p;
157+ }
158+ }
159+ if (strcmp (p, TRAILER "\n") != 0)
160+ {
161+ printf ("mismatch at trailer: [%s]\n", p);
162+ return 1;
163+ }
164+ free (buf);
165+ return 0;
166+}
167+#define TEST_FUNCTION do_test ()
168+#include "../test-skeleton.c"
169diff --git a/stdio-common/bug23-4.c b/stdio-common/bug23-4.c
170new file mode 100644
171index 0000000..a478564
172--- /dev/null
173+++ b/stdio-common/bug23-4.c
174@@ -0,0 +1,31 @@
175+#include <stdio.h>
176+#include <stdlib.h>
177+#include <string.h>
178+#include <sys/resource.h>
179+
180+#define LIMIT 1000000
181+
182+int
183+main (void)
184+{
185+ struct rlimit lim;
186+ getrlimit (RLIMIT_STACK, &lim);
187+ lim.rlim_cur = 1048576;
188+ setrlimit (RLIMIT_STACK, &lim);
189+ char *fmtstr = malloc (4 * LIMIT + 1);
190+ if (fmtstr == NULL)
191+ abort ();
192+ char *output = malloc (LIMIT + 1);
193+ if (output == NULL)
194+ abort ();
195+ for (size_t i = 0; i < LIMIT; i++)
196+ memcpy (fmtstr + 4 * i, "%1$d", 4);
197+ fmtstr[4 * LIMIT] = '\0';
198+ int ret = snprintf (output, LIMIT + 1, fmtstr, 0);
199+ if (ret != LIMIT)
200+ abort ();
201+ for (size_t i = 0; i < LIMIT; i++)
202+ if (output[i] != '0')
203+ abort ();
204+ return 0;
205+}
206diff --git a/stdio-common/vfprintf.c b/stdio-common/vfprintf.c
207index c4ff833..429a3d1 100644
208--- a/stdio-common/vfprintf.c
209+++ b/stdio-common/vfprintf.c
210@@ -263,6 +263,12 @@ vfprintf (FILE *s, const CHAR_T *format, va_list ap)
211 /* For the argument descriptions, which may be allocated on the heap. */
212 void *args_malloced = NULL;
213
214+ /* For positional argument handling. */
215+ struct printf_spec *specs;
216+
217+ /* Track if we malloced the SPECS array and thus must free it. */
218+ bool specs_malloced = false;
219+
220 /* This table maps a character into a number representing a
221 class. In each step there is a destination label for each
222 class. */
223@@ -1679,8 +1685,8 @@ do_positional:
224 size_t nspecs = 0;
225 /* A more or less arbitrary start value. */
226 size_t nspecs_size = 32 * sizeof (struct printf_spec);
227- struct printf_spec *specs = alloca (nspecs_size);
228
229+ specs = alloca (nspecs_size);
230 /* The number of arguments the format string requests. This will
231 determine the size of the array needed to store the argument
232 attributes. */
233@@ -1721,11 +1727,39 @@ do_positional:
234 if (nspecs * sizeof (*specs) >= nspecs_size)
235 {
236 /* Extend the array of format specifiers. */
237+ if (nspecs_size * 2 < nspecs_size)
238+ {
239+ __set_errno (ENOMEM);
240+ done = -1;
241+ goto all_done;
242+ }
243 struct printf_spec *old = specs;
244- specs = extend_alloca (specs, nspecs_size, 2 * nspecs_size);
245+ if (__libc_use_alloca (2 * nspecs_size))
246+ specs = extend_alloca (specs, nspecs_size, 2 * nspecs_size);
247+ else
248+ {
249+ nspecs_size *= 2;
250+ specs = malloc (nspecs_size);
251+ if (specs == NULL)
252+ {
253+ __set_errno (ENOMEM);
254+ specs = old;
255+ done = -1;
256+ goto all_done;
257+ }
258+ }
259
260 /* Copy the old array's elements to the new space. */
261 memmove (specs, old, nspecs * sizeof (*specs));
262+
263+ /* If we had previously malloc'd space for SPECS, then
264+ release it after the copy is complete. */
265+ if (specs_malloced)
266+ free (old);
267+
268+ /* Now set SPECS_MALLOCED if needed. */
269+ if (!__libc_use_alloca (nspecs_size))
270+ specs_malloced = true;
271 }
272
273 /* Parse the format specifier. */
274@@ -2046,6 +2080,8 @@ do_positional:
275 }
276
277 all_done:
278+ if (specs_malloced)
279+ free (specs);
280 if (__glibc_unlikely (args_malloced != NULL))
281 free (args_malloced);
282 if (__glibc_unlikely (workstart != NULL))
diff --git a/gnu/packages/patches/glibc-CVE-2014-7817.patch b/gnu/packages/patches/glibc-CVE-2014-7817.patch
new file mode 100644
index 00000000000..14c885523c9
--- /dev/null
+++ b/gnu/packages/patches/glibc-CVE-2014-7817.patch
@@ -0,0 +1,171 @@
1Fix CVE-2014-7817: wordexp fails to honour WRDE_NOCMD.
2
3Note: Here the ChangeLog and NEWS updates are removed from Carlos's
4 patch, since they depend on other earlier commits.
5
6From: Carlos O'Donell <carlos@redhat.com>
7Date: Wed, 19 Nov 2014 16:44:12 +0000 (-0500)
8Subject: CVE-2014-7817: wordexp fails to honour WRDE_NOCMD.
9X-Git-Url: https://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff_plain;h=33ceaf6187b31ea15284ac65131749e1cb68d2ae
10
11CVE-2014-7817: wordexp fails to honour WRDE_NOCMD.
12
13The function wordexp() fails to properly handle the WRDE_NOCMD
14flag when processing arithmetic inputs in the form of "$((... ``))"
15where "..." can be anything valid. The backticks in the arithmetic
16epxression are evaluated by in a shell even if WRDE_NOCMD forbade
17command substitution. This allows an attacker to attempt to pass
18dangerous commands via constructs of the above form, and bypass
19the WRDE_NOCMD flag. This patch fixes this by checking for WRDE_NOCMD
20in exec_comm(), the only place that can execute a shell. All other
21checks for WRDE_NOCMD are superfluous and removed.
22
23We expand the testsuite and add 3 new regression tests of roughly
24the same form but with a couple of nested levels.
25
26On top of the 3 new tests we add fork validation to the WRDE_NOCMD
27testing. If any forks are detected during the execution of a wordexp()
28call with WRDE_NOCMD, the test is marked as failed. This is slightly
29heuristic since vfork might be used in the future, but it provides a
30higher level of assurance that no shells were executed as part of
31command substitution with WRDE_NOCMD in effect. In addition it doesn't
32require libpthread or libdl, instead we use the public implementation
33namespace function __register_atfork (already part of the public ABI
34for libpthread).
35
36Tested on x86_64 with no regressions.
37
38(cherry picked from commit a39208bd7fb76c1b01c127b4c61f9bfd915bfe7c)
39---
40
41diff --git a/posix/wordexp-test.c b/posix/wordexp-test.c
42index 4957006..bdd65e4 100644
43--- a/posix/wordexp-test.c
44+++ b/posix/wordexp-test.c
45@@ -27,6 +27,25 @@
46
47 #define IFS " \n\t"
48
49+extern void *__dso_handle __attribute__ ((__weak__, __visibility__ ("hidden")));
50+extern int __register_atfork (void (*) (void), void (*) (void), void (*) (void), void *);
51+
52+static int __app_register_atfork (void (*prepare) (void), void (*parent) (void), void (*child) (void))
53+{
54+ return __register_atfork (prepare, parent, child,
55+ &__dso_handle == NULL ? NULL : __dso_handle);
56+}
57+
58+/* Number of forks seen. */
59+static int registered_forks;
60+
61+/* For each fork increment the fork count. */
62+static void
63+register_fork (void)
64+{
65+ registered_forks++;
66+}
67+
68 struct test_case_struct
69 {
70 int retval;
71@@ -206,6 +225,12 @@ struct test_case_struct
72 { WRDE_SYNTAX, NULL, "$((2+))", 0, 0, { NULL, }, IFS },
73 { WRDE_SYNTAX, NULL, "`", 0, 0, { NULL, }, IFS },
74 { WRDE_SYNTAX, NULL, "$((010+4+))", 0, 0, { NULL }, IFS },
75+ /* Test for CVE-2014-7817. We test 3 combinations of command
76+ substitution inside an arithmetic expression to make sure that
77+ no commands are executed and error is returned. */
78+ { WRDE_CMDSUB, NULL, "$((`echo 1`))", WRDE_NOCMD, 0, { NULL, }, IFS },
79+ { WRDE_CMDSUB, NULL, "$((1+`echo 1`))", WRDE_NOCMD, 0, { NULL, }, IFS },
80+ { WRDE_CMDSUB, NULL, "$((1+$((`echo 1`))))", WRDE_NOCMD, 0, { NULL, }, IFS },
81
82 { -1, NULL, NULL, 0, 0, { NULL, }, IFS },
83 };
84@@ -258,6 +283,15 @@ main (int argc, char *argv[])
85 return -1;
86 }
87
88+ /* If we are not allowed to do command substitution, we install
89+ fork handlers to verify that no forks happened. No forks should
90+ happen at all if command substitution is disabled. */
91+ if (__app_register_atfork (register_fork, NULL, NULL) != 0)
92+ {
93+ printf ("Failed to register fork handler.\n");
94+ return -1;
95+ }
96+
97 for (test = 0; test_case[test].retval != -1; test++)
98 if (testit (&test_case[test]))
99 ++fail;
100@@ -367,6 +401,9 @@ testit (struct test_case_struct *tc)
101
102 printf ("Test %d (%s): ", ++tests, tc->words);
103
104+ if (tc->flags & WRDE_NOCMD)
105+ registered_forks = 0;
106+
107 if (tc->flags & WRDE_APPEND)
108 {
109 /* initial wordexp() call, to be appended to */
110@@ -378,6 +415,13 @@ testit (struct test_case_struct *tc)
111 }
112 retval = wordexp (tc->words, &we, tc->flags);
113
114+ if ((tc->flags & WRDE_NOCMD)
115+ && (registered_forks > 0))
116+ {
117+ printf ("FAILED fork called for WRDE_NOCMD\n");
118+ return 1;
119+ }
120+
121 if (tc->flags & WRDE_DOOFFS)
122 start_offs = sav_we.we_offs;
123
124diff --git a/posix/wordexp.c b/posix/wordexp.c
125index b6b65dd..26f3a26 100644
126--- a/posix/wordexp.c
127+++ b/posix/wordexp.c
128@@ -893,6 +893,10 @@ exec_comm (char *comm, char **word, size_t *word_length, size_t *max_length,
129 pid_t pid;
130 int noexec = 0;
131
132+ /* Do nothing if command substitution should not succeed. */
133+ if (flags & WRDE_NOCMD)
134+ return WRDE_CMDSUB;
135+
136 /* Don't fork() unless necessary */
137 if (!comm || !*comm)
138 return 0;
139@@ -2082,9 +2086,6 @@ parse_dollars (char **word, size_t *word_length, size_t *max_length,
140 }
141 }
142
143- if (flags & WRDE_NOCMD)
144- return WRDE_CMDSUB;
145-
146 (*offset) += 2;
147 return parse_comm (word, word_length, max_length, words, offset, flags,
148 quoted? NULL : pwordexp, ifs, ifs_white);
149@@ -2196,9 +2197,6 @@ parse_dquote (char **word, size_t *word_length, size_t *max_length,
150 break;
151
152 case '`':
153- if (flags & WRDE_NOCMD)
154- return WRDE_CMDSUB;
155-
156 ++(*offset);
157 error = parse_backtick (word, word_length, max_length, words,
158 offset, flags, NULL, NULL, NULL);
159@@ -2357,12 +2355,6 @@ wordexp (const char *words, wordexp_t *pwordexp, int flags)
160 break;
161
162 case '`':
163- if (flags & WRDE_NOCMD)
164- {
165- error = WRDE_CMDSUB;
166- goto do_error;
167- }
168-
169 ++words_offset;
170 error = parse_backtick (&word, &word_length, &max_length, words,
171 &words_offset, flags, pwordexp, ifs,
diff --git a/gnu/packages/patches/glibc-mips-dangling-vfork-ref.patch b/gnu/packages/patches/glibc-mips-dangling-vfork-ref.patch
new file mode 100644
index 00000000000..852b6de6694
--- /dev/null
+++ b/gnu/packages/patches/glibc-mips-dangling-vfork-ref.patch
@@ -0,0 +1,45 @@
1Avoid a dangling `vfork@GLIBC_2.0' reference on MIPS.
2
3Note: Here the ChangeLog and NEWS updates are removed from Maciej's
4 patch, since they depend on other earlier commits.
5
6From: Maciej W. Rozycki <macro@codesourcery.com>
7Date: Wed, 22 Oct 2014 14:20:37 +0000 (+0100)
8Subject: MIPS: Avoid a dangling `vfork@GLIBC_2.0' reference
9X-Git-Url: https://sourceware.org/git/?p=glibc.git;a=commitdiff_plain;h=c14e752fc73d34c75d4f84f37fea8e0b1734cf98
10
11MIPS: Avoid a dangling `vfork@GLIBC_2.0' reference
12
13This satisfies a symbol reference created with:
14
15 .symver __libc_vfork, vfork@GLIBC_2.0
16
17where `__libc_vfork' has not been defined or referenced. In this case
18the `vfork@GLIBC_2.0' reference is supposed to be discarded, however a
19bug present in GAS since forever causes an undefined symbol table entry
20to be created. This in turn triggers a problem in the linker that can
21manifest itself by link errors such as:
22
23ld: libpthread.so: invalid string offset 2765592330 >= 5154 for section `.dynstr'
24
25The GAS and linker bugs need to be resolved, but we can avoid them too
26by providing a `__libc_vfork' definition just like our other platforms.
27
28 [BZ #17485]
29 * sysdeps/unix/sysv/linux/mips/vfork.S (__libc_vfork): Define.
30
31(cherry picked from commit b5af9297d51a43f96c5be1bafab032184690dd6f)
32
33Conflicts:
34 NEWS
35---
36
37diff --git a/sysdeps/unix/sysv/linux/mips/vfork.S b/sysdeps/unix/sysv/linux/mips/vfork.S
38index 80c362d..2c1a747 100644
39--- a/sysdeps/unix/sysv/linux/mips/vfork.S
40+++ b/sysdeps/unix/sysv/linux/mips/vfork.S
41@@ -108,3 +108,4 @@ L(error):
42
43 libc_hidden_def(__vfork)
44 weak_alias (__vfork, vfork)
45+strong_alias (__vfork, __libc_vfork)
diff --git a/gnu/packages/patches/gmp-arm-asm-nothumb.patch b/gnu/packages/patches/gmp-arm-asm-nothumb.patch
new file mode 100644
index 00000000000..666cf58cf69
--- /dev/null
+++ b/gnu/packages/patches/gmp-arm-asm-nothumb.patch
@@ -0,0 +1,21 @@
1
2# HG changeset patch
3# User Torbjorn Granlund <tege@gmplib.org>
4# Date 1396602422 -7200
5# Node ID 676e2d0f0e4dd301a7066079d2c9326c25c34a40
6# Parent 0194a75b56b21a9196626430af86c5bd9110c42d
7Conditionalise ARM asm on !__thumb__.
8
9diff -r 0194a75b56b2 -r 676e2d0f0e4d mpn/generic/div_qr_1n_pi1.c
10--- a/mpn/generic/div_qr_1n_pi1.c Thu Apr 03 23:58:51 2014 +0200
11+++ b/mpn/generic/div_qr_1n_pi1.c Fri Apr 04 11:07:02 2014 +0200
12@@ -130,7 +130,7 @@
13 "%2" ((UDItype)(a0)), "r" ((UDItype)(b0)) __CLOBBER_CC)
14 #endif
15
16-#if defined (__arm__) && W_TYPE_SIZE == 32
17+#if defined (__arm__) && !defined (__thumb__) && W_TYPE_SIZE == 32
18 #define add_mssaaaa(m, sh, sl, ah, al, bh, bl) \
19 __asm__ ( "adds %2, %5, %6\n\t" \
20 "adcs %1, %3, %4\n\t" \
21
diff --git a/gnu/packages/patches/guile-arm-fixes.patch b/gnu/packages/patches/guile-arm-fixes.patch
new file mode 100644
index 00000000000..62bcf0fa7b0
--- /dev/null
+++ b/gnu/packages/patches/guile-arm-fixes.patch
@@ -0,0 +1,203 @@
1Apply fixes for ARM to Guile.
2
3From df8c52e93dfa3965e4714275f4b8cea2c8e0170b Mon Sep 17 00:00:00 2001
4From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= <ludo@gnu.org>
5Date: Fri, 4 Jul 2014 15:35:06 +0200
6Subject: [PATCH] Recognize arm-* target triplets.
7
8Reported by Sylvain Beucler <beuc@beuc.net>.
9
10* module/system/base/target.scm (cpu-endianness): Add case where CPU is
11 "arm".
12* test-suite/tests/asm-to-bytecode.test ("cross-compilation")["arm-unknown-linux-androideabi"]:
13 New test.
14---
15 module/system/base/target.scm | 4 +++-
16 test-suite/tests/asm-to-bytecode.test | 5 ++++-
17 2 files changed, 7 insertions(+), 2 deletions(-)
18
19diff --git a/module/system/base/target.scm b/module/system/base/target.scm
20index c74ae67..cefa951 100644
21--- a/module/system/base/target.scm
22+++ b/module/system/base/target.scm
23@@ -1,6 +1,6 @@
24 ;;; Compilation targets
25
26-;; Copyright (C) 2011, 2012, 2013 Free Software Foundation, Inc.
27+;; Copyright (C) 2011, 2012, 2013, 2014 Free Software Foundation, Inc.
28
29 ;; This library is free software; you can redistribute it and/or
30 ;; modify it under the terms of the GNU Lesser General Public
31@@ -72,6 +72,8 @@
32 (endianness big))
33 ((string-match "^arm.*el" cpu)
34 (endianness little))
35+ ((string=? "arm" cpu) ;ARMs are LE by default
36+ (endianness little))
37 (else
38 (error "unknown CPU endianness" cpu)))))
39
40diff --git a/test-suite/tests/asm-to-bytecode.test b/test-suite/tests/asm-to-bytecode.test
41index 6d2f20e..62ea0ed 100644
42--- a/test-suite/tests/asm-to-bytecode.test
43+++ b/test-suite/tests/asm-to-bytecode.test
44@@ -1,6 +1,6 @@
45 ;;;; Assembly to bytecode compilation -*- mode: scheme; coding: utf-8; -*-
46 ;;;;
47-;;;; Copyright (C) 2010, 2011, 2012, 2013 Free Software Foundation, Inc.
48+;;;; Copyright (C) 2010, 2011, 2012, 2013, 2014 Free Software Foundation, Inc.
49 ;;;;
50 ;;;; This library is free software; you can redistribute it and/or
51 ;;;; modify it under the terms of the GNU Lesser General Public
52@@ -205,6 +205,9 @@
53 (test-target "x86_64-unknown-linux-gnux32" ; x32 ABI (Debian tuplet)
54 (endianness little) 4)
55
56+ (test-target "arm-unknown-linux-androideabi"
57+ (endianness little) 4)
58+
59 (pass-if-exception "unknown target"
60 exception:miscellaneous-error
61 (call-with-values (lambda ()
62--
632.1.2
64
65From ffd3e55cfd12a3559621e3130d613d319243512d Mon Sep 17 00:00:00 2001
66From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= <ludo@gnu.org>
67Date: Fri, 4 Jul 2014 17:26:41 +0200
68Subject: [PATCH] Recognize more ARM targets.
69
70Suggested by Dale P. Smith.
71
72* module/system/base/target.scm (cpu-endianness): Add cases for
73 "arm.*eb", "^aarch64.*be", and "aarch64". Change "arm" case to
74 "arm.*".
75 (triplet-pointer-size): Allow underscore as in 'aarch64_be'.
76* test-suite/tests/asm-to-bytecode.test ("cross-compilation")["armeb-unknown-linux-gnu",
77 "aarch64-linux-gnu", "aarch64_be-linux-gnu"]: New tests.
78---
79 module/system/base/target.scm | 10 ++++++++--
80 test-suite/tests/asm-to-bytecode.test | 6 ++++++
81 2 files changed, 14 insertions(+), 2 deletions(-)
82
83diff --git a/module/system/base/target.scm b/module/system/base/target.scm
84index cefa951..31e3fea 100644
85--- a/module/system/base/target.scm
86+++ b/module/system/base/target.scm
87@@ -72,7 +72,13 @@
88 (endianness big))
89 ((string-match "^arm.*el" cpu)
90 (endianness little))
91- ((string=? "arm" cpu) ;ARMs are LE by default
92+ ((string-match "^arm.*eb" cpu)
93+ (endianness big))
94+ ((string-prefix? "arm" cpu) ;ARMs are LE by default
95+ (endianness little))
96+ ((string-match "^aarch64.*be" cpu)
97+ (endianness big))
98+ ((string=? "aarch64" cpu)
99 (endianness little))
100 (else
101 (error "unknown CPU endianness" cpu)))))
102@@ -97,7 +103,7 @@
103 ((string-match "^x86_64-.*-gnux32" triplet) 4) ; x32
104
105 ((string-match "64$" cpu) 8)
106- ((string-match "64[lbe][lbe]$" cpu) 8)
107+ ((string-match "64_?[lbe][lbe]$" cpu) 8)
108 ((member cpu '("sparc" "powerpc" "mips" "mipsel")) 4)
109 ((string-match "^arm.*" cpu) 4)
110 (else (error "unknown CPU word size" cpu)))))
111diff --git a/test-suite/tests/asm-to-bytecode.test b/test-suite/tests/asm-to-bytecode.test
112index 62ea0ed..8aeba84 100644
113--- a/test-suite/tests/asm-to-bytecode.test
114+++ b/test-suite/tests/asm-to-bytecode.test
115@@ -207,6 +207,12 @@
116
117 (test-target "arm-unknown-linux-androideabi"
118 (endianness little) 4)
119+ (test-target "armeb-unknown-linux-gnu"
120+ (endianness big) 4)
121+ (test-target "aarch64-linux-gnu"
122+ (endianness little) 8)
123+ (test-target "aarch64_be-linux-gnu"
124+ (endianness big) 8)
125
126 (pass-if-exception "unknown target"
127 exception:miscellaneous-error
128--
1292.1.2
130
131From a85c78ea1393985fdb6e6678dea19135c553d341 Mon Sep 17 00:00:00 2001
132From: Mark H Weaver <mhw@netris.org>
133Date: Fri, 19 Sep 2014 21:18:09 -0400
134Subject: [PATCH] VM: ASM_MUL for ARM: Add earlyclobber constraint to the SMULL
135 outputs.
136
137Reported by Rob Browning <rlb@defaultvalue.org>.
138
139* libguile/vm-i-scheme.c (ASM_MUL)[ARM]: Add earlyclobber (&) constraint
140 to the SMULL output registers.
141---
142 libguile/vm-i-scheme.c | 5 ++---
143 1 file changed, 2 insertions(+), 3 deletions(-)
144
145diff --git a/libguile/vm-i-scheme.c b/libguile/vm-i-scheme.c
146index 587aa95..162efab 100644
147--- a/libguile/vm-i-scheme.c
148+++ b/libguile/vm-i-scheme.c
149@@ -1,5 +1,4 @@
150-/* Copyright (C) 2001, 2009, 2010, 2011, 2012, 2013,
151- * 2014 Free Software Foundation, Inc.
152+/* Copyright (C) 2001, 2009-2014 Free Software Foundation, Inc.
153 *
154 * This library is free software; you can redistribute it and/or
155 * modify it under the terms of the GNU Lesser General Public License
156@@ -363,7 +362,7 @@ VM_DEFINE_FUNCTION (149, ge, "ge?", 2)
157 { \
158 scm_t_signed_bits rlo, rhi; \
159 asm ("smull %0, %1, %2, %3\n" \
160- : "=r" (rlo), "=r" (rhi) \
161+ : "=&r" (rlo), "=&r" (rhi) \
162 : "r" (SCM_UNPACK (x) - scm_tc2_int), \
163 "r" (SCM_I_INUM (y))); \
164 if (SCM_LIKELY (SCM_SRS (rlo, 31) == rhi)) \
165--
1662.1.2
167
168From bed025bd2569b1c033f24d7d9e660e39ebf65cac Mon Sep 17 00:00:00 2001
169From: Mark H Weaver <mhw@netris.org>
170Date: Sat, 20 Sep 2014 03:59:51 -0400
171Subject: [PATCH] VM: Allow the C compiler to choose FP_REG on ARM.
172
173Reported by Rob Browning <rlb@defaultvalue.org>.
174
175* libguile/vm-engine.h (IP_REG)[__arm__]: Remove explicit register
176 choice ("r7") for FP_REG, which was reported to cause compilation
177 failures on ARM.
178---
179 libguile/vm-engine.h | 4 ++--
180 1 file changed, 2 insertions(+), 2 deletions(-)
181
182diff --git a/libguile/vm-engine.h b/libguile/vm-engine.h
183index 46d4cff..e618be7 100644
184--- a/libguile/vm-engine.h
185+++ b/libguile/vm-engine.h
186@@ -1,4 +1,4 @@
187-/* Copyright (C) 2001, 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
188+/* Copyright (C) 2001, 2009-2012, 2014 Free Software Foundation, Inc.
189 *
190 * This library is free software; you can redistribute it and/or
191 * modify it under the terms of the GNU Lesser General Public License
192@@ -81,7 +81,7 @@
193 #ifdef __arm__
194 #define IP_REG asm("r9")
195 #define SP_REG asm("r8")
196-#define FP_REG asm("r7")
197+#define FP_REG
198 #endif
199 #endif
200
201--
2022.1.2
203
diff --git a/gnu/packages/patches/libtool-2.4-skip-tests.patch b/gnu/packages/patches/libtool-2.4-skip-tests.patch
deleted file mode 100644
index 95747dfef06..00000000000
--- a/gnu/packages/patches/libtool-2.4-skip-tests.patch
+++ /dev/null
@@ -1,24 +0,0 @@
1Because our GCC 'lib' spec automatically adds '-rpath' for each '-L'
2and a couple more '-rpath, there are two test failures:
3one in demo.test, and one in destdir.at. Disable these.
4
5--- libtool-2.4.4/tests/testsuite 2014-11-29 17:43:11.000000000 +0100
6+++ libtool-2.4.4/tests/testsuite 2015-01-03 23:00:09.367775122 +0100
7@@ -9185,7 +9185,7 @@ read at_status <"$at_status_file"
8 #AT_START_33
9 at_fn_group_banner 33 'demo.at:548' \
10 "hardcoding library path" " " 3
11-at_xfail=no
12+at_xfail=yes
13 test no = "$ACLOCAL" && at_xfail=yes
14 test no = "$AUTOHEADER" && at_xfail=yes
15 test no = "$AUTOMAKE" && at_xfail=yes
16@@ -27052,7 +27052,7 @@ read at_status <"$at_status_file"
17 #AT_START_97
18 at_fn_group_banner 97 'destdir.at:75' \
19 "DESTDIR with in-package deplibs" " " 7
20-at_xfail=no
21+at_xfail=yes
22 eval `$LIBTOOL --config | $GREP '^fast_install='`
23 case $fast_install in no) :;; *) false;; esac && at_xfail=yes
24 (
diff --git a/gnu/packages/patches/libtool-skip-tests-for-mips.patch b/gnu/packages/patches/libtool-skip-tests-for-mips.patch
deleted file mode 100644
index 36587d23c23..00000000000
--- a/gnu/packages/patches/libtool-skip-tests-for-mips.patch
+++ /dev/null
@@ -1,12 +0,0 @@
1TEMPORARY HACK: Disable a test that fails on MIPS.
2
3--- libtool/Makefile.in.orig 2011-10-17 06:18:55.000000000 -0400
4+++ libtool/Makefile.in 2013-10-12 20:41:50.669067382 -0400
5@@ -890,7 +890,6 @@
6 tests/demo-pic-make.test \
7 tests/demo-pic-exec.test \
8 tests/demo-nopic.test \
9- tests/demo-nopic-make.test \
10 tests/demo-nopic-exec.test \
11 tests/cdemo-shared.test \
12 tests/cdemo-shared-make.test \
diff --git a/gnu/packages/patches/libtool-skip-tests.patch b/gnu/packages/patches/libtool-skip-tests.patch
index 6e12615d519..6082c3f1f11 100644
--- a/gnu/packages/patches/libtool-skip-tests.patch
+++ b/gnu/packages/patches/libtool-skip-tests.patch
@@ -1,37 +1,55 @@
1Because our GCC `lib' spec automatically adds `-rpath' for each `-L' 1Because our GCC 'lib' spec automatically adds '-rpath' for each '-L'
2and a couple more `-rpath, there are two test failures: 2and a couple more '-rpath, there are two test failures:
3demo-hardcode.test, and destdir.at. Disable these. 3one in demo.test, and one in destdir.at. Disable these.
4 4
5--- libtool-2.4.2/Makefile.in 2011-10-17 12:18:55.000000000 +0200 5Also skip the nopic test on ARM and MIPS systems.
6+++ libtool-2.4.2/Makefile.in 2012-09-13 23:50:37.000000000 +0200
7@@ -909,7 +908,7 @@ COMMON_TESTS = \
8 # but they depend on the other tests being run beforehand.
9 INTERACTIVE_TESTS = tests/demo-shared.test tests/demo-shared-make.test \
10 tests/demo-shared-exec.test tests/demo-shared-inst.test \
11- tests/demo-hardcode.test tests/demo-relink.test \
12+ tests/demo-relink.test \
13 tests/demo-noinst-link.test tests/demo-shared-unst.test \
14 tests/depdemo-shared.test tests/depdemo-shared-make.test \
15 tests/depdemo-shared-exec.test tests/depdemo-shared-inst.test \
16@@ -2580,8 +2579,7 @@ tests/cdemo-static-make.log: tests/cdemo
17
18 tests/demo-shared-unst.log: tests/demo-noinst-link.log
19 tests/demo-noinst-link.log: tests/demo-relink.log
20-tests/demo-relink.log: tests/demo-hardcode.log
21-tests/demo-hardcode.log: tests/demo-shared-inst.log
22+tests/demo-relink.log: tests/demo-shared-inst.log
23 tests/demo-shared-inst.log: tests/demo-shared-exec.log
24 tests/demo-shared-exec.log: tests/demo-shared-make.log
25 tests/demo-shared-make.log: tests/demo-shared.log
26 6
27--- libtool-2.4.2/tests/testsuite 2011-10-17 12:19:52.000000000 +0200 7--- libtool-2.4.4/tests/demo.at.orig 2014-11-19 07:28:51.000000000 -0500
28+++ libtool-2.4.2/tests/testsuite 2012-09-14 00:28:45.000000000 +0200 8+++ libtool-2.4.4/tests/demo.at 2015-01-07 17:30:46.482247718 -0500
29@@ -14443,6 +14443,6 @@ read at_status <"$at_status_file" 9@@ -510,7 +510,7 @@
30 #AT_START_69 10 AT_SETUP([force non-PIC objects])
31 at_fn_group_banner 69 'destdir.at:75' \ 11
32 "DESTDIR with in-package deplibs" " " 4 12 AT_CHECK([case $host in
13-hppa*|x86_64*|s390*)
14+hppa*|x86_64*|s390*|arm*|mips*)
15 # These hosts cannot use non-PIC shared libs
16 exit 77 ;;
17 *-solaris*|*-sunos*)
18--- libtool-2.4.4/tests/testsuite.orig 2014-11-29 11:43:11.000000000 -0500
19+++ libtool-2.4.4/tests/testsuite 2015-01-07 17:24:51.424672582 -0500
20@@ -8633,7 +8633,7 @@
21
22 { set +x
23 $as_echo "$at_srcdir/demo.at:535: case \$host in
24-hppa*|x86_64*|s390*)
25+hppa*|x86_64*|s390*|arm*|mips*)
26 # These hosts cannot use non-PIC shared libs
27 exit 77 ;;
28 *-solaris*|*-sunos*)
29@@ -8658,7 +8658,7 @@
30 "
31 at_fn_check_prepare_notrace 'a `...` command substitution' "demo.at:535"
32 ( $at_check_trace; case $host in
33-hppa*|x86_64*|s390*)
34+hppa*|x86_64*|s390*|arm*|mips*)
35 # These hosts cannot use non-PIC shared libs
36 exit 77 ;;
37 *-solaris*|*-sunos*)
38@@ -9185,7 +9185,7 @@ read at_status <"$at_status_file"
39 #AT_START_33
40 at_fn_group_banner 33 'demo.at:548' \
41 "hardcoding library path" " " 3
33-at_xfail=no 42-at_xfail=no
34+at_xfail=yes 43+at_xfail=yes
35 eval `$LIBTOOL --config | grep '^fast_install='` 44 test no = "$ACLOCAL" && at_xfail=yes
45 test no = "$AUTOHEADER" && at_xfail=yes
46 test no = "$AUTOMAKE" && at_xfail=yes
47@@ -27052,7 +27052,7 @@ read at_status <"$at_status_file"
48 #AT_START_97
49 at_fn_group_banner 97 'destdir.at:75' \
50 "DESTDIR with in-package deplibs" " " 7
51-at_xfail=no
52+at_xfail=yes
53 eval `$LIBTOOL --config | $GREP '^fast_install='`
36 case $fast_install in no) :;; *) false;; esac && at_xfail=yes 54 case $fast_install in no) :;; *) false;; esac && at_xfail=yes
37 55 (
diff --git a/gnu/packages/patches/m4-readlink-EINVAL.patch b/gnu/packages/patches/m4-readlink-EINVAL.patch
deleted file mode 100644
index dd371584a79..00000000000
--- a/gnu/packages/patches/m4-readlink-EINVAL.patch
+++ /dev/null
@@ -1,18 +0,0 @@
1Newer Linux kernels would return EINVAL instead of ENOENT.
2The patch below, taken from Gnulib, allows the test to pass when
3these Linux versions are in use:
4https://lists.gnu.org/archive/html/bug-gnulib/2011-03/msg00308.html .
5
6diff --git a/tests/test-readlink.h b/tests/test-readlink.h
7index 08d5662..7247fc4 100644
8--- a/tests/test-readlink.h
9+++ b/tests/test-readlink.h
10@@ -38,7 +38,7 @@ test_readlink (ssize_t (*func) (char const *, char *, size_t), bool print)
11 ASSERT (errno == ENOENT);
12 errno = 0;
13 ASSERT (func ("", buf, sizeof buf) == -1);
14- ASSERT (errno == ENOENT);
15+ ASSERT (errno == ENOENT || errno == EINVAL);
16 errno = 0;
17 ASSERT (func (".", buf, sizeof buf) == -1);
18 ASSERT (errno == EINVAL);
diff --git a/gnu/packages/patches/patchelf-page-size.patch b/gnu/packages/patches/patchelf-page-size.patch
index 2528b604e58..1c14047512f 100644
--- a/gnu/packages/patches/patchelf-page-size.patch
+++ b/gnu/packages/patches/patchelf-page-size.patch
@@ -28,42 +28,43 @@ Patch by Mark H Weaver <mhw@netris.org>.
28 #endif 28 #endif
29 29
30 30
31--- patchelf/tests/no-rpath.sh.orig 1969-12-31 19:00:01.000000000 -0500 31--- patchelf/tests/no-rpath.sh.orig 2014-01-14 08:17:47.000000000 -0500
32+++ patchelf/tests/no-rpath.sh 2014-02-16 20:44:12.036376953 -0500 32+++ patchelf/tests/no-rpath.sh 2015-01-06 18:31:53.418172797 -0500
33@@ -1,22 +1,22 @@ 33@@ -1,23 +1,23 @@
34 #! /bin/sh -e 34 #! /bin/sh -e
35 SCRATCH=scratch/$(basename $0 .sh)
35 36
36-rm -rf scratch 37-rm -rf ${SCRATCH}
37-mkdir -p scratch 38-mkdir -p ${SCRATCH}
38+if [ "$(uname -m)" = i686 -a "$(uname -s)" = Linux ]; then 39+if [ "$(uname -m)" = i686 -a "$(uname -s)" = Linux ]; then
39+ rm -rf scratch 40+ rm -rf ${SCRATCH}
40+ mkdir -p scratch 41+ mkdir -p ${SCRATCH}
41 42
42-cp no-rpath scratch/ 43-cp ${srcdir}/no-rpath ${SCRATCH}/
43+ cp no-rpath scratch/ 44+ cp ${srcdir}/no-rpath ${SCRATCH}/
44 45
45-oldRPath=$(../src/patchelf --print-rpath scratch/no-rpath) 46-oldRPath=$(../src/patchelf --print-rpath ${SCRATCH}/no-rpath)
46-if test -n "$oldRPath"; then exit 1; fi 47-if test -n "$oldRPath"; then exit 1; fi
47-../src/patchelf \ 48-../src/patchelf \
48- --set-interpreter "$(../src/patchelf --print-interpreter ../src/patchelf)" \ 49- --set-interpreter "$(../src/patchelf --print-interpreter ../src/patchelf)" \
49- --set-rpath /foo:/bar:/xxxxxxxxxxxxxxx scratch/no-rpath 50- --set-rpath /foo:/bar:/xxxxxxxxxxxxxxx ${SCRATCH}/no-rpath
50+ oldRPath=$(../src/patchelf --print-rpath scratch/no-rpath) 51+ oldRPath=$(../src/patchelf --print-rpath ${SCRATCH}/no-rpath)
51+ if test -n "$oldRPath"; then exit 1; fi 52+ if test -n "$oldRPath"; then exit 1; fi
52+ ../src/patchelf \ 53+ ../src/patchelf \
53+ --set-interpreter "$(../src/patchelf --print-interpreter ../src/patchelf)" \ 54+ --set-interpreter "$(../src/patchelf --print-interpreter ../src/patchelf)" \
54+ --set-rpath /foo:/bar:/xxxxxxxxxxxxxxx scratch/no-rpath 55+ --set-rpath /foo:/bar:/xxxxxxxxxxxxxxx ${SCRATCH}/no-rpath
55 56
56-newRPath=$(../src/patchelf --print-rpath scratch/no-rpath) 57-newRPath=$(../src/patchelf --print-rpath ${SCRATCH}/no-rpath)
57-if ! echo "$newRPath" | grep -q '/foo:/bar'; then 58-if ! echo "$newRPath" | grep -q '/foo:/bar'; then
58- echo "incomplete RPATH" 59- echo "incomplete RPATH"
59- exit 1 60- exit 1
60-fi 61-fi
61+ newRPath=$(../src/patchelf --print-rpath scratch/no-rpath) 62+ newRPath=$(../src/patchelf --print-rpath ${SCRATCH}/no-rpath)
62+ if ! echo "$newRPath" | grep -q '/foo:/bar'; then 63+ if ! echo "$newRPath" | grep -q '/foo:/bar'; then
63+ echo "incomplete RPATH" 64+ echo "incomplete RPATH"
64+ exit 1 65+ exit 1
65+ fi 66+ fi
66 67
67-if [ "$(uname -m)" = i686 -a "$(uname -s)" = Linux ]; then 68-if [ "$(uname -m)" = i686 -a "$(uname -s)" = Linux ]; then
68 cd scratch && ./no-rpath 69 cd ${SCRATCH} && ./no-rpath
69 fi 70 fi
diff --git a/gnu/packages/patches/patchelf-rework-for-arm.patch b/gnu/packages/patches/patchelf-rework-for-arm.patch
new file mode 100644
index 00000000000..6f4eb8f72bc
--- /dev/null
+++ b/gnu/packages/patches/patchelf-rework-for-arm.patch
@@ -0,0 +1,473 @@
1Rework the growing algorithm in patchelf to support ARM systems.
2See <https://github.com/NixOS/patchelf/issues/8>.
3This patch copied from:
4<https://github.com/sriemer/patchelf/commit/0a96239cea6b97b9a0fff80da576e58ca2dfb2a2>
5
6From 0a96239cea6b97b9a0fff80da576e58ca2dfb2a2 Mon Sep 17 00:00:00 2001
7From: Sebastian Parschauer <s.parschauer@gmx.de>
8Date: Sat, 28 Jun 2014 01:24:57 +0200
9Subject: [PATCH] Rework the growing algorithm
10
11On ARM systems there is no space in virtual memory for another LOAD
12area in front of the code LOAD area. So insert data to its end
13instead. At this location there should be enough space in virtual
14memory due to alignment. We can extend it until the end of the
15alignment but the file shift may be greater as it must be aligned
16to the page size. Do the same for the data LOAD area.
17---
18 src/patchelf.cc | 357 ++++++++++++++++++++++----------------------------------
19 1 file changed, 142 insertions(+), 215 deletions(-)
20
21diff --git a/src/patchelf.cc b/src/patchelf.cc
22index dcbfd38..4fce9e6 100644
23--- a/src/patchelf.cc
24+++ b/src/patchelf.cc
25@@ -116,7 +116,11 @@ private:
26
27 void sortShdrs();
28
29- void shiftFile(unsigned int extraPages, Elf_Addr startPage);
30+ void shiftFileSingle(size_t fileShift, Elf_Off insertOff);
31+
32+ void shiftFile(size_t neededCode, size_t neededData,
33+ Elf_Off codeOff[], Elf_Off dataOff[],
34+ Elf_Addr *codePage, Elf_Addr *dataPage);
35
36 string getSectionName(const Elf_Shdr & shdr);
37
38@@ -130,13 +134,11 @@ private:
39 unsigned int size);
40
41 void writeReplacedSections(Elf_Off & curOff,
42- Elf_Addr startAddr, Elf_Off startOffset);
43+ Elf_Addr startAddr, Elf_Off startOffset, bool isData);
44
45 void rewriteHeaders(Elf_Addr phdrAddress);
46
47- void rewriteSectionsLibrary();
48-
49- void rewriteSectionsExecutable();
50+ void rewriteSectionsBinary();
51
52 public:
53
54@@ -391,46 +393,119 @@ static unsigned int roundUp(unsigned int n, unsigned int m)
55
56
57 template<ElfFileParams>
58-void ElfFile<ElfFileParamNames>::shiftFile(unsigned int extraPages, Elf_Addr startPage)
59+void ElfFile<ElfFileParamNames>::shiftFileSingle(size_t fileShift,
60+ Elf_Off insertOff)
61 {
62- /* Move the entire contents of the file `extraPages' pages
63- further. */
64 unsigned int oldSize = fileSize;
65- unsigned int shift = extraPages * pageSize;
66- growFile(fileSize + extraPages * pageSize);
67- memmove(contents + extraPages * pageSize, contents, oldSize);
68- memset(contents + sizeof(Elf_Ehdr), 0, shift - sizeof(Elf_Ehdr));
69+
70+ /* Grow at the end */
71+ growFile(fileSize + fileShift);
72+
73+ /* move the data from the insertion point
74+ to the end and zero inserted space */
75+ memmove(contents + insertOff + fileShift,
76+ contents + insertOff, oldSize - insertOff);
77+ memset(contents + insertOff, 0, fileShift);
78
79 /* Adjust the ELF header. */
80 wri(hdr->e_phoff, sizeof(Elf_Ehdr));
81- wri(hdr->e_shoff, rdi(hdr->e_shoff) + shift);
82+ if (rdi(hdr->e_shoff) >= insertOff)
83+ wri(hdr->e_shoff, rdi(hdr->e_shoff) + fileShift);
84
85 /* Update the offsets in the section headers. */
86- for (int i = 1; i < rdi(hdr->e_shnum); ++i)
87- wri(shdrs[i].sh_offset, rdi(shdrs[i].sh_offset) + shift);
88+ for (int i = 1; i < rdi(hdr->e_shnum); ++i) {
89+ if (rdi(shdrs[i].sh_offset) >= insertOff)
90+ wri(shdrs[i].sh_offset, rdi(shdrs[i].sh_offset) + fileShift);
91+ }
92
93 /* Update the offsets in the program headers. */
94 for (int i = 0; i < rdi(hdr->e_phnum); ++i) {
95- wri(phdrs[i].p_offset, rdi(phdrs[i].p_offset) + shift);
96- if (rdi(phdrs[i].p_align) != 0 &&
97- (rdi(phdrs[i].p_vaddr) - rdi(phdrs[i].p_offset)) % rdi(phdrs[i].p_align) != 0) {
98- debug("changing alignment of program header %d from %d to %d\n", i,
99- rdi(phdrs[i].p_align), pageSize);
100- wri(phdrs[i].p_align, pageSize);
101+ if (rdi(phdrs[i].p_offset) >= insertOff)
102+ wri(phdrs[i].p_offset, rdi(phdrs[i].p_offset) + fileShift);
103+ /* Check for ELF load command alignment issue the same
104+ way as glibc/elf/dl-load.c does. This gives us the
105+ chance to run an interpreter explicitly. */
106+ if (rdi(phdrs[i].p_type) == PT_LOAD && ((rdi(phdrs[i].p_vaddr) -
107+ rdi(phdrs[i].p_offset)) & (rdi(phdrs[i].p_align) - 1)) != 0) {
108+ debug("changing alignment of program header %d from %d to %d\n",
109+ i, rdi(phdrs[i].p_align), pageSize);
110+ wri(phdrs[i].p_align, pageSize);
111 }
112 }
113+}
114+
115+template<ElfFileParams>
116+void ElfFile<ElfFileParamNames>::shiftFile(size_t neededCode,
117+ size_t neededData, Elf_Off codeOff[], Elf_Off dataOff[],
118+ Elf_Addr *codePage, Elf_Addr *dataPage)
119+{
120+ /* Move some contents of the file further. The binary has one LOAD area
121+ * for code and one for data. There is virtual memory space between
122+ * these which we can use due to alignment.
123+ */
124+ unsigned int memShift = neededCode;
125+ unsigned int fileShift = roundUp(neededCode, pageSize);
126+ unsigned int maxMemShift = 0;
127+
128+ if (neededCode > 0) {
129+ /* find the LOAD program header for code and extend it */
130+ for (int i = 0; i < rdi(hdr->e_phnum); ++i) {
131+ if (rdi(phdrs[i].p_type) == PT_LOAD &&
132+ rdi(phdrs[i].p_flags) & PF_X) {
133+ codeOff[1] = rdi(phdrs[i].p_filesz);
134+ codeOff[0] = codeOff[1] + rdi(phdrs[i].p_offset);
135+ maxMemShift = rdi(phdrs[i].p_memsz) % rdi(phdrs[i].p_align);
136+ if (maxMemShift == 0)
137+ continue;
138+ maxMemShift = rdi(phdrs[i].p_align) - maxMemShift;
139+ if (maxMemShift == 0 || memShift > maxMemShift)
140+ continue;
141+ *codePage = rdi(phdrs[i].p_vaddr);
142+ wri(phdrs[i].p_filesz, rdi(phdrs[i].p_filesz) + memShift);
143+ wri(phdrs[i].p_memsz, rdi(phdrs[i].p_memsz) + memShift);
144+ break;
145+ }
146+ }
147+ debug("codeOff: %#lx, memShift: %d, maxMemShift: %d, fileShift: %d\n",
148+ codeOff[1], memShift, maxMemShift, fileShift);
149+ if (codeOff[1] == 0 || maxMemShift == 0)
150+ goto out;
151+
152+ shiftFileSingle(fileShift, codeOff[0]);
153+ }
154+
155+ /* +++ Do the same for the data LOAD area +++ */
156+ memShift = neededData;
157+ fileShift = roundUp(neededData, pageSize);
158+ maxMemShift = 0;
159+ if (neededData > 0) {
160+ /* find the LOAD program header for data and extend it */
161+ for (int i = 0; i < rdi(hdr->e_phnum); ++i) {
162+ if (rdi(phdrs[i].p_type) == PT_LOAD &&
163+ rdi(phdrs[i].p_flags) & PF_W) {
164+ dataOff[1] = rdi(phdrs[i].p_filesz);
165+ dataOff[0] = dataOff[1] + rdi(phdrs[i].p_offset);
166+ maxMemShift = rdi(phdrs[i].p_memsz) % rdi(phdrs[i].p_align);
167+ if (maxMemShift == 0)
168+ continue;
169+ maxMemShift = rdi(phdrs[i].p_align) - maxMemShift;
170+ if (maxMemShift == 0 || memShift > maxMemShift)
171+ continue;
172+ *dataPage = rdi(phdrs[i].p_vaddr);
173+ wri(phdrs[i].p_filesz, rdi(phdrs[i].p_filesz) + memShift);
174+ wri(phdrs[i].p_memsz, rdi(phdrs[i].p_memsz) + memShift);
175+ break;
176+ }
177+ }
178+ debug("dataOff: %#lx, memShift: %d, maxMemShift: %d, fileShift: %d\n",
179+ dataOff[1], memShift, maxMemShift, fileShift);
180+ if (dataOff[1] == 0 || maxMemShift == 0)
181+ goto out;
182
183- /* Add a segment that maps the new program/section headers and
184- PT_INTERP segment into memory. Otherwise glibc will choke. */
185- phdrs.resize(rdi(hdr->e_phnum) + 1);
186- wri(hdr->e_phnum, rdi(hdr->e_phnum) + 1);
187- Elf_Phdr & phdr = phdrs[rdi(hdr->e_phnum) - 1];
188- wri(phdr.p_type, PT_LOAD);
189- wri(phdr.p_offset, 0);
190- wri(phdr.p_vaddr, wri(phdr.p_paddr, startPage));
191- wri(phdr.p_filesz, wri(phdr.p_memsz, shift));
192- wri(phdr.p_flags, PF_R | PF_W);
193- wri(phdr.p_align, pageSize);
194+ shiftFileSingle(fileShift, dataOff[0]);
195+ }
196+out:
197+ return;
198 }
199
200
201@@ -491,7 +566,7 @@ string & ElfFile<ElfFileParamNames>::replaceSection(const SectionName & sectionN
202
203 template<ElfFileParams>
204 void ElfFile<ElfFileParamNames>::writeReplacedSections(Elf_Off & curOff,
205- Elf_Addr startAddr, Elf_Off startOffset)
206+ Elf_Addr startAddr, Elf_Off startOffset, bool isData = false)
207 {
208 /* Overwrite the old section contents with 'X's. Do this
209 *before* writing the new section contents (below) to prevent
210@@ -501,6 +576,9 @@ void ElfFile<ElfFileParamNames>::writeReplacedSections(Elf_Off & curOff,
211 {
212 string sectionName = i->first;
213 Elf_Shdr & shdr = findSection(sectionName);
214+ if ((!isData && rdi(shdr.sh_flags) & SHF_WRITE) ||
215+ (isData && ~(rdi(shdr.sh_flags)) & SHF_WRITE))
216+ continue;
217 memset(contents + rdi(shdr.sh_offset), 'X', rdi(shdr.sh_size));
218 }
219
220@@ -509,6 +587,9 @@ void ElfFile<ElfFileParamNames>::writeReplacedSections(Elf_Off & curOff,
221 {
222 string sectionName = i->first;
223 Elf_Shdr & shdr = findSection(sectionName);
224+ if ((!isData && rdi(shdr.sh_flags) & SHF_WRITE) ||
225+ (isData && ~(rdi(shdr.sh_flags)) & SHF_WRITE))
226+ continue;
227 debug("rewriting section `%s' from offset 0x%x (size %d) to offset 0x%x (size %d)\n",
228 sectionName.c_str(), rdi(shdr.sh_offset), rdi(shdr.sh_size), curOff, i->second.size());
229
230@@ -546,201 +627,47 @@ void ElfFile<ElfFileParamNames>::writeReplacedSections(Elf_Off & curOff,
231 curOff += roundUp(i->second.size(), sectionAlignment);
232 }
233
234- replacedSections.clear();
235+ if (isData)
236+ replacedSections.clear();
237 }
238
239
240 template<ElfFileParams>
241-void ElfFile<ElfFileParamNames>::rewriteSectionsLibrary()
242+void ElfFile<ElfFileParamNames>::rewriteSectionsBinary()
243 {
244- /* For dynamic libraries, we just place the replacement sections
245- at the end of the file. They're mapped into memory by a
246- PT_LOAD segment located directly after the last virtual address
247- page of other segments. */
248- Elf_Addr startPage = 0;
249- for (unsigned int i = 0; i < phdrs.size(); ++i) {
250- Elf_Addr thisPage = roundUp(rdi(phdrs[i].p_vaddr) + rdi(phdrs[i].p_memsz), pageSize);
251- if (thisPage > startPage) startPage = thisPage;
252- }
253-
254- debug("last page is 0x%llx\n", (unsigned long long) startPage);
255+ Elf_Off codeOff[2] = {0}, dataOff[2] = {0};
256+ Elf_Addr codePage = 0, dataPage = 0;
257+ size_t neededCode = 0, neededData = 0, oldCode = 0, oldData = 0;
258+ Elf_Shdr shdr = findSection(".text");
259+ Elf_Addr firstPage = rdi(shdr.sh_addr) - rdi(shdr.sh_offset);
260
261+ debug("first page is 0x%llx\n", (unsigned long long) firstPage);
262
263- /* Compute the total space needed for the replaced sections and
264- the program headers. */
265- off_t neededSpace = (phdrs.size() + 1) * sizeof(Elf_Phdr);
266+ /* Compute the total space needed for the replaced sections */
267 for (ReplacedSections::iterator i = replacedSections.begin();
268- i != replacedSections.end(); ++i)
269- neededSpace += roundUp(i->second.size(), sectionAlignment);
270- debug("needed space is %d\n", neededSpace);
271-
272-
273- size_t startOffset = roundUp(fileSize, pageSize);
274-
275- growFile(startOffset + neededSpace);
276-
277-
278- /* Even though this file is of type ET_DYN, it could actually be
279- an executable. For instance, Gold produces executables marked
280- ET_DYN. In that case we can still hit the kernel bug that
281- necessitated rewriteSectionsExecutable(). However, such
282- executables also tend to start at virtual address 0, so
283- rewriteSectionsExecutable() won't work because it doesn't have
284- any virtual address space to grow downwards into. As a
285- workaround, make sure that the virtual address of our new
286- PT_LOAD segment relative to the first PT_LOAD segment is equal
287- to its offset; otherwise we hit the kernel bug. This may
288- require creating a hole in the executable. The bigger the size
289- of the uninitialised data segment, the bigger the hole. */
290- if (isExecutable) {
291- if (startOffset >= startPage) {
292- debug("shifting new PT_LOAD segment by %d bytes to work around a Linux kernel bug\n", startOffset - startPage);
293- } else {
294- size_t hole = startPage - startOffset;
295- /* Print a warning, because the hole could be very big. */
296- fprintf(stderr, "warning: working around a Linux kernel bug by creating a hole of %zu bytes in ‘%s’\n", hole, fileName.c_str());
297- assert(hole % pageSize == 0);
298- /* !!! We could create an actual hole in the file here,
299- but it's probably not worth the effort. */
300- growFile(fileSize + hole);
301- startOffset += hole;
302- }
303- startPage = startOffset;
304- }
305-
306-
307- /* Add a segment that maps the replaced sections and program
308- headers into memory. */
309- phdrs.resize(rdi(hdr->e_phnum) + 1);
310- wri(hdr->e_phnum, rdi(hdr->e_phnum) + 1);
311- Elf_Phdr & phdr = phdrs[rdi(hdr->e_phnum) - 1];
312- wri(phdr.p_type, PT_LOAD);
313- wri(phdr.p_offset, startOffset);
314- wri(phdr.p_vaddr, wri(phdr.p_paddr, startPage));
315- wri(phdr.p_filesz, wri(phdr.p_memsz, neededSpace));
316- wri(phdr.p_flags, PF_R | PF_W);
317- wri(phdr.p_align, pageSize);
318-
319-
320- /* Write out the replaced sections. */
321- Elf_Off curOff = startOffset + phdrs.size() * sizeof(Elf_Phdr);
322- writeReplacedSections(curOff, startPage, startOffset);
323- assert((off_t) curOff == startOffset + neededSpace);
324-
325-
326- /* Move the program header to the start of the new area. */
327- wri(hdr->e_phoff, startOffset);
328-
329- rewriteHeaders(startPage);
330-}
331-
332-
333-template<ElfFileParams>
334-void ElfFile<ElfFileParamNames>::rewriteSectionsExecutable()
335-{
336- /* Sort the sections by offset, otherwise we won't correctly find
337- all the sections before the last replaced section. */
338- sortShdrs();
339-
340-
341- /* What is the index of the last replaced section? */
342- unsigned int lastReplaced = 0;
343- for (unsigned int i = 1; i < rdi(hdr->e_shnum); ++i) {
344- string sectionName = getSectionName(shdrs[i]);
345- if (replacedSections.find(sectionName) != replacedSections.end()) {
346- debug("using replaced section `%s'\n", sectionName.c_str());
347- lastReplaced = i;
348- }
349- }
350-
351- assert(lastReplaced != 0);
352-
353- debug("last replaced is %d\n", lastReplaced);
354-
355- /* Try to replace all sections before that, as far as possible.
356- Stop when we reach an irreplacable section (such as one of type
357- SHT_PROGBITS). These cannot be moved in virtual address space
358- since that would invalidate absolute references to them. */
359- assert(lastReplaced + 1 < shdrs.size()); /* !!! I'm lazy. */
360- size_t startOffset = rdi(shdrs[lastReplaced + 1].sh_offset);
361- Elf_Addr startAddr = rdi(shdrs[lastReplaced + 1].sh_addr);
362- string prevSection;
363- for (unsigned int i = 1; i <= lastReplaced; ++i) {
364- Elf_Shdr & shdr(shdrs[i]);
365- string sectionName = getSectionName(shdr);
366- debug("looking at section `%s'\n", sectionName.c_str());
367- /* !!! Why do we stop after a .dynstr section? I can't
368- remember! */
369- if ((rdi(shdr.sh_type) == SHT_PROGBITS && sectionName != ".interp")
370- || prevSection == ".dynstr")
371- {
372- startOffset = rdi(shdr.sh_offset);
373- startAddr = rdi(shdr.sh_addr);
374- lastReplaced = i - 1;
375- break;
376+ i != replacedSections.end(); ++i) {
377+ shdr = findSection(i->first);
378+ if (rdi(shdr.sh_flags) & SHF_WRITE) {
379+ oldData += rdi(shdr.sh_size);
380+ neededData += roundUp(i->second.size(), sectionAlignment);
381 } else {
382- if (replacedSections.find(sectionName) == replacedSections.end()) {
383- debug("replacing section `%s' which is in the way\n", sectionName.c_str());
384- replaceSection(sectionName, rdi(shdr.sh_size));
385- }
386+ oldCode += rdi(shdr.sh_size);
387+ neededCode += roundUp(i->second.size(), sectionAlignment);
388 }
389- prevSection = sectionName;
390 }
391
392- debug("first reserved offset/addr is 0x%x/0x%llx\n",
393- startOffset, (unsigned long long) startAddr);
394-
395- assert(startAddr % pageSize == startOffset % pageSize);
396- Elf_Addr firstPage = startAddr - startOffset;
397- debug("first page is 0x%llx\n", (unsigned long long) firstPage);
398-
399- /* Right now we assume that the section headers are somewhere near
400- the end, which appears to be the case most of the time.
401- Therefore they're not accidentally overwritten by the replaced
402- sections. !!! Fix this. */
403- assert((off_t) rdi(hdr->e_shoff) >= startOffset);
404-
405-
406- /* Compute the total space needed for the replaced sections, the
407- ELF header, and the program headers. */
408- size_t neededSpace = sizeof(Elf_Ehdr) + phdrs.size() * sizeof(Elf_Phdr);
409- for (ReplacedSections::iterator i = replacedSections.begin();
410- i != replacedSections.end(); ++i)
411- neededSpace += roundUp(i->second.size(), sectionAlignment);
412-
413- debug("needed space is %d\n", neededSpace);
414-
415- /* If we need more space at the start of the file, then grow the
416- file by the minimum number of pages and adjust internal
417- offsets. */
418- if (neededSpace > startOffset) {
419-
420- /* We also need an additional program header, so adjust for that. */
421- neededSpace += sizeof(Elf_Phdr);
422- debug("needed space is %d\n", neededSpace);
423-
424- unsigned int neededPages = roundUp(neededSpace - startOffset, pageSize) / pageSize;
425- debug("needed pages is %d\n", neededPages);
426- if (neededPages * pageSize > firstPage)
427- error("virtual address space underrun!");
428-
429- firstPage -= neededPages * pageSize;
430- startOffset += neededPages * pageSize;
431-
432- shiftFile(neededPages, firstPage);
433- }
434-
435-
436- /* Clear out the free space. */
437- Elf_Off curOff = sizeof(Elf_Ehdr) + phdrs.size() * sizeof(Elf_Phdr);
438- debug("clearing first %d bytes\n", startOffset - curOff);
439- memset(contents + curOff, 0, startOffset - curOff);
440+ debug("needed space is C: %d, D: %d\n", neededCode, neededData);
441
442+ /* If we need more space within the file, then grow the
443+ file and adjust internal offsets. */
444+ shiftFile(neededCode, neededData, codeOff, dataOff, &codePage,
445+ &dataPage);
446+ assert(codeOff[0] > 0);
447
448 /* Write out the replaced sections. */
449- writeReplacedSections(curOff, firstPage, 0);
450- assert((off_t) curOff == neededSpace);
451-
452+ debug("codePage: %#lx, dataPage: %#lx\n", codePage, dataPage);
453+ writeReplacedSections(codeOff[0], codePage + codeOff[1], codeOff[0]);
454+ writeReplacedSections(dataOff[0], dataPage + dataOff[1], dataOff[0], true);
455
456 rewriteHeaders(firstPage + rdi(hdr->e_phoff));
457 }
458@@ -758,10 +685,10 @@ void ElfFile<ElfFileParamNames>::rewriteSections()
459
460 if (rdi(hdr->e_type) == ET_DYN) {
461 debug("this is a dynamic library\n");
462- rewriteSectionsLibrary();
463+ rewriteSectionsBinary();
464 } else if (rdi(hdr->e_type) == ET_EXEC) {
465 debug("this is an executable\n");
466- rewriteSectionsExecutable();
467+ rewriteSectionsBinary();
468 } else error("unknown ELF type");
469 }
470
471--
4722.1.2
473
diff --git a/gnu/packages/patches/sqlite-large-page-size-fix.patch b/gnu/packages/patches/sqlite-large-page-size-fix.patch
deleted file mode 100644
index c561fa20a27..00000000000
--- a/gnu/packages/patches/sqlite-large-page-size-fix.patch
+++ /dev/null
@@ -1,180 +0,0 @@
1Add an experimental fix to avoid attempting to mmap memory from an
2offset that is not a multiple of the system page size on systems with
3page sizes larger than 32KB.
4
5Patch by Dan Kennedy <danielk1977@gmail.com>.
6
7--- sqlite-autoconf/sqlite3.c.orig 2014-03-22 23:44:47.055908203 -0400
8+++ sqlite-autoconf/sqlite3.c 2014-03-22 23:44:06.716552734 -0400
9@@ -24010,6 +24010,7 @@
10
11 /* Forward reference */
12 static int openDirectory(const char*, int*);
13+static int unixGetpagesize(void);
14
15 /*
16 ** Many system calls are accessed through pointer-to-functions so that
17@@ -24133,6 +24134,9 @@
18 #define osMremap ((void*(*)(void*,size_t,size_t,int,...))aSyscall[23].pCurrent)
19 #endif
20
21+ { "getpagesize", (sqlite3_syscall_ptr)unixGetpagesize, 0 },
22+#define osGetpagesize ((int(*)(void))aSyscall[24].pCurrent)
23+
24 }; /* End of the overrideable system calls */
25
26 /*
27@@ -27792,6 +27796,36 @@
28 return rc;
29 }
30
31+/*
32+** Return the system page size.
33+**
34+** This function should not be called directly by other code in this file.
35+** Instead, it should be called via macro osGetpagesize().
36+*/
37+static int unixGetpagesize(void){
38+#if defined(_BSD_SOURCE)
39+ return getpagesize();
40+#else
41+ return (int)sysconf(_SC_PAGESIZE);
42+#endif
43+}
44+
45+/*
46+** Return the minimum number of 32KB shm regions that should be mapped at
47+** a time, assuming that each mapping must be an integer multiple of the
48+** current system page-size.
49+**
50+** Usually, this is 1. The exception seems to be systems that are configured
51+** to use 64KB pages - in this case each mapping must cover at least two
52+** shm regions.
53+*/
54+static int unixShmRegionPerMap(void){
55+ int shmsz = 32*1024; /* SHM region size */
56+ int pgsz = osGetpagesize(); /* System page size */
57+ assert( ((pgsz-1)&pgsz)==0 ); /* Page size must be a power of 2 */
58+ if( pgsz<shmsz ) return 1;
59+ return pgsz/shmsz;
60+}
61
62 /*
63 ** Purge the unixShmNodeList list of all entries with unixShmNode.nRef==0.
64@@ -27803,10 +27837,11 @@
65 unixShmNode *p = pFd->pInode->pShmNode;
66 assert( unixMutexHeld() );
67 if( p && p->nRef==0 ){
68+ int nShmPerMap = unixShmRegionPerMap();
69 int i;
70 assert( p->pInode==pFd->pInode );
71 sqlite3_mutex_free(p->mutex);
72- for(i=0; i<p->nRegion; i++){
73+ for(i=0; i<p->nRegion; i+=nShmPerMap){
74 if( p->h>=0 ){
75 osMunmap(p->apRegion[i], p->szRegion);
76 }else{
77@@ -28013,6 +28048,8 @@
78 unixShm *p;
79 unixShmNode *pShmNode;
80 int rc = SQLITE_OK;
81+ int nShmPerMap = unixShmRegionPerMap();
82+ int nReqRegion;
83
84 /* If the shared-memory file has not yet been opened, open it now. */
85 if( pDbFd->pShm==0 ){
86@@ -28028,9 +28065,12 @@
87 assert( pShmNode->h>=0 || pDbFd->pInode->bProcessLock==1 );
88 assert( pShmNode->h<0 || pDbFd->pInode->bProcessLock==0 );
89
90- if( pShmNode->nRegion<=iRegion ){
91+ /* Minimum number of regions required to be mapped. */
92+ nReqRegion = ((iRegion+nShmPerMap) / nShmPerMap) * nShmPerMap;
93+
94+ if( pShmNode->nRegion<nReqRegion ){
95 char **apNew; /* New apRegion[] array */
96- int nByte = (iRegion+1)*szRegion; /* Minimum required file size */
97+ int nByte = nReqRegion*szRegion; /* Minimum required file size */
98 struct stat sStat; /* Used by fstat() */
99
100 pShmNode->szRegion = szRegion;
101@@ -28079,17 +28119,19 @@
102
103 /* Map the requested memory region into this processes address space. */
104 apNew = (char **)sqlite3_realloc(
105- pShmNode->apRegion, (iRegion+1)*sizeof(char *)
106+ pShmNode->apRegion, nReqRegion*sizeof(char *)
107 );
108 if( !apNew ){
109 rc = SQLITE_IOERR_NOMEM;
110 goto shmpage_out;
111 }
112 pShmNode->apRegion = apNew;
113- while(pShmNode->nRegion<=iRegion){
114+ while( pShmNode->nRegion<nReqRegion ){
115+ int nMap = szRegion*nShmPerMap;
116+ int i;
117 void *pMem;
118 if( pShmNode->h>=0 ){
119- pMem = osMmap(0, szRegion,
120+ pMem = osMmap(0, nMap,
121 pShmNode->isReadonly ? PROT_READ : PROT_READ|PROT_WRITE,
122 MAP_SHARED, pShmNode->h, szRegion*(i64)pShmNode->nRegion
123 );
124@@ -28105,8 +28147,11 @@
125 }
126 memset(pMem, 0, szRegion);
127 }
128- pShmNode->apRegion[pShmNode->nRegion] = pMem;
129- pShmNode->nRegion++;
130+
131+ for(i=0; i<nShmPerMap; i++){
132+ pShmNode->apRegion[pShmNode->nRegion+i] = &((char*)pMem)[szRegion*i];
133+ }
134+ pShmNode->nRegion += nShmPerMap;
135 }
136 }
137
138@@ -28321,19 +28366,6 @@
139 }
140
141 /*
142-** Return the system page size.
143-*/
144-static int unixGetPagesize(void){
145-#if HAVE_MREMAP
146- return 512;
147-#elif defined(_BSD_SOURCE)
148- return getpagesize();
149-#else
150- return (int)sysconf(_SC_PAGESIZE);
151-#endif
152-}
153-
154-/*
155 ** Attempt to set the size of the memory mapping maintained by file
156 ** descriptor pFd to nNew bytes. Any existing mapping is discarded.
157 **
158@@ -28369,8 +28401,12 @@
159 if( (pFd->ctrlFlags & UNIXFILE_RDONLY)==0 ) flags |= PROT_WRITE;
160
161 if( pOrig ){
162- const int szSyspage = unixGetPagesize();
163+#if HAVE_MREMAP
164+ i64 nReuse = pFd->mmapSize;
165+#else
166+ const int szSyspage = osGetpagesize();
167 i64 nReuse = (pFd->mmapSize & ~(szSyspage-1));
168+#endif
169 u8 *pReq = &pOrig[nReuse];
170
171 /* Unmap any pages of the existing mapping that cannot be reused. */
172@@ -31116,7 +31152,7 @@
173
174 /* Double-check that the aSyscall[] array has been constructed
175 ** correctly. See ticket [bb3a86e890c8e96ab] */
176- assert( ArraySize(aSyscall)==24 );
177+ assert( ArraySize(aSyscall)==25 );
178
179 /* Register all VFSes defined in the aVfs[] array */
180 for(i=0; i<(sizeof(aVfs)/sizeof(sqlite3_vfs)); i++){
diff --git a/gnu/packages/patchutils.scm b/gnu/packages/patchutils.scm
index 3dbf72435eb..48f4d295848 100644
--- a/gnu/packages/patchutils.scm
+++ b/gnu/packages/patchutils.scm
@@ -96,7 +96,7 @@ listing the files modified by a patch.")
96 (build-system gnu-build-system) 96 (build-system gnu-build-system)
97 (inputs `(("perl" ,perl) 97 (inputs `(("perl" ,perl)
98 ("less" ,less) 98 ("less" ,less)
99 ("file" ,file-5.20) ;work around CVE-2014-3710 99 ("file" ,file)
100 ("ed" ,ed))) 100 ("ed" ,ed)))
101 (arguments 101 (arguments
102 '(#:parallel-tests? #f 102 '(#:parallel-tests? #f
diff --git a/gnu/packages/perl.scm b/gnu/packages/perl.scm
index 03cad3e25fd..699fe751def 100644
--- a/gnu/packages/perl.scm
+++ b/gnu/packages/perl.scm
@@ -66,7 +66,7 @@
66 %standard-phases))) 66 %standard-phases)))
67 (native-search-paths (list (search-path-specification 67 (native-search-paths (list (search-path-specification
68 (variable "PERL5LIB") 68 (variable "PERL5LIB")
69 (directories '("lib/perl5/site_perl"))))) 69 (files '("lib/perl5/site_perl")))))
70 (synopsis "Implementation of the Perl programming language") 70 (synopsis "Implementation of the Perl programming language")
71 (description 71 (description
72 "Perl 5 is a highly capable, feature-rich programming language with over 72 "Perl 5 is a highly capable, feature-rich programming language with over
diff --git a/gnu/packages/photo.scm b/gnu/packages/photo.scm
index 4f1787fe754..164f6e27ea3 100644
--- a/gnu/packages/photo.scm
+++ b/gnu/packages/photo.scm
@@ -1,5 +1,5 @@
1;;; GNU Guix --- Functional package management for GNU 1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2014 Ludovic Courtès <ludo@gnu.org> 2;;; Copyright © 2014, 2015 Ludovic Courtès <ludo@gnu.org>
3;;; 3;;;
4;;; This file is part of GNU Guix. 4;;; This file is part of GNU Guix.
5;;; 5;;;
@@ -64,7 +64,7 @@ data as produced by digital cameras.")
64 (native-inputs `(("pkg-config" ,pkg-config))) 64 (native-inputs `(("pkg-config" ,pkg-config)))
65 (inputs 65 (inputs
66 `(;; ("libjpeg-turbo" ,libjpeg-turbo) 66 `(;; ("libjpeg-turbo" ,libjpeg-turbo)
67 ("libtool" ,libtool) 67 ("libltdl" ,libltdl)
68 ("libusb" ,libusb))) 68 ("libusb" ,libusb)))
69 (propagated-inputs 69 (propagated-inputs
70 `(;; The .pc refers to libexif. 70 `(;; The .pc refers to libexif.
diff --git a/gnu/packages/pkg-config.scm b/gnu/packages/pkg-config.scm
index 62b0d5f65cc..dd5120c4747 100644
--- a/gnu/packages/pkg-config.scm
+++ b/gnu/packages/pkg-config.scm
@@ -30,7 +30,7 @@
30(define-public %pkg-config 30(define-public %pkg-config
31 (package 31 (package
32 (name "pkg-config") 32 (name "pkg-config")
33 (version "0.27.1") 33 (version "0.28")
34 (source (origin 34 (source (origin
35 (method url-fetch) 35 (method url-fetch)
36 (uri (string-append 36 (uri (string-append
@@ -38,14 +38,13 @@
38 version ".tar.gz")) 38 version ".tar.gz"))
39 (sha256 39 (sha256
40 (base32 40 (base32
41 "05wc5nwkqz7saj2v33ydmz1y6jdg659dll4jjh91n41m63gx0qsg")))) 41 "0igqq5m204w71m11y0nipbdf5apx87hwfll6axs12hn4dqfb6vkb"))))
42 (build-system gnu-build-system) 42 (build-system gnu-build-system)
43 (arguments `(#:configure-flags '("--with-internal-glib"))) 43 (arguments `(#:configure-flags '("--with-internal-glib")))
44 (native-search-paths 44 (native-search-paths
45 (list (search-path-specification 45 (list (search-path-specification
46 (variable "PKG_CONFIG_PATH") 46 (variable "PKG_CONFIG_PATH")
47 (directories '("lib/pkgconfig" "lib64/pkgconfig" 47 (files '("lib/pkgconfig" "lib64/pkgconfig" "share/pkgconfig")))))
48 "share/pkgconfig")))))
49 (home-page "http://www.freedesktop.org/wiki/Software/pkg-config") 48 (home-page "http://www.freedesktop.org/wiki/Software/pkg-config")
50 (license gpl2+) 49 (license gpl2+)
51 (synopsis "Helper tool used when compiling applications and libraries") 50 (synopsis "Helper tool used when compiling applications and libraries")
diff --git a/gnu/packages/pth.scm b/gnu/packages/pth.scm
index ba5fb8216d0..50385b14f83 100644
--- a/gnu/packages/pth.scm
+++ b/gnu/packages/pth.scm
@@ -1,5 +1,5 @@
1;;; GNU Guix --- Functional package management for GNU 1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2012 Ludovic Courtès <ludo@gnu.org> 2;;; Copyright © 2012, 2015 Ludovic Courtès <ludo@gnu.org>
3;;; Copyright © 2014 Mark H Weaver <mhw@netris.org> 3;;; Copyright © 2014 Mark H Weaver <mhw@netris.org>
4;;; 4;;;
5;;; This file is part of GNU Guix. 5;;; This file is part of GNU Guix.
@@ -37,12 +37,7 @@
37 "0ckjqw5kz5m30srqi87idj7xhpw6bpki43mj07bazjm2qmh3cdbj")))) 37 "0ckjqw5kz5m30srqi87idj7xhpw6bpki43mj07bazjm2qmh3cdbj"))))
38 (build-system gnu-build-system) 38 (build-system gnu-build-system)
39 (arguments 39 (arguments
40 '(#:parallel-build? #f 40 '(#:parallel-build? #f))
41 ;; By default, man pages are put in PREFIX/man,
42 ;; but we want them in PREFIX/share/man.
43 #:configure-flags (list (string-append "--mandir="
44 (assoc-ref %outputs "out")
45 "/share/man"))))
46 (home-page "http://www.gnu.org/software/pth") 41 (home-page "http://www.gnu.org/software/pth")
47 (synopsis "Portable thread library") 42 (synopsis "Portable thread library")
48 (description 43 (description
diff --git a/gnu/packages/pulseaudio.scm b/gnu/packages/pulseaudio.scm
index 61e0d029f51..1e9fe41b471 100644
--- a/gnu/packages/pulseaudio.scm
+++ b/gnu/packages/pulseaudio.scm
@@ -1,5 +1,5 @@
1;;; GNU Guix --- Functional package management for GNU 1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2013, 2014 Ludovic Courtès <ludo@gnu.org> 2;;; Copyright © 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org>
3;;; Copyright © 2014 Mark H Weaver <mhw@netris.org> 3;;; Copyright © 2014 Mark H Weaver <mhw@netris.org>
4;;; 4;;;
5;;; This file is part of GNU Guix. 5;;; This file is part of GNU Guix.
@@ -24,7 +24,7 @@
24 #:use-module (guix build-system gnu) 24 #:use-module (guix build-system gnu)
25 #:use-module (gnu packages) 25 #:use-module (gnu packages)
26 #:use-module (gnu packages algebra) 26 #:use-module (gnu packages algebra)
27 #:use-module ((gnu packages autotools) #:select (libtool)) 27 #:use-module ((gnu packages autotools) #:select (libltdl))
28 #:use-module (gnu packages avahi) 28 #:use-module (gnu packages avahi)
29 #:use-module (gnu packages check) 29 #:use-module (gnu packages check)
30 #:use-module (gnu packages gdbm) 30 #:use-module (gnu packages gdbm)
@@ -157,7 +157,7 @@ rates. ")
157 ("intltool" ,intltool) 157 ("intltool" ,intltool)
158 ("pkg-config" ,pkg-config) 158 ("pkg-config" ,pkg-config)
159 ("m4" ,m4) 159 ("m4" ,m4)
160 ("libtool" ,libtool) 160 ("libltdl" ,libltdl)
161 ("fftwf" ,fftwf) 161 ("fftwf" ,fftwf)
162 ("avahi" ,avahi) 162 ("avahi" ,avahi)
163 ("check" ,check))) 163 ("check" ,check)))
diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index 162acec6391..c2eab7dc6d5 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -198,7 +198,7 @@
198 (native-search-paths 198 (native-search-paths
199 (list (search-path-specification 199 (list (search-path-specification
200 (variable "PYTHONPATH") 200 (variable "PYTHONPATH")
201 (directories '("lib/python2.7/site-packages"))))) 201 (files '("lib/python2.7/site-packages")))))
202 (home-page "http://python.org") 202 (home-page "http://python.org")
203 (synopsis 203 (synopsis
204 "High-level, dynamically-typed programming language") 204 "High-level, dynamically-typed programming language")
@@ -237,7 +237,7 @@ data types.")
237 (native-search-paths 237 (native-search-paths
238 (list (search-path-specification 238 (list (search-path-specification
239 (variable "PYTHONPATH") 239 (variable "PYTHONPATH")
240 (directories '("lib/python3.3/site-packages"))))))) 240 (files '("lib/python3.3/site-packages")))))))
241 241
242(define-public python-wrapper 242(define-public python-wrapper
243 (package (inherit python) 243 (package (inherit python)
diff --git a/gnu/packages/ruby.scm b/gnu/packages/ruby.scm
index 4b6665cb6bd..f8276db698a 100644
--- a/gnu/packages/ruby.scm
+++ b/gnu/packages/ruby.scm
@@ -77,10 +77,9 @@
77 (native-search-paths 77 (native-search-paths
78 (list (search-path-specification 78 (list (search-path-specification
79 (variable "GEM_PATH") 79 (variable "GEM_PATH")
80 (directories 80 (files (list (string-append "lib/ruby/gems/"
81 (list (string-append "lib/ruby/gems/" 81 (version-major+minor version)
82 (version-major+minor version) 82 ".0"))))))
83 ".0"))))))
84 (synopsis "Programming language interpreter") 83 (synopsis "Programming language interpreter")
85 (description "Ruby is a dynamic object-oriented programming language with 84 (description "Ruby is a dynamic object-oriented programming language with
86a focus on simplicity and productivity.") 85a focus on simplicity and productivity.")
diff --git a/gnu/packages/ssh.scm b/gnu/packages/ssh.scm
index c39d5f82bea..79e8077cdf2 100644
--- a/gnu/packages/ssh.scm
+++ b/gnu/packages/ssh.scm
@@ -226,7 +226,7 @@ Additionally, various channel-specific options can be negotiated.")
226 #:parallel-tests? #f)) 226 #:parallel-tests? #f))
227 (native-inputs `(("autoconf" ,autoconf) 227 (native-inputs `(("autoconf" ,autoconf)
228 ("automake" ,automake) 228 ("automake" ,automake)
229 ("libtool" ,libtool "bin") 229 ("libtool" ,libtool)
230 ("texinfo" ,texinfo) 230 ("texinfo" ,texinfo)
231 ("pkg-config" ,pkg-config) 231 ("pkg-config" ,pkg-config)
232 ("which" ,which))) 232 ("which" ,which)))
diff --git a/gnu/packages/swig.scm b/gnu/packages/swig.scm
index ce91df5eda7..a978dec6819 100644
--- a/gnu/packages/swig.scm
+++ b/gnu/packages/swig.scm
@@ -1,5 +1,6 @@
1;;; GNU Guix --- Functional package management for GNU 1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2013 Ludovic Courtès <ludo@gnu.org> 2;;; Copyright © 2013 Ludovic Courtès <ludo@gnu.org>
3;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
3;;; 4;;;
4;;; This file is part of GNU Guix. 5;;; This file is part of GNU Guix.
5;;; 6;;;
@@ -53,6 +54,18 @@
53 ;; The python part probably never worked and does not seem to 54 ;; The python part probably never worked and does not seem to
54 ;; be needed for currently dependent packages. 55 ;; be needed for currently dependent packages.
55;; ("python" ,python-wrapper))) 56;; ("python" ,python-wrapper)))
57 (arguments
58 `(#:phases
59 (alist-cons-before
60 'check 'install-locales
61 (lambda _
62 ;; One of the tests requires the availability of a UTF-8
63 ;; locale and otherwise fails.
64 (setenv "LOCPATH" (getcwd))
65 (zero? (system* "localedef" "--no-archive"
66 "--prefix" (getcwd) "-i" "en_US"
67 "-f" "UTF-8" "./en_US.utf8")))
68 %standard-phases)))
56 (home-page "http://swig.org/") 69 (home-page "http://swig.org/")
57 (synopsis 70 (synopsis
58 "Interface compiler that connects C/C++ code to higher-level languages") 71 "Interface compiler that connects C/C++ code to higher-level languages")
diff --git a/gnu/packages/tcl.scm b/gnu/packages/tcl.scm
index d988249c4ce..67510eb41fa 100644
--- a/gnu/packages/tcl.scm
+++ b/gnu/packages/tcl.scm
@@ -1,6 +1,6 @@
1;;; GNU Guix --- Functional package management for GNU 1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2013, 2014 Ludovic Courtès <ludo@gnu.org> 2;;; Copyright © 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org>
3;;; Copyright © 2014 Mark H Weaver <mhw@netris.org> 3;;; Copyright © 2014, 2015 Mark H Weaver <mhw@netris.org>
4;;; Copyright © 2014 Eric Bavier <bavier@member.fsf.org> 4;;; Copyright © 2014 Eric Bavier <bavier@member.fsf.org>
5;;; 5;;;
6;;; This file is part of GNU Guix. 6;;; This file is part of GNU Guix.
@@ -63,8 +63,10 @@
63 "tclsh"))))) 63 "tclsh")))))
64 %standard-phases)) 64 %standard-phases))
65 65
66 ;; By default, man pages are put in PREFIX/man, 66 ;; By default, man pages are put in PREFIX/man, but we want them in
67 ;; but we want them in PREFIX/share/man. 67 ;; PREFIX/share/man. The 'validate-documentation-location' phase is
68 ;; not able to fix this up because the default install populates both
69 ;; PREFIX/man and PREFIX/share/man.
68 #:configure-flags (list (string-append "--mandir=" 70 #:configure-flags (list (string-append "--mandir="
69 (assoc-ref %outputs "out") 71 (assoc-ref %outputs "out")
70 "/share/man")) 72 "/share/man"))
diff --git a/gnu/packages/texlive.scm b/gnu/packages/texlive.scm
index f14bbb8c068..e3321401c35 100644
--- a/gnu/packages/texlive.scm
+++ b/gnu/packages/texlive.scm
@@ -1,6 +1,7 @@
1;;; GNU Guix --- Functional package management for GNU 1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2013, 2014 Andreas Enge <andreas@enge.fr> 2;;; Copyright © 2013, 2014 Andreas Enge <andreas@enge.fr>
3;;; Copyright © 2014 Eric Bavier <bavier@member.fsf.org> 3;;; Copyright © 2014 Eric Bavier <bavier@member.fsf.org>
4;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
4;;; 5;;;
5;;; This file is part of GNU Guix. 6;;; This file is part of GNU Guix.
6;;; 7;;;
@@ -123,7 +124,7 @@
123 124
124 ;; Disable tests on mips64 to cope with a failure of luajiterr.test. 125 ;; Disable tests on mips64 to cope with a failure of luajiterr.test.
125 ;; XXX FIXME fix luajit properly on mips64. 126 ;; XXX FIXME fix luajit properly on mips64.
126 #:tests? ,(not (equal? "mips64el-linux" (or (%current-target-system) 127 #:tests? ,(not (string-prefix? "mips64" (or (%current-target-system)
127 (%current-system)))) 128 (%current-system))))
128 #:phases 129 #:phases
129 (alist-cons-after 130 (alist-cons-after
diff --git a/gnu/packages/tre.scm b/gnu/packages/tre.scm
index 33d2cff093b..1a1aa02ec9f 100644
--- a/gnu/packages/tre.scm
+++ b/gnu/packages/tre.scm
@@ -1,5 +1,6 @@
1;;; GNU Guix --- Functional package management for GNU 1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright 2014 John Darrington 2;;; Copyright © 2014 John Darrington
3;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
3;;; 4;;;
4;;; This file is part of GNU Guix. 5;;; This file is part of GNU Guix.
5;;; 6;;;
@@ -37,6 +38,17 @@
37 (base32 "0n36cgqys59r2gmb7jzbqiwsy790v8nbxk82d2n2saz0rp145ild")))) 38 (base32 "0n36cgqys59r2gmb7jzbqiwsy790v8nbxk82d2n2saz0rp145ild"))))
38 39
39 (build-system gnu-build-system) 40 (build-system gnu-build-system)
41 (arguments
42 `(#:phases (alist-cons-before
43 'check 'install-locales
44 (lambda _
45 ;; The tests require the availability of the
46 ;; 'en_US.ISO-8859-1' locale.
47 (setenv "LOCPATH" (getcwd))
48 (zero? (system* "localedef" "--no-archive"
49 "--prefix" (getcwd) "-i" "en_US"
50 "-f" "ISO-8859-1" "./en_US.ISO-8859-1")))
51 %standard-phases)))
40 (synopsis "Approximate regex matching library and agrep utility") 52 (synopsis "Approximate regex matching library and agrep utility")
41 (description "Superset of the POSIX regex API, enabling approximate 53 (description "Superset of the POSIX regex API, enabling approximate
42matching. Also ships a version of the agrep utility which behaves similar to 54matching. Also ships a version of the agrep utility which behaves similar to
diff --git a/gnu/packages/version-control.scm b/gnu/packages/version-control.scm
index 53e3be7ba97..59ca1664165 100644
--- a/gnu/packages/version-control.scm
+++ b/gnu/packages/version-control.scm
@@ -696,7 +696,7 @@ accessed and migrated on modern systems.")
696 (inputs 696 (inputs
697 `(("e2fsprogs" ,e2fsprogs) 697 `(("e2fsprogs" ,e2fsprogs)
698 ("curl" ,curl) 698 ("curl" ,curl)
699 ("file" ,file-5.20) ;work around CVE-2014-3710 699 ("file" ,file)
700 ("libxml2" ,libxml2) 700 ("libxml2" ,libxml2)
701 ("zlib" ,zlib) 701 ("zlib" ,zlib)
702 ("gettext" ,gnu-gettext))) 702 ("gettext" ,gnu-gettext)))
diff --git a/gnu/packages/web.scm b/gnu/packages/web.scm
index 1ff3dfb5a5a..554f2a3ae4d 100644
--- a/gnu/packages/web.scm
+++ b/gnu/packages/web.scm
@@ -1,7 +1,7 @@
1;;; GNU Guix --- Functional package management for GNU 1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2013 Andreas Enge <andreas@enge.fr> 2;;; Copyright © 2013 Andreas Enge <andreas@enge.fr>
3;;; Copyright © 2013 Aljosha Papsch <misc@rpapsch.de> 3;;; Copyright © 2013 Aljosha Papsch <misc@rpapsch.de>
4;;; Copyright © 2014 Ludovic Courtès <ludo@gnu.org> 4;;; Copyright © 2014, 2015 Ludovic Courtès <ludo@gnu.org>
5;;; Copyright © 2014 Mark H Weaver <mhw@netris.org> 5;;; Copyright © 2014 Mark H Weaver <mhw@netris.org>
6;;; 6;;;
7;;; This file is part of GNU Guix. 7;;; This file is part of GNU Guix.
@@ -231,8 +231,7 @@ for efficient socket-like bidirectional reliable communication channels.")
231 ("automake" ,automake) 231 ("automake" ,automake)
232 ("gettext" ,gnu-gettext) 232 ("gettext" ,gnu-gettext)
233 ("which" ,which) 233 ("which" ,which)
234 ("libtool" ,libtool) 234 ("libtool" ,libtool)))
235 ("libtool" ,libtool "bin")))
236 (arguments 235 (arguments
237 `(#:phases (alist-cons-before 236 `(#:phases (alist-cons-before
238 'bootstrap 'fix-autogen-shebang 237 'bootstrap 'fix-autogen-shebang
@@ -644,16 +643,7 @@ help you implement simple HTTP servers.")
644 ;; Uncommenting the next two lines may assist in debugging 643 ;; Uncommenting the next two lines may assist in debugging
645 ;; (substitute* "docs/man5/Makefile" (("a2x") "a2x -v")) 644 ;; (substitute* "docs/man5/Makefile" (("a2x") "a2x -v"))
646 ;; (setenv "XML_DEBUG_CATALOG" "1") 645 ;; (setenv "XML_DEBUG_CATALOG" "1")
647 646 #t)
648 (setenv "XML_CATALOG_FILES"
649 (string-append
650 (assoc-ref inputs "docbook-xsl")
651 "/xml/xsl/docbook-xsl-1.78.1/catalog.xml"
652 ;; Contrary to the documentation, the file names must
653 ;; be separated by a space, not a colon.
654 " "
655 (assoc-ref inputs "docbook-xml")
656 "/xml/dtd/docbook/catalog.xml")))
657 %standard-phases))) 647 %standard-phases)))
658 ;; All of the below are used to generate the documentation 648 ;; All of the below are used to generate the documentation
659 ;; (Should they be propagated inputs of asciidoc ??) 649 ;; (Should they be propagated inputs of asciidoc ??)
diff --git a/gnu/packages/weechat.scm b/gnu/packages/weechat.scm
index 5555601d473..a2e53481c3b 100644
--- a/gnu/packages/weechat.scm
+++ b/gnu/packages/weechat.scm
@@ -58,12 +58,12 @@
58 ("pkg-config" ,pkg-config) 58 ("pkg-config" ,pkg-config)
59 ("file" ,file) 59 ("file" ,file)
60 ("autogen" ,autogen) 60 ("autogen" ,autogen)
61 ("automake" ,automake))) 61 ("automake" ,automake)
62 ("libtool" ,libtool)))
62 (inputs `(("ncurses" ,ncurses) 63 (inputs `(("ncurses" ,ncurses)
63 ("diffutils" ,diffutils) 64 ("diffutils" ,diffutils)
64 ("gettext" ,gnu-gettext) 65 ("gettext" ,gnu-gettext)
65 ("libtool" ,libtool "bin") 66 ("libltdl" ,libltdl)
66 ("libtool" ,libtool "out")
67 ("libgcrypt" ,libgcrypt "out") 67 ("libgcrypt" ,libgcrypt "out")
68 ("zlib" ,zlib) 68 ("zlib" ,zlib)
69 ("aspell" ,aspell) 69 ("aspell" ,aspell)
diff --git a/gnu/packages/xfce.scm b/gnu/packages/xfce.scm
index 2b15c3e35c3..17b2b4d9f77 100644
--- a/gnu/packages/xfce.scm
+++ b/gnu/packages/xfce.scm
@@ -267,7 +267,7 @@ management D-Bus specification.")
267 (native-search-paths 267 (native-search-paths
268 (list (search-path-specification 268 (list (search-path-specification
269 (variable "X_XFCE4_LIB_DIRS") 269 (variable "X_XFCE4_LIB_DIRS")
270 (directories '("lib/xfce4"))))) 270 (files '("lib/xfce4")))))
271 (home-page "http://www.xfce.org/") 271 (home-page "http://www.xfce.org/")
272 (synopsis "Xfce desktop panel") 272 (synopsis "Xfce desktop panel")
273 (description 273 (description
diff --git a/gnu/packages/xiph.scm b/gnu/packages/xiph.scm
index 77b732ba359..e6700c4c27c 100644
--- a/gnu/packages/xiph.scm
+++ b/gnu/packages/xiph.scm
@@ -202,12 +202,7 @@ OpenBSD's sndio.")
202 "1p0hh190kqvpkbk1bbajd81jfbmkyl4fn2i7pggk2zppq6m68bgs")))) 202 "1p0hh190kqvpkbk1bbajd81jfbmkyl4fn2i7pggk2zppq6m68bgs"))))
203 (build-system gnu-build-system) 203 (build-system gnu-build-system)
204 (arguments 204 (arguments
205 `(#:parallel-tests? #f 205 `(#:parallel-tests? #f))
206 ;; By default, man pages are put in PREFIX/man,
207 ;; but we want them in PREFIX/share/man.
208 #:configure-flags (list (string-append "--mandir="
209 (assoc-ref %outputs "out")
210 "/share/man"))))
211 ;; FIXME: configure also looks for xmms, input could be added once it exists 206 ;; FIXME: configure also looks for xmms, input could be added once it exists
212 (inputs `(("libogg" ,libogg))) 207 (inputs `(("libogg" ,libogg)))
213 (synopsis "Free lossless audio codec") 208 (synopsis "Free lossless audio codec")
diff --git a/gnu/packages/xml.scm b/gnu/packages/xml.scm
index 76366db58cb..f2b3baa418c 100644
--- a/gnu/packages/xml.scm
+++ b/gnu/packages/xml.scm
@@ -1,5 +1,5 @@
1;;; GNU Guix --- Functional package management for GNU 1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2013, 2014 Ludovic Courtès <ludo@gnu.org> 2;;; Copyright © 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org>
3;;; Copyright © 2013 Andreas Enge <andreas@enge.fr> 3;;; Copyright © 2013 Andreas Enge <andreas@enge.fr>
4;;; 4;;;
5;;; This file is part of GNU Guix. 5;;; This file is part of GNU Guix.
@@ -68,6 +68,18 @@ things the parser might find in the XML document (like start tags).")
68 (inputs `(("zlib" ,zlib))) 68 (inputs `(("zlib" ,zlib)))
69 (native-inputs `(("perl" ,perl) 69 (native-inputs `(("perl" ,perl)
70 ("python" ,python-2))) ; incompatible with Python 3 (print syntax) 70 ("python" ,python-2))) ; incompatible with Python 3 (print syntax)
71
72
73 ;; $XML_CATALOG_FILES lists 'catalog.xml' files found in under the 'xml'
74 ;; sub-directory of any given package.
75 (native-search-paths (list (search-path-specification
76 (variable "XML_CATALOG_FILES")
77 (separator " ")
78 (files '("xml"))
79 (file-pattern "^catalog\\.xml$")
80 (file-type 'regular))))
81 (search-paths native-search-paths)
82
71 (arguments 83 (arguments
72 `(#:phases 84 `(#:phases
73 (alist-replace 85 (alist-replace
diff --git a/gnu/packages/xorg.scm b/gnu/packages/xorg.scm
index e898c1c935a..ff4488b8ef3 100644
--- a/gnu/packages/xorg.scm
+++ b/gnu/packages/xorg.scm
@@ -4400,7 +4400,7 @@ kernel mode setting (KMS).")
4400(define-public xorg-server 4400(define-public xorg-server
4401 (package 4401 (package
4402 (name "xorg-server") 4402 (name "xorg-server")
4403 (version "1.16.2.901") 4403 (version "1.16.3")
4404 (source 4404 (source
4405 (origin 4405 (origin
4406 (method url-fetch) 4406 (method url-fetch)
@@ -4409,7 +4409,7 @@ kernel mode setting (KMS).")
4409 name "-" version ".tar.bz2")) 4409 name "-" version ".tar.bz2"))
4410 (sha256 4410 (sha256
4411 (base32 4411 (base32
4412 "19jb8v26wc332ramwjdg5vjh3s36kr7n46s6fdfaxrj1wif5m27g")))) 4412 "1yxhc3aw2cadf77w48d2glc5j6w6hairiskfiys7h45g70r483sy"))))
4413 (build-system gnu-build-system) 4413 (build-system gnu-build-system)
4414 (propagated-inputs 4414 (propagated-inputs
4415 `(("dri2proto" ,dri2proto) 4415 `(("dri2proto" ,dri2proto)
diff --git a/guix/build/gnu-build-system.scm b/guix/build/gnu-build-system.scm
index 17fa7afd8d0..2880168273f 100644
--- a/guix/build/gnu-build-system.scm
+++ b/guix/build/gnu-build-system.scm
@@ -1,5 +1,5 @@
1;;; GNU Guix --- Functional package management for GNU 1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2012, 2013, 2014 Ludovic Courtès <ludo@gnu.org> 2;;; Copyright © 2012, 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org>
3;;; 3;;;
4;;; This file is part of GNU Guix. 4;;; This file is part of GNU Guix.
5;;; 5;;;
@@ -20,6 +20,7 @@
20 #:use-module (guix build utils) 20 #:use-module (guix build utils)
21 #:use-module (ice-9 ftw) 21 #:use-module (ice-9 ftw)
22 #:use-module (ice-9 match) 22 #:use-module (ice-9 match)
23 #:use-module (ice-9 regex)
23 #:use-module (ice-9 format) 24 #:use-module (ice-9 format)
24 #:use-module (srfi srfi-1) 25 #:use-module (srfi srfi-1)
25 #:use-module (srfi srfi-26) 26 #:use-module (srfi srfi-26)
@@ -72,19 +73,23 @@
72 input-directories))) 73 input-directories)))
73 74
74 (for-each (match-lambda 75 (for-each (match-lambda
75 ((env-var (directories ...) separator) 76 ((env-var (files ...) separator type pattern)
76 (set-path-environment-variable env-var directories 77 (set-path-environment-variable env-var files
77 input-directories 78 input-directories
78 #:separator separator))) 79 #:separator separator
80 #:type type
81 #:pattern pattern)))
79 search-paths) 82 search-paths)
80 83
81 (when native-search-paths 84 (when native-search-paths
82 ;; Search paths for native inputs, when cross building. 85 ;; Search paths for native inputs, when cross building.
83 (for-each (match-lambda 86 (for-each (match-lambda
84 ((env-var (directories ...) separator) 87 ((env-var (files ...) separator type pattern)
85 (set-path-environment-variable env-var directories 88 (set-path-environment-variable env-var files
86 native-input-directories 89 native-input-directories
87 #:separator separator))) 90 #:separator separator
91 #:type type
92 #:pattern pattern)))
88 native-search-paths)) 93 native-search-paths))
89 94
90 #t) 95 #t)
@@ -110,29 +115,15 @@ working directory."
110(define* (patch-usr-bin-file #:key native-inputs inputs 115(define* (patch-usr-bin-file #:key native-inputs inputs
111 (patch-/usr/bin/file? #t) 116 (patch-/usr/bin/file? #t)
112 #:allow-other-keys) 117 #:allow-other-keys)
113 "Patch occurrences of /usr/bin/file in configure, if present." 118 "Patch occurrences of \"/usr/bin/file\" in all the executable 'configure'
119files found in the source tree. This works around Libtool's Autoconf macros,
120which generates invocations of \"/usr/bin/file\" that are used to determine
121things like the ABI being used."
114 (when patch-/usr/bin/file? 122 (when patch-/usr/bin/file?
115 (let ((file "configure") 123 (for-each (lambda (file)
116 (file-command (or (and=> (assoc-ref (or native-inputs inputs) "file") 124 (when (executable-file? file)
117 (cut string-append <> "/bin/file")) 125 (patch-/usr/bin/file file)))
118 (which "file")))) 126 (find-files "." "^configure$")))
119 (cond ((not (file-exists? file))
120 (format (current-error-port)
121 "patch-usr-bin-file: warning: `~a' not found~%"
122 file))
123 ((not file-command)
124 (format (current-error-port)
125 "patch-usr-bin-file: warning: `file' not found in PATH~%"))
126 (else
127 (let ((st (stat file)))
128 (substitute* file
129 (("/usr/bin/file")
130 (begin
131 (format (current-error-port)
132 "patch-usr-bin-file: ~a: changing `~a' to `~a'~%"
133 file "/usr/bin/file" file-command)
134 file-command)))
135 (set-file-time file st))))))
136 #t) 127 #t)
137 128
138(define* (patch-source-shebangs #:key source #:allow-other-keys) 129(define* (patch-source-shebangs #:key source #:allow-other-keys)
@@ -236,18 +227,11 @@ makefiles."
236 (string-append srcdir "/configure") 227 (string-append srcdir "/configure")
237 flags)))) 228 flags))))
238 229
239(define %parallel-job-count
240 ;; String to be passed next to GNU Make's `-j' argument.
241 (match (getenv "NIX_BUILD_CORES")
242 (#f "1")
243 ("0" (number->string (current-processor-count)))
244 (x x)))
245
246(define* (build #:key (make-flags '()) (parallel-build? #t) 230(define* (build #:key (make-flags '()) (parallel-build? #t)
247 #:allow-other-keys) 231 #:allow-other-keys)
248 (zero? (apply system* "make" 232 (zero? (apply system* "make"
249 `(,@(if parallel-build? 233 `(,@(if parallel-build?
250 `("-j" ,%parallel-job-count) 234 `("-j" ,(number->string (parallel-job-count)))
251 '()) 235 '())
252 ,@make-flags)))) 236 ,@make-flags))))
253 237
@@ -257,7 +241,7 @@ makefiles."
257 (if tests? 241 (if tests?
258 (zero? (apply system* "make" test-target 242 (zero? (apply system* "make" test-target
259 `(,@(if parallel-tests? 243 `(,@(if parallel-tests?
260 `("-j" ,%parallel-job-count) 244 `("-j" ,(number->string (parallel-job-count)))
261 '()) 245 '())
262 ,@make-flags))) 246 ,@make-flags)))
263 (begin 247 (begin
@@ -267,7 +251,7 @@ makefiles."
267(define* (install #:key (make-flags '()) #:allow-other-keys) 251(define* (install #:key (make-flags '()) #:allow-other-keys)
268 (zero? (apply system* "make" "install" make-flags))) 252 (zero? (apply system* "make" "install" make-flags)))
269 253
270(define* (patch-shebangs #:key outputs (patch-shebangs? #t) 254(define* (patch-shebangs #:key inputs outputs (patch-shebangs? #t)
271 #:allow-other-keys) 255 #:allow-other-keys)
272 (define (list-of-files dir) 256 (define (list-of-files dir)
273 (map (cut string-append dir "/" <>) 257 (map (cut string-append dir "/" <>)
@@ -276,20 +260,26 @@ makefiles."
276 (eq? 'regular (stat:type s))))) 260 (eq? 'regular (stat:type s)))))
277 '()))) 261 '())))
278 262
279 (define bindirs 263 (define bin-directories
280 (append-map (match-lambda 264 (match-lambda
281 ((_ . dir) 265 ((_ . dir)
282 (list (string-append dir "/bin") 266 (list (string-append dir "/bin")
283 (string-append dir "/sbin")))) 267 (string-append dir "/sbin")))))
284 outputs)) 268
269 (define output-bindirs
270 (append-map bin-directories outputs))
271
272 (define input-bindirs
273 ;; Shebangs should refer to binaries of the target system---i.e., from
274 ;; "inputs", not from "native-inputs".
275 (append-map bin-directories inputs))
285 276
286 (when patch-shebangs? 277 (when patch-shebangs?
287 (let ((path (append bindirs 278 (let ((path (append output-bindirs input-bindirs)))
288 (search-path-as-string->list (getenv "PATH")))))
289 (for-each (lambda (dir) 279 (for-each (lambda (dir)
290 (let ((files (list-of-files dir))) 280 (let ((files (list-of-files dir)))
291 (for-each (cut patch-shebang <> path) files))) 281 (for-each (cut patch-shebang <> path) files)))
292 bindirs))) 282 output-bindirs)))
293 #t) 283 #t)
294 284
295(define* (strip #:key target outputs (strip-binaries? #t) 285(define* (strip #:key target outputs (strip-binaries? #t)
@@ -350,7 +340,9 @@ makefiles."
350 debug-output objcopy-command)) 340 debug-output objcopy-command))
351 (file-system-fold (const #t) 341 (file-system-fold (const #t)
352 (lambda (path stat result) ; leaf 342 (lambda (path stat result) ; leaf
353 (and (or (not debug-output) 343 (and (file-exists? path) ;discard dangling symlinks
344 (or (elf-file? path) (ar-file? path))
345 (or (not debug-output)
354 (make-debug-file path)) 346 (make-debug-file path))
355 (zero? (apply system* strip-command 347 (zero? (apply system* strip-command
356 (append strip-flags (list path)))) 348 (append strip-flags (list path))))
@@ -377,6 +369,85 @@ makefiles."
377 strip-directories))) 369 strip-directories)))
378 outputs)))) 370 outputs))))
379 371
372(define* (validate-documentation-location #:key outputs
373 #:allow-other-keys)
374 "Documentation should go to 'share/info' and 'share/man', not just 'info/'
375and 'man/'. This phase moves directories to the right place if needed."
376 (define (validate-sub-directory output sub-directory)
377 (let ((directory (string-append output "/" sub-directory)))
378 (when (directory-exists? directory)
379 (let ((target (string-append output "/share/" sub-directory)))
380 (format #t "moving '~a' to '~a'~%" directory target)
381 (mkdir-p (dirname target))
382 (rename-file directory target)))))
383
384 (define (validate-output output)
385 (for-each (cut validate-sub-directory output <>)
386 '("man" "info")))
387
388 (match outputs
389 (((names . directories) ...)
390 (for-each validate-output directories)))
391 #t)
392
393(define* (compress-documentation #:key outputs
394 (compress-documentation? #t)
395 (documentation-compressor "gzip")
396 (documentation-compressor-flags
397 '("--best" "--no-name"))
398 (compressed-documentation-extension ".gz")
399 #:allow-other-keys)
400 "When COMPRESS-DOCUMENTATION? is true, compress man pages and Info files
401found in OUTPUTS using DOCUMENTATION-COMPRESSOR, called with
402DOCUMENTATION-COMPRESSOR-FLAGS."
403 (define (retarget-symlink link)
404 (let ((target (readlink link)))
405 (delete-file link)
406 (symlink (string-append target compressed-documentation-extension)
407 link)))
408
409 (define (has-links? file)
410 ;; Return #t if FILE has hard links.
411 (> (stat:nlink (lstat file)) 1))
412
413 (define (maybe-compress-directory directory regexp)
414 (or (not (directory-exists? directory))
415 (match (find-files directory regexp)
416 (() ;nothing to compress
417 #t)
418 ((files ...) ;one or more files
419 (format #t
420 "compressing documentation in '~a' with ~s and flags ~s~%"
421 directory documentation-compressor
422 documentation-compressor-flags)
423 (call-with-values
424 (lambda ()
425 (partition symbolic-link? files))
426 (lambda (symlinks regular-files)
427 ;; Compress the non-symlink files, and adjust symlinks to refer
428 ;; to the compressed files. Leave files that have hard links
429 ;; unchanged ('gzip' would refuse to compress them anyway.)
430 (and (zero? (apply system* documentation-compressor
431 (append documentation-compressor-flags
432 (remove has-links? regular-files))))
433 (every retarget-symlink
434 (filter (cut string-match regexp <>)
435 symlinks)))))))))
436
437 (define (maybe-compress output)
438 (and (maybe-compress-directory (string-append output "/share/man")
439 "\\.[0-9]+$")
440 (maybe-compress-directory (string-append output "/share/info")
441 "\\.info(-[0-9]+)?$")))
442
443 (if compress-documentation?
444 (match outputs
445 (((names . directories) ...)
446 (every maybe-compress directories)))
447 (begin
448 (format #t "not compressing documentation~%")
449 #t)))
450
380(define %standard-phases 451(define %standard-phases
381 ;; Standard build phases, as a list of symbol/procedure pairs. 452 ;; Standard build phases, as a list of symbol/procedure pairs.
382 (let-syntax ((phases (syntax-rules () 453 (let-syntax ((phases (syntax-rules ()
@@ -385,7 +456,9 @@ makefiles."
385 patch-usr-bin-file 456 patch-usr-bin-file
386 patch-source-shebangs configure patch-generated-file-shebangs 457 patch-source-shebangs configure patch-generated-file-shebangs
387 build check install 458 build check install
388 patch-shebangs strip))) 459 patch-shebangs strip
460 validate-documentation-location
461 compress-documentation)))
389 462
390 463
391(define* (gnu-build #:key (source #f) (outputs #f) (inputs #f) 464(define* (gnu-build #:key (source #f) (outputs #f) (inputs #f)
diff --git a/guix/build/utils.scm b/guix/build/utils.scm
index cda4fb12efe..4407f9af230 100644
--- a/guix/build/utils.scm
+++ b/guix/build/utils.scm
@@ -1,5 +1,5 @@
1;;; GNU Guix --- Functional package management for GNU 1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2012, 2013, 2014 Ludovic Courtès <ludo@gnu.org> 2;;; Copyright © 2012, 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org>
3;;; Copyright © 2013 Andreas Enge <andreas@enge.fr> 3;;; Copyright © 2013 Andreas Enge <andreas@enge.fr>
4;;; Copyright © 2013 Nikita Karetnikov <nikita@karetnikov.org> 4;;; Copyright © 2013 Nikita Karetnikov <nikita@karetnikov.org>
5;;; 5;;;
@@ -31,15 +31,21 @@
31 #:re-export (alist-cons 31 #:re-export (alist-cons
32 alist-delete) 32 alist-delete)
33 #:export (%store-directory 33 #:export (%store-directory
34 parallel-job-count
35
34 directory-exists? 36 directory-exists?
35 executable-file? 37 executable-file?
38 symbolic-link?
36 call-with-ascii-input-file 39 call-with-ascii-input-file
40 elf-file?
41 ar-file?
37 with-directory-excursion 42 with-directory-excursion
38 mkdir-p 43 mkdir-p
39 copy-recursively 44 copy-recursively
40 delete-file-recursively 45 delete-file-recursively
41 find-files 46 find-files
42 47
48 search-path-as-list
43 set-path-environment-variable 49 set-path-environment-variable
44 search-path-as-string->list 50 search-path-as-string->list
45 list->search-path-as-string 51 list->search-path-as-string
@@ -55,6 +61,7 @@
55 set-file-time 61 set-file-time
56 patch-shebang 62 patch-shebang
57 patch-makefile-SHELL 63 patch-makefile-SHELL
64 patch-/usr/bin/file
58 fold-port-matches 65 fold-port-matches
59 remove-store-references 66 remove-store-references
60 wrap-program)) 67 wrap-program))
@@ -69,6 +76,14 @@
69 (or (getenv "NIX_STORE") 76 (or (getenv "NIX_STORE")
70 "/gnu/store")) 77 "/gnu/store"))
71 78
79(define parallel-job-count
80 ;; Number of processes to be passed next to GNU Make's `-j' argument.
81 (make-parameter
82 (match (getenv "NIX_BUILD_CORES") ;set by the daemon
83 (#f 1)
84 ("0" (current-processor-count))
85 (x (or (string->number x) 1)))))
86
72(define (directory-exists? dir) 87(define (directory-exists? dir)
73 "Return #t if DIR exists and is a directory." 88 "Return #t if DIR exists and is a directory."
74 (let ((s (stat dir #f))) 89 (let ((s (stat dir #f)))
@@ -81,6 +96,10 @@
81 (and s 96 (and s
82 (not (zero? (logand (stat:mode s) #o100)))))) 97 (not (zero? (logand (stat:mode s) #o100))))))
83 98
99(define (symbolic-link? file)
100 "Return #t if FILE is a symbolic link (aka. \"symlink\".)"
101 (eq? (stat:type (lstat file)) 'symlink))
102
84(define (call-with-ascii-input-file file proc) 103(define (call-with-ascii-input-file file proc)
85 "Open FILE as an ASCII or binary file, and pass the resulting port to 104 "Open FILE as an ASCII or binary file, and pass the resulting port to
86PROC. FILE is closed when PROC's dynamic extent is left. Return the 105PROC. FILE is closed when PROC's dynamic extent is left. Return the
@@ -96,6 +115,42 @@ return values of applying PROC to the port."
96 (lambda () 115 (lambda ()
97 (close-input-port port))))) 116 (close-input-port port)))))
98 117
118(define (file-header-match header)
119 "Return a procedure that returns true when its argument is a file starting
120with the bytes in HEADER, a bytevector."
121 (define len
122 (bytevector-length header))
123
124 (lambda (file)
125 "Return true if FILE starts with the right magic bytes."
126 (define (get-header)
127 (call-with-input-file file
128 (lambda (port)
129 (get-bytevector-n port len))
130 #:binary #t #:guess-encoding #f))
131
132 (catch 'system-error
133 (lambda ()
134 (equal? (get-header) header))
135 (lambda args
136 (if (= EISDIR (system-error-errno args))
137 #f ;FILE is a directory
138 (apply throw args))))))
139
140(define %elf-magic-bytes
141 ;; Magic bytes of ELF files. See <elf.h>.
142 (u8-list->bytevector (map char->integer (string->list "\x7FELF"))))
143
144(define elf-file?
145 (file-header-match %elf-magic-bytes))
146
147(define %ar-magic-bytes
148 ;; Magic bytes of archives created by 'ar'. See <ar.h>.
149 (u8-list->bytevector (map char->integer (string->list "!<arch>\n"))))
150
151(define ar-file?
152 (file-header-match %ar-magic-bytes))
153
99(define-syntax-rule (with-directory-excursion dir body ...) 154(define-syntax-rule (with-directory-excursion dir body ...)
100 "Run BODY with DIR as the process's current directory." 155 "Run BODY with DIR as the process's current directory."
101 (let ((init (getcwd))) 156 (let ((init (getcwd)))
@@ -237,23 +292,37 @@ matches REGEXP."
237;;; Search paths. 292;;; Search paths.
238;;; 293;;;
239 294
240(define (search-path-as-list sub-directories input-dirs) 295(define* (search-path-as-list files input-dirs
241 "Return the list of directories among SUB-DIRECTORIES that exist in 296 #:key (type 'directory) pattern)
242INPUT-DIRS. Example: 297 "Return the list of directories among FILES of the given TYPE (a symbol as
298returned by 'stat:type') that exist in INPUT-DIRS. Example:
243 299
244 (search-path-as-list '(\"share/emacs/site-lisp\" \"share/emacs/24.1\") 300 (search-path-as-list '(\"share/emacs/site-lisp\" \"share/emacs/24.1\")
245 (list \"/package1\" \"/package2\" \"/package3\")) 301 (list \"/package1\" \"/package2\" \"/package3\"))
246 => (\"/package1/share/emacs/site-lisp\" 302 => (\"/package1/share/emacs/site-lisp\"
247 \"/package3/share/emacs/site-lisp\") 303 \"/package3/share/emacs/site-lisp\")
248 304
305When PATTERN is true, it is a regular expression denoting file names to look
306for under the directories designated by FILES. For example:
307
308 (search-path-as-list '(\"xml\") (list docbook-xml docbook-xsl)
309 #:type 'regular
310 #:pattern \"^catalog\\\\.xml$\")
311 => (\"/…/xml/dtd/docbook/catalog.xml\"
312 \"/…/xml/xsl/docbook-xsl-1.78.1/catalog.xml\")
249" 313"
250 (append-map (lambda (input) 314 (append-map (lambda (input)
251 (filter-map (lambda (dir) 315 (append-map (lambda (file)
252 (let ((dir (string-append input "/" 316 (let ((file (string-append input "/" file)))
253 dir))) 317 ;; XXX: By using 'find-files', we implicitly
254 (and (directory-exists? dir) 318 ;; assume #:type 'regular.
255 dir))) 319 (if pattern
256 sub-directories)) 320 (find-files file pattern)
321 (let ((stat (stat file #f)))
322 (if (and stat (eq? type (stat:type stat)))
323 (list file)
324 '())))))
325 files))
257 input-dirs)) 326 input-dirs))
258 327
259(define (list->search-path-as-string lst separator) 328(define (list->search-path-as-string lst separator)
@@ -262,16 +331,31 @@ INPUT-DIRS. Example:
262(define* (search-path-as-string->list path #:optional (separator #\:)) 331(define* (search-path-as-string->list path #:optional (separator #\:))
263 (string-tokenize path (char-set-complement (char-set separator)))) 332 (string-tokenize path (char-set-complement (char-set separator))))
264 333
265(define* (set-path-environment-variable env-var sub-directories input-dirs 334(define* (set-path-environment-variable env-var files input-dirs
266 #:key (separator ":")) 335 #:key
267 "Look for each of SUB-DIRECTORIES in INPUT-DIRS. Set ENV-VAR to a 336 (separator ":")
268SEPARATOR-separated path accordingly. Example: 337 (type 'directory)
338 pattern)
339 "Look for each of FILES of the given TYPE (a symbol as returned by
340'stat:type') in INPUT-DIRS. Set ENV-VAR to a SEPARATOR-separated path
341accordingly. Example:
269 342
270 (set-path-environment-variable \"PKG_CONFIG\" 343 (set-path-environment-variable \"PKG_CONFIG\"
271 '(\"lib/pkgconfig\") 344 '(\"lib/pkgconfig\")
272 (list package1 package2)) 345 (list package1 package2))
346
347When PATTERN is not #f, it must be a regular expression (really a string)
348denoting file names to look for under the directories designated by FILES:
349
350 (set-path-environment-variable \"XML_CATALOG_FILES\"
351 '(\"xml\")
352 (list docbook-xml docbook-xsl)
353 #:type 'regular
354 #:pattern \"^catalog\\\\.xml$\")
273" 355"
274 (let* ((path (search-path-as-list sub-directories input-dirs)) 356 (let* ((path (search-path-as-list files input-dirs
357 #:type type
358 #:pattern pattern))
275 (value (list->search-path-as-string path separator))) 359 (value (list->search-path-as-string path separator)))
276 (if (string-null? value) 360 (if (string-null? value)
277 (begin 361 (begin
@@ -365,10 +449,11 @@ PROC's result is returned."
365 (false-if-exception (delete-file template)))))) 449 (false-if-exception (delete-file template))))))
366 450
367(define (substitute file pattern+procs) 451(define (substitute file pattern+procs)
368 "PATTERN+PROCS is a list of regexp/two-argument procedure. For each line 452 "PATTERN+PROCS is a list of regexp/two-argument-procedure pairs. For each
369of FILE, and for each PATTERN that it matches, call the corresponding PROC 453line of FILE, and for each PATTERN that it matches, call the corresponding
370as (PROC LINE MATCHES); PROC must return the line that will be written as a 454PROC as (PROC LINE MATCHES); PROC must return the line that will be written as
371substitution of the original line." 455a substitution of the original line. Be careful about using '$' to match the
456end of a line; by itself it won't match the terminating newline of a line."
372 (let ((rx+proc (map (match-lambda 457 (let ((rx+proc (map (match-lambda
373 (((? regexp? pattern) . proc) 458 (((? regexp? pattern) . proc)
374 (cons pattern proc)) 459 (cons pattern proc))
@@ -428,7 +513,10 @@ When one of the MATCH-VAR is `_', no variable is bound to the corresponding
428match substring. 513match substring.
429 514
430Alternatively, FILE may be a list of file names, in which case they are 515Alternatively, FILE may be a list of file names, in which case they are
431all subject to the substitutions." 516all subject to the substitutions.
517
518Be careful about using '$' to match the end of a line; by itself it won't
519match the terminating newline of a line."
432 ((substitute* file ((regexp match-var ...) body ...) ...) 520 ((substitute* file ((regexp match-var ...) body ...) ...)
433 (let () 521 (let ()
434 (define (substitute-one-file file-name) 522 (define (substitute-one-file file-name)
@@ -572,9 +660,7 @@ When KEEP-MTIME? is true, the atime/mtime of FILE are kept unchanged."
572 ;; XXX: Unlike with `patch-shebang', FILE is always touched. 660 ;; XXX: Unlike with `patch-shebang', FILE is always touched.
573 661
574 (define (find-shell name) 662 (define (find-shell name)
575 (let ((shell 663 (let ((shell (which name)))
576 (search-path (search-path-as-string->list (getenv "PATH"))
577 name)))
578 (unless shell 664 (unless shell
579 (format (current-error-port) 665 (format (current-error-port)
580 "patch-makefile-SHELL: warning: no binary for shell `~a' found in $PATH~%" 666 "patch-makefile-SHELL: warning: no binary for shell `~a' found in $PATH~%"
@@ -583,7 +669,7 @@ When KEEP-MTIME? is true, the atime/mtime of FILE are kept unchanged."
583 669
584 (let ((st (stat file))) 670 (let ((st (stat file)))
585 (substitute* file 671 (substitute* file
586 (("^ *SHELL[[:blank:]]*=[[:blank:]]*([[:graph:]]*/)([[:graph:]]+)(.*)$" 672 (("^ *SHELL[[:blank:]]*:?=[[:blank:]]*([[:graph:]]*/)([[:graph:]]+)(.*)$"
587 _ dir shell args) 673 _ dir shell args)
588 (let* ((old (string-append dir shell)) 674 (let* ((old (string-append dir shell))
589 (new (or (find-shell shell) old))) 675 (new (or (find-shell shell) old)))
@@ -596,6 +682,29 @@ When KEEP-MTIME? is true, the atime/mtime of FILE are kept unchanged."
596 (when keep-mtime? 682 (when keep-mtime?
597 (set-file-time file st)))) 683 (set-file-time file st))))
598 684
685(define* (patch-/usr/bin/file file
686 #:key
687 (file-command (which "file"))
688 (keep-mtime? #t))
689 "Patch occurrences of \"/usr/bin/file\" in FILE, replacing them with
690FILE-COMMAND. When KEEP-MTIME? is true, keep FILE's modification time
691unchanged."
692 (if (not file-command)
693 (format (current-error-port)
694 "patch-/usr/bin/file: warning: \
695no replacement 'file' command, doing nothing~%")
696 (let ((st (stat file)))
697 (substitute* file
698 (("/usr/bin/file")
699 (begin
700 (format (current-error-port)
701 "patch-/usr/bin/file: ~a: changing `~a' to `~a'~%"
702 file "/usr/bin/file" file-command)
703 file-command)))
704
705 (when keep-mtime?
706 (set-file-time file st)))))
707
599(define* (fold-port-matches proc init pattern port 708(define* (fold-port-matches proc init pattern port
600 #:optional (unmatched (lambda (_ r) r))) 709 #:optional (unmatched (lambda (_ r) r)))
601 "Read from PORT character-by-character; for each match against 710 "Read from PORT character-by-character; for each match against
@@ -707,7 +816,7 @@ contents:
707 #!location/of/bin/bash 816 #!location/of/bin/bash
708 export PATH=\"/gnu/.../bar/bin\" 817 export PATH=\"/gnu/.../bar/bin\"
709 export CERT_PATH=\"$CERT_PATH${CERT_PATH:+:}/gnu/.../baz/certs:/qux/certs\" 818 export CERT_PATH=\"$CERT_PATH${CERT_PATH:+:}/gnu/.../baz/certs:/qux/certs\"
710 exec location/of/.foo-real 819 exec -a location/of/foo location/of/.foo-real \"$@\"
711 820
712This is useful for scripts that expect particular programs to be in $PATH, for 821This is useful for scripts that expect particular programs to be in $PATH, for
713programs that expect particular shared libraries to be in $LD_LIBRARY_PATH, or 822programs that expect particular shared libraries to be in $LD_LIBRARY_PATH, or
@@ -731,6 +840,7 @@ the previous wrapper."
731 (copy-file prog prog-real) 840 (copy-file prog prog-real)
732 prog-real) 841 prog-real)
733 (wrapper-file-name number))) 842 (wrapper-file-name number)))
843
734 (let* ((number (next-wrapper-number)) 844 (let* ((number (next-wrapper-number))
735 (target (wrapper-target number)) 845 (target (wrapper-target number))
736 (wrapper (wrapper-file-name (1+ number))) 846 (wrapper (wrapper-file-name (1+ number)))
@@ -760,10 +870,11 @@ the previous wrapper."
760 (with-output-to-file prog-tmp 870 (with-output-to-file prog-tmp
761 (lambda () 871 (lambda ()
762 (format #t 872 (format #t
763 "#!~a~%~a~%exec \"~a\" \"$@\"~%" 873 "#!~a~%~a~%exec -a \"~a\" \"~a\" \"$@\"~%"
764 (which "bash") 874 (which "bash")
765 (string-join (map export-variable vars) 875 (string-join (map export-variable vars)
766 "\n") 876 "\n")
877 (canonicalize-path prog)
767 (canonicalize-path target)))) 878 (canonicalize-path target))))
768 879
769 (chmod prog-tmp #o755) 880 (chmod prog-tmp #o755)
@@ -773,6 +884,7 @@ the previous wrapper."
773 884
774;;; Local Variables: 885;;; Local Variables:
775;;; eval: (put 'call-with-output-file/atomic 'scheme-indent-function 1) 886;;; eval: (put 'call-with-output-file/atomic 'scheme-indent-function 1)
887;;; eval: (put 'call-with-ascii-input-file 'scheme-indent-function 1)
776;;; eval: (put 'with-throw-handler 'scheme-indent-function 1) 888;;; eval: (put 'with-throw-handler 'scheme-indent-function 1)
777;;; eval: (put 'let-matches 'scheme-indent-function 3) 889;;; eval: (put 'let-matches 'scheme-indent-function 3)
778;;; eval: (put 'with-atomic-file-replacement 'scheme-indent-function 1) 890;;; eval: (put 'with-atomic-file-replacement 'scheme-indent-function 1)
diff --git a/guix/packages.scm b/guix/packages.scm
index 05ba389ad68..db14f9e0b8e 100644
--- a/guix/packages.scm
+++ b/guix/packages.scm
@@ -180,16 +180,21 @@ representation."
180(define-record-type* <search-path-specification> 180(define-record-type* <search-path-specification>
181 search-path-specification make-search-path-specification 181 search-path-specification make-search-path-specification
182 search-path-specification? 182 search-path-specification?
183 (variable search-path-specification-variable) 183 (variable search-path-specification-variable) ;string
184 (directories search-path-specification-directories) 184 (files search-path-specification-files) ;list of strings
185 (separator search-path-specification-separator (default ":"))) 185 (separator search-path-specification-separator ;string
186 (default ":"))
187 (file-type search-path-specification-file-type ;symbol
188 (default 'directory))
189 (file-pattern search-path-specification-file-pattern ;#f | string
190 (default #f)))
186 191
187(define (search-path-specification->sexp spec) 192(define (search-path-specification->sexp spec)
188 "Return an sexp representing SPEC, a <search-path-specification>. The sexp 193 "Return an sexp representing SPEC, a <search-path-specification>. The sexp
189corresponds to the arguments expected by `set-path-environment-variable'." 194corresponds to the arguments expected by `set-path-environment-variable'."
190 (match spec 195 (match spec
191 (($ <search-path-specification> variable directories separator) 196 (($ <search-path-specification> variable files separator type pattern)
192 `(,variable ,directories ,separator)))) 197 `(,variable ,files ,separator ,type ,pattern))))
193 198
194(define %supported-systems 199(define %supported-systems
195 ;; This is the list of system types that are supported. By default, we 200 ;; This is the list of system types that are supported. By default, we
@@ -410,7 +415,10 @@ IMPORTED-MODULES specify modules to use/import for use by SNIPPET."
410 (define (apply-patch input) 415 (define (apply-patch input)
411 (let ((patch* (assoc-ref %build-inputs input))) 416 (let ((patch* (assoc-ref %build-inputs input)))
412 (format (current-error-port) "applying '~a'...~%" patch*) 417 (format (current-error-port) "applying '~a'...~%" patch*)
413 (zero? (system* patch "--batch" ,@flags "--input" patch*)))) 418
419 ;; Use '--force' so that patches that do not apply perfectly are
420 ;; rejected.
421 (zero? (system* patch "--force" ,@flags "--input" patch*))))
414 422
415 (define (first-file directory) 423 (define (first-file directory)
416 ;; Return the name of the first file in DIRECTORY. 424 ;; Return the name of the first file in DIRECTORY.
diff --git a/guix/scripts/environment.scm b/guix/scripts/environment.scm
index af196036d5d..ffa3a097993 100644
--- a/guix/scripts/environment.scm
+++ b/guix/scripts/environment.scm
@@ -45,17 +45,15 @@ path value is appended."
45 (($ <search-path-specification> 45 (($ <search-path-specification>
46 variable directories separator) 46 variable directories separator)
47 (let* ((current (getenv variable)) 47 (let* ((current (getenv variable))
48 (path ((@@ (guix build utils) search-path-as-list) 48 (path (search-path-as-list directories paths))
49 directories paths)) 49 (value (list->search-path-as-string path separator)))
50 (value (list->search-path-as-string path separator)))
51 (proc variable 50 (proc variable
52 (if (and current (not pure?)) 51 (if (and current (not pure?))
53 (string-append value separator current) 52 (string-append value separator current)
54 value))))) 53 value)))))
55 (cons* (search-path-specification 54 (cons* (search-path-specification
56 (variable "PATH") 55 (variable "PATH")
57 (directories '("bin" "sbin")) 56 (files '("bin" "sbin")))
58 (separator ":"))
59 (delete-duplicates 57 (delete-duplicates
60 (append-map package-native-search-paths inputs)))))) 58 (append-map package-native-search-paths inputs))))))
61 59
diff --git a/guix/scripts/package.scm b/guix/scripts/package.scm
index 21dc66cb750..30b0658198e 100644
--- a/guix/scripts/package.scm
+++ b/guix/scripts/package.scm
@@ -29,7 +29,8 @@
29 #:use-module (guix utils) 29 #:use-module (guix utils)
30 #:use-module (guix config) 30 #:use-module (guix config)
31 #:use-module (guix scripts build) 31 #:use-module (guix scripts build)
32 #:use-module ((guix build utils) #:select (directory-exists? mkdir-p)) 32 #:use-module ((guix build utils)
33 #:select (directory-exists? mkdir-p search-path-as-list))
33 #:use-module (ice-9 format) 34 #:use-module (ice-9 format)
34 #:use-module (ice-9 match) 35 #:use-module (ice-9 match)
35 #:use-module (ice-9 regex) 36 #:use-module (ice-9 regex)
@@ -362,19 +363,24 @@ current settings and report only settings not already effective."
362 363
363 (define search-path-definition 364 (define search-path-definition
364 (match-lambda 365 (match-lambda
365 (($ <search-path-specification> variable directories separator) 366 (($ <search-path-specification> variable files separator
366 (let ((values (or (and=> (getenv variable) 367 type pattern)
367 (cut string-tokenize* <> separator)) 368 (let* ((values (or (and=> (getenv variable)
368 '())) 369 (cut string-tokenize* <> separator))
369 (directories (filter file-exists? 370 '()))
370 (map (cut string-append profile 371 ;; Add a trailing slash to force symlinks to be treated as
371 "/" <>) 372 ;; directories when 'find-files' traverses them.
372 directories)))) 373 (files (if pattern
373 (if (every (cut member <> values) directories) 374 (map (cut string-append <> "/") files)
375 files))
376 (path (search-path-as-list files (list profile)
377 #:type type
378 #:pattern pattern)))
379 (if (every (cut member <> values) path)
374 #f 380 #f
375 (format #f "export ~a=\"~a\"" 381 (format #f "export ~a=\"~a\""
376 variable 382 variable
377 (string-join directories separator))))))) 383 (string-join path separator)))))))
378 384
379 (let* ((packages (filter-map manifest-entry->package entries)) 385 (let* ((packages (filter-map manifest-entry->package entries))
380 (search-paths (delete-duplicates 386 (search-paths (delete-duplicates
diff --git a/guix/utils.scm b/guix/utils.scm
index d0d2e8a3d44..1c619c3ef96 100644
--- a/guix/utils.scm
+++ b/guix/utils.scm
@@ -1,6 +1,6 @@
1;;; GNU Guix --- Functional package management for GNU 1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2012, 2013, 2014 Ludovic Courtès <ludo@gnu.org> 2;;; Copyright © 2012, 2013, 2014 Ludovic Courtès <ludo@gnu.org>
3;;; Copyright © 2013 Mark H Weaver <mhw@netris.org> 3;;; Copyright © 2013, 2014, 2015 Mark H Weaver <mhw@netris.org>
4;;; Copyright © 2014 Eric Bavier <bavier@member.fsf.org> 4;;; Copyright © 2014 Eric Bavier <bavier@member.fsf.org>
5;;; Copyright © 2014 Ian Denhardt <ian@zenhack.net> 5;;; Copyright © 2014 Ian Denhardt <ian@zenhack.net>
6;;; 6;;;
@@ -61,6 +61,7 @@
61 location-column 61 location-column
62 source-properties->location 62 source-properties->location
63 63
64 nix-system->gnu-triplet
64 gnu-triplet->nix-system 65 gnu-triplet->nix-system
65 %current-system 66 %current-system
66 %current-target-system 67 %current-target-system
@@ -476,6 +477,23 @@ previous value of the keyword argument."
476 (() 477 (()
477 (reverse before))))))) 478 (reverse before)))))))
478 479
480(define* (nix-system->gnu-triplet
481 #:optional (system (%current-system)) (vendor "unknown"))
482 "Return a guess of the GNU triplet corresponding to Nix system
483identifier SYSTEM."
484 (match system
485 ("armhf-linux"
486 (string-append "arm-" vendor "-linux-gnueabihf"))
487 (_
488 (let* ((dash (string-index system #\-))
489 (arch (substring system 0 dash))
490 (os (substring system (+ 1 dash))))
491 (string-append arch
492 "-" vendor "-"
493 (if (string=? os "linux")
494 "linux-gnu"
495 os))))))
496
479(define (gnu-triplet->nix-system triplet) 497(define (gnu-triplet->nix-system triplet)
480 "Return the Nix system type corresponding to TRIPLET, a GNU triplet as 498 "Return the Nix system type corresponding to TRIPLET, a GNU triplet as
481returned by `config.guess'." 499returned by `config.guess'."
@@ -484,7 +502,9 @@ returned by `config.guess'."
484 (lambda (m) 502 (lambda (m)
485 (string-append "i686-" (match:substring m 1)))) 503 (string-append "i686-" (match:substring m 1))))
486 (else triplet)))) 504 (else triplet))))
487 (cond ((string-match "^([^-]+)-([^-]+-)?linux-gnu.*" triplet) 505 (cond ((string-match "^arm[^-]*-([^-]+-)?linux-gnueabihf" triplet)
506 "armhf-linux")
507 ((string-match "^([^-]+)-([^-]+-)?linux-gnu.*" triplet)
488 => 508 =>
489 (lambda (m) 509 (lambda (m)
490 ;; Nix omits `-gnu' for GNU/Linux. 510 ;; Nix omits `-gnu' for GNU/Linux.
diff --git a/m4/guix.m4 b/m4/guix.m4
index 19e041a72c6..d4415598b04 100644
--- a/m4/guix.m4
+++ b/m4/guix.m4
@@ -1,5 +1,6 @@
1dnl GNU Guix --- Functional package management for GNU 1dnl GNU Guix --- Functional package management for GNU
2dnl Copyright © 2012, 2013, 2014 Ludovic Courtès <ludo@gnu.org> 2dnl Copyright © 2012, 2013, 2014 Ludovic Courtès <ludo@gnu.org>
3dnl Copyright © 2014 Mark H Weaver <mhw@netris.org>
3dnl 4dnl
4dnl This file is part of GNU Guix. 5dnl This file is part of GNU Guix.
5dnl 6dnl
@@ -50,6 +51,16 @@ AC_DEFUN([GUIX_SYSTEM_TYPE], [
50 machine_name="i686";; 51 machine_name="i686";;
51 amd64) 52 amd64)
52 machine_name="x86_64";; 53 machine_name="x86_64";;
54 arm*)
55 # TODO: If not cross-compiling, add a sanity check to make
56 # sure this build machine has the needed features to
57 # support executables compiled using our armhf gcc,
58 # configured with:
59 # --with-arch=armv7-a
60 # --with-float=hard
61 # --with-mode=thumb
62 # --with-fpu=vfpv3-d16
63 machine_name="armhf";;
53 *) 64 *)
54 machine_name="$host_cpu";; 65 machine_name="$host_cpu";;
55 esac 66 esac
@@ -86,7 +97,7 @@ courageous and port the GNU System distribution to it (see
86 # Currently only Linux-based systems are supported, and only on some 97 # Currently only Linux-based systems are supported, and only on some
87 # platforms. 98 # platforms.
88 case "$guix_system" in 99 case "$guix_system" in
89 x86_64-linux|i686-linux|mips64el-linux) 100 x86_64-linux|i686-linux|armhf-linux|mips64el-linux)
90 ;; 101 ;;
91 *) 102 *)
92 if test "x$guix_courageous" = "xyes"; then 103 if test "x$guix_courageous" = "xyes"; then
diff --git a/tests/packages.scm b/tests/packages.scm
index 3ee44adc981..bd5ba3ee92c 100644
--- a/tests/packages.scm
+++ b/tests/packages.scm
@@ -19,6 +19,7 @@
19(define-module (test-packages) 19(define-module (test-packages)
20 #:use-module (guix tests) 20 #:use-module (guix tests)
21 #:use-module (guix store) 21 #:use-module (guix store)
22 #:use-module (guix monads)
22 #:use-module ((guix utils) 23 #:use-module ((guix utils)
23 ;; Rename the 'location' binding to allow proper syntax 24 ;; Rename the 'location' binding to allow proper syntax
24 ;; matching when setting the 'location' field of a package. 25 ;; matching when setting the 'location' field of a package.
@@ -31,10 +32,13 @@
31 #:use-module (guix build-system) 32 #:use-module (guix build-system)
32 #:use-module (guix build-system trivial) 33 #:use-module (guix build-system trivial)
33 #:use-module (guix build-system gnu) 34 #:use-module (guix build-system gnu)
35 #:use-module (guix profiles)
36 #:use-module (guix scripts package)
34 #:use-module (gnu packages) 37 #:use-module (gnu packages)
35 #:use-module (gnu packages base) 38 #:use-module (gnu packages base)
36 #:use-module (gnu packages guile) 39 #:use-module (gnu packages guile)
37 #:use-module (gnu packages bootstrap) 40 #:use-module (gnu packages bootstrap)
41 #:use-module (gnu packages xml)
38 #:use-module (srfi srfi-1) 42 #:use-module (srfi srfi-1)
39 #:use-module (srfi srfi-26) 43 #:use-module (srfi srfi-26)
40 #:use-module (srfi srfi-34) 44 #:use-module (srfi srfi-34)
@@ -328,10 +332,10 @@
328 search-paths))))))) 332 search-paths)))))))
329 (x (list (search-path-specification 333 (x (list (search-path-specification
330 (variable "GUILE_LOAD_PATH") 334 (variable "GUILE_LOAD_PATH")
331 (directories '("share/guile/site/2.0"))) 335 (files '("share/guile/site/2.0")))
332 (search-path-specification 336 (search-path-specification
333 (variable "GUILE_LOAD_COMPILED_PATH") 337 (variable "GUILE_LOAD_COMPILED_PATH")
334 (directories '("share/guile/site/2.0"))))) 338 (files '("share/guile/site/2.0")))))
335 (a (package (inherit (dummy-package "guile")) 339 (a (package (inherit (dummy-package "guile"))
336 (build-system s) 340 (build-system s)
337 (native-search-paths x))) 341 (native-search-paths x)))
@@ -527,6 +531,53 @@
527 (((? (cut eq? hello <>))) #t) 531 (((? (cut eq? hello <>))) #t)
528 (wrong (pk 'find-packages-by-name wrong #f)))) 532 (wrong (pk 'find-packages-by-name wrong #f))))
529 533
534(test-assert "--search-paths with pattern"
535 ;; Make sure 'guix package --search-paths' correctly reports environment
536 ;; variables when file patterns are used (in particular, it must follow
537 ;; symlinks when looking for 'catalog.xml'.) To do that, we rely on the
538 ;; libxml2 package specification, which contains such a definition.
539 (let* ((p1 (package
540 (name "foo") (version "0") (source #f)
541 (build-system trivial-build-system)
542 (arguments
543 `(#:guile ,%bootstrap-guile
544 #:modules ((guix build utils))
545 #:builder (begin
546 (use-modules (guix build utils))
547 (let ((out (assoc-ref %outputs "out")))
548 (mkdir-p (string-append out "/xml/bar/baz"))
549 (call-with-output-file
550 (string-append out "/xml/bar/baz/catalog.xml")
551 (lambda (port)
552 (display "xml? wat?!" port)))))))
553 (synopsis #f) (description #f)
554 (home-page #f) (license #f)))
555 (p2 (package
556 ;; Provide a fake libxml2 to avoid building the real one. This
557 ;; is OK because 'guix package' gets search path specifications
558 ;; from the same-named package found in the distro.
559 (name "libxml2") (version "0.0.0") (source #f)
560 (build-system trivial-build-system)
561 (arguments
562 `(#:guile ,%bootstrap-guile
563 #:builder (mkdir (assoc-ref %outputs "out"))))
564 (native-search-paths (package-native-search-paths libxml2))
565 (synopsis #f) (description #f)
566 (home-page #f) (license #f)))
567 (prof (run-with-store %store
568 (profile-derivation
569 (manifest (map package->manifest-entry
570 (list p1 p2)))
571 #:info-dir? #f)
572 #:guile-for-build (%guile-for-build))))
573 (build-derivations %store (list prof))
574 (string-match (format #f "^export XML_CATALOG_FILES=\"~a/xml/+bar/baz/catalog\\.xml\"\n"
575 (derivation->output-path prof))
576 (with-output-to-string
577 (lambda ()
578 (guix-package "-p" (derivation->output-path prof)
579 "--search-paths"))))))
580
530(test-end "packages") 581(test-end "packages")
531 582
532 583