From 0253ab39794ce5d9cf051ac70c632c378a732d8e Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sat, 22 Nov 2014 12:24:41 +0100 Subject: gnu: file: Update to 5.20. * gnu/packages/file.scm (file): Update to 5.20. (file-5.20): Remove. * gnu/packages/patches/file-CVE-2014-3587.patch: Remove. * gnu-system.am (dist_patch_DATA): Adjust accordingly. * gnu/packages/patchutils.scm (quilt): Use FILE instead of FILE-5.20. * gnu/packages/version-control.scm (aegis): Ditto. --- gnu-system.am | 1 - gnu/packages/file.scm | 26 ++++++++------------------ gnu/packages/patches/file-CVE-2014-3587.patch | 16 ---------------- gnu/packages/patchutils.scm | 2 +- gnu/packages/version-control.scm | 2 +- 5 files changed, 10 insertions(+), 37 deletions(-) delete mode 100644 gnu/packages/patches/file-CVE-2014-3587.patch diff --git a/gnu-system.am b/gnu-system.am index d3b822c169..246f52a12e 100644 --- a/gnu-system.am +++ b/gnu-system.am @@ -340,7 +340,6 @@ dist_patch_DATA = \ gnu/packages/patches/duplicity-piped-password.patch \ gnu/packages/patches/duplicity-test_selection-tmp.patch \ gnu/packages/patches/eudev-rules-directory.patch \ - gnu/packages/patches/file-CVE-2014-3587.patch \ gnu/packages/patches/findutils-absolute-paths.patch \ gnu/packages/patches/flashrom-use-libftdi1.patch \ gnu/packages/patches/flex-bison-tests.patch \ diff --git a/gnu/packages/file.scm b/gnu/packages/file.scm index 070695ec2c..7d8504b74a 100644 --- a/gnu/packages/file.scm +++ b/gnu/packages/file.scm @@ -27,14 +27,14 @@ (define-public file (package (name "file") - (version "5.19") - (source (origin - (method url-fetch) - (uri (string-append "ftp://ftp.astron.com/pub/file/file-" - version ".tar.gz")) - (sha256 (base32 - "0z1sgrcfy6d285kj5izy1yypf371bjl3247plh9ppk0svaxv714l")) - (patches (list (search-patch "file-CVE-2014-3587.patch"))))) + (version "5.20") + (source (origin + (method url-fetch) + (uri (string-append "ftp://ftp.astron.com/pub/file/file-" + version ".tar.gz")) + (sha256 + (base32 + "0iyjs9z8kp43gz7gva4j67h4p0n53f7q8x3ibai9s01sp3xnphsv")))) (build-system gnu-build-system) ;; When cross-compiling, this package depends upon a native install of @@ -50,13 +50,3 @@ of the file.") (license bsd-2) (home-page "http://www.darwinsys.com/file/"))) -(define-public file-5.20 ;fix for CVE-2014-3710 - (package (inherit file) - (version "5.20") - (source (origin - (method url-fetch) - (uri (string-append "ftp://ftp.astron.com/pub/file/file-" - version ".tar.gz")) - (sha256 - (base32 - "0iyjs9z8kp43gz7gva4j67h4p0n53f7q8x3ibai9s01sp3xnphsv")))))) 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 cf88bf5f3e..0000000000 --- a/gnu/packages/patches/file-CVE-2014-3587.patch +++ /dev/null @@ -1,16 +0,0 @@ -Fixes CVE-2014-3587. Copied from upstream commit -0641e56be1af003aa02c7c6b0184466540637233. - ---- file-5.19/src/cdf.c.orig 2014-06-09 09:04:37.000000000 -0400 -+++ file-5.19/src/cdf.c 2014-08-26 11:55:23.887118898 -0400 -@@ -824,6 +824,10 @@ - q = (const uint8_t *)(const void *) - ((const char *)(const void *)p + ofs - - 2 * sizeof(uint32_t)); -+ if (q < p) { -+ DPRINTF(("Wrapped around %p < %p\n", q, p)); -+ goto out; -+ } - if (q > e) { - DPRINTF(("Ran of the end %p > %p\n", q, e)); - goto out; diff --git a/gnu/packages/patchutils.scm b/gnu/packages/patchutils.scm index 3dbf72435e..48f4d29584 100644 --- a/gnu/packages/patchutils.scm +++ b/gnu/packages/patchutils.scm @@ -96,7 +96,7 @@ listing the files modified by a patch.") (build-system gnu-build-system) (inputs `(("perl" ,perl) ("less" ,less) - ("file" ,file-5.20) ;work around CVE-2014-3710 + ("file" ,file) ("ed" ,ed))) (arguments '(#:parallel-tests? #f diff --git a/gnu/packages/version-control.scm b/gnu/packages/version-control.scm index 931297cf2a..0b52f0c2e5 100644 --- a/gnu/packages/version-control.scm +++ b/gnu/packages/version-control.scm @@ -507,7 +507,7 @@ accessed and migrated on modern systems.") (inputs `(("e2fsprogs" ,e2fsprogs) ("curl" ,curl) - ("file" ,file-5.20) ;work around CVE-2014-3710 + ("file" ,file) ("libxml2" ,libxml2) ("zlib" ,zlib) ("gettext" ,gnu-gettext))) -- cgit v1.2.3 From e56512125d808522325324b99eaf966d8272355e Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sat, 22 Nov 2014 12:26:37 +0100 Subject: gnu: pkg-config: Update to 0.28. * gnu/packages/pkg-config.scm (%pkg-config): Update to 0.28. --- gnu/packages/pkg-config.scm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gnu/packages/pkg-config.scm b/gnu/packages/pkg-config.scm index 8317136a24..279a6c1f29 100644 --- a/gnu/packages/pkg-config.scm +++ b/gnu/packages/pkg-config.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2012, 2013 Ludovic Courtès +;;; Copyright © 2012, 2013, 2014 Ludovic Courtès ;;; ;;; This file is part of GNU Guix. ;;; @@ -30,7 +30,7 @@ (define-public %pkg-config (package (name "pkg-config") - (version "0.27.1") + (version "0.28") (source (origin (method url-fetch) (uri (string-append @@ -38,7 +38,7 @@ version ".tar.gz")) (sha256 (base32 - "05wc5nwkqz7saj2v33ydmz1y6jdg659dll4jjh91n41m63gx0qsg")))) + "0igqq5m204w71m11y0nipbdf5apx87hwfll6axs12hn4dqfb6vkb")))) (build-system gnu-build-system) (arguments `(#:configure-flags '("--with-internal-glib"))) (native-search-paths -- cgit v1.2.3 From e6039b9c70c658d648723a2d331f1c9637b49126 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sat, 22 Nov 2014 12:32:32 +0100 Subject: utils: Export 'parallel-job-count'. * guix/build/utils.scm (parallel-job-count): New procedure. * guix/build/gnu-build-system.scm (%parallel-job-count): Remove. (build, check): Use 'parallel-job-count' instead. --- guix/build/gnu-build-system.scm | 11 ++--------- guix/build/utils.scm | 10 ++++++++++ 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/guix/build/gnu-build-system.scm b/guix/build/gnu-build-system.scm index 17fa7afd8d..afed601798 100644 --- a/guix/build/gnu-build-system.scm +++ b/guix/build/gnu-build-system.scm @@ -236,18 +236,11 @@ makefiles." (string-append srcdir "/configure") flags)))) -(define %parallel-job-count - ;; String to be passed next to GNU Make's `-j' argument. - (match (getenv "NIX_BUILD_CORES") - (#f "1") - ("0" (number->string (current-processor-count))) - (x x))) - (define* (build #:key (make-flags '()) (parallel-build? #t) #:allow-other-keys) (zero? (apply system* "make" `(,@(if parallel-build? - `("-j" ,%parallel-job-count) + `("-j" ,(number->string (parallel-job-count))) '()) ,@make-flags)))) @@ -257,7 +250,7 @@ makefiles." (if tests? (zero? (apply system* "make" test-target `(,@(if parallel-tests? - `("-j" ,%parallel-job-count) + `("-j" ,(number->string (parallel-job-count))) '()) ,@make-flags))) (begin diff --git a/guix/build/utils.scm b/guix/build/utils.scm index cda4fb12ef..bfbc4dd43e 100644 --- a/guix/build/utils.scm +++ b/guix/build/utils.scm @@ -31,6 +31,8 @@ #:re-export (alist-cons alist-delete) #:export (%store-directory + parallel-job-count + directory-exists? executable-file? call-with-ascii-input-file @@ -69,6 +71,14 @@ (or (getenv "NIX_STORE") "/gnu/store")) +(define (parallel-job-count) + "Return the number of processes to be passed next to GNU Make's `-j' +argument." + (match (getenv "NIX_BUILD_CORES") ;set by the daemon + (#f 1) + ("0" (current-processor-count)) + (x (or (string->number x) 1)))) + (define (directory-exists? dir) "Return #t if DIR exists and is a directory." (let ((s (stat dir #f))) -- cgit v1.2.3 From 99533da50db89318c7ab7ae3e7a28c261fb88e84 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sat, 22 Nov 2014 12:44:56 +0100 Subject: utils: Add 'elf-file?'. * guix/build/utils.scm (elf-file?): New procedure. --- guix/build/utils.scm | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/guix/build/utils.scm b/guix/build/utils.scm index bfbc4dd43e..fcf6dfc12c 100644 --- a/guix/build/utils.scm +++ b/guix/build/utils.scm @@ -36,6 +36,7 @@ directory-exists? executable-file? call-with-ascii-input-file + elf-file? with-directory-excursion mkdir-p copy-recursively @@ -106,6 +107,17 @@ return values of applying PROC to the port." (lambda () (close-input-port port))))) +(define (elf-file? file) + "Return true if FILE starts with the ELF magic bytes." + (define (get-header) + (call-with-input-file file + (lambda (port) + (get-bytevector-n port 4)) + #:binary #t #:guess-encoding #f)) + + (equal? (get-header) + #vu8(#x7f #x45 #x4c #x46))) ;"\177ELF" + (define-syntax-rule (with-directory-excursion dir body ...) "Run BODY with DIR as the process's current directory." (let ((init (getcwd))) @@ -783,6 +795,7 @@ the previous wrapper." ;;; Local Variables: ;;; eval: (put 'call-with-output-file/atomic 'scheme-indent-function 1) +;;; eval: (put 'call-with-ascii-input-file 'scheme-indent-function 1) ;;; eval: (put 'with-throw-handler 'scheme-indent-function 1) ;;; eval: (put 'let-matches 'scheme-indent-function 3) ;;; eval: (put 'with-atomic-file-replacement 'scheme-indent-function 1) -- cgit v1.2.3 From 50b87bd54b7fd5fe5cb3482d7801d5e74d0c2fb3 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sat, 22 Nov 2014 12:49:14 +0100 Subject: build-system/gnu: Strip only ELF files. Suggested by Mark H Weaver at . * guix/build/gnu-build-system.scm (strip)[strip-dir]: Strip only when (elf-file? PATH) is true. --- guix/build/gnu-build-system.scm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/guix/build/gnu-build-system.scm b/guix/build/gnu-build-system.scm index afed601798..a8136063ef 100644 --- a/guix/build/gnu-build-system.scm +++ b/guix/build/gnu-build-system.scm @@ -343,7 +343,8 @@ makefiles." debug-output objcopy-command)) (file-system-fold (const #t) (lambda (path stat result) ; leaf - (and (or (not debug-output) + (and (elf-file? path) + (or (not debug-output) (make-debug-file path)) (zero? (apply system* strip-command (append strip-flags (list path)))) -- cgit v1.2.3 From 91ee959b03e9e45727761823a4fcc1046e0aa450 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sat, 22 Nov 2014 21:44:59 +0100 Subject: utils: Add 'ar-file?'. * guix/build/utils.scm (%ar-magic-bytes): New variable. (ar-file?): New procedure. --- guix/build/utils.scm | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/guix/build/utils.scm b/guix/build/utils.scm index fcf6dfc12c..0ea22ec657 100644 --- a/guix/build/utils.scm +++ b/guix/build/utils.scm @@ -37,6 +37,7 @@ executable-file? call-with-ascii-input-file elf-file? + ar-file? with-directory-excursion mkdir-p copy-recursively @@ -118,6 +119,21 @@ return values of applying PROC to the port." (equal? (get-header) #vu8(#x7f #x45 #x4c #x46))) ;"\177ELF" +(define %ar-magic-bytes + ;; Magic bytes of archives created by 'ar'. See . + (u8-list->bytevector (map char->integer (string->list "!\n")))) + +(define (ar-file? file) + "Return true if FILE starts with the magic bytes of archives as created by +'ar'." + (define (get-header) + (call-with-input-file file + (lambda (port) + (get-bytevector-n port 8)) + #:binary #t #:guess-encoding #f)) + + (equal? (get-header) %ar-magic-bytes)) + (define-syntax-rule (with-directory-excursion dir body ...) "Run BODY with DIR as the process's current directory." (let ((init (getcwd))) -- cgit v1.2.3 From 2bbc6db5e22b0361c166c89210c7a6fd9842db8c Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sat, 22 Nov 2014 21:52:57 +0100 Subject: utils: Factorize magic bytes detection. * guix/build/utils.scm (file-header-match): New procedure. (%elf-magic-bytes): New variable. (elf-file?, ar-file?): Define using 'file-header-match'. --- guix/build/utils.scm | 42 +++++++++++++++++++++++------------------- 1 file changed, 23 insertions(+), 19 deletions(-) diff --git a/guix/build/utils.scm b/guix/build/utils.scm index 0ea22ec657..c4c3934a5d 100644 --- a/guix/build/utils.scm +++ b/guix/build/utils.scm @@ -108,31 +108,35 @@ return values of applying PROC to the port." (lambda () (close-input-port port))))) -(define (elf-file? file) - "Return true if FILE starts with the ELF magic bytes." - (define (get-header) - (call-with-input-file file - (lambda (port) - (get-bytevector-n port 4)) - #:binary #t #:guess-encoding #f)) +(define (file-header-match header) + "Return a procedure that returns true when its argument is a file starting +with the bytes in HEADER, a bytevector." + (define len + (bytevector-length header)) - (equal? (get-header) - #vu8(#x7f #x45 #x4c #x46))) ;"\177ELF" + (lambda (file) + "Return true if FILE starts with the right magic bytes." + (define (get-header) + (call-with-input-file file + (lambda (port) + (get-bytevector-n port len)) + #:binary #t #:guess-encoding #f)) + + (equal? (get-header) header))) + +(define %elf-magic-bytes + ;; Magic bytes of ELF files. See . + (u8-list->bytevector (map char->integer (string->list "\x7FELF")))) + +(define elf-file? + (file-header-match %elf-magic-bytes)) (define %ar-magic-bytes ;; Magic bytes of archives created by 'ar'. See . (u8-list->bytevector (map char->integer (string->list "!\n")))) -(define (ar-file? file) - "Return true if FILE starts with the magic bytes of archives as created by -'ar'." - (define (get-header) - (call-with-input-file file - (lambda (port) - (get-bytevector-n port 8)) - #:binary #t #:guess-encoding #f)) - - (equal? (get-header) %ar-magic-bytes)) +(define ar-file? + (file-header-match %ar-magic-bytes)) (define-syntax-rule (with-directory-excursion dir body ...) "Run BODY with DIR as the process's current directory." -- cgit v1.2.3 From e8c7fdda5d62af08820794114e02a6f247fed2f7 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sat, 22 Nov 2014 21:54:27 +0100 Subject: build-system/gnu: Strip 'ar' archives as well. * guix/build/gnu-build-system.scm (strip): Also strip when (ar-file? PATH) is true. --- guix/build/gnu-build-system.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/guix/build/gnu-build-system.scm b/guix/build/gnu-build-system.scm index a8136063ef..dbbb71af35 100644 --- a/guix/build/gnu-build-system.scm +++ b/guix/build/gnu-build-system.scm @@ -343,7 +343,7 @@ makefiles." debug-output objcopy-command)) (file-system-fold (const #t) (lambda (path stat result) ; leaf - (and (elf-file? path) + (and (or (elf-file? path) (ar-file? path)) (or (not debug-output) (make-debug-file path)) (zero? (apply system* strip-command -- cgit v1.2.3 From 1d1fa9327c839bf7af92dd38d8306df0d456c11e Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sat, 22 Nov 2014 21:57:05 +0100 Subject: utils: Turn 'parallel-job-count' into a parameter. * guix/build/utils.scm (parallel-job-count): Turn into a SRFI-39 parameter. --- guix/build/utils.scm | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/guix/build/utils.scm b/guix/build/utils.scm index c4c3934a5d..a3050b955c 100644 --- a/guix/build/utils.scm +++ b/guix/build/utils.scm @@ -73,13 +73,13 @@ (or (getenv "NIX_STORE") "/gnu/store")) -(define (parallel-job-count) - "Return the number of processes to be passed next to GNU Make's `-j' -argument." - (match (getenv "NIX_BUILD_CORES") ;set by the daemon - (#f 1) - ("0" (current-processor-count)) - (x (or (string->number x) 1)))) +(define parallel-job-count + ;; Number of processes to be passed next to GNU Make's `-j' argument. + (make-parameter + (match (getenv "NIX_BUILD_CORES") ;set by the daemon + (#f 1) + ("0" (current-processor-count)) + (x (or (string->number x) 1))))) (define (directory-exists? dir) "Return #t if DIR exists and is a directory." -- cgit v1.2.3 From c23d17095db0611d8ee32357f17da441bcb0bc75 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sun, 23 Nov 2014 19:15:21 +0100 Subject: utils: 'elf-file?' and 'ar-file?' return #f for directories. This avoids uncaught exceptions when the 'strip' phase would call these procedures on symlinks to directories, such as 'lib/terminfo' in ncurses (see .) * guix/build/utils.scm (file-header-match): Catch 'system-error', and return #f upon EISDIR. --- guix/build/utils.scm | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/guix/build/utils.scm b/guix/build/utils.scm index a3050b955c..c480dbf8a6 100644 --- a/guix/build/utils.scm +++ b/guix/build/utils.scm @@ -122,7 +122,13 @@ with the bytes in HEADER, a bytevector." (get-bytevector-n port len)) #:binary #t #:guess-encoding #f)) - (equal? (get-header) header))) + (catch 'system-error + (lambda () + (equal? (get-header) header)) + (lambda args + (if (= EISDIR (system-error-errno args)) + #f ;FILE is a directory + (apply throw args)))))) (define %elf-magic-bytes ;; Magic bytes of ELF files. See . -- cgit v1.2.3 From f8bcf1935a18e9a728e824030b3ded4fb63638cf Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Mon, 24 Nov 2014 22:45:41 +0100 Subject: build-system/gnu: Gracefully handle dangling symlinks in the 'strip' phase. * guix/build/gnu-build-system.scm (strip): Check whether 'file-exists?' before calling 'elf-file?' and 'ar-file?'. This should fix build failures in the presence of dangling symlinks, as in . --- guix/build/gnu-build-system.scm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/guix/build/gnu-build-system.scm b/guix/build/gnu-build-system.scm index dbbb71af35..e42a6cc48b 100644 --- a/guix/build/gnu-build-system.scm +++ b/guix/build/gnu-build-system.scm @@ -343,7 +343,8 @@ makefiles." debug-output objcopy-command)) (file-system-fold (const #t) (lambda (path stat result) ; leaf - (and (or (elf-file? path) (ar-file? path)) + (and (file-exists? path) ;discard dangling symlinks + (or (elf-file? path) (ar-file? path)) (or (not debug-output) (make-debug-file path)) (zero? (apply system* strip-command -- cgit v1.2.3 From c4a298c52c8c8e80f0f08619ea171e6ad23e3654 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Mon, 24 Nov 2014 22:47:41 +0100 Subject: gnu: grep: Update to 2.21. * gnu/packages/base.scm (grep): Update to 2.21. --- gnu/packages/base.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gnu/packages/base.scm b/gnu/packages/base.scm index 4f28306652..39da8f87e9 100644 --- a/gnu/packages/base.scm +++ b/gnu/packages/base.scm @@ -64,14 +64,14 @@ command-line arguments, multiple languages, and so on.") (define-public grep (package (name "grep") - (version "2.20") + (version "2.21") (source (origin (method url-fetch) (uri (string-append "mirror://gnu/grep/grep-" version ".tar.xz")) (sha256 (base32 - "0rcs0spsxdmh6yz8y4frkqp6f5iw19mdbdl9s2v6956hq0mlbbzh")))) + "1pp5n15qwxrw1pibwjhhgsibyv5cafhamf8lwzjygs6y00fa2i2j")))) (build-system gnu-build-system) (synopsis "Print lines matching a pattern") (description -- cgit v1.2.3 From 97e11209032cb10a40c588c66ebe9f345a85f234 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Wed, 26 Nov 2014 11:16:05 +0100 Subject: gnu: glibc: Do not install all the locales. * gnu/packages/base.scm (glibc)[outputs]: Remove "locales". [arguments]: Remove --localedir argument. Change libc_cv_localedir value to "/run/current-system/locale". Remove 'install-locales' phase. --- gnu/packages/base.scm | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/gnu/packages/base.scm b/gnu/packages/base.scm index 39da8f87e9..e2ec52a45b 100644 --- a/gnu/packages/base.scm +++ b/gnu/packages/base.scm @@ -381,25 +381,27 @@ included.") ;; users should automatically pull Linux headers as well. (propagated-inputs `(("linux-headers" ,linux-libre-headers))) - ;; Store the locales separately (~100 MiB). Note that "out" retains a - ;; reference to them anyway, so there's no space savings here. - ;; TODO: Eventually we may want to add a $LOCALE_ARCHIVE search path like - ;; Nixpkgs does. - (outputs '("out" "locales" "debug")) + (outputs '("out" "debug")) (arguments `(#:out-of-source? #t #:configure-flags (list "--enable-add-ons" "--sysconfdir=/etc" - (string-append "--localedir=" (assoc-ref %outputs "locales") - "/share/locale") + ;; Installing a locale archive with all the locales is to + ;; expensive (~100 MiB), so we rely on users to install the + ;; locales they really want. + ;; + ;; Set the default locale path. In practice, $LOCPATH may be + ;; defined to point whatever locales users want. However, setuid + ;; binaries don't honor $LOCPATH, so they'll instead look into + ;; $libc_cv_localedir; we choose /run/current-system/locale, with + ;; the idea that it is going to be populated by the sysadmin. + ;; ;; `--localedir' is not honored, so work around it. ;; See . - (string-append "libc_cv_localedir=" - (assoc-ref %outputs "locales") - "/share/locale") + (string-append "libc_cv_localedir=/run/current-system/locale") (string-append "--with-headers=" (assoc-ref %build-inputs "linux-headers") @@ -476,11 +478,7 @@ included.") "") (("exec @PERL@") "exec perl")))) - (alist-cons-after - 'install 'install-locales - (lambda _ - (zero? (system* "make" "localedata/install-locales"))) - %standard-phases)))) + %standard-phases))) (inputs `(("static-bash" ,(static-package bash-light)))) -- cgit v1.2.3 From 094b2efc3c672d60c2fbaca68ce632ba6ab54700 Mon Sep 17 00:00:00 2001 From: Taylan Ulrich Bayırlı/Kammer Date: Tue, 25 Nov 2014 21:52:13 +0100 Subject: utils: Improve docstring of 'substitute*' & co. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * guix/build/utils.scm (substitute): Clarify first sentence of docstring and add warning to the docstring about using '$' to match an end of line. (substitute*): Add warning to the docstring about using '$' to match an end of line. Signed-off-by: Ludovic Courtès --- guix/build/utils.scm | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/guix/build/utils.scm b/guix/build/utils.scm index c480dbf8a6..737976e8e4 100644 --- a/guix/build/utils.scm +++ b/guix/build/utils.scm @@ -413,10 +413,11 @@ PROC's result is returned." (false-if-exception (delete-file template)))))) (define (substitute file pattern+procs) - "PATTERN+PROCS is a list of regexp/two-argument procedure. For each line -of FILE, and for each PATTERN that it matches, call the corresponding PROC -as (PROC LINE MATCHES); PROC must return the line that will be written as a -substitution of the original line." + "PATTERN+PROCS is a list of regexp/two-argument-procedure pairs. For each +line of FILE, and for each PATTERN that it matches, call the corresponding +PROC as (PROC LINE MATCHES); PROC must return the line that will be written as +a substitution of the original line. Be careful about using '$' to match the +end of a line; by itself it won't match the terminating newline of a line." (let ((rx+proc (map (match-lambda (((? regexp? pattern) . proc) (cons pattern proc)) @@ -476,7 +477,10 @@ When one of the MATCH-VAR is `_', no variable is bound to the corresponding match substring. Alternatively, FILE may be a list of file names, in which case they are -all subject to the substitutions." +all subject to the substitutions. + +Be careful about using '$' to match the end of a line; by itself it won't +match the terminating newline of a line." ((substitute* file ((regexp match-var ...) body ...) ...) (let () (define (substitute-one-file file-name) -- cgit v1.2.3 From e9bab1df6d4c71f9617362c2bd8babe61dec759d Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Wed, 26 Nov 2014 23:34:34 +0100 Subject: gnu: gawk: Build a UTF-8 locale for the tests. * gnu/packages/gawk.scm (gawk)[arguments]: Add 'install-locales' phase. --- gnu/packages/gawk.scm | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/gnu/packages/gawk.scm b/gnu/packages/gawk.scm index 10506197f3..996be7af4a 100644 --- a/gnu/packages/gawk.scm +++ b/gnu/packages/gawk.scm @@ -64,7 +64,17 @@ '((substitute* "extension/configure" (("/usr/bin/file") (which "file")))) '()))) - %standard-phases))) + + (alist-cons-before + 'check 'install-locales + (lambda _ + ;; A bunch of tests require the availability of a UTF-8 + ;; locale and otherwise fail. Give them what they want. + (setenv "LOCPATH" (getcwd)) + (zero? (system* "localedef" "--no-archive" + "--prefix" (getcwd) "-i" "en_US" + "-f" "UTF-8" "./en_US.UTF-8"))) + %standard-phases)))) (inputs `(("libsigsegv" ,libsigsegv) ,@(if (%current-target-system) -- cgit v1.2.3 From d68fe741623d11d16c514cf8bddbb48a1e5258ae Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Mon, 1 Dec 2014 14:09:36 +0100 Subject: build-system/gnu: Add 'validate-documentation-location' phase. * guix/build/gnu-build-system.scm (validate-documentation-location): New procedure. (%standard-phases): Add it. --- guix/build/gnu-build-system.scm | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/guix/build/gnu-build-system.scm b/guix/build/gnu-build-system.scm index e42a6cc48b..9d97ceb5bb 100644 --- a/guix/build/gnu-build-system.scm +++ b/guix/build/gnu-build-system.scm @@ -372,6 +372,27 @@ makefiles." strip-directories))) outputs)))) +(define* (validate-documentation-location #:key outputs + #:allow-other-keys) + "Documentation should go to 'share/info' and 'share/man', not just 'info/' +and 'man/'. This phase moves directories to the right place if needed." + (define (validate-sub-directory output sub-directory) + (let ((directory (string-append output "/" sub-directory))) + (when (directory-exists? directory) + (let ((target (string-append output "/share/" sub-directory))) + (format #t "moving '~a' to '~a'~%" directory target) + (mkdir-p (dirname target)) + (rename-file directory target))))) + + (define (validate-output output) + (for-each (cut validate-sub-directory output <>) + '("man" "info"))) + + (match outputs + (((names . directories) ...) + (for-each validate-output directories))) + #t) + (define %standard-phases ;; Standard build phases, as a list of symbol/procedure pairs. (let-syntax ((phases (syntax-rules () @@ -380,7 +401,8 @@ makefiles." patch-usr-bin-file patch-source-shebangs configure patch-generated-file-shebangs build check install - patch-shebangs strip))) + patch-shebangs strip + validate-documentation-location))) (define* (gnu-build #:key (source #f) (outputs #f) (inputs #f) -- cgit v1.2.3 From 9741aca9a586231423712b99d52346bf3dcdd4e3 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Mon, 1 Dec 2014 15:46:10 +0100 Subject: utils: Add 'symbolic-link?'. * guix/build/utils.scm (symbolic-link?): New procedure. --- guix/build/utils.scm | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/guix/build/utils.scm b/guix/build/utils.scm index 737976e8e4..de1cfcea42 100644 --- a/guix/build/utils.scm +++ b/guix/build/utils.scm @@ -35,6 +35,7 @@ directory-exists? executable-file? + symbolic-link? call-with-ascii-input-file elf-file? ar-file? @@ -93,6 +94,10 @@ (and s (not (zero? (logand (stat:mode s) #o100)))))) +(define (symbolic-link? file) + "Return #t if FILE is a symbolic link (aka. \"symlink\".)" + (eq? (stat:type (lstat file)) 'symlink)) + (define (call-with-ascii-input-file file proc) "Open FILE as an ASCII or binary file, and pass the resulting port to PROC. FILE is closed when PROC's dynamic extent is left. Return the -- cgit v1.2.3 From 7cc7dec139d4dbbeb93d7fe57740ae5f64200701 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Mon, 1 Dec 2014 15:46:26 +0100 Subject: build-system/gnu: Add 'compress-documentation' phase. * guix/build/gnu-build-system.scm (compress-documentation): New procedure. (%standard-phases): Add it. --- guix/build/gnu-build-system.scm | 62 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 61 insertions(+), 1 deletion(-) diff --git a/guix/build/gnu-build-system.scm b/guix/build/gnu-build-system.scm index 9d97ceb5bb..d3de92b724 100644 --- a/guix/build/gnu-build-system.scm +++ b/guix/build/gnu-build-system.scm @@ -20,6 +20,7 @@ #:use-module (guix build utils) #:use-module (ice-9 ftw) #:use-module (ice-9 match) + #:use-module (ice-9 regex) #:use-module (ice-9 format) #:use-module (srfi srfi-1) #:use-module (srfi srfi-26) @@ -393,6 +394,64 @@ and 'man/'. This phase moves directories to the right place if needed." (for-each validate-output directories))) #t) +(define* (compress-documentation #:key outputs + (compress-documentation? #t) + (documentation-compressor "gzip") + (documentation-compressor-flags + '("--best" "--no-name")) + (compressed-documentation-extension ".gz") + #:allow-other-keys) + "When COMPRESS-DOCUMENTATION? is true, compress man pages and Info files +found in OUTPUTS using DOCUMENTATION-COMPRESSOR, called with +DOCUMENTATION-COMPRESSOR-FLAGS." + (define (retarget-symlink link) + (let ((target (readlink link))) + (delete-file link) + (symlink (string-append target compressed-documentation-extension) + link))) + + (define (has-links? file) + ;; Return #t if FILE has hard links. + (> (stat:nlink (lstat file)) 1)) + + (define (maybe-compress-directory directory regexp) + (or (not (directory-exists? directory)) + (match (find-files directory regexp) + (() ;nothing to compress + #t) + ((files ...) ;one or more files + (format #t + "compressing documentation in '~a' with ~s and flags ~s~%" + directory documentation-compressor + documentation-compressor-flags) + (call-with-values + (lambda () + (partition symbolic-link? files)) + (lambda (symlinks regular-files) + ;; Compress the non-symlink files, and adjust symlinks to refer + ;; to the compressed files. Leave files that have hard links + ;; unchanged ('gzip' would refuse to compress them anyway.) + (and (zero? (apply system* documentation-compressor + (append documentation-compressor-flags + (remove has-links? regular-files)))) + (every retarget-symlink + (filter (cut string-match regexp <>) + symlinks))))))))) + + (define (maybe-compress output) + (and (maybe-compress-directory (string-append output "/share/man") + "\\.[0-9]+$") + (maybe-compress-directory (string-append output "/share/info") + "\\.info(-[0-9]+)?$"))) + + (if compress-documentation? + (match outputs + (((names . directories) ...) + (every maybe-compress directories))) + (begin + (format #t "not compressing documentation~%") + #t))) + (define %standard-phases ;; Standard build phases, as a list of symbol/procedure pairs. (let-syntax ((phases (syntax-rules () @@ -402,7 +461,8 @@ and 'man/'. This phase moves directories to the right place if needed." patch-source-shebangs configure patch-generated-file-shebangs build check install patch-shebangs strip - validate-documentation-location))) + validate-documentation-location + compress-documentation))) (define* (gnu-build #:key (source #f) (outputs #f) (inputs #f) -- cgit v1.2.3 From 5e5deea9529c0ed2e84235d778256cccc1701df9 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sat, 13 Dec 2014 00:04:25 +0100 Subject: utils: Use 'which' to find the shell in 'patch-makefile-SHELL'. * guix/build/utils.scm (patch-makefile-SHELL)[find-shell]: Use 'which'. --- guix/build/utils.scm | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/guix/build/utils.scm b/guix/build/utils.scm index de1cfcea42..01ac8961d8 100644 --- a/guix/build/utils.scm +++ b/guix/build/utils.scm @@ -629,9 +629,7 @@ When KEEP-MTIME? is true, the atime/mtime of FILE are kept unchanged." ;; XXX: Unlike with `patch-shebang', FILE is always touched. (define (find-shell name) - (let ((shell - (search-path (search-path-as-string->list (getenv "PATH")) - name))) + (let ((shell (which name))) (unless shell (format (current-error-port) "patch-makefile-SHELL: warning: no binary for shell `~a' found in $PATH~%" -- cgit v1.2.3 From c809ec94d11f1c7e23cccb988dfb1412aff72636 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sat, 13 Dec 2014 00:06:32 +0100 Subject: utils: Change 'patch-makefile-SHELL' to support ":=" assignments. Reported by Ricardo Wurmus . * guix/build/utils.scm (patch-makefile-SHELL): Update regexp to match ":=" assignments. --- guix/build/utils.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/guix/build/utils.scm b/guix/build/utils.scm index 01ac8961d8..be91fb467b 100644 --- a/guix/build/utils.scm +++ b/guix/build/utils.scm @@ -638,7 +638,7 @@ When KEEP-MTIME? is true, the atime/mtime of FILE are kept unchanged." (let ((st (stat file))) (substitute* file - (("^ *SHELL[[:blank:]]*=[[:blank:]]*([[:graph:]]*/)([[:graph:]]+)(.*)$" + (("^ *SHELL[[:blank:]]*:?=[[:blank:]]*([[:graph:]]*/)([[:graph:]]+)(.*)$" _ dir shell args) (let* ((old (string-append dir shell)) (new (or (find-shell shell) old))) -- cgit v1.2.3 From 2ed11b3a3e05549ed6ef8a604464f424c0eeae1c Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sun, 14 Dec 2014 11:54:12 +0100 Subject: utils: Change 'wrap-program' to preserve the original argv[0]. Suggested by Mark H Weaver in . * guix/build/utils.scm (wrap-program): Change wrapper to use "exec -a PROG" instead of just "exec". --- guix/build/utils.scm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/guix/build/utils.scm b/guix/build/utils.scm index be91fb467b..9b1e098c6b 100644 --- a/guix/build/utils.scm +++ b/guix/build/utils.scm @@ -762,7 +762,7 @@ contents: #!location/of/bin/bash export PATH=\"/gnu/.../bar/bin\" export CERT_PATH=\"$CERT_PATH${CERT_PATH:+:}/gnu/.../baz/certs:/qux/certs\" - exec location/of/.foo-real + exec -a location/of/foo location/of/.foo-real \"$@\" This is useful for scripts that expect particular programs to be in $PATH, for programs that expect particular shared libraries to be in $LD_LIBRARY_PATH, or @@ -786,6 +786,7 @@ the previous wrapper." (copy-file prog prog-real) prog-real) (wrapper-file-name number))) + (let* ((number (next-wrapper-number)) (target (wrapper-target number)) (wrapper (wrapper-file-name (1+ number))) @@ -815,10 +816,11 @@ the previous wrapper." (with-output-to-file prog-tmp (lambda () (format #t - "#!~a~%~a~%exec \"~a\" \"$@\"~%" + "#!~a~%~a~%exec -a \"~a\" \"~a\" \"$@\"~%" (which "bash") (string-join (map export-variable vars) "\n") + (canonicalize-path prog) (canonicalize-path target)))) (chmod prog-tmp #o755) -- cgit v1.2.3 From 94264407815da63c5f07a519cd41838e35ab464e Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Fri, 26 Dec 2014 23:29:51 +0100 Subject: packages: Apply patches with "patch --force". Fixes . Reported by Mark H Weaver . * guix/packages.scm (patch-and-repack): Change "--batch" to "--force". --- guix/packages.scm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/guix/packages.scm b/guix/packages.scm index 07f6d0ccbc..cf16a4730c 100644 --- a/guix/packages.scm +++ b/guix/packages.scm @@ -398,7 +398,10 @@ IMPORTED-MODULES specify modules to use/import for use by SNIPPET." (define (apply-patch input) (let ((patch* (assoc-ref %build-inputs input))) (format (current-error-port) "applying '~a'...~%" patch*) - (zero? (system* patch "--batch" ,@flags "--input" patch*)))) + + ;; Use '--force' so that patches that do not apply perfectly are + ;; rejected. + (zero? (system* patch "--force" ,@flags "--input" patch*)))) (define (first-file directory) ;; Return the name of the first file in DIRECTORY. -- cgit v1.2.3 From 0d12bc744ee4fa7860b16a555d73dfc6f463ba57 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sat, 27 Dec 2014 00:17:43 +0100 Subject: gnu: gcc-4.8: Update to 4.8.4. * gnu/packages/gcc.scm (gcc-4.8): Update to 4.8.4. Remove patch. * gnu/packages/patches/gcc-fix-pr61801.patch: Remove. * gnu-system.am (dist_patch_DATA): Adjust accordingly. --- gnu-system.am | 1 - gnu/packages/gcc.scm | 5 ++--- gnu/packages/patches/gcc-fix-pr61801.patch | 25 ------------------------- 3 files changed, 2 insertions(+), 29 deletions(-) delete mode 100644 gnu/packages/patches/gcc-fix-pr61801.patch diff --git a/gnu-system.am b/gnu-system.am index 0e912f280e..09d09caaee 100644 --- a/gnu-system.am +++ b/gnu-system.am @@ -356,7 +356,6 @@ dist_patch_DATA = \ gnu/packages/patches/flex-bison-tests.patch \ gnu/packages/patches/gawk-shell.patch \ gnu/packages/patches/gcc-cross-environment-variables.patch \ - gnu/packages/patches/gcc-fix-pr61801.patch \ gnu/packages/patches/gd-mips64-deplibs-fix.patch \ gnu/packages/patches/glib-tests-desktop.patch \ gnu/packages/patches/glib-tests-homedir.patch \ diff --git a/gnu/packages/gcc.scm b/gnu/packages/gcc.scm index 6dfdcea131..4b715f495e 100644 --- a/gnu/packages/gcc.scm +++ b/gnu/packages/gcc.scm @@ -261,15 +261,14 @@ Go. It also includes runtime support libraries for these languages.") (define-public gcc-4.8 (package (inherit gcc-4.7) - (version "4.8.3") + (version "4.8.4") (source (origin (method url-fetch) (uri (string-append "mirror://gnu/gcc/gcc-" version "/gcc-" version ".tar.bz2")) (sha256 (base32 - "07hg10zs7gnqz58my10ch0zygizqh0z0bz6pv4pgxx45n48lz3ka")) - (patches (list (search-patch "gcc-fix-pr61801.patch"))))))) + "15c6gwm6dzsaagamxkak5smdkf1rdfbqqjs9jdbrp3lbg4ism02a")))))) (define-public gcc-4.9 (package (inherit gcc-4.7) diff --git a/gnu/packages/patches/gcc-fix-pr61801.patch b/gnu/packages/patches/gcc-fix-pr61801.patch deleted file mode 100644 index e9cd92aa1c..0000000000 --- a/gnu/packages/patches/gcc-fix-pr61801.patch +++ /dev/null @@ -1,25 +0,0 @@ -GCC bug fix for . -Initially discussed at - . -Patch from . - -2014-07-17 Richard Biener - - PR rtl-optimization/61801 - - * sched-deps.c (sched_analyze_2): For ASM_OPERANDS and - ASM_INPUT don't set reg_pending_barrier if it appears in a - debug-insn. - ---- gcc-4_8-branch/gcc/sched-deps.c 2014/07/17 07:48:49 212739 -+++ gcc-4_8-branch/gcc/sched-deps.c 2014/07/17 07:49:44 212740 -@@ -2744,7 +2744,8 @@ - Consider for instance a volatile asm that changes the fpu rounding - mode. An insn should not be moved across this even if it only uses - pseudo-regs because it might give an incorrectly rounded result. */ -- if (code != ASM_OPERANDS || MEM_VOLATILE_P (x)) -+ if ((code != ASM_OPERANDS || MEM_VOLATILE_P (x)) -+ && !DEBUG_INSN_P (insn)) - reg_pending_barrier = TRUE_BARRIER; - - /* For all ASM_OPERANDS, we must traverse the vector of input operands. -- cgit v1.2.3 From 6ac8aa3d750f0ff392c3c91b7710228ab6c7831a Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Fri, 26 Dec 2014 20:20:10 -0500 Subject: gnu: m4: Remove already-applied patch. * gnu/packages/patches/m4-readlink-EINVAL.patch: Remove file. * gnu-system.am (dist_patch_DATA): Remove it. * gnu/packages/m4.scm (m4): Remove patch. --- gnu-system.am | 1 - gnu/packages/m4.scm | 3 +-- gnu/packages/patches/m4-readlink-EINVAL.patch | 18 ------------------ 3 files changed, 1 insertion(+), 21 deletions(-) delete mode 100644 gnu/packages/patches/m4-readlink-EINVAL.patch diff --git a/gnu-system.am b/gnu-system.am index 09d09caaee..9790543d35 100644 --- a/gnu-system.am +++ b/gnu-system.am @@ -403,7 +403,6 @@ dist_patch_DATA = \ gnu/packages/patches/lm-sensors-hwmon-attrs.patch \ gnu/packages/patches/luit-posix.patch \ gnu/packages/patches/m4-gets-undeclared.patch \ - gnu/packages/patches/m4-readlink-EINVAL.patch \ gnu/packages/patches/make-impure-dirs.patch \ gnu/packages/patches/mc-fix-ncurses-build.patch \ gnu/packages/patches/mcron-install.patch \ diff --git a/gnu/packages/m4.scm b/gnu/packages/m4.scm index 0915fde4f2..b3b3a00fde 100644 --- a/gnu/packages/m4.scm +++ b/gnu/packages/m4.scm @@ -33,8 +33,7 @@ version ".tar.bz2")) (sha256 (base32 - "0w0da1chh12mczxa5lnwzjk9czi3dq6gnnndbpa6w4rj76b1yklf")) - (patches (list (search-patch "m4-readlink-EINVAL.patch"))))) + "0w0da1chh12mczxa5lnwzjk9czi3dq6gnnndbpa6w4rj76b1yklf")))) (build-system gnu-build-system) (arguments ;; XXX: Disable tests on those platforms with know issues. diff --git a/gnu/packages/patches/m4-readlink-EINVAL.patch b/gnu/packages/patches/m4-readlink-EINVAL.patch deleted file mode 100644 index dd371584a7..0000000000 --- a/gnu/packages/patches/m4-readlink-EINVAL.patch +++ /dev/null @@ -1,18 +0,0 @@ -Newer Linux kernels would return EINVAL instead of ENOENT. -The patch below, taken from Gnulib, allows the test to pass when -these Linux versions are in use: -https://lists.gnu.org/archive/html/bug-gnulib/2011-03/msg00308.html . - -diff --git a/tests/test-readlink.h b/tests/test-readlink.h -index 08d5662..7247fc4 100644 ---- a/tests/test-readlink.h -+++ b/tests/test-readlink.h -@@ -38,7 +38,7 @@ test_readlink (ssize_t (*func) (char const *, char *, size_t), bool print) - ASSERT (errno == ENOENT); - errno = 0; - ASSERT (func ("", buf, sizeof buf) == -1); -- ASSERT (errno == ENOENT); -+ ASSERT (errno == ENOENT || errno == EINVAL); - errno = 0; - ASSERT (func (".", buf, sizeof buf) == -1); - ASSERT (errno == EINVAL); -- cgit v1.2.3 From 84c84ce7bfc6f34a3d5a9205dc0a92e25435efcf Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sat, 27 Dec 2014 11:52:55 +0100 Subject: gnu: binutils: Update to 2.25. * gnu/packages/base.scm (binutils): Update to 2.25. --- gnu/packages/base.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gnu/packages/base.scm b/gnu/packages/base.scm index aec8d8949c..5bf27c9ef1 100644 --- a/gnu/packages/base.scm +++ b/gnu/packages/base.scm @@ -312,14 +312,14 @@ change. GNU make offers many powerful extensions over the standard utility.") (define-public binutils (package (name "binutils") - (version "2.24") + (version "2.25") (source (origin (method url-fetch) (uri (string-append "mirror://gnu/binutils/binutils-" version ".tar.bz2")) (sha256 (base32 - "0ds1y7qa0xqihw4ihnsgg6bxanmb228r228ddvwzgrv4jszcbs75")) + "08r9i26b05zcwb9zxb6zllpfdiiicdfsgbpsjlrjmvx3rxjzrpi2")) (patches (list (search-patch "binutils-ld-new-dtags.patch") (search-patch "binutils-loongson-workaround.patch"))))) (build-system gnu-build-system) -- cgit v1.2.3 From 8c89f514bf8679ce4ebd9d3f4c8e6589340dba9a Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sat, 27 Dec 2014 11:53:11 +0100 Subject: gnu: gettext: Update to 0.19.4. * gnu/packages/gettext.scm (gnu-gettext): Update to 0.19.4. --- gnu/packages/gettext.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gnu/packages/gettext.scm b/gnu/packages/gettext.scm index bbdf0c5862..dd86fe4c5b 100644 --- a/gnu/packages/gettext.scm +++ b/gnu/packages/gettext.scm @@ -35,14 +35,14 @@ (define-public gnu-gettext (package (name "gettext") - (version "0.19.3") + (version "0.19.4") (source (origin (method url-fetch) (uri (string-append "mirror://gnu/gettext/gettext-" version ".tar.gz")) (sha256 (base32 - "1xmkxviqnq60h4wmh3bi6b1zkc9qsk3l1lv91k0iwfrxb982v5ck")))) + "0gvz86m4cs8bdf3mwmwsyx6lrq4ydfxgadrgd9jlx32z3bnz3jca")))) (build-system gnu-build-system) (inputs `(("expat" ,expat))) -- cgit v1.2.3 From 6aa47e388390e98bec6caa90fef7f39a60e338a7 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sat, 27 Dec 2014 12:16:18 +0100 Subject: build-system/gnu: Add support for non-directory search paths. Partly fixes . * guix/build/utils.scm (search-path-as-list): Rename 'sub-directories' parameter to 'files'. Add #:type parameter and honor it. (set-path-environment-variable): Likewise. Pass #:type to 'search-path-as-list'. * guix/packages.scm (search-path-specification->sexp): Add 'directory as the last item of the tuple. * guix/build/gnu-build-system.scm (set-paths): Add 'type' to search-path pattern. Pass #:type to 'set-path-environment-variable'. --- guix/build/gnu-build-system.scm | 14 ++++++++------ guix/build/utils.scm | 33 +++++++++++++++++++-------------- guix/packages.scm | 3 ++- 3 files changed, 29 insertions(+), 21 deletions(-) diff --git a/guix/build/gnu-build-system.scm b/guix/build/gnu-build-system.scm index d3de92b724..4cc755f3a6 100644 --- a/guix/build/gnu-build-system.scm +++ b/guix/build/gnu-build-system.scm @@ -73,19 +73,21 @@ input-directories))) (for-each (match-lambda - ((env-var (directories ...) separator) - (set-path-environment-variable env-var directories + ((env-var (files ...) separator type) + (set-path-environment-variable env-var files input-directories - #:separator separator))) + #:separator separator + #:type type))) search-paths) (when native-search-paths ;; Search paths for native inputs, when cross building. (for-each (match-lambda - ((env-var (directories ...) separator) - (set-path-environment-variable env-var directories + ((env-var (files ...) separator type) + (set-path-environment-variable env-var files native-input-directories - #:separator separator))) + #:separator separator + #:type type))) native-search-paths)) #t) diff --git a/guix/build/utils.scm b/guix/build/utils.scm index 9b1e098c6b..f22b2c3cb7 100644 --- a/guix/build/utils.scm +++ b/guix/build/utils.scm @@ -290,9 +290,10 @@ matches REGEXP." ;;; Search paths. ;;; -(define (search-path-as-list sub-directories input-dirs) - "Return the list of directories among SUB-DIRECTORIES that exist in -INPUT-DIRS. Example: +(define* (search-path-as-list files input-dirs + #:key (type 'directory)) + "Return the list of directories among FILES of the given TYPE (a symbol as +returned by 'stat:type') that exist in INPUT-DIRS. Example: (search-path-as-list '(\"share/emacs/site-lisp\" \"share/emacs/24.1\") (list \"/package1\" \"/package2\" \"/package3\")) @@ -301,12 +302,12 @@ INPUT-DIRS. Example: " (append-map (lambda (input) - (filter-map (lambda (dir) - (let ((dir (string-append input "/" - dir))) - (and (directory-exists? dir) - dir))) - sub-directories)) + (filter-map (lambda (file) + (let* ((file (string-append input "/" file)) + (stat (stat file #f))) + (and stat (eq? type (stat:type stat)) + file))) + files)) input-dirs)) (define (list->search-path-as-string lst separator) @@ -315,16 +316,20 @@ INPUT-DIRS. Example: (define* (search-path-as-string->list path #:optional (separator #\:)) (string-tokenize path (char-set-complement (char-set separator)))) -(define* (set-path-environment-variable env-var sub-directories input-dirs - #:key (separator ":")) - "Look for each of SUB-DIRECTORIES in INPUT-DIRS. Set ENV-VAR to a -SEPARATOR-separated path accordingly. Example: +(define* (set-path-environment-variable env-var files input-dirs + #:key + (separator ":") + (type 'directory)) + "Look for each of FILES of the given TYPE (a symbol as returned by +'stat:type') in INPUT-DIRS. Set ENV-VAR to a SEPARATOR-separated path +accordingly. Example: (set-path-environment-variable \"PKG_CONFIG\" '(\"lib/pkgconfig\") (list package1 package2)) " - (let* ((path (search-path-as-list sub-directories input-dirs)) + (let* ((path (search-path-as-list files input-dirs + #:type type)) (value (list->search-path-as-string path separator))) (if (string-null? value) (begin diff --git a/guix/packages.scm b/guix/packages.scm index a25eab7699..ed9a565dc6 100644 --- a/guix/packages.scm +++ b/guix/packages.scm @@ -180,7 +180,8 @@ representation." corresponds to the arguments expected by `set-path-environment-variable'." (match spec (($ variable directories separator) - `(,variable ,directories ,separator)))) + ;; TODO: Allow other values of TYPE. See . + `(,variable ,directories ,separator directory)))) (define %supported-systems ;; This is the list of system types that are supported. By default, we -- cgit v1.2.3 From 9a224ac2e37482cb69c2803648bf3c66fbc6eee9 Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Sat, 27 Dec 2014 08:34:43 -0500 Subject: gnu: Use patch --force instead of --batch. * gnu/packages/linux.scm (linux-libre, net-tools): Pass "--force" to patch, instead of "--batch". * gnu/packages/mit-krb5.scm (mit-krb5): Ditto. --- gnu/packages/linux.scm | 4 ++-- gnu/packages/mit-krb5.scm | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm index a2708a290f..9dc5f5cd40 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." (build-phase '(lambda* (#:key system inputs #:allow-other-keys #:rest args) ;; Apply the neat patch. - (system* "patch" "-p1" "--batch" + (system* "patch" "-p1" "--force" "-i" (assoc-ref inputs "patch/freedo+gnu")) (let ((arch (car (string-split system #\-)))) @@ -774,7 +774,7 @@ manpages.") 'unpack 'patch (lambda* (#:key inputs #:allow-other-keys) (define (apply-patch file) - (zero? (system* "patch" "-p1" "--batch" + (zero? (system* "patch" "-p1" "--force" "--input" file))) (let ((patch.gz (assoc-ref inputs "patch"))) diff --git a/gnu/packages/mit-krb5.scm b/gnu/packages/mit-krb5.scm index 2528f46157..3f3e85773e 100644 --- a/gnu/packages/mit-krb5.scm +++ b/gnu/packages/mit-krb5.scm @@ -62,7 +62,7 @@ ;; XXX The current patch system does not support unusual ;; source unpack methods, so we have to apply this patch in a ;; non-standard way. - (zero? (system* "patch" "-p1" "--batch" "-i" + (zero? (system* "patch" "-p1" "--force" "-i" (assoc-ref %build-inputs "patch/init-fix")))))) (alist-replace 'check -- cgit v1.2.3 From 856ae5e6c71a1283a414d33e638051f95d3cce35 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sat, 27 Dec 2014 19:20:18 +0100 Subject: build-system/gnu: Strip with '--strip-all' instead of '--strip-debug'. This saves 19% on the 'bin' directory of Coreutils, and certainly helpful for things like Git's 'libexec' directory. * guix/build-system/gnu.scm (gnu-build): Change default value for #:strip-flags to '("--strip-all"). * guix/build/gnu-build-system.scm (strip): Ditto. * gnu/packages/linux.scm (linux-libre)[arguments]: Add #:strip-flags. --- gnu/packages/linux.scm | 5 +++++ guix/build-system/gnu.scm | 2 +- guix/build/gnu-build-system.scm | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm index 9dc5f5cd40..53368251b5 100644 --- a/gnu/packages/linux.scm +++ b/gnu/packages/linux.scm @@ -292,6 +292,11 @@ for SYSTEM, or #f if there is no configuration for SYSTEM." (alist-replace 'install ,install-phase (alist-delete 'configure %standard-phases))) + + ;; Use '--strip-debug', not '--strip-all', because the latter leads to + ;; unloadable modules (due to the lack of a symbol table.) + #:strip-flags '("--strip-debug") + #:tests? #f)) (synopsis "100% free redistribution of a cleaned Linux kernel") (description diff --git a/guix/build-system/gnu.scm b/guix/build-system/gnu.scm index c675155a6a..f765a144c4 100644 --- a/guix/build-system/gnu.scm +++ b/guix/build-system/gnu.scm @@ -274,7 +274,7 @@ standard packages used as implicit inputs of the GNU build system." (parallel-tests? #t) (patch-shebangs? #t) (strip-binaries? #t) - (strip-flags ''("--strip-debug")) + (strip-flags ''("--strip-all")) (strip-directories ''("lib" "lib64" "libexec" "bin" "sbin")) (phases '%standard-phases) diff --git a/guix/build/gnu-build-system.scm b/guix/build/gnu-build-system.scm index 4cc755f3a6..d661736831 100644 --- a/guix/build/gnu-build-system.scm +++ b/guix/build/gnu-build-system.scm @@ -295,7 +295,7 @@ makefiles." (objcopy-command (if target (string-append target "-objcopy") "objcopy")) - (strip-flags '("--strip-debug")) + (strip-flags '("--strip-all")) (strip-directories '("lib" "lib64" "libexec" "bin" "sbin")) #:allow-other-keys) -- cgit v1.2.3 From af07095516b56dcdd38bf1874da27de9c4c841f6 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sat, 27 Dec 2014 23:22:08 +0100 Subject: packages: Add 'file-type' field to 'search-path-specification'. Fixes . * guix/packages.scm (): Rename 'directories' field to 'files'. Add 'file-type'. (search-path-specification->sexp): Honor 'file-type'. * gnu/packages/autotools.scm, gnu/packages/bootstrap.scm, gnu/packages/cross-base.scm, gnu/packages/games.scm, gnu/packages/gcc.scm, gnu/packages/glib.scm, gnu/packages/guile.scm, gnu/packages/man.scm, gnu/packages/perl.scm, gnu/packages/pkg-config.scm, gnu/packages/python.scm, gnu/packages/ruby.scm, gnu/packages/xfce.scm: Change 'directories' to 'files'. * tests/packages.scm ("search paths"): Change 'directories' field to 'files'. * guix/scripts/environment.scm (for-each-search-path): Likewise. --- gnu/packages/autotools.scm | 2 +- gnu/packages/bootstrap.scm | 4 ++-- gnu/packages/cross-base.scm | 4 ++-- gnu/packages/games.scm | 2 +- gnu/packages/gcc.scm | 4 ++-- gnu/packages/glib.scm | 4 ++-- gnu/packages/guile.scm | 6 +++--- gnu/packages/man.scm | 2 +- gnu/packages/perl.scm | 2 +- gnu/packages/pkg-config.scm | 3 +-- gnu/packages/python.scm | 4 ++-- gnu/packages/ruby.scm | 7 +++---- gnu/packages/xfce.scm | 2 +- guix/packages.scm | 10 +++++----- guix/scripts/environment.scm | 3 +-- tests/packages.scm | 4 ++-- 16 files changed, 30 insertions(+), 33 deletions(-) diff --git a/gnu/packages/autotools.scm b/gnu/packages/autotools.scm index 0094577210..a3afcdcfff 100644 --- a/gnu/packages/autotools.scm +++ b/gnu/packages/autotools.scm @@ -178,7 +178,7 @@ exec ~a --no-auto-compile \"$0\" \"$@\" (native-search-paths (list (search-path-specification (variable "ACLOCAL_PATH") - (directories '("share/aclocal"))))) + (files '("share/aclocal"))))) (arguments '(#:modules ((guix build gnu-build-system) (guix build utils) diff --git a/gnu/packages/bootstrap.scm b/gnu/packages/bootstrap.scm index 854d97bcfb..5a19783bb6 100644 --- a/gnu/packages/bootstrap.scm +++ b/gnu/packages/bootstrap.scm @@ -409,10 +409,10 @@ exec ~a/bin/.gcc-wrapped -B~a/lib \ (native-search-paths (list (search-path-specification (variable "CPATH") - (directories '("include"))) + (files '("include"))) (search-path-specification (variable "LIBRARY_PATH") - (directories '("lib" "lib64"))))) + (files '("lib" "lib64"))))) (synopsis "Bootstrap binaries of the GNU Compiler Collection") (description #f) (home-page #f) diff --git a/gnu/packages/cross-base.scm b/gnu/packages/cross-base.scm index 74809d08f9..0f32c9fab9 100644 --- a/gnu/packages/cross-base.scm +++ b/gnu/packages/cross-base.scm @@ -234,10 +234,10 @@ GCC that does not target a libc; otherwise, target that libc." (search-paths (list (search-path-specification (variable "CROSS_CPATH") - (directories '("include"))) + (files '("include"))) (search-path-specification (variable "CROSS_LIBRARY_PATH") - (directories '("lib" "lib64"))))) + (files '("lib" "lib64"))))) (native-search-paths '()))) (define* (cross-libc target diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm index db878b033d..99a4a78c11 100644 --- a/gnu/packages/games.scm +++ b/gnu/packages/games.scm @@ -706,7 +706,7 @@ for common mesh file formats, and collision detection.") (native-search-paths (list (search-path-specification (variable "MINETEST_SUBGAME_PATH") - (directories '("share/minetest/games"))))) + (files '("share/minetest/games"))))) (native-inputs `(("pkg-config" ,pkg-config))) (inputs diff --git a/gnu/packages/gcc.scm b/gnu/packages/gcc.scm index 4b715f495e..e795f9749f 100644 --- a/gnu/packages/gcc.scm +++ b/gnu/packages/gcc.scm @@ -245,10 +245,10 @@ where the OS part is overloaded to denote a specific ABI---into GCC (native-search-paths (list (search-path-specification (variable "CPATH") - (directories '("include"))) + (files '("include"))) (search-path-specification (variable "LIBRARY_PATH") - (directories '("lib" "lib64"))))) + (files '("lib" "lib64"))))) (properties `((gcc-libc . ,(assoc-ref inputs "libc")))) (synopsis "GNU Compiler Collection") diff --git a/gnu/packages/glib.scm b/gnu/packages/glib.scm index 486cdb6add..93b465b130 100644 --- a/gnu/packages/glib.scm +++ b/gnu/packages/glib.scm @@ -183,7 +183,7 @@ shared NFS home directories.") ;; by 'glib-compile-schemas'. (list (search-path-specification (variable "XDG_DATA_DIRS") - (directories '("share"))))) + (files '("share"))))) (search-paths native-search-paths) (synopsis "Thread-safe general utility library; basis of GTK+ and GNOME") @@ -225,7 +225,7 @@ dynamic loading, and an object system.") (native-search-paths (list (search-path-specification (variable "GI_TYPELIB_PATH") - (directories '("lib/girepository-1.0"))))) + (files '("lib/girepository-1.0"))))) (search-paths native-search-paths) (arguments `(#:phases diff --git a/gnu/packages/guile.scm b/gnu/packages/guile.scm index 6a76bafe84..7e3b5f847d 100644 --- a/gnu/packages/guile.scm +++ b/gnu/packages/guile.scm @@ -95,7 +95,7 @@ (native-search-paths (list (search-path-specification (variable "GUILE_LOAD_PATH") - (directories '("share/guile/site"))))) + (files '("share/guile/site"))))) (synopsis "Scheme implementation intended especially for extensions") (description @@ -155,10 +155,10 @@ without requiring the source code to be rewritten.") (native-search-paths (list (search-path-specification (variable "GUILE_LOAD_PATH") - (directories '("share/guile/site/2.0"))) + (files '("share/guile/site/2.0"))) (search-path-specification (variable "GUILE_LOAD_COMPILED_PATH") - (directories '("share/guile/site/2.0"))))) + (files '("share/guile/site/2.0"))))) (synopsis "Scheme implementation intended especially for extensions") (description diff --git a/gnu/packages/man.scm b/gnu/packages/man.scm index 028403ce74..712622aee8 100644 --- a/gnu/packages/man.scm +++ b/gnu/packages/man.scm @@ -105,7 +105,7 @@ a flexible and convenient way.") (native-search-paths (list (search-path-specification (variable "MANPATH") - (directories '("share/man"))))) + (files '("share/man"))))) (home-page "http://man-db.nongnu.org/") (synopsis "Standard Unix documentation system") (description diff --git a/gnu/packages/perl.scm b/gnu/packages/perl.scm index 03cad3e25f..699fe751de 100644 --- a/gnu/packages/perl.scm +++ b/gnu/packages/perl.scm @@ -66,7 +66,7 @@ %standard-phases))) (native-search-paths (list (search-path-specification (variable "PERL5LIB") - (directories '("lib/perl5/site_perl"))))) + (files '("lib/perl5/site_perl"))))) (synopsis "Implementation of the Perl programming language") (description "Perl 5 is a highly capable, feature-rich programming language with over diff --git a/gnu/packages/pkg-config.scm b/gnu/packages/pkg-config.scm index dc4905a271..dd5120c474 100644 --- a/gnu/packages/pkg-config.scm +++ b/gnu/packages/pkg-config.scm @@ -44,8 +44,7 @@ (native-search-paths (list (search-path-specification (variable "PKG_CONFIG_PATH") - (directories '("lib/pkgconfig" "lib64/pkgconfig" - "share/pkgconfig"))))) + (files '("lib/pkgconfig" "lib64/pkgconfig" "share/pkgconfig"))))) (home-page "http://www.freedesktop.org/wiki/Software/pkg-config") (license gpl2+) (synopsis "Helper tool used when compiling applications and libraries") diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm index adb84fc5b7..90e1f8948c 100644 --- a/gnu/packages/python.scm +++ b/gnu/packages/python.scm @@ -198,7 +198,7 @@ (native-search-paths (list (search-path-specification (variable "PYTHONPATH") - (directories '("lib/python2.7/site-packages"))))) + (files '("lib/python2.7/site-packages"))))) (home-page "http://python.org") (synopsis "High-level, dynamically-typed programming language") @@ -237,7 +237,7 @@ data types.") (native-search-paths (list (search-path-specification (variable "PYTHONPATH") - (directories '("lib/python3.3/site-packages"))))))) + (files '("lib/python3.3/site-packages"))))))) (define-public python-wrapper (package (inherit python) diff --git a/gnu/packages/ruby.scm b/gnu/packages/ruby.scm index 4b6665cb6b..f8276db698 100644 --- a/gnu/packages/ruby.scm +++ b/gnu/packages/ruby.scm @@ -77,10 +77,9 @@ (native-search-paths (list (search-path-specification (variable "GEM_PATH") - (directories - (list (string-append "lib/ruby/gems/" - (version-major+minor version) - ".0")))))) + (files (list (string-append "lib/ruby/gems/" + (version-major+minor version) + ".0")))))) (synopsis "Programming language interpreter") (description "Ruby is a dynamic object-oriented programming language with a focus on simplicity and productivity.") diff --git a/gnu/packages/xfce.scm b/gnu/packages/xfce.scm index 2b15c3e35c..17b2b4d9f7 100644 --- a/gnu/packages/xfce.scm +++ b/gnu/packages/xfce.scm @@ -267,7 +267,7 @@ management D-Bus specification.") (native-search-paths (list (search-path-specification (variable "X_XFCE4_LIB_DIRS") - (directories '("lib/xfce4"))))) + (files '("lib/xfce4"))))) (home-page "http://www.xfce.org/") (synopsis "Xfce desktop panel") (description diff --git a/guix/packages.scm b/guix/packages.scm index ed9a565dc6..b375895785 100644 --- a/guix/packages.scm +++ b/guix/packages.scm @@ -172,16 +172,16 @@ representation." search-path-specification make-search-path-specification search-path-specification? (variable search-path-specification-variable) - (directories search-path-specification-directories) - (separator search-path-specification-separator (default ":"))) + (files search-path-specification-files) + (separator search-path-specification-separator (default ":")) + (file-type search-path-specification-file-type (default 'directory))) (define (search-path-specification->sexp spec) "Return an sexp representing SPEC, a . The sexp corresponds to the arguments expected by `set-path-environment-variable'." (match spec - (($ variable directories separator) - ;; TODO: Allow other values of TYPE. See . - `(,variable ,directories ,separator directory)))) + (($ variable files separator type) + `(,variable ,files ,separator ,type)))) (define %supported-systems ;; This is the list of system types that are supported. By default, we diff --git a/guix/scripts/environment.scm b/guix/scripts/environment.scm index c388b0c52c..412b8be658 100644 --- a/guix/scripts/environment.scm +++ b/guix/scripts/environment.scm @@ -54,8 +54,7 @@ path value is appended." value))))) (cons* (search-path-specification (variable "PATH") - (directories '("bin" "sbin")) - (separator ":")) + (files '("bin" "sbin"))) (delete-duplicates (append-map package-native-search-paths inputs)))))) diff --git a/tests/packages.scm b/tests/packages.scm index 98fa9b5698..b2f09c6d6c 100644 --- a/tests/packages.scm +++ b/tests/packages.scm @@ -335,10 +335,10 @@ search-paths))))))) (x (list (search-path-specification (variable "GUILE_LOAD_PATH") - (directories '("share/guile/site/2.0"))) + (files '("share/guile/site/2.0"))) (search-path-specification (variable "GUILE_LOAD_COMPILED_PATH") - (directories '("share/guile/site/2.0"))))) + (files '("share/guile/site/2.0"))))) (a (package (inherit (dummy-package "guile")) (build-system s) (native-search-paths x))) -- cgit v1.2.3 From 7ec02d374d1fa8a8f4034a996485872fd2aa7b73 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sat, 27 Dec 2014 22:55:34 +0100 Subject: build-support/gnu: Add support for file patterns in search paths. * guix/build/utils.scm (search-path-as-list): Add #:pattern parameter and honor it. (set-path-environment-variable): Likewise, and pass it to 'search-path-as-list'. * guix/packages.scm (search-path-specification->sexp): Add PATTERN slot. * guix/build/gnu-build-system.scm (set-paths): Adjust accordingly. --- guix/build/gnu-build-system.scm | 10 ++++++---- guix/build/utils.scm | 40 ++++++++++++++++++++++++++++++++-------- guix/packages.scm | 3 ++- 3 files changed, 40 insertions(+), 13 deletions(-) diff --git a/guix/build/gnu-build-system.scm b/guix/build/gnu-build-system.scm index d661736831..11b43c521f 100644 --- a/guix/build/gnu-build-system.scm +++ b/guix/build/gnu-build-system.scm @@ -73,21 +73,23 @@ input-directories))) (for-each (match-lambda - ((env-var (files ...) separator type) + ((env-var (files ...) separator type pattern) (set-path-environment-variable env-var files input-directories #:separator separator - #:type type))) + #:type type + #:pattern pattern))) search-paths) (when native-search-paths ;; Search paths for native inputs, when cross building. (for-each (match-lambda - ((env-var (files ...) separator type) + ((env-var (files ...) separator type pattern) (set-path-environment-variable env-var files native-input-directories #:separator separator - #:type type))) + #:type type + #:pattern pattern))) native-search-paths)) #t) diff --git a/guix/build/utils.scm b/guix/build/utils.scm index f22b2c3cb7..47bcb3e8a1 100644 --- a/guix/build/utils.scm +++ b/guix/build/utils.scm @@ -291,7 +291,7 @@ matches REGEXP." ;;; (define* (search-path-as-list files input-dirs - #:key (type 'directory)) + #:key (type 'directory) pattern) "Return the list of directories among FILES of the given TYPE (a symbol as returned by 'stat:type') that exist in INPUT-DIRS. Example: @@ -300,13 +300,26 @@ returned by 'stat:type') that exist in INPUT-DIRS. Example: => (\"/package1/share/emacs/site-lisp\" \"/package3/share/emacs/site-lisp\") +When PATTERN is true, it is a regular expression denoting file names to look +for under the directories designated by FILES. For example: + + (search-path-as-list '(\"xml\") (list docbook-xml docbook-xsl) + #:type 'regular + #:pattern \"^catalog\\\\.xml$\") + => (\"/…/xml/dtd/docbook/catalog.xml\" + \"/…/xml/xsl/docbook-xsl-1.78.1/catalog.xml\") " (append-map (lambda (input) - (filter-map (lambda (file) - (let* ((file (string-append input "/" file)) - (stat (stat file #f))) - (and stat (eq? type (stat:type stat)) - file))) + (append-map (lambda (file) + (let ((file (string-append input "/" file))) + ;; XXX: By using 'find-files', we implicitly + ;; assume #:type 'regular. + (if pattern + (find-files file pattern) + (let ((stat (stat file #f))) + (if (and stat (eq? type (stat:type stat))) + (list file) + '()))))) files)) input-dirs)) @@ -319,7 +332,8 @@ returned by 'stat:type') that exist in INPUT-DIRS. Example: (define* (set-path-environment-variable env-var files input-dirs #:key (separator ":") - (type 'directory)) + (type 'directory) + pattern) "Look for each of FILES of the given TYPE (a symbol as returned by 'stat:type') in INPUT-DIRS. Set ENV-VAR to a SEPARATOR-separated path accordingly. Example: @@ -327,9 +341,19 @@ accordingly. Example: (set-path-environment-variable \"PKG_CONFIG\" '(\"lib/pkgconfig\") (list package1 package2)) + +When PATTERN is not #f, it must be a regular expression (really a string) +denoting file names to look for under the directories designated by FILES: + + (set-path-environment-variable \"XML_CATALOG_FILES\" + '(\"xml\") + (list docbook-xml docbook-xsl) + #:type 'regular + #:pattern \"^catalog\\\\.xml$\") " (let* ((path (search-path-as-list files input-dirs - #:type type)) + #:type type + #:pattern pattern)) (value (list->search-path-as-string path separator))) (if (string-null? value) (begin diff --git a/guix/packages.scm b/guix/packages.scm index b375895785..e299962a2e 100644 --- a/guix/packages.scm +++ b/guix/packages.scm @@ -181,7 +181,8 @@ representation." corresponds to the arguments expected by `set-path-environment-variable'." (match spec (($ variable files separator type) - `(,variable ,files ,separator ,type)))) + ;; TODO: Add support for PATTERN. + `(,variable ,files ,separator ,type #f)))) (define %supported-systems ;; This is the list of system types that are supported. By default, we -- cgit v1.2.3 From 7b21fe538512b452c87389607f569668a7f1a1a4 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sat, 27 Dec 2014 23:15:11 +0100 Subject: packages: Add 'file-pattern' field to 'search-path-specification'. * guix/packages.scm ()[file-pattern]: New field. (search-path-specification->sexp): Honor it. --- guix/packages.scm | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/guix/packages.scm b/guix/packages.scm index e299962a2e..68fd531c6b 100644 --- a/guix/packages.scm +++ b/guix/packages.scm @@ -171,18 +171,21 @@ representation." (define-record-type* search-path-specification make-search-path-specification search-path-specification? - (variable search-path-specification-variable) - (files search-path-specification-files) - (separator search-path-specification-separator (default ":")) - (file-type search-path-specification-file-type (default 'directory))) + (variable search-path-specification-variable) ;string + (files search-path-specification-files) ;list of strings + (separator search-path-specification-separator ;string + (default ":")) + (file-type search-path-specification-file-type ;symbol + (default 'directory)) + (file-pattern search-path-specification-file-pattern ;#f | string + (default #f))) (define (search-path-specification->sexp spec) "Return an sexp representing SPEC, a . The sexp corresponds to the arguments expected by `set-path-environment-variable'." (match spec - (($ variable files separator type) - ;; TODO: Add support for PATTERN. - `(,variable ,files ,separator ,type #f)))) + (($ variable files separator type pattern) + `(,variable ,files ,separator ,type ,pattern)))) (define %supported-systems ;; This is the list of system types that are supported. By default, we -- cgit v1.2.3 From bd2fc4d81342dc15feba2998835e69dabee08864 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sat, 27 Dec 2014 23:24:35 +0100 Subject: utils: Export 'search-path-as-list'. * guix/build/utils.scm (search-path-as-list): Make public. * guix/scripts/environment.scm (for-each-search-path): Use it. --- guix/build/utils.scm | 1 + guix/scripts/environment.scm | 5 ++--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/guix/build/utils.scm b/guix/build/utils.scm index 47bcb3e8a1..86b7ca0155 100644 --- a/guix/build/utils.scm +++ b/guix/build/utils.scm @@ -45,6 +45,7 @@ delete-file-recursively find-files + search-path-as-list set-path-environment-variable search-path-as-string->list list->search-path-as-string diff --git a/guix/scripts/environment.scm b/guix/scripts/environment.scm index 412b8be658..b3a79d9251 100644 --- a/guix/scripts/environment.scm +++ b/guix/scripts/environment.scm @@ -45,9 +45,8 @@ path value is appended." (($ variable directories separator) (let* ((current (getenv variable)) - (path ((@@ (guix build utils) search-path-as-list) - directories paths)) - (value (list->search-path-as-string path separator))) + (path (search-path-as-list directories paths)) + (value (list->search-path-as-string path separator))) (proc variable (if (and current (not pure?)) (string-append value separator current) -- cgit v1.2.3 From cc9a5c1454f49850c078045c88a300c1195eabc8 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sat, 27 Dec 2014 23:46:10 +0100 Subject: guix package: Use 'search-path-as-list' instead of custom code. This will handle the new 'file-type' and 'file-pattern' fields correctly. * guix/scripts/package.scm (search-path-environment-variables)[search-path-definition]: Rewrite in terms of 'search-path-as-list'. --- guix/scripts/package.scm | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/guix/scripts/package.scm b/guix/scripts/package.scm index 21dc66cb75..2f694cd55f 100644 --- a/guix/scripts/package.scm +++ b/guix/scripts/package.scm @@ -29,7 +29,8 @@ #:use-module (guix utils) #:use-module (guix config) #:use-module (guix scripts build) - #:use-module ((guix build utils) #:select (directory-exists? mkdir-p)) + #:use-module ((guix build utils) + #:select (directory-exists? mkdir-p search-path-as-list)) #:use-module (ice-9 format) #:use-module (ice-9 match) #:use-module (ice-9 regex) @@ -362,19 +363,19 @@ current settings and report only settings not already effective." (define search-path-definition (match-lambda - (($ variable directories separator) - (let ((values (or (and=> (getenv variable) - (cut string-tokenize* <> separator)) - '())) - (directories (filter file-exists? - (map (cut string-append profile - "/" <>) - directories)))) - (if (every (cut member <> values) directories) + (($ variable files separator + type pattern) + (let ((values (or (and=> (getenv variable) + (cut string-tokenize* <> separator)) + '())) + (path (search-path-as-list files (list profile) + #:type type + #:pattern pattern))) + (if (every (cut member <> values) path) #f (format #f "export ~a=\"~a\"" variable - (string-join directories separator))))))) + (string-join path separator))))))) (let* ((packages (filter-map manifest-entry->package entries)) (search-paths (delete-duplicates -- cgit v1.2.3 From 2a8d44015ff2672b7a9a2ea5054b51a83b0e934b Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sat, 27 Dec 2014 23:54:23 +0100 Subject: gnu: libxml2: Add search path specification. * gnu/packages/xml.scm (libxml2)[native-search-paths, search-paths]: New fields. * gnu/packages/gnome.scm (gnome-doc-utils)[arguments]: Remove. * gnu/packages/gps.scm (gpscorrelate)[arguments]: Remove settings for 'XML_CATALOG_FILES' from 'configure' phase. * gnu/packages/web.scm (tinyproxy)[arguments]: Likewise. --- gnu/packages/gnome.scm | 11 ----------- gnu/packages/gps.scm | 12 +----------- gnu/packages/web.scm | 11 +---------- gnu/packages/xml.scm | 12 ++++++++++++ 4 files changed, 14 insertions(+), 32 deletions(-) diff --git a/gnu/packages/gnome.scm b/gnu/packages/gnome.scm index d9a22b41bb..daa172fe2a 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.") (base32 "19n4x25ndzngaciiyd8dd6s2mf9gv6nv3wv27ggns2smm7zkj1nb")))) (build-system gnu-build-system) - (arguments - `(#:phases - (alist-cons-before - 'check 'pre-check - (lambda* (#:key inputs #:allow-other-keys #:rest args) - ;; This is needed, because without it, xmlint etc tries - ;; to download docbookx.dtd from the net - (setenv "XML_CATALOG_FILES" - (string-append (assoc-ref inputs "docbook-xml") - "/xml/dtd/docbook/catalog.xml"))) - %standard-phases))) (native-inputs `(("intltool" ,intltool) ("docbook-xml" ,docbook-xml-4.4) diff --git a/gnu/packages/gps.scm b/gnu/packages/gps.scm index 1fbf38f125..231b1d1b04 100644 --- a/gnu/packages/gps.scm +++ b/gnu/packages/gps.scm @@ -100,17 +100,7 @@ manipulate maps.") (substitute* "Makefile" (("prefix[[:blank:]]*=.*$") (string-append "prefix = " (assoc-ref outputs "out") - "\n"))) - - ;; Make sure the DocBook XML and XSL files are found. - ;; Note: this is a space-separated list. - (setenv "XML_CATALOG_FILES" - (string-append (assoc-ref inputs "docbook-xml") - "/xml/dtd/docbook/catalog.xml " - (assoc-ref inputs "docbook-xsl") - "/xml/xsl/" - ,(package-full-name docbook-xsl) - "/catalog.xml"))) + "\n")))) %standard-phases) #:tests? #f)) (inputs diff --git a/gnu/packages/web.scm b/gnu/packages/web.scm index 1ff3dfb5a5..8a64211697 100644 --- a/gnu/packages/web.scm +++ b/gnu/packages/web.scm @@ -644,16 +644,7 @@ help you implement simple HTTP servers.") ;; Uncommenting the next two lines may assist in debugging ;; (substitute* "docs/man5/Makefile" (("a2x") "a2x -v")) ;; (setenv "XML_DEBUG_CATALOG" "1") - - (setenv "XML_CATALOG_FILES" - (string-append - (assoc-ref inputs "docbook-xsl") - "/xml/xsl/docbook-xsl-1.78.1/catalog.xml" - ;; Contrary to the documentation, the file names must - ;; be separated by a space, not a colon. - " " - (assoc-ref inputs "docbook-xml") - "/xml/dtd/docbook/catalog.xml"))) + #t) %standard-phases))) ;; All of the below are used to generate the documentation ;; (Should they be propagated inputs of asciidoc ??) diff --git a/gnu/packages/xml.scm b/gnu/packages/xml.scm index 63d0ef2132..62f8c3c376 100644 --- a/gnu/packages/xml.scm +++ b/gnu/packages/xml.scm @@ -68,6 +68,18 @@ things the parser might find in the XML document (like start tags).") (inputs `(("zlib" ,zlib))) (native-inputs `(("perl" ,perl) ("python" ,python-2))) ; incompatible with Python 3 (print syntax) + + + ;; $XML_CATALOG_FILES lists 'catalog.xml' files found in under the 'xml' + ;; sub-directory of any given package. + (native-search-paths (search-path-specification + (variable "XML_CATALOG_FILES") + (separator " ") + (files '("xml")) + (file-pattern "^catalog\\.xml$") + (file-type 'regular))) + (search-paths native-search-paths) + (arguments `(#:phases (alist-replace -- cgit v1.2.3 From f05bdc9412135f34a1c417edc203c35cd005d0d5 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sun, 28 Dec 2014 23:46:59 +0100 Subject: gnu: Don't use --strip-all in cases where this is problematic. This is a followup to 856ae5e. See for an example of build failure. * guix/build/gnu-build-system.scm (strip): Add #:archive-strip-flags parameter. Use it when (ar-file? path). * guix/build-system/gnu.scm (gnu-build): Add #:archive-strip-flags parameter and pass it down. * gnu/packages/commencement.scm (gcc-boot0)[arguments]: Add #:strip-flags. * gnu/packages/base.scm (glibc)[arguments]: Likewise. --- gnu/packages/base.scm | 3 +++ gnu/packages/commencement.scm | 4 ++++ guix/build-system/gnu.scm | 2 ++ guix/build/gnu-build-system.scm | 11 ++++++++++- 4 files changed, 19 insertions(+), 1 deletion(-) diff --git a/gnu/packages/base.scm b/gnu/packages/base.scm index 5bf27c9ef1..b4f4d8ee06 100644 --- a/gnu/packages/base.scm +++ b/gnu/packages/base.scm @@ -421,6 +421,9 @@ included.") ;; XXX: Work around "undefined reference to `__stack_chk_guard'". "libc_cv_ssp=no") + ;; Using '--strip-all' on crt*.o breaks them. + #:strip-flags '("--strip-debug") + #:tests? #f ; XXX #:phases (alist-cons-before 'configure 'pre-configure diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm index 20831de997..309e195bc2 100644 --- a/gnu/packages/commencement.scm +++ b/gnu/packages/commencement.scm @@ -170,6 +170,10 @@ identifier SYSTEM." (ice-9 regex) (srfi srfi-1) (srfi srfi-26)) + + ;; Using '--strip-all' leads to a link failure while building libc. + #:strip-flags '("--strip-debug") + ,@(substitute-keyword-arguments (package-arguments gcc-4.8) ((#:configure-flags flags) `(append (list ,(string-append "--target=" (boot-triplet)) diff --git a/guix/build-system/gnu.scm b/guix/build-system/gnu.scm index f765a144c4..e2b41b1898 100644 --- a/guix/build-system/gnu.scm +++ b/guix/build-system/gnu.scm @@ -275,6 +275,7 @@ standard packages used as implicit inputs of the GNU build system." (patch-shebangs? #t) (strip-binaries? #t) (strip-flags ''("--strip-all")) + (archive-strip-flags ''("--strip-debug")) (strip-directories ''("lib" "lib64" "libexec" "bin" "sbin")) (phases '%standard-phases) @@ -338,6 +339,7 @@ are allowed to refer to." #:patch-shebangs? ,patch-shebangs? #:strip-binaries? ,strip-binaries? #:strip-flags ,strip-flags + #:archive-strip-flags ,archive-strip-flags #:strip-directories ,strip-directories))) (define guile-for-build diff --git a/guix/build/gnu-build-system.scm b/guix/build/gnu-build-system.scm index 11b43c521f..a985b1c715 100644 --- a/guix/build/gnu-build-system.scm +++ b/guix/build/gnu-build-system.scm @@ -298,6 +298,12 @@ makefiles." (string-append target "-objcopy") "objcopy")) (strip-flags '("--strip-all")) + + ;; Using '--strip-all' on .a file would remove the archive + ;; index, leading to "Archive has no index" errors when + ;; linking against them. + (archive-strip-flags '("--strip-debug")) + (strip-directories '("lib" "lib64" "libexec" "bin" "sbin")) #:allow-other-keys) @@ -353,7 +359,10 @@ makefiles." (or (not debug-output) (make-debug-file path)) (zero? (apply system* strip-command - (append strip-flags (list path)))) + (append (if (ar-file? path) + archive-strip-flags + strip-flags) + (list path)))) (or (not debug-output) (add-debug-link path)))) (const #t) ; down -- cgit v1.2.3 From 7da473b75721e06237b106c6d186f2729117b1ee Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Mon, 29 Dec 2014 21:44:48 +0100 Subject: gnu: Revert use of '--strip-all'. This reverts commits f05bdc9412135f34a1c417edc203c35cd005d0d5 and 856ae5e6c71a1283a414d33e638051f95d3cce35. This broke all sorts of things. See , for example. --- gnu/packages/base.scm | 3 --- gnu/packages/commencement.scm | 4 ---- gnu/packages/linux.scm | 5 ----- guix/build-system/gnu.scm | 4 +--- guix/build/gnu-build-system.scm | 13 ++----------- 5 files changed, 3 insertions(+), 26 deletions(-) diff --git a/gnu/packages/base.scm b/gnu/packages/base.scm index b4f4d8ee06..5bf27c9ef1 100644 --- a/gnu/packages/base.scm +++ b/gnu/packages/base.scm @@ -421,9 +421,6 @@ included.") ;; XXX: Work around "undefined reference to `__stack_chk_guard'". "libc_cv_ssp=no") - ;; Using '--strip-all' on crt*.o breaks them. - #:strip-flags '("--strip-debug") - #:tests? #f ; XXX #:phases (alist-cons-before 'configure 'pre-configure diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm index 309e195bc2..20831de997 100644 --- a/gnu/packages/commencement.scm +++ b/gnu/packages/commencement.scm @@ -170,10 +170,6 @@ identifier SYSTEM." (ice-9 regex) (srfi srfi-1) (srfi srfi-26)) - - ;; Using '--strip-all' leads to a link failure while building libc. - #:strip-flags '("--strip-debug") - ,@(substitute-keyword-arguments (package-arguments gcc-4.8) ((#:configure-flags flags) `(append (list ,(string-append "--target=" (boot-triplet)) diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm index 53368251b5..9dc5f5cd40 100644 --- a/gnu/packages/linux.scm +++ b/gnu/packages/linux.scm @@ -292,11 +292,6 @@ for SYSTEM, or #f if there is no configuration for SYSTEM." (alist-replace 'install ,install-phase (alist-delete 'configure %standard-phases))) - - ;; Use '--strip-debug', not '--strip-all', because the latter leads to - ;; unloadable modules (due to the lack of a symbol table.) - #:strip-flags '("--strip-debug") - #:tests? #f)) (synopsis "100% free redistribution of a cleaned Linux kernel") (description diff --git a/guix/build-system/gnu.scm b/guix/build-system/gnu.scm index e2b41b1898..c675155a6a 100644 --- a/guix/build-system/gnu.scm +++ b/guix/build-system/gnu.scm @@ -274,8 +274,7 @@ standard packages used as implicit inputs of the GNU build system." (parallel-tests? #t) (patch-shebangs? #t) (strip-binaries? #t) - (strip-flags ''("--strip-all")) - (archive-strip-flags ''("--strip-debug")) + (strip-flags ''("--strip-debug")) (strip-directories ''("lib" "lib64" "libexec" "bin" "sbin")) (phases '%standard-phases) @@ -339,7 +338,6 @@ are allowed to refer to." #:patch-shebangs? ,patch-shebangs? #:strip-binaries? ,strip-binaries? #:strip-flags ,strip-flags - #:archive-strip-flags ,archive-strip-flags #:strip-directories ,strip-directories))) (define guile-for-build diff --git a/guix/build/gnu-build-system.scm b/guix/build/gnu-build-system.scm index a985b1c715..1311cdcc9a 100644 --- a/guix/build/gnu-build-system.scm +++ b/guix/build/gnu-build-system.scm @@ -297,13 +297,7 @@ makefiles." (objcopy-command (if target (string-append target "-objcopy") "objcopy")) - (strip-flags '("--strip-all")) - - ;; Using '--strip-all' on .a file would remove the archive - ;; index, leading to "Archive has no index" errors when - ;; linking against them. - (archive-strip-flags '("--strip-debug")) - + (strip-flags '("--strip-debug")) (strip-directories '("lib" "lib64" "libexec" "bin" "sbin")) #:allow-other-keys) @@ -359,10 +353,7 @@ makefiles." (or (not debug-output) (make-debug-file path)) (zero? (apply system* strip-command - (append (if (ar-file? path) - archive-strip-flags - strip-flags) - (list path)))) + (append strip-flags (list path)))) (or (not debug-output) (add-debug-link path)))) (const #t) ; down -- cgit v1.2.3 From 26804e1351a86bfcde1b8bebeb984b9c79e6fe6f Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Tue, 30 Dec 2014 13:57:40 -0500 Subject: gnu: glibc: Add fixes for CVE-2014-7817 and CVE-2012-3406. * gnu/packages/patches/glibc-CVE-2012-3406.patch, gnu/packages/patches/glibc-CVE-2014-7817.patch: New files. * gnu-system.am (dist_patch_DATA): Add them. * gnu/packages/base.scm (glibc): Add patches. --- gnu-system.am | 2 + gnu/packages/base.scm | 4 +- gnu/packages/patches/glibc-CVE-2012-3406.patch | 282 +++++++++++++++++++++++++ gnu/packages/patches/glibc-CVE-2014-7817.patch | 171 +++++++++++++++ 4 files changed, 458 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/glibc-CVE-2012-3406.patch create mode 100644 gnu/packages/patches/glibc-CVE-2014-7817.patch diff --git a/gnu-system.am b/gnu-system.am index c2266c0da4..729d185d47 100644 --- a/gnu-system.am +++ b/gnu-system.am @@ -362,6 +362,8 @@ dist_patch_DATA = \ gnu/packages/patches/glib-tests-prlimit.patch \ gnu/packages/patches/glib-tests-timer.patch \ gnu/packages/patches/glib-tests-gapplication.patch \ + gnu/packages/patches/glibc-CVE-2012-3406.patch \ + gnu/packages/patches/glibc-CVE-2014-7817.patch \ gnu/packages/patches/glibc-bootstrap-system.patch \ gnu/packages/patches/glibc-ldd-x86_64.patch \ gnu/packages/patches/gnunet-fix-scheduler.patch \ diff --git a/gnu/packages/base.scm b/gnu/packages/base.scm index 5bf27c9ef1..117ee74b97 100644 --- a/gnu/packages/base.scm +++ b/gnu/packages/base.scm @@ -375,7 +375,9 @@ included.") (("use_ldconfig=yes") "use_ldconfig=no"))) (modules '((guix build utils))) - (patches (list (search-patch "glibc-ldd-x86_64.patch"))))) + (patches (list (search-patch "glibc-CVE-2014-7817.patch") + (search-patch "glibc-CVE-2012-3406.patch") + (search-patch "glibc-ldd-x86_64.patch"))))) (build-system gnu-build-system) ;; Glibc's refers to , for instance, so glibc 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 0000000000..9147a2aeee --- /dev/null +++ b/gnu/packages/patches/glibc-CVE-2012-3406.patch @@ -0,0 +1,282 @@ +Fix CVE-2012-3406: Stack overflow in vfprintf [BZ #16617] + +Note: Here the ChangeLog and NEWS updates are removed from Jeff's + patch, since they depend on other earlier commits. + +From: Jeff Law +Date: Mon, 15 Dec 2014 09:09:32 +0000 (+0100) +Subject: CVE-2012-3406: Stack overflow in vfprintf [BZ #16617] +X-Git-Url: https://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff_plain;h=a3a1f4163c4d0f9a36056c8640661a88674ae8a2 + +CVE-2012-3406: Stack overflow in vfprintf [BZ #16617] + +A larger number of format specifiers coudld cause a stack overflow, +potentially allowing to bypass _FORTIFY_SOURCE format string +protection. + +(cherry picked from commit a5357b7ce2a2982c5778435704bcdb55ce3667a0) +(cherry picked from commit ae61fc7b33d9d99d2763c16de8275227dc9748ba) + +Conflicts: + NEWS +--- + +diff --git a/stdio-common/Makefile b/stdio-common/Makefile +index 5f8e534..e5e45b6 100644 +--- a/stdio-common/Makefile ++++ b/stdio-common/Makefile +@@ -57,7 +57,7 @@ tests := tstscanf test_rdwr test-popen tstgetln test-fseek \ + bug19 bug19a tst-popen2 scanf13 scanf14 scanf15 bug20 bug21 bug22 \ + scanf16 scanf17 tst-setvbuf1 tst-grouping bug23 bug24 \ + bug-vfprintf-nargs tst-long-dbl-fphex tst-fphex-wide tst-sprintf3 \ +- bug25 tst-printf-round bug26 ++ bug25 tst-printf-round bug23-2 bug23-3 bug23-4 bug26 + + test-srcs = tst-unbputc tst-printf + +diff --git a/stdio-common/bug23-2.c b/stdio-common/bug23-2.c +new file mode 100644 +index 0000000..9e0cfe6 +--- /dev/null ++++ b/stdio-common/bug23-2.c +@@ -0,0 +1,70 @@ ++#include ++#include ++#include ++ ++static const char expected[] = "\ ++\n\ ++a\n\ ++abbcd55\ ++\n\ ++a\n\ ++abbcd55\ ++\n\ ++a\n\ ++abbcd55\ ++\n\ ++a\n\ ++abbcd55\ ++\n\ ++a\n\ ++abbcd55\ ++\n\ ++a\n\ ++abbcd55\ ++\n\ ++a\n\ ++abbcd55\ ++\n\ ++a\n\ ++abbcd55\ ++\n\ ++a\n\ ++abbcd55\ ++\n\ ++a\n\ ++abbcd55\ ++\n\ ++a\n\ ++abbcd55\ ++\n\ ++a\n\ ++abbcd55\ ++\n\ ++a\n\ ++abbcd55%%%%%%%%%%%%%%%%%%%%%%%%%%\n"; ++ ++static int ++do_test (void) ++{ ++ char *buf = malloc (strlen (expected) + 1); ++ snprintf (buf, strlen (expected) + 1, ++ "\n%1$s\n" "%1$s" "%2$s" "%2$s" "%3$s" "%4$s" "%5$d" "%5$d" ++ "\n%1$s\n" "%1$s" "%2$s" "%2$s" "%3$s" "%4$s" "%5$d" "%5$d" ++ "\n%1$s\n" "%1$s" "%2$s" "%2$s" "%3$s" "%4$s" "%5$d" "%5$d" ++ "\n%1$s\n" "%1$s" "%2$s" "%2$s" "%3$s" "%4$s" "%5$d" "%5$d" ++ "\n%1$s\n" "%1$s" "%2$s" "%2$s" "%3$s" "%4$s" "%5$d" "%5$d" ++ "\n%1$s\n" "%1$s" "%2$s" "%2$s" "%3$s" "%4$s" "%5$d" "%5$d" ++ "\n%1$s\n" "%1$s" "%2$s" "%2$s" "%3$s" "%4$s" "%5$d" "%5$d" ++ "\n%1$s\n" "%1$s" "%2$s" "%2$s" "%3$s" "%4$s" "%5$d" "%5$d" ++ "\n%1$s\n" "%1$s" "%2$s" "%2$s" "%3$s" "%4$s" "%5$d" "%5$d" ++ "\n%1$s\n" "%1$s" "%2$s" "%2$s" "%3$s" "%4$s" "%5$d" "%5$d" ++ "\n%1$s\n" "%1$s" "%2$s" "%2$s" "%3$s" "%4$s" "%5$d" "%5$d" ++ "\n%1$s\n" "%1$s" "%2$s" "%2$s" "%3$s" "%4$s" "%5$d" "%5$d" ++ "\n%1$s\n" "%1$s" "%2$s" "%2$s" "%3$s" "%4$s" "%5$d" "%5$d" ++ "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n", ++ "a", "b", "c", "d", 5); ++ return strcmp (buf, expected) != 0; ++} ++ ++#define TEST_FUNCTION do_test () ++#include "../test-skeleton.c" +diff --git a/stdio-common/bug23-3.c b/stdio-common/bug23-3.c +new file mode 100644 +index 0000000..57c8cef +--- /dev/null ++++ b/stdio-common/bug23-3.c +@@ -0,0 +1,50 @@ ++#include ++#include ++#include ++ ++int ++do_test (void) ++{ ++ size_t instances = 16384; ++#define X0 "\n%1$s\n" "%1$s" "%2$s" "%2$s" "%3$s" "%4$s" "%5$d" "%5$d" ++ const char *item = "\na\nabbcd55"; ++#define X3 X0 X0 X0 X0 X0 X0 X0 X0 ++#define X6 X3 X3 X3 X3 X3 X3 X3 X3 ++#define X9 X6 X6 X6 X6 X6 X6 X6 X6 ++#define X12 X9 X9 X9 X9 X9 X9 X9 X9 ++#define X14 X12 X12 X12 X12 ++#define TRAILER "%%%%%%%%%%%%%%%%%%%%%%%%%%" ++#define TRAILER2 TRAILER TRAILER ++ size_t length = instances * strlen (item) + strlen (TRAILER) + 1; ++ ++ char *buf = malloc (length + 1); ++ snprintf (buf, length + 1, ++ X14 TRAILER2 "\n", ++ "a", "b", "c", "d", 5); ++ ++ const char *p = buf; ++ size_t i; ++ for (i = 0; i < instances; ++i) ++ { ++ const char *expected; ++ for (expected = item; *expected; ++expected) ++ { ++ if (*p != *expected) ++ { ++ printf ("mismatch at offset %zu (%zu): expected %d, got %d\n", ++ (size_t) (p - buf), i, *expected & 0xFF, *p & 0xFF); ++ return 1; ++ } ++ ++p; ++ } ++ } ++ if (strcmp (p, TRAILER "\n") != 0) ++ { ++ printf ("mismatch at trailer: [%s]\n", p); ++ return 1; ++ } ++ free (buf); ++ return 0; ++} ++#define TEST_FUNCTION do_test () ++#include "../test-skeleton.c" +diff --git a/stdio-common/bug23-4.c b/stdio-common/bug23-4.c +new file mode 100644 +index 0000000..a478564 +--- /dev/null ++++ b/stdio-common/bug23-4.c +@@ -0,0 +1,31 @@ ++#include ++#include ++#include ++#include ++ ++#define LIMIT 1000000 ++ ++int ++main (void) ++{ ++ struct rlimit lim; ++ getrlimit (RLIMIT_STACK, &lim); ++ lim.rlim_cur = 1048576; ++ setrlimit (RLIMIT_STACK, &lim); ++ char *fmtstr = malloc (4 * LIMIT + 1); ++ if (fmtstr == NULL) ++ abort (); ++ char *output = malloc (LIMIT + 1); ++ if (output == NULL) ++ abort (); ++ for (size_t i = 0; i < LIMIT; i++) ++ memcpy (fmtstr + 4 * i, "%1$d", 4); ++ fmtstr[4 * LIMIT] = '\0'; ++ int ret = snprintf (output, LIMIT + 1, fmtstr, 0); ++ if (ret != LIMIT) ++ abort (); ++ for (size_t i = 0; i < LIMIT; i++) ++ if (output[i] != '0') ++ abort (); ++ return 0; ++} +diff --git a/stdio-common/vfprintf.c b/stdio-common/vfprintf.c +index c4ff833..429a3d1 100644 +--- a/stdio-common/vfprintf.c ++++ b/stdio-common/vfprintf.c +@@ -263,6 +263,12 @@ vfprintf (FILE *s, const CHAR_T *format, va_list ap) + /* For the argument descriptions, which may be allocated on the heap. */ + void *args_malloced = NULL; + ++ /* For positional argument handling. */ ++ struct printf_spec *specs; ++ ++ /* Track if we malloced the SPECS array and thus must free it. */ ++ bool specs_malloced = false; ++ + /* This table maps a character into a number representing a + class. In each step there is a destination label for each + class. */ +@@ -1679,8 +1685,8 @@ do_positional: + size_t nspecs = 0; + /* A more or less arbitrary start value. */ + size_t nspecs_size = 32 * sizeof (struct printf_spec); +- struct printf_spec *specs = alloca (nspecs_size); + ++ specs = alloca (nspecs_size); + /* The number of arguments the format string requests. This will + determine the size of the array needed to store the argument + attributes. */ +@@ -1721,11 +1727,39 @@ do_positional: + if (nspecs * sizeof (*specs) >= nspecs_size) + { + /* Extend the array of format specifiers. */ ++ if (nspecs_size * 2 < nspecs_size) ++ { ++ __set_errno (ENOMEM); ++ done = -1; ++ goto all_done; ++ } + struct printf_spec *old = specs; +- specs = extend_alloca (specs, nspecs_size, 2 * nspecs_size); ++ if (__libc_use_alloca (2 * nspecs_size)) ++ specs = extend_alloca (specs, nspecs_size, 2 * nspecs_size); ++ else ++ { ++ nspecs_size *= 2; ++ specs = malloc (nspecs_size); ++ if (specs == NULL) ++ { ++ __set_errno (ENOMEM); ++ specs = old; ++ done = -1; ++ goto all_done; ++ } ++ } + + /* Copy the old array's elements to the new space. */ + memmove (specs, old, nspecs * sizeof (*specs)); ++ ++ /* If we had previously malloc'd space for SPECS, then ++ release it after the copy is complete. */ ++ if (specs_malloced) ++ free (old); ++ ++ /* Now set SPECS_MALLOCED if needed. */ ++ if (!__libc_use_alloca (nspecs_size)) ++ specs_malloced = true; + } + + /* Parse the format specifier. */ +@@ -2046,6 +2080,8 @@ do_positional: + } + + all_done: ++ if (specs_malloced) ++ free (specs); + if (__glibc_unlikely (args_malloced != NULL)) + free (args_malloced); + 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 0000000000..14c885523c --- /dev/null +++ b/gnu/packages/patches/glibc-CVE-2014-7817.patch @@ -0,0 +1,171 @@ +Fix CVE-2014-7817: wordexp fails to honour WRDE_NOCMD. + +Note: Here the ChangeLog and NEWS updates are removed from Carlos's + patch, since they depend on other earlier commits. + +From: Carlos O'Donell +Date: Wed, 19 Nov 2014 16:44:12 +0000 (-0500) +Subject: CVE-2014-7817: wordexp fails to honour WRDE_NOCMD. +X-Git-Url: https://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff_plain;h=33ceaf6187b31ea15284ac65131749e1cb68d2ae + +CVE-2014-7817: wordexp fails to honour WRDE_NOCMD. + +The function wordexp() fails to properly handle the WRDE_NOCMD +flag when processing arithmetic inputs in the form of "$((... ``))" +where "..." can be anything valid. The backticks in the arithmetic +epxression are evaluated by in a shell even if WRDE_NOCMD forbade +command substitution. This allows an attacker to attempt to pass +dangerous commands via constructs of the above form, and bypass +the WRDE_NOCMD flag. This patch fixes this by checking for WRDE_NOCMD +in exec_comm(), the only place that can execute a shell. All other +checks for WRDE_NOCMD are superfluous and removed. + +We expand the testsuite and add 3 new regression tests of roughly +the same form but with a couple of nested levels. + +On top of the 3 new tests we add fork validation to the WRDE_NOCMD +testing. If any forks are detected during the execution of a wordexp() +call with WRDE_NOCMD, the test is marked as failed. This is slightly +heuristic since vfork might be used in the future, but it provides a +higher level of assurance that no shells were executed as part of +command substitution with WRDE_NOCMD in effect. In addition it doesn't +require libpthread or libdl, instead we use the public implementation +namespace function __register_atfork (already part of the public ABI +for libpthread). + +Tested on x86_64 with no regressions. + +(cherry picked from commit a39208bd7fb76c1b01c127b4c61f9bfd915bfe7c) +--- + +diff --git a/posix/wordexp-test.c b/posix/wordexp-test.c +index 4957006..bdd65e4 100644 +--- a/posix/wordexp-test.c ++++ b/posix/wordexp-test.c +@@ -27,6 +27,25 @@ + + #define IFS " \n\t" + ++extern void *__dso_handle __attribute__ ((__weak__, __visibility__ ("hidden"))); ++extern int __register_atfork (void (*) (void), void (*) (void), void (*) (void), void *); ++ ++static int __app_register_atfork (void (*prepare) (void), void (*parent) (void), void (*child) (void)) ++{ ++ return __register_atfork (prepare, parent, child, ++ &__dso_handle == NULL ? NULL : __dso_handle); ++} ++ ++/* Number of forks seen. */ ++static int registered_forks; ++ ++/* For each fork increment the fork count. */ ++static void ++register_fork (void) ++{ ++ registered_forks++; ++} ++ + struct test_case_struct + { + int retval; +@@ -206,6 +225,12 @@ struct test_case_struct + { WRDE_SYNTAX, NULL, "$((2+))", 0, 0, { NULL, }, IFS }, + { WRDE_SYNTAX, NULL, "`", 0, 0, { NULL, }, IFS }, + { WRDE_SYNTAX, NULL, "$((010+4+))", 0, 0, { NULL }, IFS }, ++ /* Test for CVE-2014-7817. We test 3 combinations of command ++ substitution inside an arithmetic expression to make sure that ++ no commands are executed and error is returned. */ ++ { WRDE_CMDSUB, NULL, "$((`echo 1`))", WRDE_NOCMD, 0, { NULL, }, IFS }, ++ { WRDE_CMDSUB, NULL, "$((1+`echo 1`))", WRDE_NOCMD, 0, { NULL, }, IFS }, ++ { WRDE_CMDSUB, NULL, "$((1+$((`echo 1`))))", WRDE_NOCMD, 0, { NULL, }, IFS }, + + { -1, NULL, NULL, 0, 0, { NULL, }, IFS }, + }; +@@ -258,6 +283,15 @@ main (int argc, char *argv[]) + return -1; + } + ++ /* If we are not allowed to do command substitution, we install ++ fork handlers to verify that no forks happened. No forks should ++ happen at all if command substitution is disabled. */ ++ if (__app_register_atfork (register_fork, NULL, NULL) != 0) ++ { ++ printf ("Failed to register fork handler.\n"); ++ return -1; ++ } ++ + for (test = 0; test_case[test].retval != -1; test++) + if (testit (&test_case[test])) + ++fail; +@@ -367,6 +401,9 @@ testit (struct test_case_struct *tc) + + printf ("Test %d (%s): ", ++tests, tc->words); + ++ if (tc->flags & WRDE_NOCMD) ++ registered_forks = 0; ++ + if (tc->flags & WRDE_APPEND) + { + /* initial wordexp() call, to be appended to */ +@@ -378,6 +415,13 @@ testit (struct test_case_struct *tc) + } + retval = wordexp (tc->words, &we, tc->flags); + ++ if ((tc->flags & WRDE_NOCMD) ++ && (registered_forks > 0)) ++ { ++ printf ("FAILED fork called for WRDE_NOCMD\n"); ++ return 1; ++ } ++ + if (tc->flags & WRDE_DOOFFS) + start_offs = sav_we.we_offs; + +diff --git a/posix/wordexp.c b/posix/wordexp.c +index b6b65dd..26f3a26 100644 +--- a/posix/wordexp.c ++++ b/posix/wordexp.c +@@ -893,6 +893,10 @@ exec_comm (char *comm, char **word, size_t *word_length, size_t *max_length, + pid_t pid; + int noexec = 0; + ++ /* Do nothing if command substitution should not succeed. */ ++ if (flags & WRDE_NOCMD) ++ return WRDE_CMDSUB; ++ + /* Don't fork() unless necessary */ + if (!comm || !*comm) + return 0; +@@ -2082,9 +2086,6 @@ parse_dollars (char **word, size_t *word_length, size_t *max_length, + } + } + +- if (flags & WRDE_NOCMD) +- return WRDE_CMDSUB; +- + (*offset) += 2; + return parse_comm (word, word_length, max_length, words, offset, flags, + quoted? NULL : pwordexp, ifs, ifs_white); +@@ -2196,9 +2197,6 @@ parse_dquote (char **word, size_t *word_length, size_t *max_length, + break; + + case '`': +- if (flags & WRDE_NOCMD) +- return WRDE_CMDSUB; +- + ++(*offset); + error = parse_backtick (word, word_length, max_length, words, + offset, flags, NULL, NULL, NULL); +@@ -2357,12 +2355,6 @@ wordexp (const char *words, wordexp_t *pwordexp, int flags) + break; + + case '`': +- if (flags & WRDE_NOCMD) +- { +- error = WRDE_CMDSUB; +- goto do_error; +- } +- + ++words_offset; + error = parse_backtick (&word, &word_length, &max_length, words, + &words_offset, flags, pwordexp, ifs, -- cgit v1.2.3 From bf0baaf7db6c3ab7d54f274a8728612e323b1b08 Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Tue, 30 Dec 2014 19:58:05 -0500 Subject: gnu: glibc: MIPS: Avoid a dangling `vfork@GLIBC_2.0' reference. * gnu/packages/patches/glibc-mips-dangling-vfork-ref.patch: New file. * gnu-system.am (dist_patch_DATA): Add it. * gnu/packages/base.scm (glibc): Add patch. --- gnu-system.am | 1 + gnu/packages/base.scm | 1 + .../patches/glibc-mips-dangling-vfork-ref.patch | 45 ++++++++++++++++++++++ 3 files changed, 47 insertions(+) create mode 100644 gnu/packages/patches/glibc-mips-dangling-vfork-ref.patch diff --git a/gnu-system.am b/gnu-system.am index 729d185d47..405c01fb07 100644 --- a/gnu-system.am +++ b/gnu-system.am @@ -366,6 +366,7 @@ dist_patch_DATA = \ gnu/packages/patches/glibc-CVE-2014-7817.patch \ gnu/packages/patches/glibc-bootstrap-system.patch \ gnu/packages/patches/glibc-ldd-x86_64.patch \ + gnu/packages/patches/glibc-mips-dangling-vfork-ref.patch \ gnu/packages/patches/gnunet-fix-scheduler.patch \ gnu/packages/patches/gnunet-fix-tests.patch \ gnu/packages/patches/gobject-introspection-cc.patch \ diff --git a/gnu/packages/base.scm b/gnu/packages/base.scm index 117ee74b97..1f479ccbbe 100644 --- a/gnu/packages/base.scm +++ b/gnu/packages/base.scm @@ -377,6 +377,7 @@ included.") (modules '((guix build utils))) (patches (list (search-patch "glibc-CVE-2014-7817.patch") (search-patch "glibc-CVE-2012-3406.patch") + (search-patch "glibc-mips-dangling-vfork-ref.patch") (search-patch "glibc-ldd-x86_64.patch"))))) (build-system gnu-build-system) 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 0000000000..852b6de669 --- /dev/null +++ b/gnu/packages/patches/glibc-mips-dangling-vfork-ref.patch @@ -0,0 +1,45 @@ +Avoid a dangling `vfork@GLIBC_2.0' reference on MIPS. + +Note: Here the ChangeLog and NEWS updates are removed from Maciej's + patch, since they depend on other earlier commits. + +From: Maciej W. Rozycki +Date: Wed, 22 Oct 2014 14:20:37 +0000 (+0100) +Subject: MIPS: Avoid a dangling `vfork@GLIBC_2.0' reference +X-Git-Url: https://sourceware.org/git/?p=glibc.git;a=commitdiff_plain;h=c14e752fc73d34c75d4f84f37fea8e0b1734cf98 + +MIPS: Avoid a dangling `vfork@GLIBC_2.0' reference + +This satisfies a symbol reference created with: + + .symver __libc_vfork, vfork@GLIBC_2.0 + +where `__libc_vfork' has not been defined or referenced. In this case +the `vfork@GLIBC_2.0' reference is supposed to be discarded, however a +bug present in GAS since forever causes an undefined symbol table entry +to be created. This in turn triggers a problem in the linker that can +manifest itself by link errors such as: + +ld: libpthread.so: invalid string offset 2765592330 >= 5154 for section `.dynstr' + +The GAS and linker bugs need to be resolved, but we can avoid them too +by providing a `__libc_vfork' definition just like our other platforms. + + [BZ #17485] + * sysdeps/unix/sysv/linux/mips/vfork.S (__libc_vfork): Define. + +(cherry picked from commit b5af9297d51a43f96c5be1bafab032184690dd6f) + +Conflicts: + NEWS +--- + +diff --git a/sysdeps/unix/sysv/linux/mips/vfork.S b/sysdeps/unix/sysv/linux/mips/vfork.S +index 80c362d..2c1a747 100644 +--- a/sysdeps/unix/sysv/linux/mips/vfork.S ++++ b/sysdeps/unix/sysv/linux/mips/vfork.S +@@ -108,3 +108,4 @@ L(error): + + libc_hidden_def(__vfork) + weak_alias (__vfork, vfork) ++strong_alias (__vfork, __libc_vfork) -- cgit v1.2.3 From 7452806931216a5ec8712dd39327540a3307a6ce Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sat, 3 Jan 2015 18:48:16 +0100 Subject: gnu: libxml2: Wrap search path specification in a list. Reported by Mark H Weaver. * gnu/packages/xml.scm (libxml2)[native-search-paths]: Wrap into a list. --- gnu/packages/xml.scm | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/gnu/packages/xml.scm b/gnu/packages/xml.scm index 62f8c3c376..b4b91408af 100644 --- a/gnu/packages/xml.scm +++ b/gnu/packages/xml.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2013, 2014 Ludovic Courtès +;;; Copyright © 2013, 2014, 2015 Ludovic Courtès ;;; Copyright © 2013 Andreas Enge ;;; ;;; This file is part of GNU Guix. @@ -72,12 +72,12 @@ things the parser might find in the XML document (like start tags).") ;; $XML_CATALOG_FILES lists 'catalog.xml' files found in under the 'xml' ;; sub-directory of any given package. - (native-search-paths (search-path-specification - (variable "XML_CATALOG_FILES") - (separator " ") - (files '("xml")) - (file-pattern "^catalog\\.xml$") - (file-type 'regular))) + (native-search-paths (list (search-path-specification + (variable "XML_CATALOG_FILES") + (separator " ") + (files '("xml")) + (file-pattern "^catalog\\.xml$") + (file-type 'regular)))) (search-paths native-search-paths) (arguments -- cgit v1.2.3 From cf81a2363989429f4af518e92e7404655d45dbc7 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sat, 3 Jan 2015 19:46:07 +0100 Subject: guix package: Follow symlinks for pattern search paths. * guix/scripts/package.scm (search-path-environment-variables): Add local 'files' variable. * tests/packages.scm ("--search-paths with pattern"): New test. --- guix/scripts/package.scm | 17 ++++++++++------ tests/packages.scm | 51 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 62 insertions(+), 6 deletions(-) diff --git a/guix/scripts/package.scm b/guix/scripts/package.scm index 2f694cd55f..30b0658198 100644 --- a/guix/scripts/package.scm +++ b/guix/scripts/package.scm @@ -365,12 +365,17 @@ current settings and report only settings not already effective." (match-lambda (($ variable files separator type pattern) - (let ((values (or (and=> (getenv variable) - (cut string-tokenize* <> separator)) - '())) - (path (search-path-as-list files (list profile) - #:type type - #:pattern pattern))) + (let* ((values (or (and=> (getenv variable) + (cut string-tokenize* <> separator)) + '())) + ;; Add a trailing slash to force symlinks to be treated as + ;; directories when 'find-files' traverses them. + (files (if pattern + (map (cut string-append <> "/") files) + files)) + (path (search-path-as-list files (list profile) + #:type type + #:pattern pattern))) (if (every (cut member <> values) path) #f (format #f "export ~a=\"~a\"" diff --git a/tests/packages.scm b/tests/packages.scm index bb83032602..72c69ff653 100644 --- a/tests/packages.scm +++ b/tests/packages.scm @@ -19,6 +19,7 @@ (define-module (test-packages) #:use-module (guix tests) #:use-module (guix store) + #:use-module (guix monads) #:use-module ((guix utils) ;; Rename the 'location' binding to allow proper syntax ;; matching when setting the 'location' field of a package. @@ -31,10 +32,13 @@ #:use-module (guix build-system) #:use-module (guix build-system trivial) #:use-module (guix build-system gnu) + #:use-module (guix profiles) + #:use-module (guix scripts package) #:use-module (gnu packages) #:use-module (gnu packages base) #:use-module (gnu packages guile) #:use-module (gnu packages bootstrap) + #:use-module (gnu packages xml) #:use-module (srfi srfi-1) #:use-module (srfi srfi-26) #:use-module (srfi srfi-34) @@ -527,6 +531,53 @@ (((? (cut eq? hello <>))) #t) (wrong (pk 'find-packages-by-name wrong #f)))) +(test-assert "--search-paths with pattern" + ;; Make sure 'guix package --search-paths' correctly reports environment + ;; variables when file patterns are used (in particular, it must follow + ;; symlinks when looking for 'catalog.xml'.) To do that, we rely on the + ;; libxml2 package specification, which contains such a definition. + (let* ((p1 (package + (name "foo") (version "0") (source #f) + (build-system trivial-build-system) + (arguments + `(#:guile ,%bootstrap-guile + #:modules ((guix build utils)) + #:builder (begin + (use-modules (guix build utils)) + (let ((out (assoc-ref %outputs "out"))) + (mkdir-p (string-append out "/xml/bar/baz")) + (call-with-output-file + (string-append out "/xml/bar/baz/catalog.xml") + (lambda (port) + (display "xml? wat?!" port))))))) + (synopsis #f) (description #f) + (home-page #f) (license #f))) + (p2 (package + ;; Provide a fake libxml2 to avoid building the real one. This + ;; is OK because 'guix package' gets search path specifications + ;; from the same-named package found in the distro. + (name "libxml2") (version "0.0.0") (source #f) + (build-system trivial-build-system) + (arguments + `(#:guile ,%bootstrap-guile + #:builder (mkdir (assoc-ref %outputs "out")))) + (native-search-paths (package-native-search-paths libxml2)) + (synopsis #f) (description #f) + (home-page #f) (license #f))) + (prof (run-with-store %store + (profile-derivation + (manifest (map package->manifest-entry + (list p1 p2))) + #:info-dir? #f) + #:guile-for-build (%guile-for-build)))) + (build-derivations %store (list prof)) + (string-match (format #f "^export XML_CATALOG_FILES=\"~a/xml/+bar/baz/catalog\\.xml\"\n" + (derivation->output-path prof)) + (with-output-to-string + (lambda () + (guix-package "-p" (derivation->output-path prof) + "--search-paths")))))) + (test-end "packages") -- cgit v1.2.3 From ac70048be287bf4e1624051e74b3ecc3a295fa51 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sun, 4 Jan 2015 18:16:16 +0100 Subject: build-system/gnu: Use executables from the target inputs in 'patch-shebangs'. Fixes . * guix/build/gnu-build-system.scm (patch-shebangs): Add #:inputs parameter. Remove 'bindirs'. Add 'bin-directories', 'output-bindirs', and 'input-bindirs'. Use them instead of (getenv "PATH") to as the argument to 'patch-shebang'. --- guix/build/gnu-build-system.scm | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/guix/build/gnu-build-system.scm b/guix/build/gnu-build-system.scm index 1311cdcc9a..cdfba2f9b7 100644 --- a/guix/build/gnu-build-system.scm +++ b/guix/build/gnu-build-system.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2012, 2013, 2014 Ludovic Courtès +;;; Copyright © 2012, 2013, 2014, 2015 Ludovic Courtès ;;; ;;; This file is part of GNU Guix. ;;; @@ -265,7 +265,7 @@ makefiles." (define* (install #:key (make-flags '()) #:allow-other-keys) (zero? (apply system* "make" "install" make-flags))) -(define* (patch-shebangs #:key outputs (patch-shebangs? #t) +(define* (patch-shebangs #:key inputs outputs (patch-shebangs? #t) #:allow-other-keys) (define (list-of-files dir) (map (cut string-append dir "/" <>) @@ -274,20 +274,26 @@ makefiles." (eq? 'regular (stat:type s))))) '()))) - (define bindirs - (append-map (match-lambda - ((_ . dir) - (list (string-append dir "/bin") - (string-append dir "/sbin")))) - outputs)) + (define bin-directories + (match-lambda + ((_ . dir) + (list (string-append dir "/bin") + (string-append dir "/sbin"))))) + + (define output-bindirs + (append-map bin-directories outputs)) + + (define input-bindirs + ;; Shebangs should refer to binaries of the target system---i.e., from + ;; "inputs", not from "native-inputs". + (append-map bin-directories inputs)) (when patch-shebangs? - (let ((path (append bindirs - (search-path-as-string->list (getenv "PATH"))))) + (let ((path (append output-bindirs input-bindirs))) (for-each (lambda (dir) (let ((files (list-of-files dir))) (for-each (cut patch-shebang <> path) files))) - bindirs))) + output-bindirs))) #t) (define* (strip #:key target outputs (strip-binaries? #t) -- cgit v1.2.3 From d8491ba5630d31a58b89dfe5d423988ce736266b Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sun, 4 Jan 2015 22:21:11 +0100 Subject: ld-wrapper: Add '-rpath' flag for libraries passed by file name. Discussed at . * gnu/packages/ld-wrapper.scm (switch-arguments, library-path): Remove. (library-files-linked): Rewrite to include the name of libraries passed by file names, and to honor the current -L search path instead of the final one. (rpath-arguments): Remove 'lib-path' parameter. Expect LIBRARY-FILES to be a list of absolute file names. (ld-wrapper): Adjust accordingly. --- gnu/packages/ld-wrapper.scm | 95 ++++++++++++++++++++++++--------------------- 1 file changed, 50 insertions(+), 45 deletions(-) diff --git a/gnu/packages/ld-wrapper.scm b/gnu/packages/ld-wrapper.scm index d3eb083f2f..19856176b3 100644 --- a/gnu/packages/ld-wrapper.scm +++ b/gnu/packages/ld-wrapper.scm @@ -11,7 +11,7 @@ main="(@ (gnu build-support ld-wrapper) ld-wrapper)" exec @GUILE@ -c "(load-compiled \"$0.go\") (apply $main (cdr (command-line)))" "$@" !# ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2012, 2013, 2014 Ludovic Courtès +;;; Copyright © 2012, 2013, 2014, 2015 Ludovic Courtès ;;; ;;; This file is part of GNU Guix. ;;; @@ -30,6 +30,7 @@ exec @GUILE@ -c "(load-compiled \"$0.go\") (apply $main (cdr (command-line)))" " (define-module (gnu build-support ld-wrapper) #:use-module (srfi srfi-1) + #:use-module (ice-9 match) #:export (ld-wrapper)) ;;; Commentary: @@ -103,58 +104,62 @@ exec @GUILE@ -c "(load-compiled \"$0.go\") (apply $main (cdr (command-line)))" " (< depth %max-symlink-depth) (loop (readlink file) (+ 1 depth)))))))) -(define (switch-arguments switch args) - ;; Return the arguments passed for the occurrences of SWITCH--e.g., - ;; "-L"--in ARGS. - (let ((prefix-len (string-length switch))) - (fold-right (lambda (arg path) - (if (string-prefix? switch arg) - (cons (substring arg prefix-len) path) - path)) - '() - args))) - -(define (library-path args) - ;; Return the library search path extracted from `-L' switches in ARGS. - ;; Note: allow references to out-of-store directories. When this leads to - ;; actual impurities, this is caught later. - (switch-arguments "-L" args)) - (define (library-files-linked args) ;; Return the file names of shared libraries explicitly linked against via - ;; `-l' in ARGS. - (map (lambda (lib) - (string-append "lib" lib ".so")) - (switch-arguments "-l" args))) - -(define (rpath-arguments lib-path library-files) - ;; Return the `-rpath' argument list for each of LIBRARY-FILES found in - ;; LIB-PATH. + ;; `-l' or with an absolute file name in ARGS. + (define path+files + (fold (lambda (argument result) + (match result + ((library-path . library-files) + (cond ((string-prefix? "-L" argument) ;augment the search path + (cons (append library-path + (list (string-drop argument 2))) + library-files)) + ((string-prefix? "-l" argument) ;add library + (let* ((lib (string-append "lib" + (string-drop argument 2) + ".so")) + (full (search-path library-path lib))) + (if full + (cons library-path + (cons full library-files)) + result))) + ((and (string-prefix? %store-directory argument) + (string-suffix? ".so" argument)) ;add library + (cons library-path + (cons argument library-files))) + (else + result))))) + (cons '() '()) + args)) + + (match path+files + ((path . files) + (reverse files)))) + +(define (rpath-arguments library-files) + ;; Return the `-rpath' argument list for each of LIBRARY-FILES, a list of + ;; absolute file names. (fold-right (lambda (file args) - (let ((absolute (search-path lib-path file))) - (if absolute - (if (or %allow-impurities? - (pure-file-name? absolute)) - (cons* "-rpath" (dirname absolute) - args) - (begin - (format (current-error-port) - "ld-wrapper: error: attempt to use impure library ~s~%" - absolute) - (exit 1))) - args))) + (if (or %allow-impurities? + (pure-file-name? file)) + (cons* "-rpath" (dirname file) args) + (begin + (format (current-error-port) + "ld-wrapper: error: attempt to use impure library ~s~%" + file) + (exit 1)))) '() library-files)) (define (ld-wrapper . args) ;; Invoke the real `ld' with ARGS, augmented with `-rpath' switches. - (let* ((lib-path (library-path args)) - (libs (library-files-linked args)) - (args (append args (rpath-arguments lib-path libs)))) - (if %debug? - (format (current-error-port) - "ld-wrapper: invoking `~a' with ~s~%" - %real-ld args)) + (let* ((libs (library-files-linked args)) + (args (append args (rpath-arguments libs)))) + (when %debug? + (format (current-error-port) + "ld-wrapper: invoking `~a' with ~s~%" + %real-ld args)) (apply execl %real-ld (basename %real-ld) args))) ;;; ld-wrapper.scm ends here -- cgit v1.2.3 From 9b1bf33081652210502c6ef34506e27a9bc60f06 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sun, 4 Jan 2015 22:23:48 +0100 Subject: gnu: Remove a bunch of now unneeded '--mandir' configure flags. This has become redundant with the 'validate-documentation-location' phase introduced in commit d68fe74. * gnu/packages/compression.scm (bzip2): Remove 'fix-man-dir' phase. * gnu/packages/ncurses.scm (ncurses)[arguments]: Remove --mandir. * gnu/packages/pth.scm (pth)[arguments]: Remove #:configure-flags. * gnu/packages/tcl.scm (tcl)[arguments]: Likewise. * gnu/packages/xiph.scm (flac)[arguments]: Likewise. --- gnu/packages/compression.scm | 24 +++++++----------------- gnu/packages/ncurses.scm | 7 +------ gnu/packages/pth.scm | 9 ++------- gnu/packages/tcl.scm | 8 +------- gnu/packages/xiph.scm | 7 +------ 5 files changed, 12 insertions(+), 43 deletions(-) diff --git a/gnu/packages/compression.scm b/gnu/packages/compression.scm index f2736b9eb3..cda1984f6a 100644 --- a/gnu/packages/compression.scm +++ b/gnu/packages/compression.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2012, 2013, 2014 Ludovic Courtès +;;; Copyright © 2012, 2013, 2014, 2015 Ludovic Courtès ;;; Copyright © 2013 Andreas Enge ;;; Copyright © 2014 Mark H Weaver ;;; @@ -115,13 +115,7 @@ file; as a result, it is often used in conjunction with \"tar\", resulting in (home-page "http://www.gnu.org/software/gzip/"))) (define-public bzip2 - (let ((fix-man-dir - ;; Move man pages to $out/share/. - '(lambda* (#:key outputs #:allow-other-keys) - (with-directory-excursion (assoc-ref outputs "out") - (mkdir "share") - (rename-file "man" "share/man")))) - (build-shared-lib + (let ((build-shared-lib ;; Build a shared library. '(lambda* (#:key inputs #:allow-other-keys) (patch-makefile-SHELL "Makefile-libbz2_so") @@ -171,20 +165,16 @@ file; as a result, it is often used in conjunction with \"tar\", resulting in `(alist-cons-before 'build 'build-shared-lib ,build-shared-lib (alist-cons-after - 'install 'fix-man-dir ,fix-man-dir - (alist-cons-after - 'install 'install-shared-lib ,install-shared-lib - (alist-replace 'configure ,set-cross-environment - %standard-phases)))) + 'install 'install-shared-lib ,install-shared-lib + (alist-replace 'configure ,set-cross-environment + %standard-phases))) ;; Native compilation: build the shared library. `(alist-cons-before 'build 'build-shared-lib ,build-shared-lib (alist-cons-after - 'install 'fix-man-dir ,fix-man-dir - (alist-cons-after - 'install 'install-shared-lib ,install-shared-lib - (alist-delete 'configure %standard-phases))))) + 'install 'install-shared-lib ,install-shared-lib + (alist-delete 'configure %standard-phases)))) #:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out"))) diff --git a/gnu/packages/ncurses.scm b/gnu/packages/ncurses.scm index de7e6f6721..0dbc583f79 100644 --- a/gnu/packages/ncurses.scm +++ b/gnu/packages/ncurses.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2012, 2013, 2014 Ludovic Courtès +;;; Copyright © 2012, 2013, 2014, 2015 Ludovic Courtès ;;; Copyright © 2014 Mark H Weaver ;;; ;;; This file is part of GNU Guix. @@ -99,11 +99,6 @@ ,(string-append "--includedir=" (assoc-ref %outputs "out") "/include") - ;; By default man pages land in PREFIX/man, but we want them - ;; in PREFIX/share/man. - ,(string-append "--mandir=" (assoc-ref %outputs "out") - "/share/man") - ;; Make sure programs like 'tic', 'reset', and 'clear' have a ;; correct RUNPATH. ,(string-append "LDFLAGS=-Wl,-rpath=" (assoc-ref %outputs "out") diff --git a/gnu/packages/pth.scm b/gnu/packages/pth.scm index ba5fb8216d..50385b14f8 100644 --- a/gnu/packages/pth.scm +++ b/gnu/packages/pth.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2012 Ludovic Courtès +;;; Copyright © 2012, 2015 Ludovic Courtès ;;; Copyright © 2014 Mark H Weaver ;;; ;;; This file is part of GNU Guix. @@ -37,12 +37,7 @@ "0ckjqw5kz5m30srqi87idj7xhpw6bpki43mj07bazjm2qmh3cdbj")))) (build-system gnu-build-system) (arguments - '(#:parallel-build? #f - ;; By default, man pages are put in PREFIX/man, - ;; but we want them in PREFIX/share/man. - #:configure-flags (list (string-append "--mandir=" - (assoc-ref %outputs "out") - "/share/man")))) + '(#:parallel-build? #f)) (home-page "http://www.gnu.org/software/pth") (synopsis "Portable thread library") (description diff --git a/gnu/packages/tcl.scm b/gnu/packages/tcl.scm index d988249c4c..2de2624df4 100644 --- a/gnu/packages/tcl.scm +++ b/gnu/packages/tcl.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2013, 2014 Ludovic Courtès +;;; Copyright © 2013, 2014, 2015 Ludovic Courtès ;;; Copyright © 2014 Mark H Weaver ;;; Copyright © 2014 Eric Bavier ;;; @@ -63,12 +63,6 @@ "tclsh"))))) %standard-phases)) - ;; By default, man pages are put in PREFIX/man, - ;; but we want them in PREFIX/share/man. - #:configure-flags (list (string-append "--mandir=" - (assoc-ref %outputs "out") - "/share/man")) - ;; XXX: There are a few test failures (related to HTTP, most ;; likely related to name resolution), but that doesn't cause ;; `make' to fail. diff --git a/gnu/packages/xiph.scm b/gnu/packages/xiph.scm index 77b732ba35..e6700c4c27 100644 --- a/gnu/packages/xiph.scm +++ b/gnu/packages/xiph.scm @@ -202,12 +202,7 @@ OpenBSD's sndio.") "1p0hh190kqvpkbk1bbajd81jfbmkyl4fn2i7pggk2zppq6m68bgs")))) (build-system gnu-build-system) (arguments - `(#:parallel-tests? #f - ;; By default, man pages are put in PREFIX/man, - ;; but we want them in PREFIX/share/man. - #:configure-flags (list (string-append "--mandir=" - (assoc-ref %outputs "out") - "/share/man")))) + `(#:parallel-tests? #f)) ;; FIXME: configure also looks for xmms, input could be added once it exists (inputs `(("libogg" ,libogg))) (synopsis "Free lossless audio codec") -- cgit v1.2.3 From cd06768e66b0e2babf792e46e5066bac89ecae81 Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Mon, 5 Jan 2015 23:09:07 +0000 Subject: gnu: mit-krb5: Build with default gcc. * gnu/packages/mit-krb5.scm (mit-krb5)[native-inputs]: Remove gcc-4.7. --- gnu/packages/mit-krb5.scm | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/gnu/packages/mit-krb5.scm b/gnu/packages/mit-krb5.scm index 3f3e85773e..0a107a8bec 100644 --- a/gnu/packages/mit-krb5.scm +++ b/gnu/packages/mit-krb5.scm @@ -41,11 +41,7 @@ (native-inputs `(("patch/init-fix" ,(search-patch "mit-krb5-init-fix.patch")) ("bison" ,bison) - ("perl" ,perl) - - ;; XXX: When built with GCC 4.8, the 'db_test' test program enters an - ;; infinite loop. As a stopgap measure, build with GCC 4.7. - ("gcc" ,gcc-4.7))) + ("perl" ,perl))) (arguments '(#:phases (alist-replace -- cgit v1.2.3 From 97f94f5e9b610781e19ba9e7584ffe46d859de2e Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Tue, 6 Jan 2015 13:11:43 -0500 Subject: gnu: gtk+: Include xorg-server in native-inputs on MIPS; enable tests. * gnu/packages/gtk.scm (gtk+)[native-inputs]: Unconditionally include xorg-server and enable tests. --- gnu/packages/gtk.scm | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/gnu/packages/gtk.scm b/gnu/packages/gtk.scm index ce1c533df8..dae3bac567 100644 --- a/gnu/packages/gtk.scm +++ b/gnu/packages/gtk.scm @@ -1,7 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2013 Andreas Enge ;;; Copyright © 2013, 2014 Ludovic Courtès -;;; Copyright © 2014 Mark H Weaver +;;; Copyright © 2014, 2015 Mark H Weaver ;;; Copyright © 2014 Eric Bavier ;;; ;;; This file is part of GNU Guix. @@ -418,18 +418,9 @@ application suites.") ("pkg-config" ,pkg-config) ("gobject-introspection" ,gobject-introspection) ("python-wrapper" ,python-wrapper) - - ;; FIXME: The Xorg server is needed to run the tests, but it currently - ;; fails to build on mips64el, so remove it in the meantime. - ,@(if (string=? (or (%current-target-system) (%current-system)) - "mips64el-linux") - '() - `(("xorg-server" ,xorg-server))))) + ("xorg-server" ,xorg-server))) (arguments - `(;; FIXME: See above. - #:tests? ,(not (string=? (or (%current-target-system) (%current-system)) - "mips64el-linux")) - #:phases + `(#:phases (alist-replace 'configure (lambda* (#:key inputs #:allow-other-keys #:rest args) -- cgit v1.2.3 From d2e842814a233b7d0a72b4071fa2e8878fe0bb82 Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Tue, 6 Jan 2015 13:16:43 -0500 Subject: gnu: texlive: Fix target-system check. * gnu/packages/texlive.scm (texlive)[arguments]: Fix target-system check. --- gnu/packages/texlive.scm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gnu/packages/texlive.scm b/gnu/packages/texlive.scm index f14bbb8c06..e3321401c3 100644 --- a/gnu/packages/texlive.scm +++ b/gnu/packages/texlive.scm @@ -1,6 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2013, 2014 Andreas Enge ;;; Copyright © 2014 Eric Bavier +;;; Copyright © 2015 Mark H Weaver ;;; ;;; This file is part of GNU Guix. ;;; @@ -123,7 +124,7 @@ ;; Disable tests on mips64 to cope with a failure of luajiterr.test. ;; XXX FIXME fix luajit properly on mips64. - #:tests? ,(not (equal? "mips64el-linux" (or (%current-target-system) + #:tests? ,(not (string-prefix? "mips64" (or (%current-target-system) (%current-system)))) #:phases (alist-cons-after -- cgit v1.2.3 From 7cd802f342407c0d1cdef888a2e0d22f07690bb4 Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Tue, 6 Jan 2015 13:22:42 -0500 Subject: gnu: boost: Fix target-system check. * gnu/packages/boost.scm (boost): Fix target-system check. --- gnu/packages/boost.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gnu/packages/boost.scm b/gnu/packages/boost.scm index 3e8d2b8a02..1767681955 100644 --- a/gnu/packages/boost.scm +++ b/gnu/packages/boost.scm @@ -1,6 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2014 John Darrington -;;; Copyright © 2014 Mark H Weaver +;;; Copyright © 2014, 2015 Mark H Weaver ;;; ;;; This file is part of GNU Guix. ;;; @@ -53,7 +53,7 @@ ;; Boost's 'context' library is not yet supported on mips64, so ;; we disable it. The 'coroutine' library depends on 'context', ;; so we disable that too. - ,@(if (equal? "mips64el-linux" (or (%current-target-system) + ,@(if (string-prefix? "mips64" (or (%current-target-system) (%current-system))) '("--without-context" "--without-coroutine") '())))) -- cgit v1.2.3 From cf0a154c4105abf42824007848f4e319ce23f987 Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Tue, 6 Jan 2015 13:27:18 -0500 Subject: gnu: gawk: Fix target-system check. * gnu/packages/gawk.scm (gawk): Fix target-system check. --- gnu/packages/gawk.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gnu/packages/gawk.scm b/gnu/packages/gawk.scm index 996be7af4a..74d0720567 100644 --- a/gnu/packages/gawk.scm +++ b/gnu/packages/gawk.scm @@ -1,6 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2012, 2013, 2014 Ludovic Courtès -;;; Copyright © 2014 Mark H Weaver +;;; Copyright © 2014, 2015 Mark H Weaver ;;; ;;; This file is part of GNU Guix. ;;; @@ -59,7 +59,7 @@ ;; XXX FIXME prerelease libtool fails on MIPS in the ;; absence of /usr/bin/file. - ,@(if (equal? "mips64el-linux" (or (%current-target-system) + ,@(if (string-prefix? "mips64" (or (%current-target-system) (%current-system))) '((substitute* "extension/configure" (("/usr/bin/file") (which "file")))) -- cgit v1.2.3 From 0d93648bece32ba516812b3a4264dd0a72810dbf Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Mon, 5 Jan 2015 19:50:25 +0000 Subject: gnu: icu4c: Avoid use of 'patchelf'; fix build on ARM systems. * gnu/packages/icu4c.scm (icu4c)[inputs]: Remove patchelf. [configure-flags]: Add --enable-rpath. Add --with-data-packaging=archive on arm systems. [phases]: Remove 'add-lib-to-runpath' phase. --- gnu/packages/icu4c.scm | 31 +++++++++---------------------- 1 file changed, 9 insertions(+), 22 deletions(-) diff --git a/gnu/packages/icu4c.scm b/gnu/packages/icu4c.scm index ea5aecc21f..a575e91c8c 100644 --- a/gnu/packages/icu4c.scm +++ b/gnu/packages/icu4c.scm @@ -1,5 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2013 Andreas Enge +;;; Copyright © 2015 Mark H Weaver ;;; ;;; This file is part of GNU Guix. ;;; @@ -18,7 +19,6 @@ (define-module (gnu packages icu4c) #:use-module (gnu packages) - #:use-module (gnu packages elf) #:use-module (gnu packages perl) #:use-module (guix licenses) #:use-module (guix packages) @@ -40,16 +40,14 @@ (base32 "1cwapgjmvrcv1n2wjspj3vahidg596gjfp4jn1gcb4baralcjayl")))) (build-system gnu-build-system) (inputs - `(("patchelf" ,patchelf) - ("perl" ,perl))) + `(("perl" ,perl))) (arguments - `(#:modules ((guix build gnu-build-system) - (guix build utils) - (guix build rpath) - (srfi srfi-26)) - #:imported-modules ((guix build gnu-build-system) - (guix build utils) - (guix build rpath)) + `(#:configure-flags + '("--enable-rpath" + ,@(if (string-prefix? "arm" (or (%current-target-system) + (%current-system))) + '("--with-data-packaging=archive") + '())) #:phases (alist-cons-after 'unpack 'chdir-to-source @@ -62,18 +60,7 @@ (substitute* "configure" (("`/bin/sh") (string-append "`" (which "bash"))))) - (alist-cons-after - 'strip 'add-lib-to-runpath - (lambda* (#:key outputs #:allow-other-keys) - (let* ((out (assoc-ref outputs "out")) - (lib (string-append out "/lib"))) - ;; Add LIB to the RUNPATH of all the libraries and binaries. - (with-directory-excursion out - (for-each (cut augment-rpath <> lib) - (append (find-files "lib" ".*") - (find-files "bin" ".*") - (find-files "sbin" ".*")))))) - %standard-phases))))) + %standard-phases)))) (synopsis "International Components for Unicode") (description "ICU is a set of C/C++ and Java libraries providing Unicode and -- cgit v1.2.3 From 77a39799f9c9f416ba86b80099db2b4040624115 Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Tue, 6 Jan 2015 11:02:25 +0000 Subject: gnu: swig: Build a UTF-8 locale for the tests. * gnu/packages/swig.scm (swig)[arguments]: Add 'install-locales' phase. --- gnu/packages/swig.scm | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/gnu/packages/swig.scm b/gnu/packages/swig.scm index ce91df5eda..a978dec681 100644 --- a/gnu/packages/swig.scm +++ b/gnu/packages/swig.scm @@ -1,5 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2013 Ludovic Courtès +;;; Copyright © 2015 Mark H Weaver ;;; ;;; This file is part of GNU Guix. ;;; @@ -53,6 +54,18 @@ ;; The python part probably never worked and does not seem to ;; be needed for currently dependent packages. ;; ("python" ,python-wrapper))) + (arguments + `(#:phases + (alist-cons-before + 'check 'install-locales + (lambda _ + ;; One of the tests requires the availability of a UTF-8 + ;; locale and otherwise fails. + (setenv "LOCPATH" (getcwd)) + (zero? (system* "localedef" "--no-archive" + "--prefix" (getcwd) "-i" "en_US" + "-f" "UTF-8" "./en_US.utf8"))) + %standard-phases))) (home-page "http://swig.org/") (synopsis "Interface compiler that connects C/C++ code to higher-level languages") -- cgit v1.2.3 From 8fcaf8b173a6d0ce3d6f58f9052fdd085911912f Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Tue, 6 Jan 2015 13:52:57 -0500 Subject: gnu: lvm2: Switch to eudev from udev. * gnu/packages/linux.scm (lvm2)[inputs]: Use eudev, not udev. --- gnu/packages/linux.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm index 9dc5f5cd40..d5c7ffdcba 100644 --- a/gnu/packages/linux.scm +++ b/gnu/packages/linux.scm @@ -2,7 +2,7 @@ ;;; Copyright © 2012, 2013, 2014 Ludovic Courtès ;;; Copyright © 2013, 2014 Andreas Enge ;;; Copyright © 2012 Nikita Karetnikov -;;; Copyright © 2014 Mark H Weaver +;;; Copyright © 2014, 2015 Mark H Weaver ;;; ;;; This file is part of GNU Guix. ;;; @@ -1439,7 +1439,7 @@ time.") `(("pkg-config" ,pkg-config) ("procps" ,procps))) ;tests use 'pgrep' (inputs - `(("udev" ,udev))) + `(("udev" ,eudev))) (arguments '(#:phases (alist-cons-after 'configure 'set-makefile-shell -- cgit v1.2.3 From fe32c7f760ba9a8082eecd0fa0136f71dced032b Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Tue, 6 Jan 2015 14:02:08 -0500 Subject: gnu: udev: Remove package, now superceded by eudev. * gnu/packages/linux.scm (udev): Remove. (eudev): Incorporate fields formerly inherited from udev. --- gnu/packages/linux.scm | 84 ++++++++++++++++++++------------------------------ 1 file changed, 33 insertions(+), 51 deletions(-) diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm index d5c7ffdcba..00ac4d893a 100644 --- a/gnu/packages/linux.scm +++ b/gnu/packages/linux.scm @@ -1337,55 +1337,9 @@ kmod. The aim is to be compatible with tools, configurations and indices from the module-init-tools project.") (license gpl2+))) ; library under lgpl2.1+ -(define-public udev - ;; The last pre-systemd version. - (package - (name "udev") - (version "182") - (source (origin - (method url-fetch) - (uri (string-append - "mirror://kernel.org/linux/utils/kernel/hotplug/udev-" - version ".tar.xz")) - (sha256 - (base32 - "1awp7p07gi083w0dwqhhbbas68a7fx2sbm1yf1ip2jwf7cpqkf5d")) - (patches (list (search-patch "udev-gir-libtool.patch"))))) - (build-system gnu-build-system) - (arguments - `(#:configure-flags (list (string-append - "--with-pci-ids-path=" - (assoc-ref %build-inputs "pciutils") - "/share/pci.ids.gz") - - "--with-firmware-path=/no/firmware" - - ;; Work around undefined reference to - ;; 'mq_getattr' in sc-daemon.c. - "LDFLAGS=-lrt"))) - (native-inputs - `(("pkg-config" ,pkg-config) - ("gperf" ,gperf) - ("glib" ,glib "bin") ; glib-genmarshal, etc. - ("perl" ,perl) ; for the tests - ("python" ,python-2))) ; ditto - (inputs - `(("kmod" ,kmod) - ("pciutils" ,pciutils) - ("usbutils" ,usbutils) - ("util-linux" ,util-linux) - ("glib" ,glib) - ("gobject-introspection" ,gobject-introspection))) - (home-page "http://www.freedesktop.org/software/systemd/libudev/") - (synopsis "Userspace device management") - (description "Udev is a daemon which dynamically creates and removes -device nodes from /dev/, handles hotplug events and loads drivers at boot -time.") - (license gpl2+))) ; libudev is under lgpl2.1+ - (define-public eudev ;; The post-systemd fork, maintained by Gentoo. - (package (inherit udev) + (package (name "eudev") (version "1.10") (source (origin @@ -1406,11 +1360,39 @@ time.") '(substitute* "configure" (("linux/btrfs\\.h") ""))))) + (build-system gnu-build-system) + (native-inputs + `(("pkg-config" ,pkg-config) + ("gperf" ,gperf) + ("glib" ,glib "bin") ; glib-genmarshal, etc. + ("perl" ,perl) ; for the tests + ("python" ,python-2))) ; ditto + (inputs + `(("kmod" ,kmod) + ("pciutils" ,pciutils) + ("usbutils" ,usbutils) + ("util-linux" ,util-linux) + ("glib" ,glib) + ("gobject-introspection" ,gobject-introspection))) (arguments - (substitute-keyword-arguments (package-arguments udev) - ((#:configure-flags flags) - `(cons "--enable-libkmod" ,flags)))) - (home-page "http://www.gentoo.org/proj/en/eudev/"))) + `(#:configure-flags (list "--enable-libkmod" + + (string-append + "--with-pci-ids-path=" + (assoc-ref %build-inputs "pciutils") + "/share/pci.ids.gz") + + "--with-firmware-path=/no/firmware" + + ;; Work around undefined reference to + ;; 'mq_getattr' in sc-daemon.c. + "LDFLAGS=-lrt"))) + (home-page "http://www.gentoo.org/proj/en/eudev/") + (synopsis "Userspace device management") + (description "Udev is a daemon which dynamically creates and removes +device nodes from /dev/, handles hotplug events and loads drivers at boot +time.") + (license gpl2+))) (define-public lvm2 (package -- cgit v1.2.3 From c93d7edda30efc4a0245e36148aff5717c7a1cae Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Tue, 6 Jan 2015 17:46:00 -0500 Subject: gnu: bash: Update to 4.3.33. * gnu/packages/bash.scm (%patch-series-4.3): Add patches 31-33. --- gnu/packages/bash.scm | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/gnu/packages/bash.scm b/gnu/packages/bash.scm index 8a589395f3..f565c1a876 100644 --- a/gnu/packages/bash.scm +++ b/gnu/packages/bash.scm @@ -1,6 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2012, 2013, 2014 Ludovic Courtès -;;; Copyright © 2014 Mark H Weaver +;;; Copyright © 2014, 2015 Mark H Weaver ;;; ;;; This file is part of GNU Guix. ;;; @@ -81,8 +81,10 @@ (27 "1gnsfvq6bhb3srlbh0cannj2hackdsipcg7z0ds7zlk1hp96mdqy") (28 "17a65c4fn4c5rgsiw9gqqnzhznh3gwnd2xzzv2dppyi48znxpc78") ;CVE-2014-7186 (29 "14k27p28r5l2fz3r03kd0x72vvsq8bja8c6hjz5kxikbzsbs7i2c") ;CVE-2014-6277 - (30 "0nrqb0m7s89qsrbfaffpilc5gcf82bx9yvgzld4hr79p5y54yhw5"))) ;CVE-2014-6278 - + (30 "0nrqb0m7s89qsrbfaffpilc5gcf82bx9yvgzld4hr79p5y54yhw5") ;CVE-2014-6278 + (31 "07d62bl3z7qa8v6kgk47vzzazw563mlk9zhrsr4xsbqgvmcrylnd") + (32 "0jjgapfq4qhmndfrw8c3q3lva8xjdhlbd9cc631v41b0kb95g4w8") + (33 "05ma5rlxiadnfh925p4y7s0vvk917kmsdb1mfdx05gizl63pfapv"))) (define (download-patches store count) "Download COUNT Bash patches into store. Return a list of number/base32-hash tuples, directly usable in the 'patch-series' form." -- cgit v1.2.3 From fd19df72528a6ee7abd934da08c669094006fa2a Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Tue, 6 Jan 2015 21:38:35 +0000 Subject: gnu: patchelf: Update to 0.8. * gnu/packages/elf.scm (patchelf): Update to 0.8. * gnu/packages/patches/patchelf-page-size.patch: Adapt to new version. --- gnu/packages/elf.scm | 5 ++-- gnu/packages/patches/patchelf-page-size.patch | 33 ++++++++++++++------------- 2 files changed, 20 insertions(+), 18 deletions(-) diff --git a/gnu/packages/elf.scm b/gnu/packages/elf.scm index 248297bbbb..7fc689cb11 100644 --- a/gnu/packages/elf.scm +++ b/gnu/packages/elf.scm @@ -1,5 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2013, 2014 Ludovic Courtès +;;; Copyright © 2014, 2015 Mark H Weaver ;;; ;;; This file is part of GNU Guix. ;;; @@ -87,7 +88,7 @@ addr2line, and more.") (define-public patchelf (package (name "patchelf") - (version "0.6") + (version "0.8") (source (origin (method url-fetch) (uri (string-append @@ -96,7 +97,7 @@ addr2line, and more.") "/patchelf-" version ".tar.bz2")) (sha256 (base32 - "00bw29vdsscsili65wcb5ay0gvg1w0ljd00sb5xc6br8bylpyzpw")) + "1rqpg84wrd3fa16wa9vqdvasnc05yz49w207cz1l0wrl4k8q97y9")) (patches (list (search-patch "patchelf-page-size.patch"))))) (build-system gnu-build-system) (home-page "http://nixos.org/patchelf.html") diff --git a/gnu/packages/patches/patchelf-page-size.patch b/gnu/packages/patches/patchelf-page-size.patch index 2528b604e5..1c14047512 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 . #endif ---- patchelf/tests/no-rpath.sh.orig 1969-12-31 19:00:01.000000000 -0500 -+++ patchelf/tests/no-rpath.sh 2014-02-16 20:44:12.036376953 -0500 -@@ -1,22 +1,22 @@ +--- patchelf/tests/no-rpath.sh.orig 2014-01-14 08:17:47.000000000 -0500 ++++ patchelf/tests/no-rpath.sh 2015-01-06 18:31:53.418172797 -0500 +@@ -1,23 +1,23 @@ #! /bin/sh -e + SCRATCH=scratch/$(basename $0 .sh) --rm -rf scratch --mkdir -p scratch +-rm -rf ${SCRATCH} +-mkdir -p ${SCRATCH} +if [ "$(uname -m)" = i686 -a "$(uname -s)" = Linux ]; then -+ rm -rf scratch -+ mkdir -p scratch ++ rm -rf ${SCRATCH} ++ mkdir -p ${SCRATCH} --cp no-rpath scratch/ -+ cp no-rpath scratch/ +-cp ${srcdir}/no-rpath ${SCRATCH}/ ++ cp ${srcdir}/no-rpath ${SCRATCH}/ --oldRPath=$(../src/patchelf --print-rpath scratch/no-rpath) +-oldRPath=$(../src/patchelf --print-rpath ${SCRATCH}/no-rpath) -if test -n "$oldRPath"; then exit 1; fi -../src/patchelf \ - --set-interpreter "$(../src/patchelf --print-interpreter ../src/patchelf)" \ -- --set-rpath /foo:/bar:/xxxxxxxxxxxxxxx scratch/no-rpath -+ oldRPath=$(../src/patchelf --print-rpath scratch/no-rpath) +- --set-rpath /foo:/bar:/xxxxxxxxxxxxxxx ${SCRATCH}/no-rpath ++ oldRPath=$(../src/patchelf --print-rpath ${SCRATCH}/no-rpath) + if test -n "$oldRPath"; then exit 1; fi + ../src/patchelf \ + --set-interpreter "$(../src/patchelf --print-interpreter ../src/patchelf)" \ -+ --set-rpath /foo:/bar:/xxxxxxxxxxxxxxx scratch/no-rpath ++ --set-rpath /foo:/bar:/xxxxxxxxxxxxxxx ${SCRATCH}/no-rpath --newRPath=$(../src/patchelf --print-rpath scratch/no-rpath) +-newRPath=$(../src/patchelf --print-rpath ${SCRATCH}/no-rpath) -if ! echo "$newRPath" | grep -q '/foo:/bar'; then - echo "incomplete RPATH" - exit 1 -fi -+ newRPath=$(../src/patchelf --print-rpath scratch/no-rpath) ++ newRPath=$(../src/patchelf --print-rpath ${SCRATCH}/no-rpath) + if ! echo "$newRPath" | grep -q '/foo:/bar'; then + echo "incomplete RPATH" + exit 1 + fi -if [ "$(uname -m)" = i686 -a "$(uname -s)" = Linux ]; then - cd scratch && ./no-rpath + cd ${SCRATCH} && ./no-rpath fi -- cgit v1.2.3 From 91c47befb889ec2242078776cf58541eba8f938a Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Tue, 6 Jan 2015 19:37:04 -0500 Subject: gnu: gcc: Improve dynamic linker patching code. * gnu/packages/gcc.scm (gcc-4.7): Join multi-line definitions of GLIBC_DYNAMIC_LINKER* before attempting substitutions. (gcc-4.9)[arguments]: Remove arguments override. --- gnu/packages/gcc.scm | 34 +++++++++++----------------------- 1 file changed, 11 insertions(+), 23 deletions(-) diff --git a/gnu/packages/gcc.scm b/gnu/packages/gcc.scm index 4733fc1af6..a510af48a0 100644 --- a/gnu/packages/gcc.scm +++ b/gnu/packages/gcc.scm @@ -178,6 +178,16 @@ where the OS part is overloaded to denote a specific ABI---into GCC ;; The following is not performed for `--without-headers' ;; cross-compiler builds. + ;; Join multi-line definitions of GLIBC_DYNAMIC_LINKER* into a + ;; single line, to allow the next step to work properly. + (for-each + (lambda (x) + (substitute* (find-files "gcc/config" + "^linux(64|-elf)?\\.h$") + (("(#define GLIBC_DYNAMIC_LINKER.*)\\\\\n$" _ line) + line))) + '(1 2 3)) + ;; Fix the dynamic linker's file name. (substitute* (find-files "gcc/config" "^linux(64|-elf)?\\.h$") @@ -279,29 +289,7 @@ Go. It also includes runtime support libraries for these languages.") version "/gcc-" version ".tar.bz2")) (sha256 (base32 - "1pbjp4blk2ycaa6r3jmw4ky5f1s9ji3klbqgv8zs2sl5jn1cj810")))) - - ;; TODO: In core-updates, improve the 'pre-configure phase of the main - ;; 'gcc' package so that the 'join-two-line-dynamic-linker-defns phase is - ;; no longer needed here. Then the entire 'arguments' override below can - ;; be removed. - (arguments - (substitute-keyword-arguments (package-arguments gcc-4.7) - ((#:phases phases) - `(alist-cons-before - 'pre-configure 'join-two-line-dynamic-linker-defns - (lambda* (#:key inputs outputs #:allow-other-keys) - (let ((libc (assoc-ref inputs "libc"))) - (when libc - ;; Join two-line definitions of GLIBC_DYNAMIC_LINKER* into a - ;; single line, to allow the 'pre-configure phase to work - ;; properly. - (substitute* (find-files "gcc/config" - "^linux(64|-elf)?\\.h$") - (("(#define GLIBC_DYNAMIC_LINKER[^ ]*.*)\\\\\n$" _ line) - line))) - #t)) - ,phases)))))) + "1pbjp4blk2ycaa6r3jmw4ky5f1s9ji3klbqgv8zs2sl5jn1cj810")))))) (define* (custom-gcc gcc name languages #:key (separate-lib-output? #t)) "Return a custom version of GCC that supports LANGUAGES." -- cgit v1.2.3 From 9097e666d48c9b6c0263dcbe60b5af69ff7689f4 Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Thu, 1 Jan 2015 22:53:55 -0500 Subject: gnu: gcc: Add '-lgcc_s' only when '-pthread' is given. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Suggested by Ludovic Courtès . * gnu/packages/gcc.scm (gcc-4.7): In our modified GNU_USER_TARGET_LIB_SPEC, add '-lgcc_s' only when '-pthread' is given. --- gnu/packages/gcc.scm | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/gnu/packages/gcc.scm b/gnu/packages/gcc.scm index a510af48a0..df161193c1 100644 --- a/gnu/packages/gcc.scm +++ b/gnu/packages/gcc.scm @@ -1,5 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2012, 2013, 2014 Ludovic Courtès +;;; Copyright © 2015 Mark H Weaver ;;; ;;; This file is part of GNU Guix. ;;; @@ -201,14 +202,15 @@ where the OS part is overloaded to denote a specific ABI---into GCC (substitute* (find-files "gcc/config" "^gnu-user.*\\.h$") (("#define GNU_USER_TARGET_LIB_SPEC (.*)$" _ suffix) - ;; Help libgcc_s.so be found (see also below.) Always use - ;; '-lgcc_s' so that libgcc_s.so is always found by those - ;; programs that use 'pthread_cancel' (glibc dlopens - ;; libgcc_s.so when pthread_cancel support is needed, but - ;; having it in the application's RUNPATH isn't enough; see + ;; Help libgcc_s.so be found (see also below.) When + ;; -pthread is given, use '-lgcc_s' so that libgcc_s.so is + ;; always found by those programs that use 'pthread_cancel' + ;; (glibc dlopens libgcc_s.so when pthread_cancel support + ;; is needed, but having it in the application's RUNPATH + ;; isn't enough; see ;; .) (format #f "#define GNU_USER_TARGET_LIB_SPEC \ -\"-L~a/lib %{!static:-rpath=~a/lib %{!static-libgcc:-rpath=~a/lib64 -rpath=~a/lib -lgcc_s}} \" ~a" +\"-L~a/lib %{!static:-rpath=~a/lib %{!static-libgcc:-rpath=~a/lib64 -rpath=~a/lib %{pthread:-lgcc_s}}} \" ~a" libc libc libdir libdir suffix)) (("#define GNU_USER_TARGET_STARTFILE_SPEC.*$" line) (format #f "#define STANDARD_STARTFILE_PREFIX_1 \"~a/lib\" -- cgit v1.2.3 From b515822de1001170b05bb78be3887c04acbe3653 Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Wed, 31 Dec 2014 04:48:46 -0500 Subject: gnu: guile: Apply fixes for arm. * gnu/packages/patches/guile-arm-fixes.patch: New file. * gnu-system.am (dist_patch_DATA): Add it. * gnu/packages/guile.scm (guile-2.0): Add patch. --- gnu-system.am | 3 +- gnu/packages/guile.scm | 5 +- gnu/packages/patches/guile-arm-fixes.patch | 203 +++++++++++++++++++++++++++++ 3 files changed, 208 insertions(+), 3 deletions(-) create mode 100644 gnu/packages/patches/guile-arm-fixes.patch diff --git a/gnu-system.am b/gnu-system.am index fc7f326c4f..5dd3a4937e 100644 --- a/gnu-system.am +++ b/gnu-system.am @@ -1,7 +1,7 @@ # GNU Guix --- Functional package management for GNU # Copyright © 2012, 2013, 2014, 2015 Ludovic Courtès # Copyright © 2013, 2014 Andreas Enge -# Copyright © 2013, 2014 Mark H Weaver +# Copyright © 2013, 2014, 2015 Mark H Weaver # # This file is part of GNU Guix. # @@ -379,6 +379,7 @@ dist_patch_DATA = \ gnu/packages/patches/gstreamer-0.10-bison3.patch \ gnu/packages/patches/gstreamer-0.10-silly-test.patch \ gnu/packages/patches/guile-1.8-cpp-4.5.patch \ + gnu/packages/patches/guile-arm-fixes.patch \ gnu/packages/patches/guile-default-utf8.patch \ gnu/packages/patches/guile-linux-syscalls.patch \ gnu/packages/patches/guile-relocatable.patch \ diff --git a/gnu/packages/guile.scm b/gnu/packages/guile.scm index 7e3b5f847d..0796834369 100644 --- a/gnu/packages/guile.scm +++ b/gnu/packages/guile.scm @@ -1,6 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2012, 2013, 2014 Ludovic Courtès -;;; Copyright © 2014 Mark H Weaver +;;; Copyright © 2014, 2015 Mark H Weaver ;;; ;;; This file is part of GNU Guix. ;;; @@ -117,7 +117,8 @@ without requiring the source code to be rewritten.") ".tar.xz")) (sha256 (base32 - "1qh3j7308qvsjgwf7h94yqgckpbgz2k3yqdkzsyhqcafvfka9l5f")))) + "1qh3j7308qvsjgwf7h94yqgckpbgz2k3yqdkzsyhqcafvfka9l5f")) + (patches (list (search-patch "guile-arm-fixes.patch"))))) (build-system gnu-build-system) (native-inputs `(("pkgconfig" ,pkg-config))) (inputs `(("libffi" ,libffi) diff --git a/gnu/packages/patches/guile-arm-fixes.patch b/gnu/packages/patches/guile-arm-fixes.patch new file mode 100644 index 0000000000..62bcf0fa7b --- /dev/null +++ b/gnu/packages/patches/guile-arm-fixes.patch @@ -0,0 +1,203 @@ +Apply fixes for ARM to Guile. + +From df8c52e93dfa3965e4714275f4b8cea2c8e0170b Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= +Date: Fri, 4 Jul 2014 15:35:06 +0200 +Subject: [PATCH] Recognize arm-* target triplets. + +Reported by Sylvain Beucler . + +* module/system/base/target.scm (cpu-endianness): Add case where CPU is + "arm". +* test-suite/tests/asm-to-bytecode.test ("cross-compilation")["arm-unknown-linux-androideabi"]: + New test. +--- + module/system/base/target.scm | 4 +++- + test-suite/tests/asm-to-bytecode.test | 5 ++++- + 2 files changed, 7 insertions(+), 2 deletions(-) + +diff --git a/module/system/base/target.scm b/module/system/base/target.scm +index c74ae67..cefa951 100644 +--- a/module/system/base/target.scm ++++ b/module/system/base/target.scm +@@ -1,6 +1,6 @@ + ;;; Compilation targets + +-;; Copyright (C) 2011, 2012, 2013 Free Software Foundation, Inc. ++;; Copyright (C) 2011, 2012, 2013, 2014 Free Software Foundation, Inc. + + ;; This library is free software; you can redistribute it and/or + ;; modify it under the terms of the GNU Lesser General Public +@@ -72,6 +72,8 @@ + (endianness big)) + ((string-match "^arm.*el" cpu) + (endianness little)) ++ ((string=? "arm" cpu) ;ARMs are LE by default ++ (endianness little)) + (else + (error "unknown CPU endianness" cpu))))) + +diff --git a/test-suite/tests/asm-to-bytecode.test b/test-suite/tests/asm-to-bytecode.test +index 6d2f20e..62ea0ed 100644 +--- a/test-suite/tests/asm-to-bytecode.test ++++ b/test-suite/tests/asm-to-bytecode.test +@@ -1,6 +1,6 @@ + ;;;; Assembly to bytecode compilation -*- mode: scheme; coding: utf-8; -*- + ;;;; +-;;;; Copyright (C) 2010, 2011, 2012, 2013 Free Software Foundation, Inc. ++;;;; Copyright (C) 2010, 2011, 2012, 2013, 2014 Free Software Foundation, Inc. + ;;;; + ;;;; This library is free software; you can redistribute it and/or + ;;;; modify it under the terms of the GNU Lesser General Public +@@ -205,6 +205,9 @@ + (test-target "x86_64-unknown-linux-gnux32" ; x32 ABI (Debian tuplet) + (endianness little) 4) + ++ (test-target "arm-unknown-linux-androideabi" ++ (endianness little) 4) ++ + (pass-if-exception "unknown target" + exception:miscellaneous-error + (call-with-values (lambda () +-- +2.1.2 + +From ffd3e55cfd12a3559621e3130d613d319243512d Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= +Date: Fri, 4 Jul 2014 17:26:41 +0200 +Subject: [PATCH] Recognize more ARM targets. + +Suggested by Dale P. Smith. + +* module/system/base/target.scm (cpu-endianness): Add cases for + "arm.*eb", "^aarch64.*be", and "aarch64". Change "arm" case to + "arm.*". + (triplet-pointer-size): Allow underscore as in 'aarch64_be'. +* test-suite/tests/asm-to-bytecode.test ("cross-compilation")["armeb-unknown-linux-gnu", + "aarch64-linux-gnu", "aarch64_be-linux-gnu"]: New tests. +--- + module/system/base/target.scm | 10 ++++++++-- + test-suite/tests/asm-to-bytecode.test | 6 ++++++ + 2 files changed, 14 insertions(+), 2 deletions(-) + +diff --git a/module/system/base/target.scm b/module/system/base/target.scm +index cefa951..31e3fea 100644 +--- a/module/system/base/target.scm ++++ b/module/system/base/target.scm +@@ -72,7 +72,13 @@ + (endianness big)) + ((string-match "^arm.*el" cpu) + (endianness little)) +- ((string=? "arm" cpu) ;ARMs are LE by default ++ ((string-match "^arm.*eb" cpu) ++ (endianness big)) ++ ((string-prefix? "arm" cpu) ;ARMs are LE by default ++ (endianness little)) ++ ((string-match "^aarch64.*be" cpu) ++ (endianness big)) ++ ((string=? "aarch64" cpu) + (endianness little)) + (else + (error "unknown CPU endianness" cpu))))) +@@ -97,7 +103,7 @@ + ((string-match "^x86_64-.*-gnux32" triplet) 4) ; x32 + + ((string-match "64$" cpu) 8) +- ((string-match "64[lbe][lbe]$" cpu) 8) ++ ((string-match "64_?[lbe][lbe]$" cpu) 8) + ((member cpu '("sparc" "powerpc" "mips" "mipsel")) 4) + ((string-match "^arm.*" cpu) 4) + (else (error "unknown CPU word size" cpu))))) +diff --git a/test-suite/tests/asm-to-bytecode.test b/test-suite/tests/asm-to-bytecode.test +index 62ea0ed..8aeba84 100644 +--- a/test-suite/tests/asm-to-bytecode.test ++++ b/test-suite/tests/asm-to-bytecode.test +@@ -207,6 +207,12 @@ + + (test-target "arm-unknown-linux-androideabi" + (endianness little) 4) ++ (test-target "armeb-unknown-linux-gnu" ++ (endianness big) 4) ++ (test-target "aarch64-linux-gnu" ++ (endianness little) 8) ++ (test-target "aarch64_be-linux-gnu" ++ (endianness big) 8) + + (pass-if-exception "unknown target" + exception:miscellaneous-error +-- +2.1.2 + +From a85c78ea1393985fdb6e6678dea19135c553d341 Mon Sep 17 00:00:00 2001 +From: Mark H Weaver +Date: Fri, 19 Sep 2014 21:18:09 -0400 +Subject: [PATCH] VM: ASM_MUL for ARM: Add earlyclobber constraint to the SMULL + outputs. + +Reported by Rob Browning . + +* libguile/vm-i-scheme.c (ASM_MUL)[ARM]: Add earlyclobber (&) constraint + to the SMULL output registers. +--- + libguile/vm-i-scheme.c | 5 ++--- + 1 file changed, 2 insertions(+), 3 deletions(-) + +diff --git a/libguile/vm-i-scheme.c b/libguile/vm-i-scheme.c +index 587aa95..162efab 100644 +--- a/libguile/vm-i-scheme.c ++++ b/libguile/vm-i-scheme.c +@@ -1,5 +1,4 @@ +-/* Copyright (C) 2001, 2009, 2010, 2011, 2012, 2013, +- * 2014 Free Software Foundation, Inc. ++/* Copyright (C) 2001, 2009-2014 Free Software Foundation, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public License +@@ -363,7 +362,7 @@ VM_DEFINE_FUNCTION (149, ge, "ge?", 2) + { \ + scm_t_signed_bits rlo, rhi; \ + asm ("smull %0, %1, %2, %3\n" \ +- : "=r" (rlo), "=r" (rhi) \ ++ : "=&r" (rlo), "=&r" (rhi) \ + : "r" (SCM_UNPACK (x) - scm_tc2_int), \ + "r" (SCM_I_INUM (y))); \ + if (SCM_LIKELY (SCM_SRS (rlo, 31) == rhi)) \ +-- +2.1.2 + +From bed025bd2569b1c033f24d7d9e660e39ebf65cac Mon Sep 17 00:00:00 2001 +From: Mark H Weaver +Date: Sat, 20 Sep 2014 03:59:51 -0400 +Subject: [PATCH] VM: Allow the C compiler to choose FP_REG on ARM. + +Reported by Rob Browning . + +* libguile/vm-engine.h (IP_REG)[__arm__]: Remove explicit register + choice ("r7") for FP_REG, which was reported to cause compilation + failures on ARM. +--- + libguile/vm-engine.h | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/libguile/vm-engine.h b/libguile/vm-engine.h +index 46d4cff..e618be7 100644 +--- a/libguile/vm-engine.h ++++ b/libguile/vm-engine.h +@@ -1,4 +1,4 @@ +-/* Copyright (C) 2001, 2009, 2010, 2011, 2012 Free Software Foundation, Inc. ++/* Copyright (C) 2001, 2009-2012, 2014 Free Software Foundation, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public License +@@ -81,7 +81,7 @@ + #ifdef __arm__ + #define IP_REG asm("r9") + #define SP_REG asm("r8") +-#define FP_REG asm("r7") ++#define FP_REG + #endif + #endif + +-- +2.1.2 + -- cgit v1.2.3 From fa1e2f3d0d04a2d8e841c6d77244739c00176e9a Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Wed, 7 Jan 2015 09:51:23 -0500 Subject: Revert "gnu: gcc: Add '-lgcc_s' only when '-pthread' is given." This reverts commit 9097e666d48c9b6c0263dcbe60b5af69ff7689f4. This turned out not to be a good strategy. Some build system, e.g. tcl's, do not pass -pthread on GNU/Linux by default, but merely link with -lpthread. Also, Ludovic found other cases where libgcc_s is dlopened by libc that have nothing to do with pthreads, e.g. to walk the stack. --- gnu/packages/gcc.scm | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/gnu/packages/gcc.scm b/gnu/packages/gcc.scm index df161193c1..a510af48a0 100644 --- a/gnu/packages/gcc.scm +++ b/gnu/packages/gcc.scm @@ -1,6 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2012, 2013, 2014 Ludovic Courtès -;;; Copyright © 2015 Mark H Weaver ;;; ;;; This file is part of GNU Guix. ;;; @@ -202,15 +201,14 @@ where the OS part is overloaded to denote a specific ABI---into GCC (substitute* (find-files "gcc/config" "^gnu-user.*\\.h$") (("#define GNU_USER_TARGET_LIB_SPEC (.*)$" _ suffix) - ;; Help libgcc_s.so be found (see also below.) When - ;; -pthread is given, use '-lgcc_s' so that libgcc_s.so is - ;; always found by those programs that use 'pthread_cancel' - ;; (glibc dlopens libgcc_s.so when pthread_cancel support - ;; is needed, but having it in the application's RUNPATH - ;; isn't enough; see + ;; Help libgcc_s.so be found (see also below.) Always use + ;; '-lgcc_s' so that libgcc_s.so is always found by those + ;; programs that use 'pthread_cancel' (glibc dlopens + ;; libgcc_s.so when pthread_cancel support is needed, but + ;; having it in the application's RUNPATH isn't enough; see ;; .) (format #f "#define GNU_USER_TARGET_LIB_SPEC \ -\"-L~a/lib %{!static:-rpath=~a/lib %{!static-libgcc:-rpath=~a/lib64 -rpath=~a/lib %{pthread:-lgcc_s}}} \" ~a" +\"-L~a/lib %{!static:-rpath=~a/lib %{!static-libgcc:-rpath=~a/lib64 -rpath=~a/lib -lgcc_s}} \" ~a" libc libc libdir libdir suffix)) (("#define GNU_USER_TARGET_STARTFILE_SPEC.*$" line) (format #f "#define STANDARD_STARTFILE_PREFIX_1 \"~a/lib\" -- cgit v1.2.3 From 5d65ad80b542e223c540250c27645e05239a0f33 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Tue, 6 Jan 2015 22:58:26 +0100 Subject: gnu: libtool: Use 'parallel-job-count' to get the argument for '-j'. * gnu/packages/autotools.scm (libtool)[arguments] : Use (parallel-job-count) instead of hand-written code. --- gnu/packages/autotools.scm | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/gnu/packages/autotools.scm b/gnu/packages/autotools.scm index 427c6e3113..4723d27c47 100644 --- a/gnu/packages/autotools.scm +++ b/gnu/packages/autotools.scm @@ -266,17 +266,10 @@ Makefile, simplifying the entire process for the developer.") 'check 'pre-check (lambda* (#:key inputs #:allow-other-keys) ;; Run the test suite in parallel, if possible. - (let ((ncores - (cond - ((getenv "NIX_BUILD_CORES") - => - (lambda (n) - (if (zero? (string->number n)) - (number->string (current-processor-count)) - n))) - (else "1")))) - (setenv "TESTSUITEFLAGS" - (string-append "-j" ncores))) + (setenv "TESTSUITEFLAGS" + (string-append + "-j" + (number->string (parallel-job-count)))) ;; Path references to /bin/sh. (let ((bash (assoc-ref inputs "bash"))) -- cgit v1.2.3 From 3cbb3f9c55290ba151df3d3bbb78c83cef7cf6c0 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Tue, 6 Jan 2015 23:12:05 +0100 Subject: gnu: libtool: Add libltdl as a separate package. * gnu/packages/autotools.scm (libltdl): New variable. --- gnu/packages/autotools.scm | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/gnu/packages/autotools.scm b/gnu/packages/autotools.scm index 4723d27c47..eb33009d83 100644 --- a/gnu/packages/autotools.scm +++ b/gnu/packages/autotools.scm @@ -310,3 +310,26 @@ complexity of working with shared libraries across platforms.") `(#:tests? #f ,@(package-arguments libtool)) (package-arguments libtool))))) + +(define-public libltdl + ;; This is a libltdl package separate from the libtool package. This is + ;; useful because, unlike libtool, it has zero extra dependencies (making it + ;; readily usable during bootstrap), and it builds very quickly since + ;; Libtool's extensive test suite isn't run. + (package + (name "libltdl") + (version (package-version libtool)) + (source (package-source libtool)) + (build-system gnu-build-system) + (arguments + '(#:configure-flags '("--enable-ltdl-install") ;really install it + #:phases (alist-cons-before + 'configure 'change-directory + (lambda _ + (chdir "libltdl")) + %standard-phases))) + + (synopsis "System-independent dlopen wrapper of GNU libtool") + (description (package-description libtool)) + (home-page (package-home-page libtool)) + (license lgpl2.1+))) -- cgit v1.2.3 From be11b1024474489ead4d6befa40d38fd39fb9b72 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Tue, 6 Jan 2015 23:14:59 +0100 Subject: gnu: guile: Depend on 'libltdl' rather than 'libtool'. * gnu/packages/guile.scm (guile-1.8, guile-2.0): Replace LIBTOOL with LIBLTDL. --- gnu/packages/guile.scm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/gnu/packages/guile.scm b/gnu/packages/guile.scm index 0796834369..0900768832 100644 --- a/gnu/packages/guile.scm +++ b/gnu/packages/guile.scm @@ -87,7 +87,7 @@ ;; Since `guile-1.8.pc' has "Libs: ... -lgmp -lltdl", these must be ;; propagated. (propagated-inputs `(("gmp" ,gmp) - ("libtool" ,libtool))) + ("libltdl" ,libltdl))) ;; When cross-compiling, a native version of Guile itself is needed. (self-native-input? #t) @@ -131,7 +131,10 @@ without requiring the source code to be rewritten.") ;; `-L' flags. As for why the `.la' file lacks the `-L' flags, see ;; . ("libunistring" ,libunistring) - ("libtool" ,libtool) + + ;; Depend on LIBLTDL, not LIBTOOL. That way, we avoid some the extra + ;; dependencies that LIBTOOL has, which is helpful during bootstrap. + ("libltdl" ,libltdl) ;; The headers and/or `guile-2.0.pc' refer to these packages, so they ;; must be propagated. -- cgit v1.2.3 From c154e1ea81b1eb81c5716ce5a4df694fbd05c421 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Tue, 6 Jan 2015 23:22:00 +0100 Subject: gnu: libtool: Update to 2.4.4. * gnu/packages/patches/libtool-2.4-skip-tests.patch: Rename to... * gnu/packages/patches/libtool-skip-tests.patch: ... this. * gnu/packages/patches/libtool-skip-tests-for-mips.patch: Remove. * gnu-system.am (dist_patch_DATA): Adjust accordingly. * gnu/packages/autotools.scm (libtool): Update to 2.4.4. (libtool-2.4.4): Remove. --- gnu-system.am | 2 - gnu/packages/autotools.scm | 63 ++++++++-------------- gnu/packages/patches/libtool-2.4-skip-tests.patch | 24 --------- .../patches/libtool-skip-tests-for-mips.patch | 12 ----- gnu/packages/patches/libtool-skip-tests.patch | 53 +++++++----------- 5 files changed, 42 insertions(+), 112 deletions(-) delete mode 100644 gnu/packages/patches/libtool-2.4-skip-tests.patch delete mode 100644 gnu/packages/patches/libtool-skip-tests-for-mips.patch diff --git a/gnu-system.am b/gnu-system.am index 5dd3a4937e..03b4134019 100644 --- a/gnu-system.am +++ b/gnu-system.am @@ -407,8 +407,6 @@ dist_patch_DATA = \ gnu/packages/patches/libmad-mips-newgcc.patch \ gnu/packages/patches/libtheora-config-guess.patch \ gnu/packages/patches/libtool-skip-tests.patch \ - gnu/packages/patches/libtool-skip-tests-for-mips.patch \ - gnu/packages/patches/libtool-2.4-skip-tests.patch \ gnu/packages/patches/libssh-CVE-2014-0017.patch \ gnu/packages/patches/lm-sensors-hwmon-attrs.patch \ gnu/packages/patches/luit-posix.patch \ diff --git a/gnu/packages/autotools.scm b/gnu/packages/autotools.scm index eb33009d83..0ee1d149b9 100644 --- a/gnu/packages/autotools.scm +++ b/gnu/packages/autotools.scm @@ -238,31 +238,38 @@ Makefile, simplifying the entire process for the developer.") (define-public libtool (package (name "libtool") - (version "2.4.2") + (version "2.4.4") (source (origin - (method url-fetch) - (uri (string-append "mirror://gnu/libtool/libtool-" - version ".tar.gz")) - (sha256 - (base32 - "0649qfpzkswgcj9vqkkr9rn4nlcx80faxpyqscy2k1x9c94f93dk")) - (patches - (list (search-patch "libtool-skip-tests.patch") - (search-patch "libtool-skip-tests-for-mips.patch"))))) + (method url-fetch) + (uri (string-append "mirror://gnu/libtool/libtool-" + version ".tar.xz")) + (sha256 + (base32 + "0v3zq08qxv7k5067mpqrkjkjl3wphhg06i696mka90mzadc5nad8")) + (patches + (list (search-patch "libtool-skip-tests.patch"))))) (build-system gnu-build-system) (native-inputs `(("m4" ,m4) - ("perl" ,perl))) + ("perl" ,perl) + ("automake" ,automake) ;some tests rely on 'aclocal' + ("autoconf" ,(autoconf-wrapper)))) ;others on 'autom4te' ;; Separate binaries from the rest. During bootstrap, only ltdl is ;; used; not depending on the binaries allows us to avoid retaining ;; a reference to the bootstrap bash. - (outputs '("bin" ; libtoolize, libtool, etc. - "out")) ; libltdl.so, ltdl.h, etc. + (outputs '("bin" ;libtoolize, libtool, etc. + "out")) ;libltdl.so, ltdl.h, etc. (arguments (if (%current-target-system) - '() ; no `check' phase when cross-building - '(#:phases (alist-cons-before + '() ;no `check' phase when cross-building + `(;; XXX: There are test failures on mips64el-linux starting from 2.4.4: + ;; . + #:tests? ,(not (string-prefix? "mips64" + (or (%current-target-system) + (%current-system)))) + + #:phases (alist-cons-before 'check 'pre-check (lambda* (#:key inputs #:allow-other-keys) ;; Run the test suite in parallel, if possible. @@ -285,32 +292,6 @@ complexity of working with shared libraries across platforms.") (license gpl3+) (home-page "http://www.gnu.org/software/libtool/"))) -(define-public libtool-2.4.4 - (package (inherit libtool) - (version "2.4.4") - (source (origin - (method url-fetch) - (uri (string-append "mirror://gnu/libtool/libtool-" - version ".tar.xz")) - (sha256 - (base32 - "0v3zq08qxv7k5067mpqrkjkjl3wphhg06i696mka90mzadc5nad8")) - (patches - (list (search-patch "libtool-2.4-skip-tests.patch"))))) - - (native-inputs `(("automake" ,automake) ;some tests rely on 'aclocal' - ("autoconf" ,(autoconf-wrapper)) ;others on 'autom4te' - ,@(package-native-inputs libtool))) - - (arguments - ;; XXX: There are test failures on mips64el-linux starting from 2.4.4: - ;; . - (if (string-prefix? "mips64el" - (or (%current-target-system) (%current-system))) - `(#:tests? #f - ,@(package-arguments libtool)) - (package-arguments libtool))))) - (define-public libltdl ;; This is a libltdl package separate from the libtool package. This is ;; useful because, unlike libtool, it has zero extra dependencies (making it 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 95747dfef0..0000000000 --- a/gnu/packages/patches/libtool-2.4-skip-tests.patch +++ /dev/null @@ -1,24 +0,0 @@ -Because our GCC 'lib' spec automatically adds '-rpath' for each '-L' -and a couple more '-rpath, there are two test failures: -one in demo.test, and one in destdir.at. Disable these. - ---- libtool-2.4.4/tests/testsuite 2014-11-29 17:43:11.000000000 +0100 -+++ libtool-2.4.4/tests/testsuite 2015-01-03 23:00:09.367775122 +0100 -@@ -9185,7 +9185,7 @@ read at_status <"$at_status_file" - #AT_START_33 - at_fn_group_banner 33 'demo.at:548' \ - "hardcoding library path" " " 3 --at_xfail=no -+at_xfail=yes - test no = "$ACLOCAL" && at_xfail=yes - test no = "$AUTOHEADER" && at_xfail=yes - test no = "$AUTOMAKE" && at_xfail=yes -@@ -27052,7 +27052,7 @@ read at_status <"$at_status_file" - #AT_START_97 - at_fn_group_banner 97 'destdir.at:75' \ - "DESTDIR with in-package deplibs" " " 7 --at_xfail=no -+at_xfail=yes - eval `$LIBTOOL --config | $GREP '^fast_install='` - case $fast_install in no) :;; *) false;; esac && at_xfail=yes - ( 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 36587d23c2..0000000000 --- a/gnu/packages/patches/libtool-skip-tests-for-mips.patch +++ /dev/null @@ -1,12 +0,0 @@ -TEMPORARY HACK: Disable a test that fails on MIPS. - ---- libtool/Makefile.in.orig 2011-10-17 06:18:55.000000000 -0400 -+++ libtool/Makefile.in 2013-10-12 20:41:50.669067382 -0400 -@@ -890,7 +890,6 @@ - tests/demo-pic-make.test \ - tests/demo-pic-exec.test \ - tests/demo-nopic.test \ -- tests/demo-nopic-make.test \ - tests/demo-nopic-exec.test \ - tests/cdemo-shared.test \ - tests/cdemo-shared-make.test \ diff --git a/gnu/packages/patches/libtool-skip-tests.patch b/gnu/packages/patches/libtool-skip-tests.patch index 6e12615d51..95747dfef0 100644 --- a/gnu/packages/patches/libtool-skip-tests.patch +++ b/gnu/packages/patches/libtool-skip-tests.patch @@ -1,37 +1,24 @@ -Because our GCC `lib' spec automatically adds `-rpath' for each `-L' -and a couple more `-rpath, there are two test failures: -demo-hardcode.test, and destdir.at. Disable these. +Because our GCC 'lib' spec automatically adds '-rpath' for each '-L' +and a couple more '-rpath, there are two test failures: +one in demo.test, and one in destdir.at. Disable these. ---- libtool-2.4.2/Makefile.in 2011-10-17 12:18:55.000000000 +0200 -+++ libtool-2.4.2/Makefile.in 2012-09-13 23:50:37.000000000 +0200 -@@ -909,7 +908,7 @@ COMMON_TESTS = \ - # but they depend on the other tests being run beforehand. - INTERACTIVE_TESTS = tests/demo-shared.test tests/demo-shared-make.test \ - tests/demo-shared-exec.test tests/demo-shared-inst.test \ -- tests/demo-hardcode.test tests/demo-relink.test \ -+ tests/demo-relink.test \ - tests/demo-noinst-link.test tests/demo-shared-unst.test \ - tests/depdemo-shared.test tests/depdemo-shared-make.test \ - tests/depdemo-shared-exec.test tests/depdemo-shared-inst.test \ -@@ -2580,8 +2579,7 @@ tests/cdemo-static-make.log: tests/cdemo - - tests/demo-shared-unst.log: tests/demo-noinst-link.log - tests/demo-noinst-link.log: tests/demo-relink.log --tests/demo-relink.log: tests/demo-hardcode.log --tests/demo-hardcode.log: tests/demo-shared-inst.log -+tests/demo-relink.log: tests/demo-shared-inst.log - tests/demo-shared-inst.log: tests/demo-shared-exec.log - tests/demo-shared-exec.log: tests/demo-shared-make.log - tests/demo-shared-make.log: tests/demo-shared.log - ---- libtool-2.4.2/tests/testsuite 2011-10-17 12:19:52.000000000 +0200 -+++ libtool-2.4.2/tests/testsuite 2012-09-14 00:28:45.000000000 +0200 -@@ -14443,6 +14443,6 @@ read at_status <"$at_status_file" - #AT_START_69 - at_fn_group_banner 69 'destdir.at:75' \ - "DESTDIR with in-package deplibs" " " 4 +--- libtool-2.4.4/tests/testsuite 2014-11-29 17:43:11.000000000 +0100 ++++ libtool-2.4.4/tests/testsuite 2015-01-03 23:00:09.367775122 +0100 +@@ -9185,7 +9185,7 @@ read at_status <"$at_status_file" + #AT_START_33 + at_fn_group_banner 33 'demo.at:548' \ + "hardcoding library path" " " 3 +-at_xfail=no ++at_xfail=yes + test no = "$ACLOCAL" && at_xfail=yes + test no = "$AUTOHEADER" && at_xfail=yes + test no = "$AUTOMAKE" && at_xfail=yes +@@ -27052,7 +27052,7 @@ read at_status <"$at_status_file" + #AT_START_97 + at_fn_group_banner 97 'destdir.at:75' \ + "DESTDIR with in-package deplibs" " " 7 -at_xfail=no +at_xfail=yes - eval `$LIBTOOL --config | grep '^fast_install='` + eval `$LIBTOOL --config | $GREP '^fast_install='` case $fast_install in no) :;; *) false;; esac && at_xfail=yes - + ( -- cgit v1.2.3 From 3246cc91858a18344a6b62272521c88dd0ec5037 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Wed, 7 Jan 2015 09:44:10 +0100 Subject: gnu: Make libtool and libltdl completely separate. * gnu/packages/autotools.scm (libtool)[outputs]: Remove. [arguments]: Remove 'if' around arguments. Add #:configure-flags. * gnu/packages/apr.scm (apr)[inputs]: Change libtool to libltdl. * gnu/packages/fontutils.scm (libuninameslist)[native-inputs]: Remove "libtool-bin". * gnu/packages/global.scm (global): Change libtool to libltdl. * gnu/packages/gnunet.scm (libextractor, gnunet): Likewise. * gnu/packages/graphviz.scm (graphviz): Likewise. * gnu/packages/libcanberra.scm (libcanberra): Likewise. * gnu/packages/libevent.scm (libuv)[native-inputs]: Remove "bin" part for libtool. * gnu/packages/mail.scm (mailutils): Change libtool to libltdl. (libetpan): Remove "bin" part for libtool. * gnu/packages/mp3.scm (libmp3splt): Change libtool to libltdl. * gnu/packages/openldap.scm (openldap): Remove "bin" part of libtool. Move it from 'inputs' to 'native-inputs'. * gnu/packages/photo.scm (libgphoto2): Change libtool to libltdl. * gnu/packages/pulseaudio.scm (pulseaudio): Likewise. * gnu/packages/ssh.scm (guile-ssh): Remove "bin" part of libtool. * gnu/packages/web.scm (libpsl): Likewise. * gnu/packages/weechat.scm (weechat): Move libtool to 'native-inputs' and add libltdl to 'inputs'. --- gnu/packages/apr.scm | 2 +- gnu/packages/autotools.scm | 49 ++++++++++++++++++++------------------------ gnu/packages/fontutils.scm | 3 +-- gnu/packages/global.scm | 4 ++-- gnu/packages/gnunet.scm | 4 ++-- gnu/packages/graphviz.scm | 4 ++-- gnu/packages/libcanberra.scm | 4 ++-- gnu/packages/libevent.scm | 4 ++-- gnu/packages/mail.scm | 6 +++--- gnu/packages/mp3.scm | 4 ++-- gnu/packages/openldap.scm | 4 ++-- gnu/packages/photo.scm | 4 ++-- gnu/packages/pulseaudio.scm | 6 +++--- gnu/packages/ssh.scm | 2 +- gnu/packages/web.scm | 5 ++--- gnu/packages/weechat.scm | 6 +++--- 16 files changed, 52 insertions(+), 59 deletions(-) diff --git a/gnu/packages/apr.scm b/gnu/packages/apr.scm index cedeea8a14..3e53a614fc 100644 --- a/gnu/packages/apr.scm +++ b/gnu/packages/apr.scm @@ -48,7 +48,7 @@ '(#:parallel-build? #f #:parallel-tests? #f)) (inputs `(("perl" ,perl) - ("libtool" ,libtool))) + ("libltdl" ,libltdl))) (home-page "http://apr.apache.org/") (synopsis "The Apache Portable Runtime Library") (description diff --git a/gnu/packages/autotools.scm b/gnu/packages/autotools.scm index 0ee1d149b9..07fdde73ea 100644 --- a/gnu/packages/autotools.scm +++ b/gnu/packages/autotools.scm @@ -254,36 +254,31 @@ Makefile, simplifying the entire process for the developer.") ("automake" ,automake) ;some tests rely on 'aclocal' ("autoconf" ,(autoconf-wrapper)))) ;others on 'autom4te' - ;; Separate binaries from the rest. During bootstrap, only ltdl is - ;; used; not depending on the binaries allows us to avoid retaining - ;; a reference to the bootstrap bash. - (outputs '("bin" ;libtoolize, libtool, etc. - "out")) ;libltdl.so, ltdl.h, etc. - (arguments - (if (%current-target-system) - '() ;no `check' phase when cross-building - `(;; XXX: There are test failures on mips64el-linux starting from 2.4.4: - ;; . - #:tests? ,(not (string-prefix? "mips64" - (or (%current-target-system) - (%current-system)))) + `(;; Libltdl is provided as a separate package, so don't install it here. + #:configure-flags '("--disable-ltdl-install") + + ;; XXX: There are test failures on mips64el-linux starting from 2.4.4: + ;; . + #:tests? ,(not (string-prefix? "mips64" + (or (%current-target-system) + (%current-system)))) - #:phases (alist-cons-before - 'check 'pre-check - (lambda* (#:key inputs #:allow-other-keys) - ;; Run the test suite in parallel, if possible. - (setenv "TESTSUITEFLAGS" - (string-append - "-j" - (number->string (parallel-job-count)))) + #:phases (alist-cons-before + 'check 'pre-check + (lambda* (#:key inputs #:allow-other-keys) + ;; Run the test suite in parallel, if possible. + (setenv "TESTSUITEFLAGS" + (string-append + "-j" + (number->string (parallel-job-count)))) - ;; Path references to /bin/sh. - (let ((bash (assoc-ref inputs "bash"))) - (substitute* "tests/testsuite" - (("/bin/sh") - (string-append bash "/bin/bash"))))) - %standard-phases)))) + ;; Path references to /bin/sh. + (let ((bash (assoc-ref inputs "bash"))) + (substitute* "tests/testsuite" + (("/bin/sh") + (string-append bash "/bin/bash"))))) + %standard-phases))) (synopsis "Generic shared library support tools") (description "GNU Libtool helps in the creation and use of shared libraries, by diff --git a/gnu/packages/fontutils.scm b/gnu/packages/fontutils.scm index a4da6df553..f98625cdae 100644 --- a/gnu/packages/fontutils.scm +++ b/gnu/packages/fontutils.scm @@ -272,8 +272,7 @@ smooth contours with constant curvature at the spline joins.") (build-system gnu-build-system) (native-inputs `(("autoconf" ,autoconf) ("automake" ,automake) - ("libtool" ,libtool) - ("libtool-bin" ,libtool "bin"))) + ("libtool" ,libtool))) (arguments `(#:phases (alist-cons-before 'configure 'bootstrap diff --git a/gnu/packages/global.scm b/gnu/packages/global.scm index f7377def0a..72a53ad4a8 100644 --- a/gnu/packages/global.scm +++ b/gnu/packages/global.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2013 Ludovic Courtès +;;; Copyright © 2013, 2015 Ludovic Courtès ;;; ;;; This file is part of GNU Guix. ;;; @@ -38,7 +38,7 @@ "0j828dg2cjf77rx71cw68jpk7jl119v6nyb0kyvirr5i1860j1fx")))) (build-system gnu-build-system) (inputs `(("ncurses" ,ncurses) - ("libtool" ,libtool))) + ("libltdl" ,libltdl))) (arguments `(#:configure-flags (list (string-append "--with-ncurses=" diff --git a/gnu/packages/gnunet.scm b/gnu/packages/gnunet.scm index 249971becd..f7063ead11 100644 --- a/gnu/packages/gnunet.scm +++ b/gnu/packages/gnunet.scm @@ -85,7 +85,7 @@ ("libjpeg" ,libjpeg) ("libogg" ,libogg) ("libtiff" ,libtiff) - ("libtool" ,libtool) + ("libltdl" ,libltdl) ("libvorbis" ,libvorbis) ("zlib" ,zlib))) (native-inputs @@ -213,7 +213,7 @@ supports HTTPS, HTTPS and GnuTLS.") ("libgcrypt" ,libgcrypt) ("libidn" ,libidn) ("libmicrohttpd" ,libmicrohttpd) - ("libtool" ,libtool) + ("libltdl" ,libltdl) ("libunistring" ,libunistring) ("openssl" ,openssl) ("opus" ,opus) diff --git a/gnu/packages/graphviz.scm b/gnu/packages/graphviz.scm index dc477f30b3..52522af446 100644 --- a/gnu/packages/graphviz.scm +++ b/gnu/packages/graphviz.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2013 Ludovic Courtès +;;; Copyright © 2013, 2015 Ludovic Courtès ;;; ;;; This file is part of GNU Guix. ;;; @@ -69,7 +69,7 @@ ("pango" ,pango) ("fontconfig" ,fontconfig) ("freetype" ,freetype) - ("libltdl" ,libtool) + ("libltdl" ,libltdl) ("libXaw" ,libxaw) ("expat" ,expat) ("libjpeg" ,libjpeg) diff --git a/gnu/packages/libcanberra.scm b/gnu/packages/libcanberra.scm index 764c3272a2..859740aaee 100644 --- a/gnu/packages/libcanberra.scm +++ b/gnu/packages/libcanberra.scm @@ -1,6 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2013 Andreas Enge -;;; Copyright © 2014 Ludovic Courtès +;;; Copyright © 2014, 2015 Ludovic Courtès ;;; ;;; This file is part of GNU Guix. ;;; @@ -52,7 +52,7 @@ `(("alsa-lib" ,alsa-lib) ("gstreamer" ,gstreamer) ("gtk+" ,gtk+) - ("libtool" ,libtool) + ("libltdl" ,libltdl) ("libvorbis" ,libvorbis) ("pulseaudio" ,pulseaudio) ("udev" ,eudev))) diff --git a/gnu/packages/libevent.scm b/gnu/packages/libevent.scm index 27416a0e59..64892bf878 100644 --- a/gnu/packages/libevent.scm +++ b/gnu/packages/libevent.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2013, 2014 Ludovic Courtès +;;; Copyright © 2013, 2014, 2015 Ludovic Courtès ;;; ;;; This file is part of GNU Guix. ;;; @@ -85,7 +85,7 @@ loop.") #:tests? #f)) (native-inputs `(("autoconf" ,(autoconf-wrapper)) ("automake" ,automake) - ("libtool" ,libtool "bin") + ("libtool" ,libtool) ;; libuv.pc is installed only when pkg-config is found. ("pkg-config" ,pkg-config))) diff --git a/gnu/packages/mail.scm b/gnu/packages/mail.scm index 8424d8ccbe..62f86ef839 100644 --- a/gnu/packages/mail.scm +++ b/gnu/packages/mail.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2013, 2014 Ludovic Courtès +;;; Copyright © 2013, 2014, 2015 Ludovic Courtès ;;; Copyright © 2014 Mark H Weaver ;;; Copyright © 2014 Ian Denhardt ;;; Copyright © 2014 Sou Bunnbu @@ -113,7 +113,7 @@ ("readline" ,readline-6.2) ("linux-pam" ,linux-pam) - ("libtool" ,libtool) + ("libltdl" ,libltdl) ("gdbm" ,gdbm))) (home-page "http://www.gnu.org/software/mailutils/") (synopsis "Utilities and library for reading and serving mail") @@ -419,7 +419,7 @@ useful features.") (build-system gnu-build-system) (native-inputs `(("autoconf" ,(autoconf-wrapper)) ("automake" ,automake) - ("libtool" ,libtool "bin") + ("libtool" ,libtool) ("pkg-config" ,pkg-config))) (propagated-inputs ;; 'libetpan-config --libs' returns '-lssl -lcrypto -lsasl2', so these diff --git a/gnu/packages/mp3.scm b/gnu/packages/mp3.scm index 1731cd59af..55ab4b497c 100644 --- a/gnu/packages/mp3.scm +++ b/gnu/packages/mp3.scm @@ -1,6 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2013 Andreas Enge -;;; Copyright © 2014 Ludovic Courtès +;;; Copyright © 2014, 2015 Ludovic Courtès ;;; ;;; This file is part of GNU Guix. ;;; @@ -231,7 +231,7 @@ pre-defined or user-specifiable output format.") (inputs `(("libid3tag" ,libid3tag) ("libmad" ,libmad) ("libogg" ,libogg) - ("libtool" ,libtool) + ("libltdl" ,libltdl) ("libvorbid" ,libvorbis) ("pcre" ,pcre))) (native-inputs diff --git a/gnu/packages/openldap.scm b/gnu/packages/openldap.scm index 23c32488e9..a6c4cb0d93 100644 --- a/gnu/packages/openldap.scm +++ b/gnu/packages/openldap.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2013, 2014 Ludovic Courtès +;;; Copyright © 2013, 2014, 2015 Ludovic Courtès ;;; Copyright © 2013 Andreas Enge ;;; ;;; This file is part of GNU Guix. @@ -52,8 +52,8 @@ ;; FIXME: currently, openldap requires openssl or gnutls<3, see ;; http://www.openldap.org/its/index.cgi/Incoming?id=7430;page=17 ;; Once this is fixed, switch to gnutls. - ("libtool" ,libtool "bin") ("zlib" ,zlib))) + (native-inputs `(("libtool" ,libtool))) (arguments `(#:tests? #f #:phases diff --git a/gnu/packages/photo.scm b/gnu/packages/photo.scm index 4f1787fe75..164f6e27ea 100644 --- a/gnu/packages/photo.scm +++ b/gnu/packages/photo.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2014 Ludovic Courtès +;;; Copyright © 2014, 2015 Ludovic Courtès ;;; ;;; This file is part of GNU Guix. ;;; @@ -64,7 +64,7 @@ data as produced by digital cameras.") (native-inputs `(("pkg-config" ,pkg-config))) (inputs `(;; ("libjpeg-turbo" ,libjpeg-turbo) - ("libtool" ,libtool) + ("libltdl" ,libltdl) ("libusb" ,libusb))) (propagated-inputs `(;; The .pc refers to libexif. diff --git a/gnu/packages/pulseaudio.scm b/gnu/packages/pulseaudio.scm index 61e0d029f5..1e9fe41b47 100644 --- a/gnu/packages/pulseaudio.scm +++ b/gnu/packages/pulseaudio.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2013, 2014 Ludovic Courtès +;;; Copyright © 2013, 2014, 2015 Ludovic Courtès ;;; Copyright © 2014 Mark H Weaver ;;; ;;; This file is part of GNU Guix. @@ -24,7 +24,7 @@ #:use-module (guix build-system gnu) #:use-module (gnu packages) #:use-module (gnu packages algebra) - #:use-module ((gnu packages autotools) #:select (libtool)) + #:use-module ((gnu packages autotools) #:select (libltdl)) #:use-module (gnu packages avahi) #:use-module (gnu packages check) #:use-module (gnu packages gdbm) @@ -157,7 +157,7 @@ rates. ") ("intltool" ,intltool) ("pkg-config" ,pkg-config) ("m4" ,m4) - ("libtool" ,libtool) + ("libltdl" ,libltdl) ("fftwf" ,fftwf) ("avahi" ,avahi) ("check" ,check))) diff --git a/gnu/packages/ssh.scm b/gnu/packages/ssh.scm index c39d5f82be..79e8077cdf 100644 --- a/gnu/packages/ssh.scm +++ b/gnu/packages/ssh.scm @@ -226,7 +226,7 @@ Additionally, various channel-specific options can be negotiated.") #:parallel-tests? #f)) (native-inputs `(("autoconf" ,autoconf) ("automake" ,automake) - ("libtool" ,libtool "bin") + ("libtool" ,libtool) ("texinfo" ,texinfo) ("pkg-config" ,pkg-config) ("which" ,which))) diff --git a/gnu/packages/web.scm b/gnu/packages/web.scm index 8a64211697..554f2a3ae4 100644 --- a/gnu/packages/web.scm +++ b/gnu/packages/web.scm @@ -1,7 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2013 Andreas Enge ;;; Copyright © 2013 Aljosha Papsch -;;; Copyright © 2014 Ludovic Courtès +;;; Copyright © 2014, 2015 Ludovic Courtès ;;; Copyright © 2014 Mark H Weaver ;;; ;;; This file is part of GNU Guix. @@ -231,8 +231,7 @@ for efficient socket-like bidirectional reliable communication channels.") ("automake" ,automake) ("gettext" ,gnu-gettext) ("which" ,which) - ("libtool" ,libtool) - ("libtool" ,libtool "bin"))) + ("libtool" ,libtool))) (arguments `(#:phases (alist-cons-before 'bootstrap 'fix-autogen-shebang diff --git a/gnu/packages/weechat.scm b/gnu/packages/weechat.scm index 5555601d47..a2e53481c3 100644 --- a/gnu/packages/weechat.scm +++ b/gnu/packages/weechat.scm @@ -58,12 +58,12 @@ ("pkg-config" ,pkg-config) ("file" ,file) ("autogen" ,autogen) - ("automake" ,automake))) + ("automake" ,automake) + ("libtool" ,libtool))) (inputs `(("ncurses" ,ncurses) ("diffutils" ,diffutils) ("gettext" ,gnu-gettext) - ("libtool" ,libtool "bin") - ("libtool" ,libtool "out") + ("libltdl" ,libltdl) ("libgcrypt" ,libgcrypt "out") ("zlib" ,zlib) ("aspell" ,aspell) -- cgit v1.2.3 From c9a465555388867725cf455066ab909c9610c2f5 Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Wed, 7 Jan 2015 11:56:13 -0500 Subject: gnu: tcl: Pass --mandir to configure. This partially reverts 9b1bf33081652210502c6ef34506e27a9bc60f06. "gnu: Remove a bunch of now unneeded '--mandir' configure flags." * gnu/packages/tcl.scm (tcl)[arguments]: Put back the --mandir configure flag, with a comment explaining why it's still needed. --- gnu/packages/tcl.scm | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/gnu/packages/tcl.scm b/gnu/packages/tcl.scm index 2de2624df4..67510eb41f 100644 --- a/gnu/packages/tcl.scm +++ b/gnu/packages/tcl.scm @@ -1,6 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2013, 2014, 2015 Ludovic Courtès -;;; Copyright © 2014 Mark H Weaver +;;; Copyright © 2014, 2015 Mark H Weaver ;;; Copyright © 2014 Eric Bavier ;;; ;;; This file is part of GNU Guix. @@ -63,6 +63,14 @@ "tclsh"))))) %standard-phases)) + ;; By default, man pages are put in PREFIX/man, but we want them in + ;; PREFIX/share/man. The 'validate-documentation-location' phase is + ;; not able to fix this up because the default install populates both + ;; PREFIX/man and PREFIX/share/man. + #:configure-flags (list (string-append "--mandir=" + (assoc-ref %outputs "out") + "/share/man")) + ;; XXX: There are a few test failures (related to HTTP, most ;; likely related to name resolution), but that doesn't cause ;; `make' to fail. -- cgit v1.2.3 From 2959dbe935f17bdcc19405067aa7353d8cc98c48 Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Wed, 31 Dec 2014 03:38:26 -0500 Subject: gnu: bootstrap: Add support for snippets to 'package-from-tarball'. * gnu/packages/bootstrap.scm (package-from-tarball): Add new keyword argument #:snippet. --- gnu/packages/bootstrap.scm | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/gnu/packages/bootstrap.scm b/gnu/packages/bootstrap.scm index 5a19783bb6..05444dd017 100644 --- a/gnu/packages/bootstrap.scm +++ b/gnu/packages/bootstrap.scm @@ -1,5 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2012, 2013, 2014 Ludovic Courtès +;;; Copyright © 2014, 2015 Mark H Weaver ;;; ;;; This file is part of GNU Guix. ;;; @@ -87,10 +88,13 @@ (patch patch)) (origin-patches source)))))) -(define (package-from-tarball name source program-to-test description) +(define* (package-from-tarball name source program-to-test description + #:key snippet) "Return a package that correspond to the extraction of SOURCE. PROGRAM-TO-TEST is a program to run after extraction of SOURCE, to -check whether everything is alright." +check whether everything is alright. If SNIPPET is provided, it is +evaluated after extracting SOURCE. SNIPPET should return true if +successful, or false to signal an error." (package (name name) (version "0") @@ -112,6 +116,7 @@ check whether everything is alright." (with-directory-excursion out (and (zero? (system* tar "xvf" (string-append builddir "/binaries.tar"))) + ,@(if snippet (list snippet) '()) (zero? (system* (string-append "bin/" ,program-to-test) "--version")))))))) (inputs -- cgit v1.2.3 From 84cbe39c5a21495647ab6528715c42e4c5b94e83 Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Wed, 31 Dec 2014 03:41:50 -0500 Subject: gnu: bootstrap: Fix egrep and fgrep after unpacking bootstrap binaries. * gnu/packages/bootstrap.scm (%bootstrap-coreutils&co): Add #:snippet argument to 'package-from-tarball' that calls 'patch-shebang' on egrep and fgrep after unpacking. Test 'fgrep' instead of 'true'. --- gnu/packages/bootstrap.scm | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/gnu/packages/bootstrap.scm b/gnu/packages/bootstrap.scm index 05444dd017..f1110d9cf0 100644 --- a/gnu/packages/bootstrap.scm +++ b/gnu/packages/bootstrap.scm @@ -264,8 +264,15 @@ $out/bin/guile --version~%" ("mips64el-linux" (base32 "072y4wyfsj1bs80r6vbybbafy8ya4vfy7qj25dklwk97m6g71753")))))) - "true" ; the program to test - "Bootstrap binaries of Coreutils, Awk, etc.")) + "fgrep" ; the program to test + "Bootstrap binaries of Coreutils, Awk, etc." + #:snippet + '(let ((path (list (string-append (getcwd) "/bin")))) + (chmod "bin" #o755) + (patch-shebang "bin/egrep" path) + (patch-shebang "bin/fgrep" path) + (chmod "bin" #o555) + #t))) (define %bootstrap-binutils (package-from-tarball "binutils-bootstrap" -- cgit v1.2.3 From 270b501ee2b1b4ea4003a60b5568fc4dcb09d9db Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Thu, 1 Jan 2015 22:53:55 -0500 Subject: gnu: gcc-static: Remove -lgcc_s from GNU_USER_TARGET_LIB_SPEC. * gnu/packages/make-bootstrap.scm (%gcc-static): Add 'remove-lgcc_s phase. * gnu/packages/gcc.scm (gcc-4.7): Add comment. --- gnu/packages/gcc.scm | 6 ++++++ gnu/packages/make-bootstrap.scm | 14 +++++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/gnu/packages/gcc.scm b/gnu/packages/gcc.scm index a510af48a0..c9f9ab007a 100644 --- a/gnu/packages/gcc.scm +++ b/gnu/packages/gcc.scm @@ -1,5 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2012, 2013, 2014 Ludovic Courtès +;;; Copyright © 2014, 2015 Mark H Weaver ;;; ;;; This file is part of GNU Guix. ;;; @@ -207,6 +208,11 @@ where the OS part is overloaded to denote a specific ABI---into GCC ;; libgcc_s.so when pthread_cancel support is needed, but ;; having it in the application's RUNPATH isn't enough; see ;; .) + ;; + ;; NOTE: The '-lgcc_s' added below needs to be removed in a + ;; later phase of %gcc-static. If you change the string + ;; below, make sure to update the relevant code in + ;; %gcc-static package as needed. (format #f "#define GNU_USER_TARGET_LIB_SPEC \ \"-L~a/lib %{!static:-rpath=~a/lib %{!static-libgcc:-rpath=~a/lib64 -rpath=~a/lib -lgcc_s}} \" ~a" libc libc libdir libdir suffix)) diff --git a/gnu/packages/make-bootstrap.scm b/gnu/packages/make-bootstrap.scm index f6ef2e326a..88fad0e604 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." "--disable-libquadmath" "--disable-decimal-float") (remove (cut string-match "--(.*plugin|enable-languages)" <>) - ,flags)))))) + ,flags))) + ((#:phases phases) + `(alist-cons-after + 'pre-configure 'remove-lgcc_s + (lambda _ + ;; Remove the '-lgcc_s' added to GNU_USER_TARGET_LIB_SPEC in + ;; the 'pre-configure phase of our main gcc package, because + ;; that shared library is not present in this static gcc. See + ;; . + (substitute* (find-files "gcc/config" + "^gnu-user.*\\.h$") + ((" -lgcc_s}}") "}}"))) + ,phases))))) (native-inputs (if (%current-target-system) `(;; When doing a Canadian cross, we need GMP/MPFR/MPC both -- cgit v1.2.3 From 8eb8048432f57254e07d48ab17890cbeca50e96f Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Wed, 31 Dec 2014 03:47:40 -0500 Subject: Move 'nix-system->gnu-triplet' to (guix utils) and export it. * gnu/packages/commencement.scm (nix-system->gnu-triplet): Move to... * guix/utils.scm (nix-system->gnu-triplet): ... here. Fix docstring typo. --- gnu/packages/commencement.scm | 13 ------------- guix/utils.scm | 14 ++++++++++++++ 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm index 20831de997..e6d03b184f 100644 --- a/gnu/packages/commencement.scm +++ b/gnu/packages/commencement.scm @@ -122,19 +122,6 @@ ("file" ,file-boot0) ,@%bootstrap-inputs)) -(define* (nix-system->gnu-triplet - #:optional (system (%current-system)) (vendor "unknown")) - "Return an a guess of the GNU triplet corresponding to Nix system -identifier SYSTEM." - (let* ((dash (string-index system #\-)) - (arch (substring system 0 dash)) - (os (substring system (+ 1 dash)))) - (string-append arch - "-" vendor "-" - (if (string=? os "linux") - "linux-gnu" - os)))) - (define* (boot-triplet #:optional (system (%current-system))) ;; Return the triplet used to create the cross toolchain needed in the ;; first bootstrapping stage. diff --git a/guix/utils.scm b/guix/utils.scm index d0d2e8a3d4..7ac586b0aa 100644 --- a/guix/utils.scm +++ b/guix/utils.scm @@ -61,6 +61,7 @@ location-column source-properties->location + nix-system->gnu-triplet gnu-triplet->nix-system %current-system %current-target-system @@ -476,6 +477,19 @@ previous value of the keyword argument." (() (reverse before))))))) +(define* (nix-system->gnu-triplet + #:optional (system (%current-system)) (vendor "unknown")) + "Return a guess of the GNU triplet corresponding to Nix system +identifier SYSTEM." + (let* ((dash (string-index system #\-)) + (arch (substring system 0 dash)) + (os (substring system (+ 1 dash)))) + (string-append arch + "-" vendor "-" + (if (string=? os "linux") + "linux-gnu" + os)))) + (define (gnu-triplet->nix-system triplet) "Return the Nix system type corresponding to TRIPLET, a GNU triplet as returned by `config.guess'." -- cgit v1.2.3 From 76e639a00fecb194e2fefc267e2e97c5845434b2 Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Wed, 7 Jan 2015 15:00:44 +0000 Subject: gnu: gcc: Use 'gcc-configure-flags-for-triplet' for native compilers too. * gnu/packages/gcc.scm (gcc-configure-flags-for-triplet): Do not export it. (gcc-4.7): Pass the result of 'gcc-configure-flags-for-triplet' to configure for all builds, including native ones. * gnu/packages/cross-base.scm (cross-gcc-arguments): Do not add the result of 'gcc-configure-flags-for-triplet' here, since it is now included in the configure-flags inherited from gcc-4.8. --- gnu/packages/cross-base.scm | 1 - gnu/packages/gcc.scm | 12 ++++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/gnu/packages/cross-base.scm b/gnu/packages/cross-base.scm index 0f32c9fab9..a9ae5ee333 100644 --- a/gnu/packages/cross-base.scm +++ b/gnu/packages/cross-base.scm @@ -88,7 +88,6 @@ may be either a libc package or #f.)" (substitute-keyword-arguments (package-arguments gcc-4.8) ((#:configure-flags flags) `(append (list ,(string-append "--target=" target) - ,@(gcc-configure-flags-for-triplet target) ,@(if libc '() `( ;; Disable features not needed at this stage. diff --git a/gnu/packages/gcc.scm b/gnu/packages/gcc.scm index c9f9ab007a..0e507576fd 100644 --- a/gnu/packages/gcc.scm +++ b/gnu/packages/gcc.scm @@ -36,7 +36,7 @@ ;; Base URL for GCC's infrastructure. "ftp://gcc.gnu.org/pub/gcc/infrastructure/") -(define-public (gcc-configure-flags-for-triplet target) +(define (gcc-configure-flags-for-triplet target) "Return a list of additional GCC `configure' flags for TARGET, a GNU triplet. The purpose of this procedure is to translate extended GNU triplets---e.g., @@ -102,11 +102,11 @@ where the OS part is overloaded to denote a specific ABI---into GCC "/include") "--without-headers"))) - ;; When cross-compiling GCC, pass the right options for the - ;; target triplet. - (or (and=> (%current-target-system) - gcc-configure-flags-for-triplet) - '()) + ;; Pass the right options for the target triplet. + (let ((triplet + (or (%current-target-system) + (nix-system->gnu-triplet (%current-system))))) + (gcc-configure-flags-for-triplet triplet)) (maybe-target-tools)))))) (package -- cgit v1.2.3 From 24aaf2f257e6b611d3759ffc53c29828efce1917 Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Wed, 31 Dec 2014 04:17:45 -0500 Subject: gnu: gmp: Apply fixes for armhf. * gnu/packages/patches/gmp-arm-asm-nothumb.patch: New file. * gnu-system.am (dist_patch_DATA): Add it. * gnu/packages/multiprecision.scm (gmp): Add patch. Include --build triplet in configure args when building natively. * gnu/packages/commencement.scm (gcc-final): Use bootstrap guile to build gmp-source. --- gnu-system.am | 1 + gnu/packages/commencement.scm | 2 +- gnu/packages/multiprecision.scm | 15 +++++++++++++-- gnu/packages/patches/gmp-arm-asm-nothumb.patch | 21 +++++++++++++++++++++ 4 files changed, 36 insertions(+), 3 deletions(-) create mode 100644 gnu/packages/patches/gmp-arm-asm-nothumb.patch diff --git a/gnu-system.am b/gnu-system.am index 03b4134019..840b76437f 100644 --- a/gnu-system.am +++ b/gnu-system.am @@ -372,6 +372,7 @@ dist_patch_DATA = \ gnu/packages/patches/glibc-bootstrap-system.patch \ gnu/packages/patches/glibc-ldd-x86_64.patch \ gnu/packages/patches/glibc-mips-dangling-vfork-ref.patch \ + gnu/packages/patches/gmp-arm-asm-nothumb.patch \ gnu/packages/patches/gnunet-fix-scheduler.patch \ gnu/packages/patches/gnunet-fix-tests.patch \ gnu/packages/patches/gobject-introspection-cc.patch \ diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm index e6d03b184f..8fa90fed3f 100644 --- a/gnu/packages/commencement.scm +++ b/gnu/packages/commencement.scm @@ -531,7 +531,7 @@ exec ~a/bin/~a-~a -B~a/lib -Wl,-dynamic-linker -Wl,~a/~a \"$@\"~%" (native-inputs `(("texinfo" ,texinfo-boot0) ,@(package-native-inputs gcc-boot0))) - (inputs `(("gmp-source" ,(package-source gmp)) + (inputs `(("gmp-source" ,(bootstrap-origin (package-source gmp))) ("mpfr-source" ,(package-source mpfr)) ("mpc-source" ,(package-source mpc)) ("binutils" ,binutils-final) diff --git a/gnu/packages/multiprecision.scm b/gnu/packages/multiprecision.scm index 377d922a09..ddbfc79965 100644 --- a/gnu/packages/multiprecision.scm +++ b/gnu/packages/multiprecision.scm @@ -1,5 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2012, 2013 Ludovic Courtès +;;; Copyright © 2014 Mark H Weaver ;;; ;;; This file is part of GNU Guix. ;;; @@ -22,6 +23,7 @@ #:use-module (gnu packages m4) #:use-module (guix packages) #:use-module (guix download) + #:use-module (guix utils) #:use-module (guix build-system gnu)) (define-public gmp @@ -35,7 +37,8 @@ version ".tar.xz")) (sha256 (base32 - "0r5pp27cy7ch3dg5v0rsny8bib1zfvrza6027g2mp5f6v8pd6mli")))) + "0r5pp27cy7ch3dg5v0rsny8bib1zfvrza6027g2mp5f6v8pd6mli")) + (patches (list (search-patch "gmp-arm-asm-nothumb.patch"))))) (build-system gnu-build-system) (native-inputs `(("m4" ,m4))) (outputs '("out" "debug")) @@ -43,7 +46,15 @@ '(;; Build a "fat binary", with routines for several ;; sub-architectures. "--enable-fat" - "--enable-cxx"))) + "--enable-cxx" + + ;; FIXME: gmp-6.0.0a's config.guess fails on + ;; multi-core armhf systems. + ,@(if (%current-target-system) + '() + (let ((triplet + (nix-system->gnu-triplet (%current-system)))) + (list (string-append "--build=" triplet))))))) (synopsis "Multiple-precision arithmetic library") (description "GMP is a library for arbitrary precision arithmetic, operating on 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 0000000000..666cf58cf6 --- /dev/null +++ b/gnu/packages/patches/gmp-arm-asm-nothumb.patch @@ -0,0 +1,21 @@ + +# HG changeset patch +# User Torbjorn Granlund +# Date 1396602422 -7200 +# Node ID 676e2d0f0e4dd301a7066079d2c9326c25c34a40 +# Parent 0194a75b56b21a9196626430af86c5bd9110c42d +Conditionalise ARM asm on !__thumb__. + +diff -r 0194a75b56b2 -r 676e2d0f0e4d mpn/generic/div_qr_1n_pi1.c +--- a/mpn/generic/div_qr_1n_pi1.c Thu Apr 03 23:58:51 2014 +0200 ++++ b/mpn/generic/div_qr_1n_pi1.c Fri Apr 04 11:07:02 2014 +0200 +@@ -130,7 +130,7 @@ + "%2" ((UDItype)(a0)), "r" ((UDItype)(b0)) __CLOBBER_CC) + #endif + +-#if defined (__arm__) && W_TYPE_SIZE == 32 ++#if defined (__arm__) && !defined (__thumb__) && W_TYPE_SIZE == 32 + #define add_mssaaaa(m, sh, sl, ah, al, bh, bl) \ + __asm__ ( "adds %2, %5, %6\n\t" \ + "adcs %1, %3, %4\n\t" \ + -- cgit v1.2.3 From f7d2b496b9a3f613aff50fef1e56d9f3aab99c7b Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Tue, 6 Jan 2015 21:41:55 +0000 Subject: gnu: patchelf: On ARM, apply experimental patch to get it working. * gnu/packages/patches/patchelf-rework-for-arm.patch: New file. * gnu-system.am: Add it. * gnu/packages/elf.scm: Apply patch when the target is ARM. --- gnu-system.am | 1 + gnu/packages/elf.scm | 21 + gnu/packages/patches/patchelf-rework-for-arm.patch | 473 +++++++++++++++++++++ 3 files changed, 495 insertions(+) create mode 100644 gnu/packages/patches/patchelf-rework-for-arm.patch diff --git a/gnu-system.am b/gnu-system.am index 840b76437f..06e96fb784 100644 --- a/gnu-system.am +++ b/gnu-system.am @@ -426,6 +426,7 @@ dist_patch_DATA = \ gnu/packages/patches/orpheus-cast-errors-and-includes.patch \ gnu/packages/patches/ots-no-include-missing-file.patch \ gnu/packages/patches/patchelf-page-size.patch \ + gnu/packages/patches/patchelf-rework-for-arm.patch \ gnu/packages/patches/patchutils-xfail-gendiff-tests.patch \ gnu/packages/patches/perl-no-sys-dirs.patch \ gnu/packages/patches/perl-tk-x11-discover.patch \ diff --git a/gnu/packages/elf.scm b/gnu/packages/elf.scm index 7fc689cb11..46c59c3a3b 100644 --- a/gnu/packages/elf.scm +++ b/gnu/packages/elf.scm @@ -100,6 +100,27 @@ addr2line, and more.") "1rqpg84wrd3fa16wa9vqdvasnc05yz49w207cz1l0wrl4k8q97y9")) (patches (list (search-patch "patchelf-page-size.patch"))))) (build-system gnu-build-system) + + ;; XXX: The upstream 'patchelf' doesn't support ARM. The only available + ;; patch makes significant changes to the algorithm, possibly + ;; introducing bugs. So, we apply the patch only on ARM systems. + (inputs + (if (string-prefix? "arm" (or (%current-target-system) (%current-system))) + `(("patch/rework-for-arm" ,(search-patch + "patchelf-rework-for-arm.patch"))) + '())) + (arguments + (if (string-prefix? "arm" (or (%current-target-system) (%current-system))) + `(#:phases (alist-cons-after + 'unpack 'patch/rework-for-arm + (lambda* (#:key inputs #:allow-other-keys) + (let ((patch-file + (assoc-ref inputs "patch/rework-for-arm"))) + (zero? (system* "patch" "--force" "-p1" + "--input" patch-file)))) + %standard-phases)) + '())) + (home-page "http://nixos.org/patchelf.html") (synopsis "Modify the dynamic linker and RPATH of ELF executables") (description 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 0000000000..6f4eb8f72b --- /dev/null +++ b/gnu/packages/patches/patchelf-rework-for-arm.patch @@ -0,0 +1,473 @@ +Rework the growing algorithm in patchelf to support ARM systems. +See . +This patch copied from: + + +From 0a96239cea6b97b9a0fff80da576e58ca2dfb2a2 Mon Sep 17 00:00:00 2001 +From: Sebastian Parschauer +Date: Sat, 28 Jun 2014 01:24:57 +0200 +Subject: [PATCH] Rework the growing algorithm + +On ARM systems there is no space in virtual memory for another LOAD +area in front of the code LOAD area. So insert data to its end +instead. At this location there should be enough space in virtual +memory due to alignment. We can extend it until the end of the +alignment but the file shift may be greater as it must be aligned +to the page size. Do the same for the data LOAD area. +--- + src/patchelf.cc | 357 ++++++++++++++++++++++---------------------------------- + 1 file changed, 142 insertions(+), 215 deletions(-) + +diff --git a/src/patchelf.cc b/src/patchelf.cc +index dcbfd38..4fce9e6 100644 +--- a/src/patchelf.cc ++++ b/src/patchelf.cc +@@ -116,7 +116,11 @@ private: + + void sortShdrs(); + +- void shiftFile(unsigned int extraPages, Elf_Addr startPage); ++ void shiftFileSingle(size_t fileShift, Elf_Off insertOff); ++ ++ void shiftFile(size_t neededCode, size_t neededData, ++ Elf_Off codeOff[], Elf_Off dataOff[], ++ Elf_Addr *codePage, Elf_Addr *dataPage); + + string getSectionName(const Elf_Shdr & shdr); + +@@ -130,13 +134,11 @@ private: + unsigned int size); + + void writeReplacedSections(Elf_Off & curOff, +- Elf_Addr startAddr, Elf_Off startOffset); ++ Elf_Addr startAddr, Elf_Off startOffset, bool isData); + + void rewriteHeaders(Elf_Addr phdrAddress); + +- void rewriteSectionsLibrary(); +- +- void rewriteSectionsExecutable(); ++ void rewriteSectionsBinary(); + + public: + +@@ -391,46 +393,119 @@ static unsigned int roundUp(unsigned int n, unsigned int m) + + + template +-void ElfFile::shiftFile(unsigned int extraPages, Elf_Addr startPage) ++void ElfFile::shiftFileSingle(size_t fileShift, ++ Elf_Off insertOff) + { +- /* Move the entire contents of the file `extraPages' pages +- further. */ + unsigned int oldSize = fileSize; +- unsigned int shift = extraPages * pageSize; +- growFile(fileSize + extraPages * pageSize); +- memmove(contents + extraPages * pageSize, contents, oldSize); +- memset(contents + sizeof(Elf_Ehdr), 0, shift - sizeof(Elf_Ehdr)); ++ ++ /* Grow at the end */ ++ growFile(fileSize + fileShift); ++ ++ /* move the data from the insertion point ++ to the end and zero inserted space */ ++ memmove(contents + insertOff + fileShift, ++ contents + insertOff, oldSize - insertOff); ++ memset(contents + insertOff, 0, fileShift); + + /* Adjust the ELF header. */ + wri(hdr->e_phoff, sizeof(Elf_Ehdr)); +- wri(hdr->e_shoff, rdi(hdr->e_shoff) + shift); ++ if (rdi(hdr->e_shoff) >= insertOff) ++ wri(hdr->e_shoff, rdi(hdr->e_shoff) + fileShift); + + /* Update the offsets in the section headers. */ +- for (int i = 1; i < rdi(hdr->e_shnum); ++i) +- wri(shdrs[i].sh_offset, rdi(shdrs[i].sh_offset) + shift); ++ for (int i = 1; i < rdi(hdr->e_shnum); ++i) { ++ if (rdi(shdrs[i].sh_offset) >= insertOff) ++ wri(shdrs[i].sh_offset, rdi(shdrs[i].sh_offset) + fileShift); ++ } + + /* Update the offsets in the program headers. */ + for (int i = 0; i < rdi(hdr->e_phnum); ++i) { +- wri(phdrs[i].p_offset, rdi(phdrs[i].p_offset) + shift); +- if (rdi(phdrs[i].p_align) != 0 && +- (rdi(phdrs[i].p_vaddr) - rdi(phdrs[i].p_offset)) % rdi(phdrs[i].p_align) != 0) { +- debug("changing alignment of program header %d from %d to %d\n", i, +- rdi(phdrs[i].p_align), pageSize); +- wri(phdrs[i].p_align, pageSize); ++ if (rdi(phdrs[i].p_offset) >= insertOff) ++ wri(phdrs[i].p_offset, rdi(phdrs[i].p_offset) + fileShift); ++ /* Check for ELF load command alignment issue the same ++ way as glibc/elf/dl-load.c does. This gives us the ++ chance to run an interpreter explicitly. */ ++ if (rdi(phdrs[i].p_type) == PT_LOAD && ((rdi(phdrs[i].p_vaddr) - ++ rdi(phdrs[i].p_offset)) & (rdi(phdrs[i].p_align) - 1)) != 0) { ++ debug("changing alignment of program header %d from %d to %d\n", ++ i, rdi(phdrs[i].p_align), pageSize); ++ wri(phdrs[i].p_align, pageSize); + } + } ++} ++ ++template ++void ElfFile::shiftFile(size_t neededCode, ++ size_t neededData, Elf_Off codeOff[], Elf_Off dataOff[], ++ Elf_Addr *codePage, Elf_Addr *dataPage) ++{ ++ /* Move some contents of the file further. The binary has one LOAD area ++ * for code and one for data. There is virtual memory space between ++ * these which we can use due to alignment. ++ */ ++ unsigned int memShift = neededCode; ++ unsigned int fileShift = roundUp(neededCode, pageSize); ++ unsigned int maxMemShift = 0; ++ ++ if (neededCode > 0) { ++ /* find the LOAD program header for code and extend it */ ++ for (int i = 0; i < rdi(hdr->e_phnum); ++i) { ++ if (rdi(phdrs[i].p_type) == PT_LOAD && ++ rdi(phdrs[i].p_flags) & PF_X) { ++ codeOff[1] = rdi(phdrs[i].p_filesz); ++ codeOff[0] = codeOff[1] + rdi(phdrs[i].p_offset); ++ maxMemShift = rdi(phdrs[i].p_memsz) % rdi(phdrs[i].p_align); ++ if (maxMemShift == 0) ++ continue; ++ maxMemShift = rdi(phdrs[i].p_align) - maxMemShift; ++ if (maxMemShift == 0 || memShift > maxMemShift) ++ continue; ++ *codePage = rdi(phdrs[i].p_vaddr); ++ wri(phdrs[i].p_filesz, rdi(phdrs[i].p_filesz) + memShift); ++ wri(phdrs[i].p_memsz, rdi(phdrs[i].p_memsz) + memShift); ++ break; ++ } ++ } ++ debug("codeOff: %#lx, memShift: %d, maxMemShift: %d, fileShift: %d\n", ++ codeOff[1], memShift, maxMemShift, fileShift); ++ if (codeOff[1] == 0 || maxMemShift == 0) ++ goto out; ++ ++ shiftFileSingle(fileShift, codeOff[0]); ++ } ++ ++ /* +++ Do the same for the data LOAD area +++ */ ++ memShift = neededData; ++ fileShift = roundUp(neededData, pageSize); ++ maxMemShift = 0; ++ if (neededData > 0) { ++ /* find the LOAD program header for data and extend it */ ++ for (int i = 0; i < rdi(hdr->e_phnum); ++i) { ++ if (rdi(phdrs[i].p_type) == PT_LOAD && ++ rdi(phdrs[i].p_flags) & PF_W) { ++ dataOff[1] = rdi(phdrs[i].p_filesz); ++ dataOff[0] = dataOff[1] + rdi(phdrs[i].p_offset); ++ maxMemShift = rdi(phdrs[i].p_memsz) % rdi(phdrs[i].p_align); ++ if (maxMemShift == 0) ++ continue; ++ maxMemShift = rdi(phdrs[i].p_align) - maxMemShift; ++ if (maxMemShift == 0 || memShift > maxMemShift) ++ continue; ++ *dataPage = rdi(phdrs[i].p_vaddr); ++ wri(phdrs[i].p_filesz, rdi(phdrs[i].p_filesz) + memShift); ++ wri(phdrs[i].p_memsz, rdi(phdrs[i].p_memsz) + memShift); ++ break; ++ } ++ } ++ debug("dataOff: %#lx, memShift: %d, maxMemShift: %d, fileShift: %d\n", ++ dataOff[1], memShift, maxMemShift, fileShift); ++ if (dataOff[1] == 0 || maxMemShift == 0) ++ goto out; + +- /* Add a segment that maps the new program/section headers and +- PT_INTERP segment into memory. Otherwise glibc will choke. */ +- phdrs.resize(rdi(hdr->e_phnum) + 1); +- wri(hdr->e_phnum, rdi(hdr->e_phnum) + 1); +- Elf_Phdr & phdr = phdrs[rdi(hdr->e_phnum) - 1]; +- wri(phdr.p_type, PT_LOAD); +- wri(phdr.p_offset, 0); +- wri(phdr.p_vaddr, wri(phdr.p_paddr, startPage)); +- wri(phdr.p_filesz, wri(phdr.p_memsz, shift)); +- wri(phdr.p_flags, PF_R | PF_W); +- wri(phdr.p_align, pageSize); ++ shiftFileSingle(fileShift, dataOff[0]); ++ } ++out: ++ return; + } + + +@@ -491,7 +566,7 @@ string & ElfFile::replaceSection(const SectionName & sectionN + + template + void ElfFile::writeReplacedSections(Elf_Off & curOff, +- Elf_Addr startAddr, Elf_Off startOffset) ++ Elf_Addr startAddr, Elf_Off startOffset, bool isData = false) + { + /* Overwrite the old section contents with 'X's. Do this + *before* writing the new section contents (below) to prevent +@@ -501,6 +576,9 @@ void ElfFile::writeReplacedSections(Elf_Off & curOff, + { + string sectionName = i->first; + Elf_Shdr & shdr = findSection(sectionName); ++ if ((!isData && rdi(shdr.sh_flags) & SHF_WRITE) || ++ (isData && ~(rdi(shdr.sh_flags)) & SHF_WRITE)) ++ continue; + memset(contents + rdi(shdr.sh_offset), 'X', rdi(shdr.sh_size)); + } + +@@ -509,6 +587,9 @@ void ElfFile::writeReplacedSections(Elf_Off & curOff, + { + string sectionName = i->first; + Elf_Shdr & shdr = findSection(sectionName); ++ if ((!isData && rdi(shdr.sh_flags) & SHF_WRITE) || ++ (isData && ~(rdi(shdr.sh_flags)) & SHF_WRITE)) ++ continue; + debug("rewriting section `%s' from offset 0x%x (size %d) to offset 0x%x (size %d)\n", + sectionName.c_str(), rdi(shdr.sh_offset), rdi(shdr.sh_size), curOff, i->second.size()); + +@@ -546,201 +627,47 @@ void ElfFile::writeReplacedSections(Elf_Off & curOff, + curOff += roundUp(i->second.size(), sectionAlignment); + } + +- replacedSections.clear(); ++ if (isData) ++ replacedSections.clear(); + } + + + template +-void ElfFile::rewriteSectionsLibrary() ++void ElfFile::rewriteSectionsBinary() + { +- /* For dynamic libraries, we just place the replacement sections +- at the end of the file. They're mapped into memory by a +- PT_LOAD segment located directly after the last virtual address +- page of other segments. */ +- Elf_Addr startPage = 0; +- for (unsigned int i = 0; i < phdrs.size(); ++i) { +- Elf_Addr thisPage = roundUp(rdi(phdrs[i].p_vaddr) + rdi(phdrs[i].p_memsz), pageSize); +- if (thisPage > startPage) startPage = thisPage; +- } +- +- debug("last page is 0x%llx\n", (unsigned long long) startPage); ++ Elf_Off codeOff[2] = {0}, dataOff[2] = {0}; ++ Elf_Addr codePage = 0, dataPage = 0; ++ size_t neededCode = 0, neededData = 0, oldCode = 0, oldData = 0; ++ Elf_Shdr shdr = findSection(".text"); ++ Elf_Addr firstPage = rdi(shdr.sh_addr) - rdi(shdr.sh_offset); + ++ debug("first page is 0x%llx\n", (unsigned long long) firstPage); + +- /* Compute the total space needed for the replaced sections and +- the program headers. */ +- off_t neededSpace = (phdrs.size() + 1) * sizeof(Elf_Phdr); ++ /* Compute the total space needed for the replaced sections */ + for (ReplacedSections::iterator i = replacedSections.begin(); +- i != replacedSections.end(); ++i) +- neededSpace += roundUp(i->second.size(), sectionAlignment); +- debug("needed space is %d\n", neededSpace); +- +- +- size_t startOffset = roundUp(fileSize, pageSize); +- +- growFile(startOffset + neededSpace); +- +- +- /* Even though this file is of type ET_DYN, it could actually be +- an executable. For instance, Gold produces executables marked +- ET_DYN. In that case we can still hit the kernel bug that +- necessitated rewriteSectionsExecutable(). However, such +- executables also tend to start at virtual address 0, so +- rewriteSectionsExecutable() won't work because it doesn't have +- any virtual address space to grow downwards into. As a +- workaround, make sure that the virtual address of our new +- PT_LOAD segment relative to the first PT_LOAD segment is equal +- to its offset; otherwise we hit the kernel bug. This may +- require creating a hole in the executable. The bigger the size +- of the uninitialised data segment, the bigger the hole. */ +- if (isExecutable) { +- if (startOffset >= startPage) { +- debug("shifting new PT_LOAD segment by %d bytes to work around a Linux kernel bug\n", startOffset - startPage); +- } else { +- size_t hole = startPage - startOffset; +- /* Print a warning, because the hole could be very big. */ +- fprintf(stderr, "warning: working around a Linux kernel bug by creating a hole of %zu bytes in ‘%s’\n", hole, fileName.c_str()); +- assert(hole % pageSize == 0); +- /* !!! We could create an actual hole in the file here, +- but it's probably not worth the effort. */ +- growFile(fileSize + hole); +- startOffset += hole; +- } +- startPage = startOffset; +- } +- +- +- /* Add a segment that maps the replaced sections and program +- headers into memory. */ +- phdrs.resize(rdi(hdr->e_phnum) + 1); +- wri(hdr->e_phnum, rdi(hdr->e_phnum) + 1); +- Elf_Phdr & phdr = phdrs[rdi(hdr->e_phnum) - 1]; +- wri(phdr.p_type, PT_LOAD); +- wri(phdr.p_offset, startOffset); +- wri(phdr.p_vaddr, wri(phdr.p_paddr, startPage)); +- wri(phdr.p_filesz, wri(phdr.p_memsz, neededSpace)); +- wri(phdr.p_flags, PF_R | PF_W); +- wri(phdr.p_align, pageSize); +- +- +- /* Write out the replaced sections. */ +- Elf_Off curOff = startOffset + phdrs.size() * sizeof(Elf_Phdr); +- writeReplacedSections(curOff, startPage, startOffset); +- assert((off_t) curOff == startOffset + neededSpace); +- +- +- /* Move the program header to the start of the new area. */ +- wri(hdr->e_phoff, startOffset); +- +- rewriteHeaders(startPage); +-} +- +- +-template +-void ElfFile::rewriteSectionsExecutable() +-{ +- /* Sort the sections by offset, otherwise we won't correctly find +- all the sections before the last replaced section. */ +- sortShdrs(); +- +- +- /* What is the index of the last replaced section? */ +- unsigned int lastReplaced = 0; +- for (unsigned int i = 1; i < rdi(hdr->e_shnum); ++i) { +- string sectionName = getSectionName(shdrs[i]); +- if (replacedSections.find(sectionName) != replacedSections.end()) { +- debug("using replaced section `%s'\n", sectionName.c_str()); +- lastReplaced = i; +- } +- } +- +- assert(lastReplaced != 0); +- +- debug("last replaced is %d\n", lastReplaced); +- +- /* Try to replace all sections before that, as far as possible. +- Stop when we reach an irreplacable section (such as one of type +- SHT_PROGBITS). These cannot be moved in virtual address space +- since that would invalidate absolute references to them. */ +- assert(lastReplaced + 1 < shdrs.size()); /* !!! I'm lazy. */ +- size_t startOffset = rdi(shdrs[lastReplaced + 1].sh_offset); +- Elf_Addr startAddr = rdi(shdrs[lastReplaced + 1].sh_addr); +- string prevSection; +- for (unsigned int i = 1; i <= lastReplaced; ++i) { +- Elf_Shdr & shdr(shdrs[i]); +- string sectionName = getSectionName(shdr); +- debug("looking at section `%s'\n", sectionName.c_str()); +- /* !!! Why do we stop after a .dynstr section? I can't +- remember! */ +- if ((rdi(shdr.sh_type) == SHT_PROGBITS && sectionName != ".interp") +- || prevSection == ".dynstr") +- { +- startOffset = rdi(shdr.sh_offset); +- startAddr = rdi(shdr.sh_addr); +- lastReplaced = i - 1; +- break; ++ i != replacedSections.end(); ++i) { ++ shdr = findSection(i->first); ++ if (rdi(shdr.sh_flags) & SHF_WRITE) { ++ oldData += rdi(shdr.sh_size); ++ neededData += roundUp(i->second.size(), sectionAlignment); + } else { +- if (replacedSections.find(sectionName) == replacedSections.end()) { +- debug("replacing section `%s' which is in the way\n", sectionName.c_str()); +- replaceSection(sectionName, rdi(shdr.sh_size)); +- } ++ oldCode += rdi(shdr.sh_size); ++ neededCode += roundUp(i->second.size(), sectionAlignment); + } +- prevSection = sectionName; + } + +- debug("first reserved offset/addr is 0x%x/0x%llx\n", +- startOffset, (unsigned long long) startAddr); +- +- assert(startAddr % pageSize == startOffset % pageSize); +- Elf_Addr firstPage = startAddr - startOffset; +- debug("first page is 0x%llx\n", (unsigned long long) firstPage); +- +- /* Right now we assume that the section headers are somewhere near +- the end, which appears to be the case most of the time. +- Therefore they're not accidentally overwritten by the replaced +- sections. !!! Fix this. */ +- assert((off_t) rdi(hdr->e_shoff) >= startOffset); +- +- +- /* Compute the total space needed for the replaced sections, the +- ELF header, and the program headers. */ +- size_t neededSpace = sizeof(Elf_Ehdr) + phdrs.size() * sizeof(Elf_Phdr); +- for (ReplacedSections::iterator i = replacedSections.begin(); +- i != replacedSections.end(); ++i) +- neededSpace += roundUp(i->second.size(), sectionAlignment); +- +- debug("needed space is %d\n", neededSpace); +- +- /* If we need more space at the start of the file, then grow the +- file by the minimum number of pages and adjust internal +- offsets. */ +- if (neededSpace > startOffset) { +- +- /* We also need an additional program header, so adjust for that. */ +- neededSpace += sizeof(Elf_Phdr); +- debug("needed space is %d\n", neededSpace); +- +- unsigned int neededPages = roundUp(neededSpace - startOffset, pageSize) / pageSize; +- debug("needed pages is %d\n", neededPages); +- if (neededPages * pageSize > firstPage) +- error("virtual address space underrun!"); +- +- firstPage -= neededPages * pageSize; +- startOffset += neededPages * pageSize; +- +- shiftFile(neededPages, firstPage); +- } +- +- +- /* Clear out the free space. */ +- Elf_Off curOff = sizeof(Elf_Ehdr) + phdrs.size() * sizeof(Elf_Phdr); +- debug("clearing first %d bytes\n", startOffset - curOff); +- memset(contents + curOff, 0, startOffset - curOff); ++ debug("needed space is C: %d, D: %d\n", neededCode, neededData); + ++ /* If we need more space within the file, then grow the ++ file and adjust internal offsets. */ ++ shiftFile(neededCode, neededData, codeOff, dataOff, &codePage, ++ &dataPage); ++ assert(codeOff[0] > 0); + + /* Write out the replaced sections. */ +- writeReplacedSections(curOff, firstPage, 0); +- assert((off_t) curOff == neededSpace); +- ++ debug("codePage: %#lx, dataPage: %#lx\n", codePage, dataPage); ++ writeReplacedSections(codeOff[0], codePage + codeOff[1], codeOff[0]); ++ writeReplacedSections(dataOff[0], dataPage + dataOff[1], dataOff[0], true); + + rewriteHeaders(firstPage + rdi(hdr->e_phoff)); + } +@@ -758,10 +685,10 @@ void ElfFile::rewriteSections() + + if (rdi(hdr->e_type) == ET_DYN) { + debug("this is a dynamic library\n"); +- rewriteSectionsLibrary(); ++ rewriteSectionsBinary(); + } else if (rdi(hdr->e_type) == ET_EXEC) { + debug("this is an executable\n"); +- rewriteSectionsExecutable(); ++ rewriteSectionsBinary(); + } else error("unknown ELF type"); + } + +-- +2.1.2 + -- cgit v1.2.3 From 3f00ff8b43bfef244e211d1c9bb71132926c1580 Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Wed, 7 Jan 2015 15:55:23 -0500 Subject: gnu: Add toolchain support for 'armhf-linux'. Based on preliminary work by John Darrington . * gnu/packages/cross-base.scm (xgcc-armhf): New variable. * gnu/packages/gcc.scm (gcc-configure-flags-for-triplet): Add armhf case. (gcc-4.7)[pre-configure]: Add gcc/config/*/linux-eabi.h to the list of files in which to patch GLIBC_DYNAMIC_LINKER. * gnu/packages/bootstrap.scm (glibc-dynamic-linker): Add armhf case. * guix/utils.scm (gnu-triplet->nix-system, nix-system->gnu-triplet): Add armhf cases. --- gnu/packages/bootstrap.scm | 1 + gnu/packages/cross-base.scm | 7 +++++++ gnu/packages/gcc.scm | 15 ++++++++++++--- guix/utils.scm | 26 ++++++++++++++++---------- 4 files changed, 36 insertions(+), 13 deletions(-) diff --git a/gnu/packages/bootstrap.scm b/gnu/packages/bootstrap.scm index f1110d9cf0..e1b50a1e4f 100644 --- a/gnu/packages/bootstrap.scm +++ b/gnu/packages/bootstrap.scm @@ -162,6 +162,7 @@ successful, or false to signal an error." "Return the name of Glibc's dynamic linker for SYSTEM." (cond ((string=? system "x86_64-linux") "/lib/ld-linux-x86-64.so.2") ((string=? system "i686-linux") "/lib/ld-linux.so.2") + ((string=? system "armhf-linux") "/lib/ld-linux-armhf.so.3") ((string=? system "mips64el-linux") "/lib/ld.so.1") ;; XXX: This one is used bare-bones, without a libc, so add a case diff --git a/gnu/packages/cross-base.scm b/gnu/packages/cross-base.scm index a9ae5ee333..794d925841 100644 --- a/gnu/packages/cross-base.scm +++ b/gnu/packages/cross-base.scm @@ -1,5 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2013, 2014 Ludovic Courtès +;;; Copyright © 2014, 2015 Mark H Weaver ;;; ;;; This file is part of GNU Guix. ;;; @@ -322,6 +323,12 @@ XBINUTILS and the cross tool chain." ;; Bare-bones Xtensa cross-compiler, used to build the Atheros firmware. (cross-gcc "xtensa-elf")) +(define-public xgcc-armhf + (let ((triplet "arm-linux-gnueabihf")) + (cross-gcc triplet + (cross-binutils triplet) + (cross-libc triplet)))) + ;; (define-public xgcc-armel ;; (let ((triplet "armel-linux-gnueabi")) ;; (cross-gcc triplet diff --git a/gnu/packages/gcc.scm b/gnu/packages/gcc.scm index 0e507576fd..276b986331 100644 --- a/gnu/packages/gcc.scm +++ b/gnu/packages/gcc.scm @@ -46,8 +46,17 @@ where the OS part is overloaded to denote a specific ABI---into GCC ;; Triplets recognized by glibc as denoting the N64 ABI; see ;; ports/sysdeps/mips/preconfigure. '("--with-abi=64")) + + ((string-match "^arm.*-gnueabihf$" target) + '("--with-arch=armv7-a" + "--with-float=hard" + "--with-mode=thumb" + + ;; See + "--with-fpu=vfpv3-d16")) + (else - ;; TODO: Add `armel.*gnueabi', `hf', etc. + ;; TODO: Add `arm.*-gnueabi', etc. '()))) (define-public gcc-4.7 @@ -184,14 +193,14 @@ where the OS part is overloaded to denote a specific ABI---into GCC (for-each (lambda (x) (substitute* (find-files "gcc/config" - "^linux(64|-elf)?\\.h$") + "^linux(64|-elf|-eabi)?\\.h$") (("(#define GLIBC_DYNAMIC_LINKER.*)\\\\\n$" _ line) line))) '(1 2 3)) ;; Fix the dynamic linker's file name. (substitute* (find-files "gcc/config" - "^linux(64|-elf)?\\.h$") + "^linux(64|-elf|-eabi)?\\.h$") (("#define GLIBC_DYNAMIC_LINKER([^ ]*).*$" _ suffix) (format #f "#define GLIBC_DYNAMIC_LINKER~a \"~a\"~%" suffix diff --git a/guix/utils.scm b/guix/utils.scm index 7ac586b0aa..1c619c3ef9 100644 --- a/guix/utils.scm +++ b/guix/utils.scm @@ -1,6 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2012, 2013, 2014 Ludovic Courtès -;;; Copyright © 2013 Mark H Weaver +;;; Copyright © 2013, 2014, 2015 Mark H Weaver ;;; Copyright © 2014 Eric Bavier ;;; Copyright © 2014 Ian Denhardt ;;; @@ -481,14 +481,18 @@ previous value of the keyword argument." #:optional (system (%current-system)) (vendor "unknown")) "Return a guess of the GNU triplet corresponding to Nix system identifier SYSTEM." - (let* ((dash (string-index system #\-)) - (arch (substring system 0 dash)) - (os (substring system (+ 1 dash)))) - (string-append arch - "-" vendor "-" - (if (string=? os "linux") - "linux-gnu" - os)))) + (match system + ("armhf-linux" + (string-append "arm-" vendor "-linux-gnueabihf")) + (_ + (let* ((dash (string-index system #\-)) + (arch (substring system 0 dash)) + (os (substring system (+ 1 dash)))) + (string-append arch + "-" vendor "-" + (if (string=? os "linux") + "linux-gnu" + os)))))) (define (gnu-triplet->nix-system triplet) "Return the Nix system type corresponding to TRIPLET, a GNU triplet as @@ -498,7 +502,9 @@ returned by `config.guess'." (lambda (m) (string-append "i686-" (match:substring m 1)))) (else triplet)))) - (cond ((string-match "^([^-]+)-([^-]+-)?linux-gnu.*" triplet) + (cond ((string-match "^arm[^-]*-([^-]+-)?linux-gnueabihf" triplet) + "armhf-linux") + ((string-match "^([^-]+)-([^-]+-)?linux-gnu.*" triplet) => (lambda (m) ;; Nix omits `-gnu' for GNU/Linux. -- cgit v1.2.3 From b58b7dbb75208f92c5eda7834fb42a196d66ca12 Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Wed, 7 Jan 2015 17:54:53 -0500 Subject: gnu: libtool: Skip nopic test on ARM and MIPS systems. * gnu/packages/patches/libtool-skip-tests.patch: Skip nopic test on ARM and MIPS systems. --- gnu/packages/patches/libtool-skip-tests.patch | 35 +++++++++++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/gnu/packages/patches/libtool-skip-tests.patch b/gnu/packages/patches/libtool-skip-tests.patch index 95747dfef0..6082c3f1f1 100644 --- a/gnu/packages/patches/libtool-skip-tests.patch +++ b/gnu/packages/patches/libtool-skip-tests.patch @@ -2,8 +2,39 @@ Because our GCC 'lib' spec automatically adds '-rpath' for each '-L' and a couple more '-rpath, there are two test failures: one in demo.test, and one in destdir.at. Disable these. ---- libtool-2.4.4/tests/testsuite 2014-11-29 17:43:11.000000000 +0100 -+++ libtool-2.4.4/tests/testsuite 2015-01-03 23:00:09.367775122 +0100 +Also skip the nopic test on ARM and MIPS systems. + +--- libtool-2.4.4/tests/demo.at.orig 2014-11-19 07:28:51.000000000 -0500 ++++ libtool-2.4.4/tests/demo.at 2015-01-07 17:30:46.482247718 -0500 +@@ -510,7 +510,7 @@ + AT_SETUP([force non-PIC objects]) + + AT_CHECK([case $host in +-hppa*|x86_64*|s390*) ++hppa*|x86_64*|s390*|arm*|mips*) + # These hosts cannot use non-PIC shared libs + exit 77 ;; + *-solaris*|*-sunos*) +--- libtool-2.4.4/tests/testsuite.orig 2014-11-29 11:43:11.000000000 -0500 ++++ libtool-2.4.4/tests/testsuite 2015-01-07 17:24:51.424672582 -0500 +@@ -8633,7 +8633,7 @@ + + { set +x + $as_echo "$at_srcdir/demo.at:535: case \$host in +-hppa*|x86_64*|s390*) ++hppa*|x86_64*|s390*|arm*|mips*) + # These hosts cannot use non-PIC shared libs + exit 77 ;; + *-solaris*|*-sunos*) +@@ -8658,7 +8658,7 @@ + " + at_fn_check_prepare_notrace 'a `...` command substitution' "demo.at:535" + ( $at_check_trace; case $host in +-hppa*|x86_64*|s390*) ++hppa*|x86_64*|s390*|arm*|mips*) + # These hosts cannot use non-PIC shared libs + exit 77 ;; + *-solaris*|*-sunos*) @@ -9185,7 +9185,7 @@ read at_status <"$at_status_file" #AT_START_33 at_fn_group_banner 33 'demo.at:548' \ -- cgit v1.2.3 From aa1e19477b2d78884fc500fef497cd6677604d9b Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Wed, 31 Dec 2014 04:23:12 -0500 Subject: gnu: Add bootstrap binaries for 'armhf-linux'. * gnu/packages/bootstrap/armhf-linux/bash, gnu/packages/bootstrap/armhf-linux/mkdir, gnu/packages/bootstrap/armhf-linux/tar, gnu/packages/bootstrap/armhf-linux/xz: New files. * gnu-system.am (bootstrap_armhf_linuxdir, dist_bootstrap_armhf_linux_DATA) (nodist_bootstrap_armhf_linux_DATA): New variables. (DISTCLEANFILES): Add $(nodist_bootstrap_armhf_linux_DATA). (gnu/packages/bootstrap/armhf-linux/guile-2.0.11.tar.xz): New target. * build-aux/download.scm (file-name->uri): Use newer date in URI for armhf-linux. * gnu/packages/bootstrap.scm (raw-build): Use "guile-2.0.11.tar.xz" on armhf-linux. (glibc-dynamic-linker, %bootstrap-coreutils&co, %bootstrap-binutils) (%bootstrap-glibc, %bootstrap-gcc): Add armhf-linux cases. * m4/guix.m4 (GUIX_SYSTEM_TYPE): Add armhf case. (GUIX_ASSERT_SUPPORTED_SYSTEM): Add armhf-linux to list of supported systems. * doc/guix.texi (GNU Distribution): Add armhf-linux to the list of supported systems. --- .gitignore | 1 + build-aux/download.scm | 8 +++++- doc/guix.texi | 4 +++ gnu-system.am | 13 ++++++++++ gnu/packages/bootstrap.scm | 42 +++++++++++++++++++++++++++---- gnu/packages/bootstrap/armhf-linux/bash | Bin 0 -> 802224 bytes gnu/packages/bootstrap/armhf-linux/mkdir | Bin 0 -> 401544 bytes gnu/packages/bootstrap/armhf-linux/tar | Bin 0 -> 755356 bytes gnu/packages/bootstrap/armhf-linux/xz | Bin 0 -> 502884 bytes m4/guix.m4 | 13 +++++++++- 10 files changed, 74 insertions(+), 7 deletions(-) create mode 100755 gnu/packages/bootstrap/armhf-linux/bash create mode 100755 gnu/packages/bootstrap/armhf-linux/mkdir create mode 100755 gnu/packages/bootstrap/armhf-linux/tar create mode 100755 gnu/packages/bootstrap/armhf-linux/xz diff --git a/.gitignore b/.gitignore index bcb82aa26d..3ec36366e3 100644 --- a/.gitignore +++ b/.gitignore @@ -67,6 +67,7 @@ config.cache /doc/version.texi /gnu/packages/bootstrap/x86_64-linux/guile-2.0.9.tar.xz /gnu/packages/bootstrap/i686-linux/guile-2.0.9.tar.xz +/gnu/packages/bootstrap/armhf-linux/guile-2.0.11.tar.xz /gnu/packages/bootstrap/mips64el-linux/guile-2.0.9.tar.xz /guix/config.scm /nix/nix-daemon/nix-daemon.cc diff --git a/build-aux/download.scm b/build-aux/download.scm index 50123f59d2..a107a887dc 100644 --- a/build-aux/download.scm +++ b/build-aux/download.scm @@ -1,5 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2012, 2013 Ludovic Courtès +;;; Copyright © 2014, 2015 Mark H Weaver ;;; ;;; This file is part of GNU Guix. ;;; @@ -45,7 +46,12 @@ (match (string-tokenize file (char-set-complement (char-set #\/))) ((_ ... system basename) (string->uri (string-append %url-base "/" system - "/20131110/" basename))))) + (match system + ("armhf-linux" + "/20150101/") + (_ + "/20131110/")) + basename))))) (match (command-line) ((_ file expected-hash) diff --git a/doc/guix.texi b/doc/guix.texi index 12a1808137..65d5eaea0e 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -3246,6 +3246,10 @@ Intel/AMD @code{x86_64} architecture, Linux-Libre kernel; @item i686-linux Intel 32-bit architecture (IA32), Linux-Libre kernel; +@item armhf-linux +ARMv7-A architecture with hard float, Thumb-2 and VFP3D16 coprocessor, +using the EABI hard-float ABI, and Linux-Libre kernel. + @item mips64el-linux little-endian 64-bit MIPS processors, specifically the Loongson series, n32 application binary interface (ABI), and Linux-Libre kernel. diff --git a/gnu-system.am b/gnu-system.am index 06e96fb784..a00b83dbf4 100644 --- a/gnu-system.am +++ b/gnu-system.am @@ -495,6 +495,7 @@ dist_patch_DATA = \ bootstrapdir = $(guilemoduledir)/gnu/packages/bootstrap bootstrap_x86_64_linuxdir = $(bootstrapdir)/x86_64-linux bootstrap_i686_linuxdir = $(bootstrapdir)/i686-linux +bootstrap_armhf_linuxdir = $(bootstrapdir)/armhf-linux bootstrap_mips64el_linuxdir = $(bootstrapdir)/mips64el-linux dist_bootstrap_x86_64_linux_DATA = \ @@ -509,6 +510,12 @@ dist_bootstrap_i686_linux_DATA = \ gnu/packages/bootstrap/i686-linux/tar \ gnu/packages/bootstrap/i686-linux/xz +dist_bootstrap_armhf_linux_DATA = \ + gnu/packages/bootstrap/armhf-linux/bash \ + gnu/packages/bootstrap/armhf-linux/mkdir \ + gnu/packages/bootstrap/armhf-linux/tar \ + gnu/packages/bootstrap/armhf-linux/xz + dist_bootstrap_mips64el_linux_DATA = \ gnu/packages/bootstrap/mips64el-linux/bash \ gnu/packages/bootstrap/mips64el-linux/mkdir \ @@ -521,6 +528,8 @@ nodist_bootstrap_x86_64_linux_DATA = \ gnu/packages/bootstrap/x86_64-linux/guile-2.0.9.tar.xz nodist_bootstrap_i686_linux_DATA = \ gnu/packages/bootstrap/i686-linux/guile-2.0.9.tar.xz +nodist_bootstrap_armhf_linux_DATA = \ + gnu/packages/bootstrap/armhf-linux/guile-2.0.11.tar.xz nodist_bootstrap_mips64el_linux_DATA = \ gnu/packages/bootstrap/mips64el-linux/guile-2.0.9.tar.xz @@ -532,6 +541,7 @@ set-bootstrap-executable-permissions: DISTCLEANFILES = \ $(nodist_bootstrap_x86_64_linux_DATA) \ $(nodist_bootstrap_i686_linux_DATA) \ + $(nodist_bootstrap_armhf_linux_DATA) \ $(nodist_bootstrap_mips64el_linux_DATA) # Method to download a file from an external source. @@ -546,6 +556,9 @@ gnu/packages/bootstrap/x86_64-linux/guile-2.0.9.tar.xz: gnu/packages/bootstrap/i686-linux/guile-2.0.9.tar.xz: $(MKDIR_P) `dirname "$@"` $(DOWNLOAD_FILE) "$@" "b757cd46bf13ecac83fb8e955fb50096ac2d17bb610ca8eb816f29302a00a846" +gnu/packages/bootstrap/armhf-linux/guile-2.0.11.tar.xz: + $(MKDIR_P) `dirname "$@"` + $(DOWNLOAD_FILE) "$@" "e551d05d4d385d6706ab8d574856a087758294dc90ab4c06e70a157a685e23d6" gnu/packages/bootstrap/mips64el-linux/guile-2.0.9.tar.xz: $(MKDIR_P) `dirname "$@"` $(DOWNLOAD_FILE) "$@" "994680f0001346864aa2c2cc5110f380ee7518dcd701c614291682b8e948f73b" diff --git a/gnu/packages/bootstrap.scm b/gnu/packages/bootstrap.scm index e1b50a1e4f..8373c4b5c8 100644 --- a/gnu/packages/bootstrap.scm +++ b/gnu/packages/bootstrap.scm @@ -192,7 +192,11 @@ successful, or false to signal an error." (xz (->store "xz")) (mkdir (->store "mkdir")) (bash (->store "bash")) - (guile (->store "guile-2.0.9.tar.xz")) + (guile (->store (match system + ("armhf-linux" + "guile-2.0.11.tar.xz") + (_ + "guile-2.0.9.tar.xz")))) (builder (add-text-to-store store "build-bootstrap-guile.sh" @@ -252,7 +256,11 @@ $out/bin/guile --version~%" (origin (method url-fetch) (uri (map (cut string-append <> "/" system - "/20131110/static-binaries.tar.xz") + (match system + ("armhf-linux" + "/20150101/static-binaries.tar.xz") + (_ + "/20131110/static-binaries.tar.xz"))) %bootstrap-base-urls)) (sha256 (match system @@ -262,6 +270,9 @@ $out/bin/guile --version~%" ("i686-linux" (base32 "0s5b3jb315n13m1k8095l0a5hfrsz8g0fv1b6riyc5hnxqyphlak")) + ("armhf-linux" + (base32 + "0gf0fn2kbpxkjixkmx5f4z6hv6qpmgixl69zgg74dbsfdfj8jdv5")) ("mips64el-linux" (base32 "072y4wyfsj1bs80r6vbybbafy8ya4vfy7qj25dklwk97m6g71753")))))) @@ -281,7 +292,11 @@ $out/bin/guile --version~%" (origin (method url-fetch) (uri (map (cut string-append <> "/" system - "/20131110/binutils-2.23.2.tar.xz") + (match system + ("armhf-linux" + "/20150101/binutils-2.25.tar.xz") + (_ + "/20131110/binutils-2.23.2.tar.xz"))) %bootstrap-base-urls)) (sha256 (match system @@ -291,6 +306,9 @@ $out/bin/guile --version~%" ("i686-linux" (base32 "14jgwf9gscd7l2pnz610b1zia06dvcm2qyzvni31b8zpgmcai2v9")) + ("armhf-linux" + (base32 + "1v7dj6bzn6m36f20gw31l99xaabq4xrhrx3gwqkhhig0mdlmr69q")) ("mips64el-linux" (base32 "1x8kkhcxmfyzg1ddpz2pxs6fbdl6412r7x0nzbmi5n7mj8zw2gy7")))))) @@ -335,7 +353,11 @@ $out/bin/guile --version~%" (origin (method url-fetch) (uri (map (cut string-append <> "/" (%current-system) - "/20131110/glibc-2.18.tar.xz") + (match (%current-system) + ("armhf-linux" + "/20150101/glibc-2.20.tar.xz") + (_ + "/20131110/glibc-2.18.tar.xz"))) %bootstrap-base-urls)) (sha256 (match (%current-system) @@ -345,6 +367,9 @@ $out/bin/guile --version~%" ("i686-linux" (base32 "1hgrccw1zqdc7lvgivwa54d9l3zsim5pqm0dykxg0z522h6gr05w")) + ("armhf-linux" + (base32 + "18cmgvpllqfpn6khsmivqib7ys8ymnq0hdzi3qp24prik0ykz8gn")) ("mips64el-linux" (base32 "0k97a3whzx3apsi9n2cbsrr79ad6lh00klxph9hw4fqyp1abkdsg"))))))))) @@ -406,7 +431,11 @@ exec ~a/bin/.gcc-wrapped -B~a/lib \ (origin (method url-fetch) (uri (map (cut string-append <> "/" (%current-system) - "/20131110/gcc-4.8.2.tar.xz") + (match (%current-system) + ("armhf-linux" + "/20150101/gcc-4.8.4.tar.xz") + (_ + "/20131110/gcc-4.8.2.tar.xz"))) %bootstrap-base-urls)) (sha256 (match (%current-system) @@ -416,6 +445,9 @@ exec ~a/bin/.gcc-wrapped -B~a/lib \ ("i686-linux" (base32 "150c1arrf2k8vfy6dpxh59vcgs4p1bgiz2av5m19dynpks7rjnyw")) + ("armhf-linux" + (base32 + "0ghz825yzp43fxw53kd6afm8nkz16f7dxi9xi40bfwc8x3nbbr8v")) ("mips64el-linux" (base32 "1m5miqkyng45l745n0sfafdpjkqv9225xf44jqkygwsipj2cv9ks"))))))))) diff --git a/gnu/packages/bootstrap/armhf-linux/bash b/gnu/packages/bootstrap/armhf-linux/bash new file mode 100755 index 0000000000..212a22c8ce Binary files /dev/null and b/gnu/packages/bootstrap/armhf-linux/bash differ diff --git a/gnu/packages/bootstrap/armhf-linux/mkdir b/gnu/packages/bootstrap/armhf-linux/mkdir new file mode 100755 index 0000000000..c3e5246e92 Binary files /dev/null and b/gnu/packages/bootstrap/armhf-linux/mkdir differ diff --git a/gnu/packages/bootstrap/armhf-linux/tar b/gnu/packages/bootstrap/armhf-linux/tar new file mode 100755 index 0000000000..5a6aac8a58 Binary files /dev/null and b/gnu/packages/bootstrap/armhf-linux/tar differ diff --git a/gnu/packages/bootstrap/armhf-linux/xz b/gnu/packages/bootstrap/armhf-linux/xz new file mode 100755 index 0000000000..a77aebc268 Binary files /dev/null and b/gnu/packages/bootstrap/armhf-linux/xz differ diff --git a/m4/guix.m4 b/m4/guix.m4 index 19e041a72c..d4415598b0 100644 --- a/m4/guix.m4 +++ b/m4/guix.m4 @@ -1,5 +1,6 @@ dnl GNU Guix --- Functional package management for GNU dnl Copyright © 2012, 2013, 2014 Ludovic Courtès +dnl Copyright © 2014 Mark H Weaver dnl dnl This file is part of GNU Guix. dnl @@ -50,6 +51,16 @@ AC_DEFUN([GUIX_SYSTEM_TYPE], [ machine_name="i686";; amd64) machine_name="x86_64";; + arm*) + # TODO: If not cross-compiling, add a sanity check to make + # sure this build machine has the needed features to + # support executables compiled using our armhf gcc, + # configured with: + # --with-arch=armv7-a + # --with-float=hard + # --with-mode=thumb + # --with-fpu=vfpv3-d16 + machine_name="armhf";; *) machine_name="$host_cpu";; esac @@ -86,7 +97,7 @@ courageous and port the GNU System distribution to it (see # Currently only Linux-based systems are supported, and only on some # platforms. case "$guix_system" in - x86_64-linux|i686-linux|mips64el-linux) + x86_64-linux|i686-linux|armhf-linux|mips64el-linux) ;; *) if test "x$guix_courageous" = "xyes"; then -- cgit v1.2.3 From 4eb01e5442aa7bbaa880ae8e72bd5d27434855ef Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Fri, 9 Jan 2015 22:35:33 +0100 Subject: build-system/gnu: Patch /usr/bin/file in all 'configure' files. * guix/build/utils.scm (patch-/usr/bin/file): New procedure. * guix/build/gnu-build-system.scm (patch-usr-bin-file): Rewrite using it. Patch all the files returned by 'find-files' that are executable. * gnu/packages/gawk.scm (gawk)[arguments]: Remove use of 'substitute*' for 'extension/configure'. --- gnu/packages/gawk.scm | 10 +--------- guix/build/gnu-build-system.scm | 30 ++++++++---------------------- guix/build/utils.scm | 26 +++++++++++++++++++++++++- 3 files changed, 34 insertions(+), 32 deletions(-) diff --git a/gnu/packages/gawk.scm b/gnu/packages/gawk.scm index 74d0720567..e0d3f41ac2 100644 --- a/gnu/packages/gawk.scm +++ b/gnu/packages/gawk.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2012, 2013, 2014 Ludovic Courtès +;;; Copyright © 2012, 2013, 2014, 2015 Ludovic Courtès ;;; Copyright © 2014, 2015 Mark H Weaver ;;; ;;; This file is part of GNU Guix. @@ -55,14 +55,6 @@ '((substitute* "extension/Makefile.in" (("^.*: check-for-shared-lib-support" match) (string-append "### " match)))) - '()) - - ;; XXX FIXME prerelease libtool fails on MIPS in the - ;; absence of /usr/bin/file. - ,@(if (string-prefix? "mips64" (or (%current-target-system) - (%current-system))) - '((substitute* "extension/configure" - (("/usr/bin/file") (which "file")))) '()))) (alist-cons-before diff --git a/guix/build/gnu-build-system.scm b/guix/build/gnu-build-system.scm index cdfba2f9b7..2880168273 100644 --- a/guix/build/gnu-build-system.scm +++ b/guix/build/gnu-build-system.scm @@ -115,29 +115,15 @@ working directory." (define* (patch-usr-bin-file #:key native-inputs inputs (patch-/usr/bin/file? #t) #:allow-other-keys) - "Patch occurrences of /usr/bin/file in configure, if present." + "Patch occurrences of \"/usr/bin/file\" in all the executable 'configure' +files found in the source tree. This works around Libtool's Autoconf macros, +which generates invocations of \"/usr/bin/file\" that are used to determine +things like the ABI being used." (when patch-/usr/bin/file? - (let ((file "configure") - (file-command (or (and=> (assoc-ref (or native-inputs inputs) "file") - (cut string-append <> "/bin/file")) - (which "file")))) - (cond ((not (file-exists? file)) - (format (current-error-port) - "patch-usr-bin-file: warning: `~a' not found~%" - file)) - ((not file-command) - (format (current-error-port) - "patch-usr-bin-file: warning: `file' not found in PATH~%")) - (else - (let ((st (stat file))) - (substitute* file - (("/usr/bin/file") - (begin - (format (current-error-port) - "patch-usr-bin-file: ~a: changing `~a' to `~a'~%" - file "/usr/bin/file" file-command) - file-command))) - (set-file-time file st)))))) + (for-each (lambda (file) + (when (executable-file? file) + (patch-/usr/bin/file file))) + (find-files "." "^configure$"))) #t) (define* (patch-source-shebangs #:key source #:allow-other-keys) diff --git a/guix/build/utils.scm b/guix/build/utils.scm index 86b7ca0155..4407f9af23 100644 --- a/guix/build/utils.scm +++ b/guix/build/utils.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2012, 2013, 2014 Ludovic Courtès +;;; Copyright © 2012, 2013, 2014, 2015 Ludovic Courtès ;;; Copyright © 2013 Andreas Enge ;;; Copyright © 2013 Nikita Karetnikov ;;; @@ -61,6 +61,7 @@ set-file-time patch-shebang patch-makefile-SHELL + patch-/usr/bin/file fold-port-matches remove-store-references wrap-program)) @@ -681,6 +682,29 @@ When KEEP-MTIME? is true, the atime/mtime of FILE are kept unchanged." (when keep-mtime? (set-file-time file st)))) +(define* (patch-/usr/bin/file file + #:key + (file-command (which "file")) + (keep-mtime? #t)) + "Patch occurrences of \"/usr/bin/file\" in FILE, replacing them with +FILE-COMMAND. When KEEP-MTIME? is true, keep FILE's modification time +unchanged." + (if (not file-command) + (format (current-error-port) + "patch-/usr/bin/file: warning: \ +no replacement 'file' command, doing nothing~%") + (let ((st (stat file))) + (substitute* file + (("/usr/bin/file") + (begin + (format (current-error-port) + "patch-/usr/bin/file: ~a: changing `~a' to `~a'~%" + file "/usr/bin/file" file-command) + file-command))) + + (when keep-mtime? + (set-file-time file st))))) + (define* (fold-port-matches proc init pattern port #:optional (unmatched (lambda (_ r) r))) "Read from PORT character-by-character; for each match against -- cgit v1.2.3 From b2363f65517dd30b9766c9714c42dc06fd8b438a Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Sat, 10 Jan 2015 00:04:02 -0500 Subject: gnu: file: Update to 5.22. * gnu/packages/file.scm (file): Update to 5.22. --- gnu/packages/file.scm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gnu/packages/file.scm b/gnu/packages/file.scm index 7d8504b74a..161df544de 100644 --- a/gnu/packages/file.scm +++ b/gnu/packages/file.scm @@ -1,6 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2013 Andreas Enge -;;; Copyright © 2014 Mark H Weaver +;;; Copyright © 2014, 2015 Mark H Weaver ;;; ;;; This file is part of GNU Guix. ;;; @@ -27,14 +27,14 @@ (define-public file (package (name "file") - (version "5.20") + (version "5.22") (source (origin (method url-fetch) (uri (string-append "ftp://ftp.astron.com/pub/file/file-" version ".tar.gz")) (sha256 (base32 - "0iyjs9z8kp43gz7gva4j67h4p0n53f7q8x3ibai9s01sp3xnphsv")))) + "02zw14hw3gqlw91w2f2snbirvyrp7r83irvnnkjcb25q9kjaiqy4")))) (build-system gnu-build-system) ;; When cross-compiling, this package depends upon a native install of -- cgit v1.2.3 From 62c155c0bcbc0d71b1bc35e966193b6e8de03246 Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Sat, 10 Jan 2015 19:14:29 -0500 Subject: gnu: libtool: Add m4 to propagated-inputs. * gnu/packages/autotools.scm (libtool)[propagated-inputs]: Add m4. --- gnu/packages/autotools.scm | 1 + 1 file changed, 1 insertion(+) diff --git a/gnu/packages/autotools.scm b/gnu/packages/autotools.scm index 07fdde73ea..8e72562444 100644 --- a/gnu/packages/autotools.scm +++ b/gnu/packages/autotools.scm @@ -249,6 +249,7 @@ Makefile, simplifying the entire process for the developer.") (patches (list (search-patch "libtool-skip-tests.patch"))))) (build-system gnu-build-system) + (propagated-inputs `(("m4" ,m4))) (native-inputs `(("m4" ,m4) ("perl" ,perl) ("automake" ,automake) ;some tests rely on 'aclocal' -- cgit v1.2.3 From 74d72608b35e1840a4e784b3a901e17d4f495dc1 Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Sun, 11 Jan 2015 09:43:22 -0500 Subject: gnu: curl: Update to 7.40.0. * gnu/packages/patches/curl-gss-api-fix.patch: New file. * gnu-system.am (dist_patch_DATA): Add it. * gnu/packages/curl.scm (curl): Update to 7.40.0. Add patch. --- gnu-system.am | 1 + gnu/packages/curl.scm | 6 +++-- gnu/packages/patches/curl-gss-api-fix.patch | 38 +++++++++++++++++++++++++++++ 3 files changed, 43 insertions(+), 2 deletions(-) create mode 100644 gnu/packages/patches/curl-gss-api-fix.patch diff --git a/gnu-system.am b/gnu-system.am index 70e347d2c0..73d45a7cd1 100644 --- a/gnu-system.am +++ b/gnu-system.am @@ -348,6 +348,7 @@ dist_patch_DATA = \ gnu/packages/patches/cpio-gets-undeclared.patch \ gnu/packages/patches/cssc-gets-undeclared.patch \ gnu/packages/patches/cssc-missing-include.patch \ + gnu/packages/patches/curl-gss-api-fix.patch \ gnu/packages/patches/cursynth-wave-rand.patch \ gnu/packages/patches/dbus-localstatedir.patch \ gnu/packages/patches/diffutils-gets-undeclared.patch \ diff --git a/gnu/packages/curl.scm b/gnu/packages/curl.scm index f595e7259c..8792ddceaf 100644 --- a/gnu/packages/curl.scm +++ b/gnu/packages/curl.scm @@ -1,5 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2013, 2014 Andreas Enge +;;; Copyright © 2015 Mark H Weaver ;;; ;;; This file is part of GNU Guix. ;;; @@ -36,14 +37,15 @@ (define-public curl (package (name "curl") - (version "7.37.1") + (version "7.40.0") (source (origin (method url-fetch) (uri (string-append "http://curl.haxx.se/download/curl-" version ".tar.lzma")) (sha256 (base32 - "10yfh4hy8wbkj43la238hg6h8i9wyp1cvvk8kl0giac1020imn5d")))) + "1a15fdc26b3vwwmchzzpd3l1hfyhx06dn7b6lkikqd7kgwvg5ps7")) + (patches (list (search-patch "curl-gss-api-fix.patch"))))) (build-system gnu-build-system) (inputs `(("gnutls" ,gnutls) ("gss" ,gss) 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 0000000000..ea838ae8c7 --- /dev/null +++ b/gnu/packages/patches/curl-gss-api-fix.patch @@ -0,0 +1,38 @@ +Copied from upstream: +https://github.com/bagder/curl/commit/5c0e66d63214e0306197c5a3f162441e074f3401.patch + +From 5c0e66d63214e0306197c5a3f162441e074f3401 Mon Sep 17 00:00:00 2001 +From: Steve Holme +Date: Thu, 8 Jan 2015 19:23:53 +0000 +Subject: [PATCH] sasl_gssapi: Fixed build on NetBSD with built-in GSS-API + +Bug: http://curl.haxx.se/bug/view.cgi?id=1469 +Reported-by: Thomas Klausner +--- + lib/curl_sasl_gssapi.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/lib/curl_sasl_gssapi.c b/lib/curl_sasl_gssapi.c +index 6dda0e9..a50646a 100644 +--- a/lib/curl_sasl_gssapi.c ++++ b/lib/curl_sasl_gssapi.c +@@ -6,6 +6,7 @@ + * \___|\___/|_| \_\_____| + * + * Copyright (C) 2014, Steve Holme, . ++ * Copyright (C) 2015, Daniel Stenberg, , et al. + * + * This software is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms +@@ -126,7 +127,7 @@ CURLcode Curl_sasl_create_gssapi_user_message(struct SessionHandle *data, + + /* Import the SPN */ + gss_major_status = gss_import_name(&gss_minor_status, &spn_token, +- gss_nt_service_name, &krb5->spn); ++ GSS_C_NT_HOSTBASED_SERVICE, &krb5->spn); + if(GSS_ERROR(gss_major_status)) { + Curl_gss_log_error(data, gss_minor_status, "gss_import_name() failed: "); + +-- +2.2.1 + -- cgit v1.2.3 From 798e004538664489243d784c2dfa75b9fd7277a6 Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Sun, 11 Jan 2015 15:21:19 -0500 Subject: gnu: sqlite: Update to 3.8.7.4. * gnu/packages/patches/sqlite-large-page-size-fix.patch: Remove file. * gnu-system.am (dist_patch_DATA): Remove it. * gnu/packages/databases.scm (sqlite): Update to 3.8.7.4. Remove patch. --- gnu-system.am | 1 - gnu/packages/databases.scm | 8 +- .../patches/sqlite-large-page-size-fix.patch | 180 --------------------- 3 files changed, 3 insertions(+), 186 deletions(-) delete mode 100644 gnu/packages/patches/sqlite-large-page-size-fix.patch diff --git a/gnu-system.am b/gnu-system.am index 73d45a7cd1..a166adda2d 100644 --- a/gnu-system.am +++ b/gnu-system.am @@ -459,7 +459,6 @@ dist_patch_DATA = \ gnu/packages/patches/slim-sigusr1.patch \ gnu/packages/patches/soprano-find-clucene.patch \ gnu/packages/patches/source-highlight-regexrange-test.patch \ - gnu/packages/patches/sqlite-large-page-size-fix.patch \ gnu/packages/patches/superlu-dist-scotchmetis.patch \ gnu/packages/patches/tcsh-fix-autotest.patch \ gnu/packages/patches/teckit-cstdio.patch \ diff --git a/gnu/packages/databases.scm b/gnu/packages/databases.scm index 5a7b9950a1..8d21248fe5 100644 --- a/gnu/packages/databases.scm +++ b/gnu/packages/databases.scm @@ -3,7 +3,7 @@ ;;; Copyright © 2012, 2014 Andreas Enge ;;; Copyright © 2013 Cyril Roelandt ;;; Copyright © 2014 David Thompson -;;; Copyright © 2014 Mark H Weaver +;;; Copyright © 2014, 2015 Mark H Weaver ;;; ;;; This file is part of GNU Guix. ;;; @@ -213,7 +213,7 @@ types are supported, as is encryption.") (define-public sqlite (package (name "sqlite") - (version "3.8.4.3") + (version "3.8.7.4") (source (origin (method url-fetch) ;; TODO: Download from sqlite.org once this bug : @@ -233,9 +233,7 @@ types are supported, as is encryption.") "/sqlite-autoconf-" numeric-version ".tar.gz"))) (sha256 (base32 - "0rcdsk5sz34w8vy0g5yhfms4saiq81i872jxx5m5sjij7bi9bsg0")) - (patches - (list (search-patch "sqlite-large-page-size-fix.patch"))))) + "1v2rhgsx27in6dcvxk0pkxc0zrbl38biimjg6c1zxz85jh9hydw6")))) (build-system gnu-build-system) (inputs `(("readline" ,readline))) 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 c561fa20a2..0000000000 --- a/gnu/packages/patches/sqlite-large-page-size-fix.patch +++ /dev/null @@ -1,180 +0,0 @@ -Add an experimental fix to avoid attempting to mmap memory from an -offset that is not a multiple of the system page size on systems with -page sizes larger than 32KB. - -Patch by Dan Kennedy . - ---- sqlite-autoconf/sqlite3.c.orig 2014-03-22 23:44:47.055908203 -0400 -+++ sqlite-autoconf/sqlite3.c 2014-03-22 23:44:06.716552734 -0400 -@@ -24010,6 +24010,7 @@ - - /* Forward reference */ - static int openDirectory(const char*, int*); -+static int unixGetpagesize(void); - - /* - ** Many system calls are accessed through pointer-to-functions so that -@@ -24133,6 +24134,9 @@ - #define osMremap ((void*(*)(void*,size_t,size_t,int,...))aSyscall[23].pCurrent) - #endif - -+ { "getpagesize", (sqlite3_syscall_ptr)unixGetpagesize, 0 }, -+#define osGetpagesize ((int(*)(void))aSyscall[24].pCurrent) -+ - }; /* End of the overrideable system calls */ - - /* -@@ -27792,6 +27796,36 @@ - return rc; - } - -+/* -+** Return the system page size. -+** -+** This function should not be called directly by other code in this file. -+** Instead, it should be called via macro osGetpagesize(). -+*/ -+static int unixGetpagesize(void){ -+#if defined(_BSD_SOURCE) -+ return getpagesize(); -+#else -+ return (int)sysconf(_SC_PAGESIZE); -+#endif -+} -+ -+/* -+** Return the minimum number of 32KB shm regions that should be mapped at -+** a time, assuming that each mapping must be an integer multiple of the -+** current system page-size. -+** -+** Usually, this is 1. The exception seems to be systems that are configured -+** to use 64KB pages - in this case each mapping must cover at least two -+** shm regions. -+*/ -+static int unixShmRegionPerMap(void){ -+ int shmsz = 32*1024; /* SHM region size */ -+ int pgsz = osGetpagesize(); /* System page size */ -+ assert( ((pgsz-1)&pgsz)==0 ); /* Page size must be a power of 2 */ -+ if( pgszpInode->pShmNode; - assert( unixMutexHeld() ); - if( p && p->nRef==0 ){ -+ int nShmPerMap = unixShmRegionPerMap(); - int i; - assert( p->pInode==pFd->pInode ); - sqlite3_mutex_free(p->mutex); -- for(i=0; inRegion; i++){ -+ for(i=0; inRegion; i+=nShmPerMap){ - if( p->h>=0 ){ - osMunmap(p->apRegion[i], p->szRegion); - }else{ -@@ -28013,6 +28048,8 @@ - unixShm *p; - unixShmNode *pShmNode; - int rc = SQLITE_OK; -+ int nShmPerMap = unixShmRegionPerMap(); -+ int nReqRegion; - - /* If the shared-memory file has not yet been opened, open it now. */ - if( pDbFd->pShm==0 ){ -@@ -28028,9 +28065,12 @@ - assert( pShmNode->h>=0 || pDbFd->pInode->bProcessLock==1 ); - assert( pShmNode->h<0 || pDbFd->pInode->bProcessLock==0 ); - -- if( pShmNode->nRegion<=iRegion ){ -+ /* Minimum number of regions required to be mapped. */ -+ nReqRegion = ((iRegion+nShmPerMap) / nShmPerMap) * nShmPerMap; -+ -+ if( pShmNode->nRegionszRegion = szRegion; -@@ -28079,17 +28119,19 @@ - - /* Map the requested memory region into this processes address space. */ - apNew = (char **)sqlite3_realloc( -- pShmNode->apRegion, (iRegion+1)*sizeof(char *) -+ pShmNode->apRegion, nReqRegion*sizeof(char *) - ); - if( !apNew ){ - rc = SQLITE_IOERR_NOMEM; - goto shmpage_out; - } - pShmNode->apRegion = apNew; -- while(pShmNode->nRegion<=iRegion){ -+ while( pShmNode->nRegionh>=0 ){ -- pMem = osMmap(0, szRegion, -+ pMem = osMmap(0, nMap, - pShmNode->isReadonly ? PROT_READ : PROT_READ|PROT_WRITE, - MAP_SHARED, pShmNode->h, szRegion*(i64)pShmNode->nRegion - ); -@@ -28105,8 +28147,11 @@ - } - memset(pMem, 0, szRegion); - } -- pShmNode->apRegion[pShmNode->nRegion] = pMem; -- pShmNode->nRegion++; -+ -+ for(i=0; iapRegion[pShmNode->nRegion+i] = &((char*)pMem)[szRegion*i]; -+ } -+ pShmNode->nRegion += nShmPerMap; - } - } - -@@ -28321,19 +28366,6 @@ - } - - /* --** Return the system page size. --*/ --static int unixGetPagesize(void){ --#if HAVE_MREMAP -- return 512; --#elif defined(_BSD_SOURCE) -- return getpagesize(); --#else -- return (int)sysconf(_SC_PAGESIZE); --#endif --} -- --/* - ** Attempt to set the size of the memory mapping maintained by file - ** descriptor pFd to nNew bytes. Any existing mapping is discarded. - ** -@@ -28369,8 +28401,12 @@ - if( (pFd->ctrlFlags & UNIXFILE_RDONLY)==0 ) flags |= PROT_WRITE; - - if( pOrig ){ -- const int szSyspage = unixGetPagesize(); -+#if HAVE_MREMAP -+ i64 nReuse = pFd->mmapSize; -+#else -+ const int szSyspage = osGetpagesize(); - i64 nReuse = (pFd->mmapSize & ~(szSyspage-1)); -+#endif - u8 *pReq = &pOrig[nReuse]; - - /* Unmap any pages of the existing mapping that cannot be reused. */ -@@ -31116,7 +31152,7 @@ - - /* Double-check that the aSyscall[] array has been constructed - ** correctly. See ticket [bb3a86e890c8e96ab] */ -- assert( ArraySize(aSyscall)==24 ); -+ assert( ArraySize(aSyscall)==25 ); - - /* Register all VFSes defined in the aVfs[] array */ - for(i=0; i<(sizeof(aVfs)/sizeof(sqlite3_vfs)); i++){ -- cgit v1.2.3 From 73161579b20139cc141210bd1a3fc1446eed19a8 Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Mon, 12 Jan 2015 18:34:11 -0500 Subject: gnu: libpng: Update to 1.5.21. * gnu/packages/image.scm (libpng): Update to 1.5.21. --- gnu/packages/image.scm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gnu/packages/image.scm b/gnu/packages/image.scm index cdb9c1cfb2..07669a1803 100644 --- a/gnu/packages/image.scm +++ b/gnu/packages/image.scm @@ -1,6 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2013 Andreas Enge -;;; Copyright © 2014 Mark H Weaver +;;; Copyright © 2014, 2015 Mark H Weaver ;;; Copyright © 2014 Alex Kost ;;; Copyright © 2014 Ricardo Wurmus ;;; @@ -39,7 +39,7 @@ (define-public libpng (package (name "libpng") - (version "1.5.17") + (version "1.5.21") (source (origin (method url-fetch) @@ -50,7 +50,7 @@ "ftp://ftp.simplesystems.org/pub/libpng/png/src" "/libpng15/libpng-" version ".tar.xz"))) (sha256 - (base32 "19wj293r4plbfgb43yhrc2qx8bsch9gbazazfqrj9haa7lsk29jp")))) + (base32 "19yvzw6sf9gf7v25ha9bla8bw1nijh82wj8ag6brjj3hpij1q5dm")))) (build-system gnu-build-system) ;; libpng.la says "-lz", so propagate it. -- cgit v1.2.3 From d8cd15949092b7cd90ee1dcc4aefe87b3ba4a6fb Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Tue, 13 Jan 2015 11:49:22 -0500 Subject: gnu: xorg-server: Update to 1.16.3. * gnu/packages/xorg.scm (xorg-server): Update to 1.16.3. --- gnu/packages/xorg.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gnu/packages/xorg.scm b/gnu/packages/xorg.scm index e898c1c935..ff4488b8ef 100644 --- a/gnu/packages/xorg.scm +++ b/gnu/packages/xorg.scm @@ -4400,7 +4400,7 @@ kernel mode setting (KMS).") (define-public xorg-server (package (name "xorg-server") - (version "1.16.2.901") + (version "1.16.3") (source (origin (method url-fetch) @@ -4409,7 +4409,7 @@ kernel mode setting (KMS).") name "-" version ".tar.bz2")) (sha256 (base32 - "19jb8v26wc332ramwjdg5vjh3s36kr7n46s6fdfaxrj1wif5m27g")))) + "1yxhc3aw2cadf77w48d2glc5j6w6hairiskfiys7h45g70r483sy")))) (build-system gnu-build-system) (propagated-inputs `(("dri2proto" ,dri2proto) -- cgit v1.2.3 From fe3711bcce4fa689bf380235fa47cfa5fa612fea Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Tue, 13 Jan 2015 14:54:31 -0500 Subject: gnu: openssl: Update to 1.0.1k. * gnu/packages/openssl.scm (openssl): Update to 1.0.1k. --- gnu/packages/openssl.scm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gnu/packages/openssl.scm b/gnu/packages/openssl.scm index 141e105a2d..7764fc462b 100644 --- a/gnu/packages/openssl.scm +++ b/gnu/packages/openssl.scm @@ -1,6 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2013 Andreas Enge -;;; Copyright © 2014 Mark H Weaver +;;; Copyright © 2014, 2015 Mark H Weaver ;;; ;;; This file is part of GNU Guix. ;;; @@ -29,14 +29,14 @@ (define-public openssl (package (name "openssl") - (version "1.0.1j") + (version "1.0.1k") (source (origin (method url-fetch) (uri (string-append "ftp://ftp.openssl.org/source/openssl-" version ".tar.gz")) (sha256 (base32 - "1wzdaiix40lz0rsyf51qv0wiq4ywp29j5ni0xzl06vxsi63wlq0v")))) + "0754wzmzr90hiiqs5cy6g3cf8as75ljkhppgyirfg26hpapax7wg")))) (build-system gnu-build-system) (native-inputs `(("perl" ,perl))) (arguments -- cgit v1.2.3 From d585f244cea92d6a9ab6644159bc6b4f487b5283 Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Tue, 13 Jan 2015 15:05:52 -0500 Subject: gnu: gnutls: Update to 3.2.21. * gnu/packages/gnutls.scm (gnutls): Update to 3.2.21. --- gnu/packages/gnutls.scm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gnu/packages/gnutls.scm b/gnu/packages/gnutls.scm index 7ac7a9e304..4f6bd22977 100644 --- a/gnu/packages/gnutls.scm +++ b/gnu/packages/gnutls.scm @@ -1,6 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2012, 2013, 2014 Ludovic Courtès -;;; Copyright © 2014 Mark H Weaver +;;; Copyright © 2014, 2015 Mark H Weaver ;;; Copyright © 2014 Ian Denhardt ;;; ;;; This file is part of GNU Guix. @@ -63,7 +63,7 @@ specifications.") (define-public gnutls (package (name "gnutls") - (version "3.2.20") + (version "3.2.21") (source (origin (method url-fetch) (uri @@ -74,7 +74,7 @@ specifications.") "/gnutls-" version ".tar.xz")) (sha256 (base32 - "165mpmm506jgpiffgf0s01rrn8c14qkan1saaa79dvf3g1z0arvr")))) + "0zq8syiq51ls5g0f32nglvps330h5llpyrs1z2gjn5pr9hjrchc2")))) (build-system gnu-build-system) (arguments '(#:configure-flags -- cgit v1.2.3 From a0ba3fc52028d84d18bfb0af3cd4f5c7e1fe9d8c Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Tue, 13 Jan 2015 20:37:57 -0500 Subject: gnu: guile-ncurses: Build a UTF-8 locale for the tests. * gnu/packages/guile.scm (guile-ncurses)[arguments]: Add 'install-locales' phase. --- gnu/packages/guile.scm | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/gnu/packages/guile.scm b/gnu/packages/guile.scm index 0900768832..c0c5ced0f3 100644 --- a/gnu/packages/guile.scm +++ b/gnu/packages/guile.scm @@ -262,7 +262,16 @@ many readers as needed).") (("\"libguile-ncurses\"") (format #f "\"~a/lib/libguile-ncurses\"" out))))) - %standard-phases))) + (alist-cons-before + 'check 'install-locales + (lambda _ + ;; One of the tests requires the availability of a UTF-8 + ;; locale and otherwise fails. + (setenv "LOCPATH" (getcwd)) + (zero? (system* "localedef" "--no-archive" + "--prefix" (getcwd) "-i" "en_US" + "-f" "UTF-8" "./en_US.utf8"))) + %standard-phases)))) (home-page "http://www.gnu.org/software/guile-ncurses/") (synopsis "Guile bindings to ncurses") (description -- cgit v1.2.3 From 54e612818b3ec5b1687d6d52c75b967a72bd5051 Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Wed, 14 Jan 2015 08:40:22 -0500 Subject: gnu: tre: Build a locale for the tests. * gnu/packages/tre.scm (tre)[arguments]: Add 'install-locales' phase. --- gnu/packages/tre.scm | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/gnu/packages/tre.scm b/gnu/packages/tre.scm index 33d2cff093..1a1aa02ec9 100644 --- a/gnu/packages/tre.scm +++ b/gnu/packages/tre.scm @@ -1,5 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright 2014 John Darrington +;;; Copyright © 2014 John Darrington +;;; Copyright © 2015 Mark H Weaver ;;; ;;; This file is part of GNU Guix. ;;; @@ -37,6 +38,17 @@ (base32 "0n36cgqys59r2gmb7jzbqiwsy790v8nbxk82d2n2saz0rp145ild")))) (build-system gnu-build-system) + (arguments + `(#:phases (alist-cons-before + 'check 'install-locales + (lambda _ + ;; The tests require the availability of the + ;; 'en_US.ISO-8859-1' locale. + (setenv "LOCPATH" (getcwd)) + (zero? (system* "localedef" "--no-archive" + "--prefix" (getcwd) "-i" "en_US" + "-f" "ISO-8859-1" "./en_US.ISO-8859-1"))) + %standard-phases))) (synopsis "Approximate regex matching library and agrep utility") (description "Superset of the POSIX regex API, enabling approximate matching. Also ships a version of the agrep utility which behaves similar to -- cgit v1.2.3 From 58caebf0327aafe6240612f28c339f5a00cd2c92 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Wed, 14 Jan 2015 17:05:10 +0100 Subject: build: Use the canonical list of supported systems in 'assert-*'. * build-aux/check-available-binaries.scm (%supported-systems): Remove. * build-aux/check-final-inputs-self-contained.scm (%supported-systems): Remove. --- build-aux/check-available-binaries.scm | 5 +---- build-aux/check-final-inputs-self-contained.scm | 5 +---- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/build-aux/check-available-binaries.scm b/build-aux/check-available-binaries.scm index d5163a9503..74a43ff1d8 100644 --- a/build-aux/check-available-binaries.scm +++ b/build-aux/check-available-binaries.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2013, 2014 Ludovic Courtès +;;; Copyright © 2013, 2014, 2015 Ludovic Courtès ;;; ;;; This file is part of GNU Guix. ;;; @@ -28,9 +28,6 @@ (srfi srfi-1) (srfi srfi-26)) -(define %supported-systems - '("x86_64-linux" "i686-linux")) - (let* ((store (open-connection)) (native (append-map (lambda (system) (map (cut package-derivation store <> system) diff --git a/build-aux/check-final-inputs-self-contained.scm b/build-aux/check-final-inputs-self-contained.scm index ade4e98001..ca7e8030b4 100644 --- a/build-aux/check-final-inputs-self-contained.scm +++ b/build-aux/check-final-inputs-self-contained.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2014 Ludovic Courtès +;;; Copyright © 2014, 2015 Ludovic Courtès ;;; ;;; This file is part of GNU Guix. ;;; @@ -29,9 +29,6 @@ (srfi srfi-1) (srfi srfi-26)) -(define %supported-systems - '("x86_64-linux" "i686-linux")) - (define (final-inputs store system) "Return the list of outputs directories of the final inputs for SYSTEM." (append-map (match-lambda -- cgit v1.2.3 From 619c9522b2d6d7c451f90524c3a041c5fb12c28e Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Wed, 14 Jan 2015 18:20:01 +0100 Subject: check-available-binaries: Use 'with-store'. * build-aux/check-available-binaries.scm: Use 'with-store' instead of an explicit 'open-connection'. --- build-aux/check-available-binaries.scm | 48 +++++++++++++++++----------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/build-aux/check-available-binaries.scm b/build-aux/check-available-binaries.scm index 74a43ff1d8..ebe94d2f7f 100644 --- a/build-aux/check-available-binaries.scm +++ b/build-aux/check-available-binaries.scm @@ -28,28 +28,28 @@ (srfi srfi-1) (srfi srfi-26)) -(let* ((store (open-connection)) - (native (append-map (lambda (system) - (map (cut package-derivation store <> system) - (list %bootstrap-tarballs emacs))) - %supported-systems)) - (cross (map (cut package-cross-derivation store - %bootstrap-tarballs <>) - '("mips64el-linux-gnuabi64"))) - (total (append native cross))) - (define (warn proc) - (lambda (drv) - (or (proc drv) - (begin - (format (current-error-port) "~a is not substitutable~%" - drv) - #f)))) +(with-store store + (let* ((native (append-map (lambda (system) + (map (cut package-derivation store <> system) + (list %bootstrap-tarballs emacs))) + %supported-systems)) + (cross (map (cut package-cross-derivation store + %bootstrap-tarballs <>) + '("mips64el-linux-gnuabi64"))) + (total (append native cross))) + (define (warn proc) + (lambda (drv) + (or (proc drv) + (begin + (format (current-error-port) "~a is not substitutable~%" + drv) + #f)))) - (set-build-options store #:use-substitutes? #t) - (let ((result (every (compose (warn (cut has-substitutes? store <>)) - derivation->output-path) - total))) - (when result - (format (current-error-port) "~a packages found substitutable~%" - (length total))) - (exit result))) + (set-build-options store #:use-substitutes? #t) + (let ((result (every (compose (warn (cut has-substitutes? store <>)) + derivation->output-path) + total))) + (when result + (format (current-error-port) "~a packages found substitutable~%" + (length total))) + (exit result)))) -- cgit v1.2.3 From df5188ddfa0c004009c7fcb0ce09a27bb50b9a59 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Wed, 14 Jan 2015 18:28:46 +0100 Subject: check-available-binaries: Use 'substitution-oracle'. * build-aux/check-available-binaries.scm: Use 'substitution-oracle'. Changer caller and 'warn' accordingly. --- build-aux/check-available-binaries.scm | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/build-aux/check-available-binaries.scm b/build-aux/check-available-binaries.scm index ebe94d2f7f..7ac4352839 100644 --- a/build-aux/check-available-binaries.scm +++ b/build-aux/check-available-binaries.scm @@ -37,18 +37,18 @@ %bootstrap-tarballs <>) '("mips64el-linux-gnuabi64"))) (total (append native cross))) - (define (warn proc) - (lambda (drv) - (or (proc drv) - (begin - (format (current-error-port) "~a is not substitutable~%" - drv) - #f)))) + (define (warn item system) + (format (current-error-port) "~a (~a) is not substitutable~%" + item system) + #f) (set-build-options store #:use-substitutes? #t) - (let ((result (every (compose (warn (cut has-substitutes? store <>)) - derivation->output-path) - total))) + (let* ((substitutable? (substitution-oracle store total)) + (result (every (lambda (drv) + (let ((out (derivation->output-path drv))) + (or (substitutable? out) + (warn out (derivation-system drv))))) + total))) (when result (format (current-error-port) "~a packages found substitutable~%" (length total))) -- cgit v1.2.3 From 6ee01481c36949680d775af6a125dae2ad4b492d Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Wed, 14 Jan 2015 19:40:58 +0100 Subject: gnu: Don't build the mips64el-linux-gnuabi64 cross-compiler on i686. Fixes . Reported by Mark H Weaver . * gnu/packages/cross-base.scm (xgcc-mips64el): Remove "i686-linux" from 'supported-systems'. --- gnu/packages/cross-base.scm | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/gnu/packages/cross-base.scm b/gnu/packages/cross-base.scm index 794d925841..a062128a79 100644 --- a/gnu/packages/cross-base.scm +++ b/gnu/packages/cross-base.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2013, 2014 Ludovic Courtès +;;; Copyright © 2013, 2014, 2015 Ludovic Courtès ;;; Copyright © 2014, 2015 Mark H Weaver ;;; ;;; This file is part of GNU Guix. @@ -308,10 +308,15 @@ XBINUTILS and the cross tool chain." ;;; (define-public xgcc-mips64el - (let ((triplet "mips64el-linux-gnuabi64")) ; N64 ABI - (cross-gcc triplet - (cross-binutils triplet) - (cross-libc triplet)))) + (let* ((triplet "mips64el-linux-gnuabi64") ;N64 ABI + (xgcc (cross-gcc triplet + (cross-binutils triplet) + (cross-libc triplet)))) + ;; Don't attempt to build this cross-compiler on i686; + ;; see . + (package (inherit xgcc) + (supported-systems (delete "i686-linux" + (package-supported-systems xgcc)))))) (define-public xgcc-avr ;; AVR cross-compiler, used to build AVR-Libc. -- cgit v1.2.3 From 9fdd80e8f28a7d48615fa4d5652e81ea5f679485 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Wed, 14 Jan 2015 21:14:14 +0100 Subject: gnu: cross-base: Don't build the cross-compilers with target = host. * gnu/packages/cross-base.scm (xgcc-mips64el)[supported-systems]: Delete "mips64el-linux". (xgcc-armhf)[supported-systems]: Delete "armhf-linux". --- gnu/packages/cross-base.scm | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/gnu/packages/cross-base.scm b/gnu/packages/cross-base.scm index a062128a79..5a67d4b6ac 100644 --- a/gnu/packages/cross-base.scm +++ b/gnu/packages/cross-base.scm @@ -315,8 +315,9 @@ XBINUTILS and the cross tool chain." ;; Don't attempt to build this cross-compiler on i686; ;; see . (package (inherit xgcc) - (supported-systems (delete "i686-linux" - (package-supported-systems xgcc)))))) + (supported-systems (fold delete + (package-supported-systems xgcc) + '("mips64el-linux" "i686-linux")))))) (define-public xgcc-avr ;; AVR cross-compiler, used to build AVR-Libc. @@ -329,10 +330,12 @@ XBINUTILS and the cross tool chain." (cross-gcc "xtensa-elf")) (define-public xgcc-armhf - (let ((triplet "arm-linux-gnueabihf")) - (cross-gcc triplet - (cross-binutils triplet) - (cross-libc triplet)))) + (let* ((triplet "arm-linux-gnueabihf") + (xgcc (cross-gcc triplet + (cross-binutils triplet) + (cross-libc triplet)))) + (package (inherit xgcc) + (supported-systems (delete "armhf-linux" %supported-systems))))) ;; (define-public xgcc-armel ;; (let ((triplet "armel-linux-gnueabi")) -- cgit v1.2.3 From b01a0ba86e93012044f42c41ba5cbc7d7936c356 Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Thu, 15 Jan 2015 18:46:23 -0500 Subject: gnu: gd: Update to 2.1.1. * gnu/packages/patches/gd-mips64-deplibs-fix.patch: Remove file. * gnu-system.am (dist_patch_DATA): Remove it. * gnu/packages/gd.scm (gd): Update to 2.1.1. Update source URI. Remove patch. Remove 'chdir' phase. Add pkg-config to native-inputs. --- gnu-system.am | 1 - gnu/packages/gd.scm | 22 ++++++++++------------ gnu/packages/patches/gd-mips64-deplibs-fix.patch | 17 ----------------- 3 files changed, 10 insertions(+), 30 deletions(-) delete mode 100644 gnu/packages/patches/gd-mips64-deplibs-fix.patch diff --git a/gnu-system.am b/gnu-system.am index 4473651ab9..8cd2c68e0b 100644 --- a/gnu-system.am +++ b/gnu-system.am @@ -362,7 +362,6 @@ dist_patch_DATA = \ gnu/packages/patches/flex-bison-tests.patch \ gnu/packages/patches/gawk-shell.patch \ gnu/packages/patches/gcc-cross-environment-variables.patch \ - gnu/packages/patches/gd-mips64-deplibs-fix.patch \ gnu/packages/patches/glib-tests-desktop.patch \ gnu/packages/patches/glib-tests-homedir.patch \ gnu/packages/patches/glib-tests-prlimit.patch \ diff --git a/gnu/packages/gd.scm b/gnu/packages/gd.scm index caeaeae36b..2d6ccb8d7d 100644 --- a/gnu/packages/gd.scm +++ b/gnu/packages/gd.scm @@ -1,5 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2013 Ludovic Courtès +;;; Copyright © 2015 Mark H Weaver ;;; ;;; This file is part of GNU Guix. ;;; @@ -24,6 +25,7 @@ #:use-module (gnu packages image) #:use-module (gnu packages fontutils) #:use-module (gnu packages compression) + #:use-module (gnu packages pkg-config) #:use-module ((guix licenses) #:select (bsd-style))) (define-public gd @@ -31,25 +33,21 @@ (name "gd") ;; Note: With libgd.org now pointing to bitbucket.org, genuine old - ;; tarballs are no longer available. Notably, versions 2.0.34 and .35 are + ;; tarballs are no longer available. Notably, versions 2.0.x are ;; missing. - (version "2.0.33") + (version "2.1.1") (source (origin (method url-fetch) - (uri "https://bitbucket.org/libgd/gd-libgd/get/GD_2_0_33.tar.gz") + (uri (string-append + "https://bitbucket.org/libgd/gd-libgd/downloads/" + "libgd-" version ".tar.xz")) (sha256 (base32 - "0yrbx8mj9pykyzm0zl1q86xlkdvkajcsf5jmg688vhw9yc5wmbbw")) - (patches - (list (search-patch "gd-mips64-deplibs-fix.patch"))))) + "11djy9flzxczphigqgp7fbbblbq35gqwwhn9xfcckawlapa1xnls")))) (build-system gnu-build-system) - (arguments - '(#:phases (alist-cons-after - 'unpack 'chdir - (lambda _ - (chdir "src")) - %standard-phases))) + (native-inputs + `(("pkg-config" ,pkg-config))) (inputs `(("freetype" ,freetype) ("libpng" ,libpng) 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 6231310cdb..0000000000 --- a/gnu/packages/patches/gd-mips64-deplibs-fix.patch +++ /dev/null @@ -1,17 +0,0 @@ -Patch configure script to choose pass_all deplibs check method for -linux-gnu* systems on mips64. This is a temporary hack until libgd -bootstraps their build system with a newer libtool. - -Patch by Mark H Weaver . - ---- libgd-gd/src/configure.orig 2006-04-05 11:56:57.000000000 -0400 -+++ libgd-gd/src/configure 2013-11-02 17:56:19.123995838 -0400 -@@ -4457,7 +4457,7 @@ - # This must be Linux ELF. - linux-gnu*) - case $host_cpu in -- alpha* | hppa* | i*86 | mips | mipsel | powerpc* | sparc* | ia64* | s390* | x86_64*) -+ alpha* | hppa* | i*86 | mips | mipsel | mips64 | mips64el | powerpc* | sparc* | ia64* | s390* | x86_64*) - lt_cv_deplibs_check_method=pass_all ;; - *) - # glibc up to 2.1.1 does not perform some relocations on ARM -- cgit v1.2.3